blob: 24272415e6b21f7dcdf9bbdb1797e3e29f4fcb80 [file] [log] [blame]
Richard S. Hall85bafab2009-07-13 13:25:46 +00001<html>
2<head>
3<title>Sigil Build Instructions</title>
4</head>
5<body>
6
7<h1>Build Instructions</h1>
8
9<h2>1. Install Prerequisites</h2>
10
11<p>A full copy of Eclipse SDK is required to build. This must be
12installed in a directory called <code>eclipse</code>, and the full path
13should not contain any spaces. For example:</p>
14
15<ul>
16 <li><code>C:/eclipse-SDK-3.4/eclipse</code> is GOOD</li>
17 <li><code>C:/eclipse-SDK-3.4/</code> is BAD</li>
18 <li><code>C:/Program Files/Eclipse 3.4/</code> is VERY BAD</li>
19</ul>
20
21<p>This directory (<strong>including</strong> the final <code>eclipse</code>)
22will be referred to as the SDK directory.</p>
23
24<h2>2. Setup the Target Platform</h2>
25
26<p>The target platform is the collection of binary plugins and
27features against which the source projects are built. It is an Eclipse
28installation (with a <code>plugins</code> and <code>features</code>
29directory), and so can be setup by downloading the correct zip or
30tarball from the Eclipse website. Like the SDK directory, the target
31platform must be inside a directory called <code>eclipse</code>. In your
32IDE, you should point PDE at the target platform by opening Preferences
33and navigating to "Plug-in Development" --&gt; "Target Platform". Click
34Browse and select the <code>eclipse</code> directory.</p>
35
36<p>Note that since we are building SDK plugins, the Target Platform
37will be a full SDK (eg "Eclipse Classic SDK"). Therefore we can reuse
38the same SDK directory that we setup in the previous step. However it
39can also be useful to separate these because we might want to use
40different Eclipse versions for each function. For example, we may want
41to use Eclipse 3.4 to build a 3.3-based product.</p>
42
43<h2>3. Create and edit <code>user.properties</code></h2>
44
45<p>User-specific properties are supplied in the file <code>user.properties</code>.
46After checkout this file does not exist, so please copy <code>template.user.properties</code>
47to <code>user.properties</code> and change the following settings:</p>
48
49<ul>
50 <li><code>target.platform</code>: this should be set to the <strong>parent
51 </strong> directory of the <code>eclipse</code> directory which contains the
52 Target Platform.</li>
53 <li><code>eclipse.install.dir</code>: the SDK directory (including
54 final <code>eclipse</code> segment).</li>
55</ul>
56
57<p>Do not check <code>user.properties</code> into version control:
58the settings inside are specific to your machine.</p>
59
60<h2>4. Configure the Update Site URL</h2>
61
62<p>The Update Site URL can be specified by setting the <code>updateUrl</code>
63property in <code>project.properties</code> . This will be copied into
64the <code>feature.xml</code> descriptor for each feature that is part of
65the build. For this to work, the update site URL setting in the <code>feature.xml</code>
66of each source feature project must be set to the following placeholder
67string: <code>http://replace.with.real.url</code></p>
68
69<h2>5. Execute the Build</h2>
70
71<p>Execute a full build by running the <code>pdebuild</code> target
72in ANT, e.g.:</p>
73
74<pre>
75 ant pdebuild
76</pre>
77
78<p>This will generate a directory named <code>target/tmp/eclipse</code>
79which contains a <code>plugins</code> directory for the built plugin
80JARs and a <code>features</code> directory for the built features. If
81the build fails then compilation logs for each plugin can be found in <code>target/N.Sigil/compilelogs/plugins</code>.</p>
82
83<h2>6. Deploy to Update Site</h2>
84
85<p>After the features and plugins are built we can deploy them to an
86update site on the local filesystem. The update site directory must
87already exist with the following layout:</p>
88
89<pre>
90${updateSiteDir}/
91 |--plugins/
92 |--features/
93 \--site.xml
94</pre>
95
96<p>And <code>site.xml</code> must have at least the following
97content:</p>
98
99<pre>
100&lt;site&gt;
101 &lt;category-def name="Sigil" label="Sigil"&gt;
102 &lt;description&gt;Blah blah&lt;/description&gt;
103 &lt;/category-def&gt;
104&lt;/site&gt;
105</pre>
106
107<p>It can also have any number of pre-existing <code>&lt;feature&gt;</code>
108entries as direct children of the <code>&lt;site&gt;</code> element.</p>
109
110<p>Next set the <code>updateSiteDir</code> property in <code>project.properties</code>
111to point at the above directory. Now we can run the deploy target as
112follows:</p>
113
114<pre>
115 ant copy.updateSite
116</pre>
117
118<p>This will copy all of the plugin and feature JARs that were built
119in the previous step into the update site directory. It will also add a
120new entry into <code>site.xml</code> for each feature. Note that the
121update site directory will grow continually. Since the plugins and
122features are generated with a timestamp in their version qualifier (e.g.
1231.2.3.200808091200 for version 1.2.3 built on 9 Aug 2008 at 12 o'clock
124GMT), Eclipse Update Manager will always select the newest version
125available.</p>
126
127<p>NB: the deploy target will overwrite <code>site.xml</code>. A
128backup will be saved in <code>site.xml.bak</code> but this backup will
129be overwritten next time the build is run.</p>
130</body>
131</html>