forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pom.rb
388 lines (335 loc) · 15.5 KB
/
pom.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
version = ENV['JRUBY_VERSION'] ||
File.read( File.join( basedir, '..', 'VERSION' ) ).strip
project 'JRuby Core' do
model_version '4.0.0'
inherit 'org.jruby:jruby-parent', version
id 'org.jruby:jruby-core'
properties( 'polyglot.dump.pom' => 'pom.xml',
'polyglot.dump.readonly' => true,
'tzdata.version' => '2013d',
'tzdata.scope' => 'provided',
'unsafe.version' => '8.92.1',
'unsafe.jar' => '${settings.localRepository}/com/headius/unsafe-mock/${unsafe.version}/unsafe-mock-${unsafe.version}.jar',
'maven.build.timestamp.format' => 'yyyy-MM-dd',
'maven.test.skip' => 'true',
'build.date' => '${maven.build.timestamp}',
'main.basedir' => '${project.parent.basedir}',
'Constants.java' => 'org/jruby/runtime/Constants.java',
'anno.sources' => '${project.basedir}/target/generated-sources',
'jruby.basedir' => '${basedir}/..',
'jruby.test.memory' => '3G',
'jruby.test.memory.permgen' => '2G',
'jruby.compile.memory' => '2G' )
IO.foreach(File.join(basedir, '..', 'default.build.properties')) do |line|
line.chomp!
# skip comments
next if line =~ /(^\W*#|^$)/
# build const name
name, value = line.split("=", 2)
properties name => value
end
jar 'org.ow2.asm:asm:${asm.version}'
jar 'org.ow2.asm:asm-commons:${asm.version}'
jar 'org.ow2.asm:asm-analysis:${asm.version}'
jar 'org.ow2.asm:asm-util:${asm.version}'
# exclude jnr-ffi to avoid problems with shading and relocation of the asm packages
jar 'com.github.jnr:jnr-netdb:1.1.5', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-enxio:0.12', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.12', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.29', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.0.9'
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'
jar 'org.jruby.joni:joni:2.1.10'
jar 'org.jruby.extras:bytelist:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.18-SNAPSHOT'
jar 'org.jruby:dirgra:0.3'
jar 'com.headius:invokebinder:1.7'
jar 'com.headius:options:1.4'
jar 'com.headius:coro-mock:1.0', :scope => 'provided'
jar 'com.headius:unsafe-mock', '${unsafe.version}', :scope => 'provided'
jar 'com.headius:jsr292-mock:1.1', :scope => 'provided'
jar 'bsf:bsf:2.4.0', :scope => 'provided'
jar 'com.jcraft:jzlib:1.1.3'
jar 'com.martiansoftware:nailgun-server:0.9.1'
jar 'junit:junit', :scope => 'test'
jar 'org.apache.ant:ant:${ant.version}', :scope => 'provided'
jar 'org.osgi:org.osgi.core:5.0.0', :scope => 'provided'
# joda timezone must be before joda-time to be packed correctly
jar 'org.jruby:joda-timezones:${tzdata.version}', :scope => '${tzdata.scope}'
jar 'joda-time:joda-time:${joda.time.version}'
# SLF4J only used within SLF4JLogger (JRuby logger impl) class
jar 'org.slf4j:slf4j-api:1.7.12', :scope => 'provided', :optional => true
jar 'org.slf4j:slf4j-simple:1.7.12', :scope => 'test'
plugin_management do
plugin( 'org.eclipse.m2e:lifecycle-mapping:1.0.0',
'lifecycleMappingMetadata' => {
'pluginExecutions' => [ { 'pluginExecutionFilter' => {
'groupId' => 'org.codehaus.mojo',
'artifactId' => 'properties-maven-plugin',
'versionRange' => '[1.0-alpha-2,)',
'goals' => [ 'read-project-properties' ]
},
'action' => {
'ignore' => ''
} },
{ 'pluginExecutionFilter' => {
'groupId' => 'org.codehaus.mojo',
'artifactId' => 'build-helper-maven-plugin',
'versionRange' => '[1.8,)',
'goals' => [ 'add-source' ]
},
'action' => {
'ignore' => ''
} },
{ 'pluginExecutionFilter' => {
'groupId' => 'org.codehaus.mojo',
'artifactId' => 'exec-maven-plugin',
'versionRange' => '[1.2.1,)',
'goals' => [ 'exec' ]
},
'action' => {
'ignore' => ''
} },
{ 'pluginExecutionFilter' => {
'groupId' => 'org.apache.maven.plugins',
'artifactId' => 'maven-dependency-plugin',
'versionRange' => '[2.8,)',
'goals' => [ 'copy' ]
},
'action' => {
'ignore' => ''
} },
{ 'pluginExecutionFilter' => {
'groupId' => 'org.apache.maven.plugins',
'artifactId' => 'maven-clean-plugin',
'versionRange' => '[2.5,)',
'goals' => [ 'clean' ]
},
'action' => {
'ignore' => ''
} } ]
} )
end
plugin 'org.codehaus.mojo:buildnumber-maven-plugin:1.2' do
execute_goals( 'create',
:id => 'jruby-revision',
:phase => 'generate-sources',
'shortRevisionLength' => '7',
'buildNumberPropertyName' => 'jruby.revision' )
end
phase 'process-classes' do
plugin 'org.codehaus.mojo:build-helper-maven-plugin' do
execute_goals( 'add-source',
:id => 'add-populators',
'sources' => [ '${anno.sources}' ] )
end
plugin 'org.codehaus.mojo:exec-maven-plugin' do
execute_goals( 'exec',
:id => 'invoker-generator',
'arguments' => [ '-Djruby.bytecode.version=${base.java.version}',
'-classpath',
xml( '<classpath/>' ),
'org.jruby.anno.InvokerGenerator',
'${anno.sources}/annotated_classes.txt',
'${project.build.outputDirectory}' ],
'executable' => 'java',
'classpathScope' => 'compile' )
end
end
plugin( :compiler,
'encoding' => 'utf-8',
'debug' => 'true',
'verbose' => 'true',
'fork' => 'true',
'compilerArgs' => { 'arg' => '-J-Xmx1G' },
'showWarnings' => 'true',
'showDeprecation' => 'true',
'source' => [ '${base.java.version}', '1.7' ],
'target' => [ '${base.javac.version}', '1.7' ],
'useIncrementalCompilation' => 'false' ) do
execute_goals( 'compile',
:id => 'anno',
:phase => 'process-resources',
'includes' => [ 'org/jruby/anno/FrameField.java',
'org/jruby/anno/AnnotationBinder.java',
'org/jruby/anno/JRubyMethod.java',
'org/jruby/anno/FrameField.java',
'org/jruby/CompatVersion.java',
'org/jruby/runtime/Visibility.java',
'org/jruby/util/CodegenUtils.java',
'org/jruby/util/SafePropertyAccessor.java' ] )
execute_goals( 'compile',
:id => 'default-compile',
:phase => 'compile',
'annotationProcessors' => [ 'org.jruby.anno.AnnotationBinder' ],
'generatedSourcesDirectory' => 'target/generated-sources',
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ] )
execute_goals( 'compile',
:id => 'populators',
:phase => 'process-classes',
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ],
'includes' => [ 'org/jruby/gen/**/*.java' ] )
execute_goals( 'compile',
:id => 'eclipse-hack',
:phase => 'process-classes',
'skipMain' => 'true',
'includes' => [ '**/*.java' ] )
end
plugin :clean do
execute_goals( 'clean',
:id => 'default-clean',
:phase => 'clean',
'filesets' => [ { 'directory' => '${project.build.sourceDirectory}',
'includes' => [ '${Constants.java}' ] },
{ 'directory' => '${project.basedir}/..',
'includes' => [ 'bin/jruby' ] },
{ 'directory' => '${project.basedir}/..',
'includes' => [ 'lib/jni/**' ] } ],
'failOnError' => 'false' )
end
plugin( :surefire,
'forkCount' => '1',
'reuseForks' => 'false',
'systemProperties' => {
'jruby.home' => '${basedir}/..'
},
'argLine' => '-Xmx${jruby.test.memory} -XX:MaxPermSize=${jruby.test.memory.permgen} -Dfile.encoding=UTF-8 -Djava.awt.headless=true',
'includes' => [ 'org/jruby/test/MainTestSuite.java',
'org/jruby/embed/**/*Test*.java',
'org/jruby/util/**/*Test*.java' ],
'additionalClasspathElements' => [ '${basedir}/src/test/ruby' ] )
build do
default_goal 'package'
resource do
directory 'src/main/ruby'
includes '**/*rb'
end
resource do
directory 'src/main/resources'
includes 'META-INF/**/*'
end
resource do
directory '${project.basedir}/src/main/resources'
includes '${Constants.java}'
target_path '${project.build.sourceDirectory}'
filtering 'true'
end
resource do
directory '${project.basedir}/..'
includes [ 'BSDL', 'COPYING', 'LEGAL', 'LICENSE.RUBY' ]
target_path '${project.build.outputDirectory}/META-INF/'
end
end
plugin :shade do
execute_goals( 'shade',
:id => 'create lib/jruby.jar',
:phase => 'package',
'relocations' => [ { 'pattern' => 'org.objectweb',
'shadedPattern' => 'org.jruby.org.objectweb' } ],
'outputFile' => '${jruby.basedir}/lib/jruby.jar',
'transformers' => [ { '@implementation' => 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer',
'mainClass' => 'org.jruby.Main' } ] )
end
[:release, :main, :osgi, :j2ee, :complete, :dist, :'jruby_complete_jar_extended', :'jruby-jars' ].each do |name|
profile name do
plugin :shade do
execute_goals( 'shade',
:id => 'shade the asm classes',
:phase => 'package',
'artifactSet' => {
'includes' => [ 'com.github.jnr:jnr-ffi',
'org.ow2.asm:*' ]
},
'relocations' => [ { 'pattern' => 'org.objectweb',
'shadedPattern' => 'org.jruby.org.objectweb' } ] )
end
end
end
copy_goal = [:exec, :executable => '/bin/sh', :arguments => ['-c', 'cp ${jruby.basedir}/bin/jruby.bash ${jruby.basedir}/bin/jruby']]
profile :clean do
activation do
# hack to get the os triggeer into the model
os = org.apache.maven.model.ActivationOS.new
os.family = 'unix'
@current.os = os
end
phase :clean do
plugin 'org.codehaus.mojo:exec-maven-plugin' do
execute_goals( *copy_goal )
end
end
end
profile 'jruby.bash' do
activation do
file( :missing => '../bin/jruby' )
end
activation do
# hack to get the os triggeer into the model
os = org.apache.maven.model.ActivationOS.new
os.family = 'unix'
@current.os = os
end
phase :initialize do
plugin 'org.codehaus.mojo:exec-maven-plugin' do
execute_goals *copy_goal
end
end
end
jni_config = [ 'unpack', { :id => 'unzip native',
'excludes' => 'META-INF,META-INF/*',
'artifactItems' => [ { 'groupId' => 'com.github.jnr',
'artifactId' => 'jffi',
'version' => '${jffi.version}',
'type' => 'jar',
'classifier' => 'native',
'overWrite' => 'false',
'outputDirectory' => '${jruby.basedir}/lib' } ] } ]
phase :clean do
plugin :dependency do
execute_goals( *jni_config )
end
end
profile 'native' do
activation do
file( :missing => '../lib/jni' )
end
phase 'process-classes' do
plugin :dependency do
execute_goals( *jni_config )
end
end
end
profile 'test' do
properties( 'maven.test.skip' => 'false' )
end
profile 'build.properties' do
activation do
file( :exists => '../build.properties' )
end
plugin 'org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2' do
execute_goals( 'read-project-properties',
:id => 'properties',
:phase => 'initialize',
'files' => [ '${jruby.basedir}/build.properties' ],
'quiet' => 'true' )
end
end
profile 'tzdata' do
activation do
property( :name => 'tzdata.version' )
end
properties( 'tzdata.jar.version' => '${tzdata.version}',
'tzdata.scope' => 'runtime' )
end
end