ビルド
ポータビリティ環境
ソフトウェアのビルド
Build Targets
Maven 2 の利用
Translating
Providing Patches
Automated Build
ポータビリティ
このデータベースはJavaによって記述されているため、多くのプラットフォームで動作します。また、GCJを利用することで、ネイティブでも実行可能に(ネイティブコードに)コンパイルすることが可能です
環境
A Java Runtime Environment (JRE) version 1.5 or higher is required to run this database.
To build the database executables, the following software stack was used. Newer version or compatible software works too.
- Mac OS X and Windows XP
- Sun JDK Version 1.5 and 1.6
- Eclipse Version 3.4
- Eclipse Plugins: Subclipse 1.4.6 , Eclipse Checkstyle Plug-in 4.4.2 , EclEmma Java Code Coverage 1.3.0
- Emma Java Code Coverage
- Mozilla Firefox 3.0
- OpenOffice 3.0
- NSIS 2.38 (Nullsoft Scriptable Install System)
- Maven 2.0.9
ソフトウェアのビルド
You need to install a JDK, for example the Sun JDK version 1.5 or 1.6. Ensure that Java binary directory is included in the PATH environment variable, and that the environment variable JAVA_HOME points to your Java installation. On the command line, go to the directory h2 and execute the following command:
build -?
For Linux and OS X, use ./build.sh instead of build .
You will get a list of targets. If you want to build the jar file, execute (Windows):
build jar
Switching the Source Code
By default the source code uses Java 1.5 features, however Java 1.6 is supported as well. To switch the source code to the install version of Java, run:
build switchSource
Build Targets
The build system can generate smaller jar files as well. The following targets are currently supported:
- jarClient creates the h2client.jar. This only contains the JDBC client.
- jarSmall creates the file h2small.jar. This only contains the embedded database. Debug information is disabled.
- jarJaqu creates the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
- javadocImpl creates the Javadocs of the implementation.
To create the h2client.jar file, go to the directory h2 and execute the following command:
build jarClient
Maven 2 の利用
Centralリポジトリの利用
依存関係を取ることで、Maven 2プロジェクトでデータベースを組み込むことも可能です。例:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.1.119</version>
</dependency>
New versions of this database are first uploaded to http://hsql.sourceforge.net/m2-repo/ and then automatically synchronized with the main maven repository; however after a new release it may take a few hours before they are available there.
スナップショットバージョンの利用
スナップショット版のH2.jarファイルをビルドし、ローカルのMaven2リポジトリを更新するには以下のコマンドを実行します:
build mavenInstallLocal
実行後、Maven2プロジェクトにH2DBを依存させ組み込むことが出来るようになります:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Translating
The translation of this software is split into the following parts:
- H2 Console: src/main/org/h2/server/web/res/_text_*.properties
- Error messages: src/main/org/h2/res/_messages_*.properties
- Web site: src/docsrc/text/_docs_*.utf8.txt
To translate the H2 Console, start it and select Preferences / Translate. The conversion between UTF-8 and Java encoding (using the \u syntax), as well as the HTML entities (&#..;) is automated by running the tool PropertiesToUTF8. The web site translation is automated as well, using build docs .
Providing Patches
If you like to provide patches, please consider the following guidelines to simplify merging them:
- Only use Java 1.5 features (do not use Java 1.6) (see Environment).
- Follow the coding style used in the project, and use Checkstyle (see above) to verify. For example, do not use tabs (use spaces instead). The checkstyle configuration is in
src/installer/checkstyle.xml. - Please provide test cases and integrate them into the test suite. For Java level tests, see
src/test/org/h2/test/TestAll.java. For SQL level tests, seesrc/test/org/h2/test/test.in.txtortestSimple.in.txt. - The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above). or use the build target 'coverage'.
- Verify that you did not break other features: run the test cases by executing
build test. - Provide end user documentation if required (
src/docsrc/html/*). - Document grammar changes in
src/main/org/h2/res/help.csv - Provide a change log entry (
src/docsrc/html/changelog.html). - Verify the spelling using
build spellcheck. If required add the new words tosrc/tools/org/h2/build/doc/dictionary.txt. - Run the src/installer/buildRelease to find and fix formatting errors.
- Verify the formatting using
build docsandbuild javadoc. - Submit patches as .patch files (compressed if big). To create a patch using Eclipse, use Team / Create Patch.
For legal reasons, patches need to be public in the form of an email to the group , or in the form of an issue report or attachment . Significant contributions need to include the following statement:
"I wrote the code, it's mine, and I'm contributing it to H2 for distribution multiple-licensed under the H2 License, version 1.0, and under the Eclipse Public License, version 1.0 (http://h2database.com/html/license.html)."
Automated Build
This build process is automated and runs regularly. The build process includes running the tests and code coverage, using the command line ./build.sh clean jar coverage -Dh2.ftpPassword=... uploadBuild . The last results are available here: