forked from jruby/jruby-openssl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mavenfile
199 lines (166 loc) · 7.92 KB
/
Mavenfile
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
#-*- mode: ruby -*-
gemspec :jar => 'jopenssl', :include_jars => true
sonatype_url = 'https://oss.sonatype.org/content/repositories/snapshots/'
snapshot_repository :id => 'sonatype', :url => sonatype_url
distribution_management do
snapshot_repository :id => :ossrh, :url => 'https://oss.sonatype.org/content/repositories/snapshots'
repository :id => :ossrh, :url => 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
end
java_target = '1.6'
gen_sources = '${basedir}/target/generated-sources' # hard-coded in AnnotationBinder
plugin( 'org.codehaus.mojo:exec-maven-plugin', '1.3.2' ) do
=begin
invoker_main = '-Djruby.bytecode.version=${compiler.target}'
#invoker_main << ' -classpath '
invoker_main << ' org.jruby.anno.InvokerGenerator'
invoker_main << " #{gen_sources}/annotated_classes.txt ${project.build.outputDirectory}"
dependency 'org.jruby', 'jruby-core', '${jruby.version}'
execute_goal :java, :id => 'invoker-generator', :phase => 'process-classes',
:mainClass => 'org.jruby.anno.InvokerGenerator', :classpathScope => 'compile',
#:arguments => [ '${gen.sources}/annotated_classes.txt', '${project.build.outputDirectory}' ] do
:commandlineArgs => "#{gen_sources}/annotated_classes.txt ${project.build.outputDirectory}",
:classpathScope => 'runtime', :additionalClasspathElements => [ '${project.build.outputDirectory}' ],
:includeProjectDependencies => false, :includePluginDependencies => true do
#systemProperties do
# property '-Djruby.bytecode.version=${compiler.target}'
#end
=end
execute_goal :exec, :id => 'invoker-generator', :phase => 'process-classes',
:executable => 'java', :classpathScope => 'compile',
:arguments => [ "-Djruby.bytecode.version=#{java_target}",
'-classpath', xml( '<classpath/>' ),
'org.jruby.anno.InvokerGenerator',
"#{gen_sources}/annotated_classes.txt",
'${project.build.outputDirectory}' ]
end
plugin( 'org.codehaus.mojo:build-helper-maven-plugin', '1.9' ) do
execute_goal 'add-source', :phase => 'process-classes', :sources => [ gen_sources ]
end
plugin( :compiler, '3.1',
:source => java_target, :target => java_target,
:encoding => 'UTF-8', :debug => true,
:showWarnings => true, :showDeprecation => true,
:generatedSourcesDirectory => gen_sources,
:annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ],
:compilerArgs => [ '-XDignore.symbol.file=true' ] ) do
#execute_goal :compile, :id => 'annotation-binder', :phase => 'compile',
# :generatedSourcesDirectory => gen_sources, #:outputDirectory => gen_sources,
# :annotationProcessors => [ 'org.jruby.anno.AnnotationBinder' ],
# :proc => 'only', # :compilerReuseStrategy => 'alwaysNew',
# :useIncrementalCompilation => false, :fork => true, :verbose => true,
# :compilerArgs => [ '-XDignore.symbol.file=true', '-J-Dfile.encoding=UTF-8' ]
execute_goal :compile, :id => 'compile-populators', :phase => 'process-classes',
:includes => [ 'org/jruby/gen/**/*.java' ], :optimize => true,
:compilerArgs => [ '-XDignore.symbol.file=true' ]
# NOTE: maybe '-J-Xbootclasspath/p:${unsafe.jar}' ... as well ?!
end
plugin :clean do
execute_goals( 'clean', :id => 'default-clean', :phase => 'clean',
'filesets' => [
{ :directory => 'lib', :includes => [ 'jopenssl.jar' ] },
{ :directory => 'lib/org' },
{ :directory => 'target', :includes => [ '*' ] }
],
'failOnError' => 'false' )
end
# NOTE: unfortunately we can not use 1.6.8 to generate invokers ...
# although we'd like to compile against 1.6 to make sure all is well
jar 'org.jruby:jruby-core', '1.7.17', :scope => :provided # 1.6.8
jar 'junit:junit', '4.11', :scope => :test
jruby_plugin! :gem do
# when installing dependent gems we want to use the built in openssl
# not the one from this lib directory
# we compile against jruby-core-1.7.17 and want to keep this out of
# the plugin execution here
execute_goal :id => 'default-initialize', :addProjectClasspath => false, :libDirectory => 'something-which-does-not-exists'
execute_goals :id => 'default-push', :skip => true
end
# we want to have the snapshots on oss.sonatype.org and the released gems
# on maven central
plugin :deploy, '2.8.1' do
execute_goals( :deploy, :skip => false )
end
supported_bc_versions = %w{ 1.47 1.48 1.49 1.50 1.51 }
default_bc_version = File.read('lib/jopenssl/version.rb')[/BOUNCY_CASTLE_VERSION\s?=\s?'(.*?)'/, 1]
properties( 'jruby.plugins.version' => '1.0.10',
'jruby.versions' => '1.7.18',
'bc.versions' => default_bc_version,
'invoker.test' => '${bc.versions}',
# allow to skip all tests with -Dmaven.test.skip
'invoker.skip' => '${maven.test.skip}',
'runit.dir' => 'src/test/ruby/**/test_*.rb',
# use this version of jruby for ALL the jruby-maven-plugins
'jruby.version' => '1.7.18',
# dump pom.xml as readonly when running 'rmvn'
'polyglot.dump.pom' => 'pom.xml',
'polyglot.dump.readonly' => true,
'tesla.dump.pom' => 'pom.xml',
'tesla.dump.readonly' => true )
# make sure we have the embedded jars in place before we run runit plugin
plugin! :dependency do
execute_goal 'copy-dependencies', :phase => 'generate-test-resources', :outputDirectory => '${basedir}/lib', :useRepositoryLayout => true, :includeGroupIds => 'org.bouncycastle'
end
jruby_plugin(:runit) { execute_goal( :test, :runitDirectory => '${runit.dir}' ) }
invoker_run_options = {
:id => 'tests-with-different-bc-versions',
:projectsDirectory => 'integration',
:pomIncludes => [ '*/pom.xml' ],
:streamLogs => true,
# pass those properties on to the test project
:properties => {
'jruby.versions' => '${jruby.versions}',
'jruby.modes' => '${jruby.modes}',
'jruby.openssl.version' => '${project.version}',
'bc.versions' => '${bc.versions}',
'runit.dir' => '${runit.dir}' }
}
profile :id => 'test-1.6.8' do
plugin :invoker, '1.8' do
execute_goals( :install, :run, invoker_run_options )
end
properties 'jruby.versions' => '1.6.8', 'jruby.modes' => '1.8,1.9',
'bc.versions' => supported_bc_versions.join(',')
end
profile :id => 'test-1.7.4' do
plugin :invoker, '1.8' do
execute_goals( :install, :run, invoker_run_options )
end
properties 'jruby.versions' => '1.7.4', 'jruby.modes' => '1.8,1.9',
'bc.versions' => supported_bc_versions.join(',')
end
%w{ 1.7.13 1.7.15 1.7.16 1.7.18 1.7.20 1.7.21 1.7.22 }.each { |version|
profile :id => "test-#{version}" do
plugin :invoker, '1.8' do
execute_goals( :install, :run, invoker_run_options )
end
properties 'jruby.versions' => version, 'jruby.modes' => '1.8,1.9,2.0',
'bc.versions' => supported_bc_versions.join(',')
end
}
%w{ 9.0.1.0 9.0.4.0 }.each { |version|
profile :id => "test-#{version}" do
plugin :invoker, '1.8' do
execute_goals( :install, :run, invoker_run_options )
end
# NOTE: we're work-around 9K maven-runit version bug (due minitest changes) !
# ... still can not build with 9K : https://github.com/jruby/jruby/issues/3184
properties 'jruby.version' => version, 'jruby.versions' => version,
'bc.versions' => supported_bc_versions.join(',')
end
}
#profile :id => 'test-9000' do
# plugin :invoker, '1.8' do
# execute_goals( :install, :run, invoker_run_options )
# end
# # NOTE: we're work-around 9K maven-runit version bug (due minitest changes) !
# # ... still can not build with 9K : https://github.com/jruby/jruby/issues/3184
# properties 'jruby.version' => '9.0.0.0',
# 'jruby.versions' => '9.0.0.0',
# 'bc.versions' => supported_bc_versions.join(',')
#end
profile :id => 'release' do
plugin :gpg, '1.5' do
execute_goal :sign, :phase => :verify
end
end
# vim: syntax=Ruby