5
jh_compilefeatures - Compiles eclipse features using pde-build.
11
use Debian::Debhelper::Dh_Lib;
15
B<jh_compilefeatures> [S<I<debhelper options>>] [S<I<options>>] [B<--pde-build-dir=>I<dir>] [S<I<feature [...]>>]
19
jh_compilefeatures is a javahelper program that handles compiling
20
features using pde-build. These features can be specified either in
21
debian/eclipse.features or via command-line.
23
jh_compilefeatures uses debhelper behind the scenes and are therefore
24
subject to the compat level (e.g. when parsing the eclipse.features file).
26
When specifying the dependencies for a feature, jh_compilefeatures will
27
see if this feature has just been compiled and will use the dependency
28
if it is among the results. This can be used together with
29
debian/eclipse.features.
31
Dependencies are always resolved by first checking if it is a recently
32
built feature and if not, then the system installed eclipse's dropins
33
folders will be checked.
35
Currently jh_compilefeatures do not clean up between builds, which means
36
the dependencies for previous builds are present for the current build.
37
Nevertheless, do not rely on this, as this behavior is subject to change.
39
Note: jh_compilefeatures will I<not> rearrange the build order for you
42
Note: that jh_compilefeatures will not error out if it cannot find a
43
missing dependency. This is due to the underlying builder being unable
50
=item debian/eclipse.features
52
List the eclipse features to compile and their dependencies. The first
53
item on the line is the feature to compile and the following items
54
are considered dependencies.
56
A dependency can either be a dropins folder or a previous built feature.
57
jh_compilefeatures will find it as long as it is installed in the system
58
eclipse's dropins folder or it has just been compiled.
66
=item B<--pde-build-dir=dir>
68
Specifies the directory from where pde-build is to be run. Defauls to
69
"debian/.eclipse_build".
71
=item B<--feature-deps=deps>
73
A space separated list of dependencies. These dependencies will be used
74
to compile all features passed by command-line. Features read from
75
debian/eclipse.features are unaffected by this.
77
=item B<--build-opts=args>
79
Pass args to the underlying builder. These options are passed to all
82
This defaults to "-DjavacTarget=1.5 -DjavacSource=1.5" if not set.
83
This can be disabled by passing the empty string.
85
=item B<--jvm-args=args>
87
Pass args to the JVM. These options are passed to all
90
=item B<--orbit-dir=dir>
92
Specifies where the Orbit dependencies can be found. This is only needed
93
if the orbit dir is in an unusual location.
95
=item B<--pde-build=cmd>
97
Use a non-standard pde-build command to compile the features.
99
=item B<--pde-args=args>
101
Passes args directly to pde-build. Note, jh_compilefeatures have
102
specialised options for some of pde-build options and these should
103
be used whenever possible.
105
These options are passed to all features built.
107
=item B<--ignore-java-home>
109
Skip the check of JAVA_HOME. Since the underlying builder uses ant
110
(and therefore java), the build should ensure it always uses the
111
expected java implementation.
113
Use this if you (for whatever reason) need to declare the specific
114
java implementation without being able to use JAVA_HOME.
116
Note: You still have to tell the underlying builder which java to
124
my $ffile = 'debian/eclipse.features';
127
my $orbitdir = undef;
134
'pde-build-dir=s' => \$pdebdir,
135
'feature-deps=s' => \$fdeps,
136
'orbit-dir=s' => \$orbitdir,
137
'pde-build=s' => \$pdebcmd,
138
'build-opts=s' => \$bopts,
139
'pde-args=s' => \$pdeargs,
140
'jvm-args=s' => \$jvmargs,
141
'ignore-java-home' => \$ignoreJH,
144
error("pde-build uses ant, therefore JAVA_HOME must be set.") unless(($ENV{'JAVA_HOME'}//'') ne '' or $ignoreJH);
146
# Use default value if none are given.
147
$pdebdir = 'debian/.eclipse-build' unless(defined($pdebdir));
148
$pdebdir =~ s@/*$@@; # remove trailing slash, looks better.
150
$orbitdir = "$pdebdir/orbitdeps" unless(defined($orbitdir));
152
$pdebcmd = '/usr/lib/eclipse/buildscripts/pde-build' unless(defined($pdebcmd));
154
$bopts = '-DjavacTarget=1.5 -DjavacSource=1.5' unless(defined($bopts));
156
$orbitdir = Cwd::abs_path($orbitdir) unless($orbitdir =~ m@^/@);
159
@features = filedoublearray($ffile);
162
error("$pdebdir does not exist") if(scalar(@ARGV) + scalar(@features) > 0 && ! -d $pdebdir);
164
foreach my $arg (@ARGV){
165
compile($arg, split(/\s+/, $fdeps));
168
foreach my $feat (@features){
178
DEP_LOOP: foreach my $d (@_){
179
# Check if we just built this feature.
180
foreach my $s qw(. .zip .ZIP) {
181
my $zip = "$pdebdir/$d$s";
183
installZippedFeature($zip, "$pdebdir/build/SDK");
189
push(@args, "-o", escape_shell($orbitdir)) if(defined($orbitdir) && -d $orbitdir);
190
push(@args, "-j", escape_shell($jvmargs)) if($jvmargs ne '');
191
push(@args, "-a", escape_shell($bopts)) if($bopts ne '');
192
push(@args, "-d", escape_shell(@deps)) if(scalar(@deps) > 0);
193
push(@args, $pdeargs);
194
complex_doit("cd", $pdebdir , "&&", $pdebcmd, @args, "-f", $feat);
199
A sample debian/eclipse.features
201
org.eclipse.tm.terminal emf
204
org.eclipse.tm.terminal depends on "emf", which is expected to be found in
205
eclipse's dropins folder. org.eclipse.rse.sdk on the other hand has no
206
dependencies beyond the eclipse platform.
208
If needed you can also specify a previously built feature as a dependency:
210
org.eclipse.some.feature
211
org.eclipse.another.feature org.eclipse.some.feature rse
213
Here org.eclipse.another.feature depends org.eclipse.some.feature, which was
214
just built and also rse, which is expected to be in system installed eclipse's
221
This program is a part of javahelper and uses debhelper as backend. There are
222
also tutorials in /usr/share/javahelper.
226
Niels Thykier <niels@thykier.net>
228
=head1 COPYRIGHT AND LICENSE
230
Copyright 2010 by Niels Thykier
232
This tool is free software; you may redistribute it and/or modify
233
it under the terms of GNU GPL 2.