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
|
version = ENV['JRUBY_VERSION'] ||
File.read( File.join( basedir, '..', 'VERSION' ) ).strip
project 'JRuby Integration Tests' do
model_version '4.0.0'
inherit 'org.jruby:jruby-parent', version
id 'org.jruby:jruby-tests'
extension 'org.jruby.maven:mavengem-wagon:debian'
repository :id => :mavengems, :url => 'mavengem:http://rubygems.org'
plugin_repository :id => :mavengems, :url => 'mavengem:http://rubygems.org'
plugin_repository( :url => 'https://oss.sonatype.org/content/repositories/snapshots/',
:id => 'sonatype' ) do
releases 'false'
snapshots 'true'
end
properties( 'polyglot.dump.pom' => 'pom.xml',
'jruby.home' => '${basedir}/..',
'gem.home' => '${jruby.home}/lib/ruby/gems/shared' )
scope :test do
jar 'junit:junit:4.11'
jar 'jakarta.annotation:jakarta.annotation-api:2.0.0'
jar 'commons-logging:commons-logging:1.1.3'
jar 'org.livetribe:livetribe-jsr223:2.0.7'
jar 'org.jruby:jruby-core', '${project.version}'
end
scope :provided do
jar 'org.apache.ant:ant:${ant.version}'
end
jar( 'org.jruby:requireTest:1.0',
:scope => 'system',
:systemPath => '${project.basedir}/jruby/requireTest-1.0.jar' )
overrides do
plugin( 'org.eclipse.m2e:lifecycle-mapping:1.0.0',
'lifecycleMappingMetadata' => {
'pluginExecutions' => [ { 'pluginExecutionFilter' => {
'groupId' => 'org.jruby.maven',
'artifactId' => 'gem-maven-plugin',
'versionRange' => '[1.0.0-rc3,)',
'goals' => [ 'initialize' ]
},
'action' => {
'ignore' => ''
} } ]
} )
end
jruby_plugin :gem, '${jruby.plugins.version}' do
options = { :phase => 'initialize',
'gemPath' => '${gem.home}',
'gemHome' => '${gem.home}',
'binDirectory' => '${jruby.home}/bin',
'includeRubygemsInTestResources' => 'false',
}
execute_goals( 'initialize', options )
end
plugin( :compiler,
'encoding' => 'utf-8',
'debug' => 'true',
'verbose' => 'true',
'fork' => 'true',
'showWarnings' => 'true',
'showDeprecation' => 'true',
'source' => '${base.java.version}',
'target' => '${base.java.version}' )
plugin :dependency do
execute_goals( 'copy',
:id => 'copy jars for testing',
:phase => 'process-classes',
'artifactItems' => [ { 'groupId' => 'junit',
'artifactId' => 'junit',
'version' => '4.11',
'type' => 'jar',
'overWrite' => 'false',
'outputDirectory' => 'target',
'destFileName' => 'junit.jar' },
{ 'groupId' => 'jakarta.annotation',
'artifactId' => 'jakarta.annotation-api',
'version' => '2.0.0',
'type' => 'jar',
'overWrite' => 'false',
'outputDirectory' => 'target',
'destFileName' => 'annotation-api.jar' },
{ 'groupId' => 'com.googlecode.jarjar',
'artifactId' => 'jarjar',
'version' => '1.1',
'type' => 'jar',
'overWrite' => 'false',
'outputDirectory' => 'target',
'destFileName' => 'jarjar.jar' } ] )
end
plugin( :deploy,
'skip' => 'true' )
plugin( :site,
'skip' => 'true',
'skipDeploy' => 'true' )
build do
default_goal 'test'
test_source_directory '.'
end
profile 'rake' do
plugin :antrun do
execute_goals( 'run',
:id => 'rake',
:phase => 'test',
:configuration => [ xml( '<target><exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true"><env key="JRUBY_OPTS" value=""/><arg value="-S"/><arg value="rake"/><arg value="${task}"/></exec></target>' ) ] )
end
end
profile 'jruby_complete_jar_extended' do
jar 'org.jruby:jruby-complete', '${project.version}', :scope => :provided
plugin :antrun do
[ 'jruby', 'objectspace', 'slow' ].each do |index|
filenames = []
File.open(File.join(basedir, index + '.index')) do |file|
file.each_line do |line|
next if line =~ /^#/ || line.strip.empty?
filename = "mri/#{line.chomp}"
filename = "jruby/#{line.chomp}.rb" unless File.exist? File.join(basedir, filename)
filename = "#{line.chomp}.rb" unless File.exist? File.join(basedir, filename)
next if filename =~ /mri\/psych\//
next if filename =~ /mri\/net\/http\//
next unless File.exist? File.join(basedir, filename)
filenames << filename
end
end
# some tests from jruby suite (test/jruby/test_kernel.rb, test/jruby/test_socket.rb) need sub-process control
if ENV_JAVA['java.specification.version'].to_i > 8
add_opens = ['java.base/java.io=ALL-UNNAMED', 'java.base/sun.nio.ch=ALL-UNNAMED']
else
add_opens = []
end
execute_goals( 'run',
:id => "jruby_complete_jar_#{index}",
:phase => 'test',
:configuration => [
xml( "<target unless='maven.test.skip'>" +
"<exec dir='${jruby.home}' executable='java' failonerror='true'>" +
add_opens.map { |value| "<arg value='--add-opens'/><arg value='#{value}'/>" }.join +
"<arg value='-Djruby.home=${jruby.home}'/>" +
"<arg value='-cp'/>" +
"<arg value='core/target/test-classes:test/target/test-classes:maven/jruby-complete/target/jruby-complete-${project.version}.jar'/>" +
"<arg value='-Djruby.home=${jruby.home}'/>" +
"<arg value='-Djruby.aot.loadClasses=true'/>" +
"<arg value='org.jruby.Main'/>" +
"<arg value='-I.'/>" +
"<arg value='-Itest'/>" +
"<arg value='lib/ruby/gems/shared/gems/rake-${rake.version}/lib/rake/rake_test_loader.rb'/>" +
filenames.map { |filename| "<arg value='test/#{filename}'/>" }.join +
"<arg value='-v'/>
</exec>
</target>" )
] )
end
end
end
end
|