Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <parent>
    <groupId>org.jruby</groupId>
    <artifactId>jruby-artifacts</artifactId>
    <version>1.7.12</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>jruby-stdlib</artifactId>
  <packaging>jar</packaging>
  <name>JRuby Stdlib</name>

  <dependencies>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>readline</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>openssl</artifactId>
      <version>0.9.4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk15on</artifactId>
      <version>${bouncy-castle.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk15on</artifactId>
      <version>${bouncy-castle.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <properties>
    <jruby.basedir>${basedir}/../../</jruby.basedir>
    <jruby.complete.home>${project.build.outputDirectory}/META-INF/jruby.home</jruby.complete.home>
    <jruby.complete.gems>${jruby.complete.home}/lib/ruby/gems/shared</jruby.complete.gems>
    <gem.home>${jruby.basedir}/lib/ruby/gems/shared</gem.home>
    <main.basedir>${project.parent.parent.basedir}</main.basedir>
    <bundle.name>JRuby Stdlib</bundle.name>
    <bundle.symbolic_name>org.jruby.jruby-stdlib</bundle.symbolic_name>
  </properties>

  <build>
    <resources>
      <resource>
        <directory>${gem.home}</directory>
        <targetPath>${jruby.complete.gems}</targetPath>
        <includes>
	  <include>gems/rake-${rake.version}/bin/r*</include>
	  <include>gems/rdoc-${rdoc.version}/bin/r*</include>
          <include>specifications/default/*.gemspec</include>
        </includes>
      </resource>
      <resource>
        <directory>${jruby.basedir}</directory>
        <targetPath>${jruby.complete.home}</targetPath>
        <includes>
          <include>bin/ast*</include>
          <include>bin/gem*</include>
          <include>bin/irb*</include>
          <include>bin/jgem*</include>
          <include>bin/jirb*</include>
          <include>bin/jruby*</include>
          <include>bin/rake*</include>
          <include>bin/ri*</include>
          <include>bin/rdoc*</include>
          <include>bin/testrb*</include>
          <include>lib/ruby/1.8/**</include>
          <include>lib/ruby/1.9/**</include>
          <include>lib/ruby/2.0/**</include>
          <include>lib/ruby/shared/**</include>
        </includes>
	<excludes>
          <exclude>bin/jruby</exclude>
          <exclude>bin/jruby*_*</exclude>
          <exclude>bin/jruby*-*</exclude>
          <exclude>**/.*</exclude>
          <exclude>lib/ruby/shared/rubygems/defaults/jruby_native.rb</exclude>
	</excludes>
      </resource>
    </resources>

    <plugins>
      <plugin>
	<artifactId>maven-source-plugin</artifactId>
	<configuration>
	  <skipSource>true</skipSource>
	</configuration>
      </plugin>
      <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>gem-maven-plugin</artifactId>
        <version>${jruby.plugins.version}</version>
        <executions>
          <execution>
            <id>fix shebang on gem bin files and add *.bat files</id>
            <phase>initialize</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
	      <script>
		puts 'fix the gem stub files'
		Dir[ '../../lib/ruby/gems/shared/bin/*' ].each do |f|
		  content = File.read( f )
		  new_content = content.sub(/#!.*/, "#!/usr/bin/env jruby
")
		  File.open( f, "w" ) { |file| file.print( new_content ) }
		end
	
		puts 'generate the missing bat files'
		Dir[File.join( '${jruby.basedir}', 'bin', '*' )].each do |fn|
                  next unless File.file?(fn)
		  next if fn =~ /.bat$/
		  next if File.exist?("#{fn}.bat")
		  next unless File.open(fn, 'r', :internal_encoding => 'ASCII-8BIT') do |io|
		    line = io.readline rescue ""
		    line =~ /^#!.*ruby/
		  end
		  puts "Generating #{File.basename(fn)}.bat"
		  File.open("#{fn}.bat", "wb") do |f|
                    f.print "@ECHO OFF\r\n"
		    f.print "@\"%~dp0jruby.exe\" -S #{File.basename(fn)} %*\r\n"
                  end
		end
	      </script>
	    </configuration>
          </execution>
          <execution>
            <id>copy bin/jruby.bash to bin/jruby</id>
            <phase>process-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
	      <script>		
		puts 'copy jruby.bash to jruby'
		require 'fileutils'
		FileUtils.cp( File.join( '${jruby.complete.home}', 'bin', 'jruby.bash' ), File.join( '${jruby.complete.home}', 'bin', 'jruby' ) )
		
	      </script>
	    </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${basedir}/src/empty.jar</file>
                  <classifier>sources</classifier>
                </artifact>
                <artifact>
                  <file>${basedir}/src/empty.jar</file>
                  <classifier>javadoc</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
	<groupId>org.apache.felix</groupId>
	<artifactId>maven-bundle-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
	    <configuration>
	      <archive>
		<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
	      </archive>
	    </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
New to GrepCode? Check out our FAQ X