Skip to content

Commit

Permalink
Showing 5 changed files with 68 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/pom.rb
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ def to_pathname
# this is not an artifact for maven central
plugin :deploy, :skip => true

gem 'ruby-maven', '3.1.1.0.8', :scope => :provided
gem 'ruby-maven', '3.3.3', :scope => :provided

execute :install_gems, :package do |ctx|
require 'fileutils'
2 changes: 1 addition & 1 deletion lib/pom.xml
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@
<dependency>
<groupId>rubygems</groupId>
<artifactId>ruby-maven</artifactId>
<version>3.1.1.0.8</version>
<version>3.3.3</version>
<type>gem</type>
<scope>provided</scope>
</dependency>
21 changes: 19 additions & 2 deletions maven/jruby-dist/pom.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'rubygems/package'
require 'fileutils'
project 'JRuby Dist' do

version = File.read( File.join( basedir, '..', '..', 'VERSION' ) ).strip
@@ -10,10 +12,12 @@
properties( 'tesla.dump.pom' => 'pom.xml',
'tesla.dump.readOnly' => true,
'jruby.home' => '${basedir}/../..',
'main.basedir' => '${project.parent.parent.basedir}' )
'main.basedir' => '${project.parent.parent.basedir}',
'ruby.maven.version' => '3.3.3',
'ruby.maven.libs.version' => '3.3.3' )

# pre-installed gems - not default gems !
gem 'ruby-maven', '3.1.1.0.8', :scope => 'provided'
gem 'ruby-maven', '${ruby.maven.version}', :scope => 'provided'

# add torquebox repo only when building from filesystem
# not when using the pom as "dependency" in some other projects
@@ -63,6 +67,19 @@
File.chmod( 0644, f ) rescue nil if File.file?( f )
end
end

execute :dump_full_specs_of_ruby_maven do |ctx|
rubygems = File.join( ctx.project.build.directory.to_pathname, 'rubygems-provided' )
gems = File.join( rubygems, 'cache/*gem' )
default_specs = File.join( rubygems, 'specifications/default' )
FileUtils.mkdir_p( default_specs )
Dir[gems].each do |gem|
spec = Gem::Package.new( gem ).spec
File.open( File.join( default_specs, File.basename( gem ) + 'spec' ), 'w' ) do |f|
f.print( spec.to_ruby )
end
end
end
end

phase :package do
19 changes: 16 additions & 3 deletions maven/jruby-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -11,18 +11,20 @@
<packaging>pom</packaging>
<name>JRuby Dist</name>
<properties>
<ruby.maven.libs.version>3.3.3</ruby.maven.libs.version>
<jruby.home>${basedir}/../..</jruby.home>
<tesla.dump.readOnly>true</tesla.dump.readOnly>
<jruby.plugins.version>1.0.3</jruby.plugins.version>
<jruby.plugins.version>1.0.8</jruby.plugins.version>
<main.basedir>${project.parent.parent.basedir}</main.basedir>
<ruby.maven.version>3.3.3</ruby.maven.version>
<tesla.dump.pom>pom.xml</tesla.dump.pom>
<tesla.version>0.1.1</tesla.version>
</properties>
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>ruby-maven</artifactId>
<version>3.1.1.0.8</version>
<version>${ruby.maven.version}</version>
<type>gem</type>
<scope>provided</scope>
</dependency>
@@ -78,7 +80,7 @@
</execution>
</executions>
<configuration>
<finalName>jruby-dist-1.7.21-SNAPSHOT</finalName>
<finalName>jruby-dist-1.7.21</finalName>
<tarLongFileMode>gnu</tarLongFileMode>
<descriptors>
<descriptor>src/main/assembly/jruby.xml</descriptor>
@@ -115,6 +117,17 @@
<nativePom>pom.rb</nativePom>
</configuration>
</execution>
<execution>
<id>dump_full_specs_of_ruby_maven</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<taskId>dump_full_specs_of_ruby_maven</taskId>
<nativePom>pom.rb</nativePom>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
36 changes: 31 additions & 5 deletions maven/jruby-dist/src/main/assembly/jruby.xml
Original file line number Diff line number Diff line change
@@ -16,12 +16,38 @@
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/rubygems-provided</directory>
<outputDirectory>/lib/ruby/gems/shared</outputDirectory>
<directory>${project.build.directory}/rubygems-provided/gems/ruby-maven-${ruby.maven.version}/lib</directory>
<outputDirectory>/lib/ruby/shared</outputDirectory>
<includes>
<include>cache/*</include>
<include>specifications/*</include>
<include>gems/**/*</include>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/rubygems-provided/gems/ruby-maven-${ruby.maven.version}</directory>
<outputDirectory>/lib/ruby/</outputDirectory>
<includes>
<include>.mvn/**/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/rubygems-provided/gems/ruby-maven-libs-${ruby.maven.libs.version}/lib</directory>
<outputDirectory>/lib/ruby/shared</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/rubygems-provided/gems/ruby-maven-libs-${ruby.maven.libs.version}</directory>
<outputDirectory>/lib/ruby/</outputDirectory>
<includes>
<include>maven-home/**/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/rubygems-provided/specifications/default</directory>
<outputDirectory>/lib/ruby/gems/shared/specifications/default</outputDirectory>
<includes>
<include>*.gemspec</include>
</includes>
</fileSet>
<fileSet>

0 comments on commit 643006f

Please sign in to comment.