build.html 6.0 KB
Newer Older
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
<!--
3 4 5
Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
6 7
Initial Developer: H2 Group
-->
8 9
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
10
Build
11
</title><link rel="stylesheet" type="text/css" href="stylesheet.css" />
12
<!-- [search] { -->
13 14 15
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="frameMe();">
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
16
<!-- } -->
17 18 19

<h1>Build</h1>
<a href="#portability">
20
    Portability</a><br />
21
<a href="#environment">
22
    Environment</a><br />
23
<a href="#building">
24
    Building the Software</a><br />
25 26
<a href="#build_targets">
    Build Targets</a><br />
27
<a href="#maven2">
28
    Using Maven 2</a><br />
29 30
<a href="#translating">
    Translating</a><br />
31 32
<a href="#providing_patches">
    Providing Patches</a><br />
33

34
<br /><a name="portability"></a>
35
<h2>Portability</h2>
36
<p>
37
This database is written in Java and therefore works on many platforms.
38
It can also be compiled to a native executable using GCJ.
39
</p>
40

41
<br /><a name="environment"></a>
42
<h2>Environment</h2>
43
<p>
44 45 46
A Java Runtime Environment (JRE) version 1.4 or higher is required to run this database.
</p>
<p>
47
To build the database executables, the following software stack was used.
48
Newer version or compatible software works too.
49
</p>
Thomas Mueller's avatar
Thomas Mueller committed
50 51 52 53 54 55 56 57 58
<ul><li>Windows XP
</li><li>Sun JDK Version 1.4 and 1.6
</li><li>Eclipse Version 3.3
</li><li>Eclipse Plugins: Subclipse 1.2.4, EclEmma Java Code Coverage 1.3.0, Eclipse Checkstyle Plug-in 4.4.0
</li><li>Mozilla Firefox 3.0
</li><li>OpenOffice 3.0
</li><li>NSIS 2.38 (Nullsoft Scriptable Install System)
</li><li>Maven 2.0.7
</li><li>YourKit Java Profiler
59
</li></ul>
60

61
<br /><a name="building"></a>
62
<h2>Building the Software</h2>
63
<p>
64
On the command line, go to the directory h2 and execute the following command:
65
</p>
66
<pre>
67
build -?
68
</pre>
69
<p>
70 71 72 73 74
For Linux and OS X, use <code>./build.sh</code> instead of <code>build</code>.
</p>

<p>
You will get a list of targets. If you want to build the jar file, execute (Windows):
75
</p>
76
<pre>
77
build jar
78
</pre>
79 80 81 82 83 84 85 86 87 88

<br /><a name="build_targets"></a>
<h2>Build Targets</h2>
<p>
The build system can generate smaller jar files as well. The following targets are currently supported:
</p>
<ul><li>jarClient: Create the h2client.jar. This only contains the remote JDBC implementation.
</li><li>jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled.
</li><li>jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
</li></ul>
89
<p>
90
To create the h2client.jar file, go to the directory h2 and execute the following command:
91
</p>
92
<pre>
93
build jarClient
94 95
</pre>

96
<br /><a name="maven2"></a>
97
<h2>Using Maven 2</h2>
98
<h3>Using a Central Repository</h3>
99
<p>
100
You can include the database in your Maven 2 project as a dependency.
101
Example:
102
</p>
103 104 105 106
<pre>
&lt;dependency&gt;
    &lt;groupId&gt;com.h2database&lt;/groupId&gt;
    &lt;artifactId&gt;h2&lt;/artifactId&gt;
Thomas Mueller's avatar
Thomas Mueller committed
107
    &lt;version&gt;${version}&lt;/version&gt;
108 109
&lt;/dependency&gt;
</pre>
110
<p>
111
New versions of this database are first uploaded to http://hsql.sourceforge.net/m2-repo/ and then automatically
112 113
synchronized with the main maven repository; however after a new release it may take a few hours before
they are available there.
114
</p>
115 116

<h3>Using Snapshot Version</h3>
117
<p>
118
To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command:
119
</p>
120
<pre>
121
build mavenInstallLocal
122
</pre>
123
<p>
124
Afterwards, you can include the database in your Maven 2 project as a dependency:
125
</p>
126 127
<pre>
&lt;dependency&gt;
128
    &lt;groupId&gt;com.h2database&lt;/groupId&gt;
129 130 131 132 133
    &lt;artifactId&gt;h2&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;/dependency&gt;
</pre>

134 135 136 137 138 139 140 141 142 143 144
<br /><a name="translating"></a>
<h2>Translating</h2>
<p>
The translation of this software is split into the following parts:
</p>
<ul>
<li>H2 Console: src/main/org/h2/server/web/res/_text_*.properties
</li><li>Error messages: src/main/org/h2/res/_messages_*.properties
</li><li>Web site: src/docsrc/text/_docs_*.utf8.txt
</li></ul>
<p>
145
The conversion between UTF-8 and Java encoding (using the \u syntax), as well as the HTML entities (&amp;#..;)
146
is automated by running the tool PropertiesToUTF8. The web site translation is automated as well,
147
using <code>build docs</code>.
148 149
</p>

150 151 152 153 154 155 156 157
<br /><a name="providing_patches"></a>
<h2>Providing Patches</h2>
<p>
If you like to provide patches, please consider the following guidelines to simplify merging them:
</p>
<ul><li>Only use Java 1.4 features (not use Java 1.5 or 1.6) (see Environment).
</li><li>Follow the coding style used in the project, use Checkstyle (see above) to check the coding style.
</li><li>Please provide test cases and integrate them into the test suite. 
Thomas Mueller's avatar
Thomas Mueller committed
158 159
    For Java level tests, see src/test/org/h2/test/TestAll.java.
    For SQL level tests, see src/test/org/h2/test/test.in.txt or testSimple.in.txt
160 161 162 163 164 165
</li><li>The test cases should cover at least 90% of the changed/new code; use a code coverage tool to verify that (see above).
</li><li>Verify that you did not break other features: Run the test cases by executing build test.
</li><li>Provide end user documentation if required (src/docsrc/html/*).
</li><li>Document grammar changes in src/main/org/h2/res/help.csv
</li><li>Provide a change log entry (src/docsrc/html/changelog.html).
</li><li>Submit patches as .patch files (compressed if big). To create a patch, use for example Eclipse Team/Create Patch.
Thomas Mueller's avatar
Thomas Mueller committed
166
</li></ul>
167

168 169
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>