Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
jruby-gradle-plugin/examples/self-executing-jar/build.gradle
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
51 lines (44 sloc)
1.33 KB
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
/* | |
* This project is intended to be used as an acceptance test *and* a | |
* documentation example. If you change this file, please be sure that it | |
* renders appropriately in the generated documentation | |
*/ | |
buildscript { | |
repositories { jcenter() } | |
dependencies { | |
/* here to make sure that our dependencies get loaded in properly under | |
* GradleTest, this is NOT needed by end-users | |
*/ | |
classpath 'com.github.jengelman.gradle.plugins:shadow:[1.2.2,2.0)' | |
} | |
} | |
plugins { | |
id 'com.github.jruby-gradle.jar' | |
} | |
repositories { | |
jcenter() | |
ruby.gems() | |
} | |
dependencies { | |
/* Using the built-in `jrubyJar` configuration to describe the | |
* dependencies our jrubyJar task will need, so the gem is properly | |
* included in the resulting .jar file | |
*/ | |
jrubyJar "rubygems:colorize:0.7.7+" | |
jrubyJar 'org.slf4j:slf4j-simple:1.7.12' | |
} | |
jrubyJar { | |
/* We want to use this Ruby script as our start point when the jar executes | |
*/ | |
initScript "${projectDir}/entrypoint.rb" | |
} | |
/* | |
* This task is only here for the execution fo the gradleTest | |
*/ | |
task runGradleTest(type: Exec) { | |
dependsOn jrubyJar | |
description "Execute the constructed self-executing jar" | |
environment [:] | |
workingDir "${buildDir}/libs" | |
commandLine 'java', '-jar', jrubyJar.outputs.files.singleFile.absolutePath | |
} |