Last active
December 20, 2015 09:59
-
-
Save mkristian/6111925 to your computer and use it in GitHub Desktop.
rewrite of
https://github.com/tesla/tesla-polyglot/blob/master/tesla-polyglot-gem/Mavenfile
as a Rakefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake -T | |
rake build # Build gem into the pkg directory | |
rake compile # Compile any java source configured - default java files are in src/main/java | |
rake jar # Package Jarfile with the compiled classes - default jarfile lib/{name}.jar | |
rake maven # Setup Maven instance | |
rake push # Push gem to rubygems.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'maven/ruby/tasks' | |
# overwrite predefined task with custom maven | |
task :maven do | |
# the block is the POM for maven | |
maven do | |
# load data from gemspec | |
gemspec | |
inherit "io.tesla.polyglot:tesla-polyglot:0.0.1-SNAPSHOT" | |
plugin( :dependency, | |
:phase => 'process-sources' ) do | |
execute_goals( :unpack, | |
:outputAbsoluteArtifactFilename => false, | |
:artifactItems => [ { :groupId => '${project.parent.groupId}', | |
:artifactId => 'tesla-polyglot-cli', | |
:version => '${project.parent.version}', | |
:classifier => 'bin', | |
:type => 'tar.gz', | |
:outputDirectory => '${project.build.directory}' } ] ) | |
end # maven-dependency-plugin | |
plugin( :clean, '2.5', | |
:filesets => [ { :directory => 'lib', | |
:includes => ['*.jar', 'ext/**' ] }, | |
{ :directory => 'conf' }, | |
{ :directory => 'ext' }, | |
{ :directory => 'boot' }, | |
{ :directory => 'bin', | |
:includes => ['*'], | |
:excludes => ['rmvn'] }, | |
{ :directory => './', | |
:includes => ['*.txt'] } ] ) | |
plugin( 'io.tesla.maven.plugins:tesla-license-plugin', | |
:header => '../license-header.txt', | |
:excludes => [ 'pom.xml', '**/conf/**'] ) | |
resource do | |
target_path "${project.basedir}" | |
directory "${project.build.directory}/tesla-polyglot-${project.parent.version}" | |
includes [ 'lib/**/*', 'conf/**/*', 'ext/**', 'boot/*', 'bin/m2.conf', '*.txt' ] | |
end | |
properties( 'tesla.dump.pom' => 'pom.xml', | |
'tesla.dump.readonly' => true ) | |
end | |
maven.verbose = true | |
end | |
task :deploy do | |
maven.deploy | |
end | |
task :default => :build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment