Switch over to using Gradle to build and test the Blick agent
This commit is contained in:
parent
749381d441
commit
83f6ef60e8
|
@ -0,0 +1,24 @@
|
|||
# Hacking on Blick
|
||||
|
||||
Blick relies on the [Gradle](http://gradle.org) build tool by way of the
|
||||
[jruby-gradle-jar-plugin](https://github.com/jruby-gradle/jruby-gradle-jar-plugin).
|
||||
|
||||
## Building
|
||||
|
||||
In order to build an agent jar, you only need to run `./gradlew shadowJar` in
|
||||
the `blick/` directory.
|
||||
|
||||
## Testing
|
||||
|
||||
Running the [RSpec](http://rspec.org) tests requires executing: `./gradlew
|
||||
spec`
|
||||
|
||||
## Running
|
||||
|
||||
The created "shadow jar" is fully self-contained and executable, executing it
|
||||
requires building the jar (see above) and then: `java -jar
|
||||
build/libs/blick-agent-all.jar`
|
||||
|
||||
**NOTE:** if you're using [rvm](http://rvm.io) or any other tool that sets the
|
||||
`GEM_HOME` and/or `GEM_PATH` environment variables, you should unset them
|
||||
before running the jar.
|
62
build.gradle
62
build.gradle
|
@ -1,30 +1,70 @@
|
|||
apply plugin: 'java'
|
||||
apply plugin: 'com.github.jruby-gradle.jar'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'com.github.jruby-gradle', name: 'jruby-gradle-plugin', version: '0.1.3-SNAPSHOT'
|
||||
classpath group: 'com.github.jruby-gradle', name: 'jruby-gradle-jar-plugin', version: '0.1.1-SNAPSHOT'
|
||||
classpath group: 'com.github.jruby-gradle',
|
||||
name: 'jruby-gradle-plugin',
|
||||
version: '0.1.3-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
//id "com.github.jruby-gradle.base" version "0.1.2"
|
||||
id "com.github.jruby-gradle.jar" version '0.1.1'
|
||||
id "com.github.johnrengelman.shadow" version "1.1.2"
|
||||
}
|
||||
apply plugin: 'java'
|
||||
|
||||
import com.github.jrubygradle.JRubyExec
|
||||
|
||||
// There appear to be issues with 1.7.16:
|
||||
// <https://gist.github.com/rtyler/dd1f1df58d4712a9e63d>
|
||||
project.jruby.execVersion = '1.7.15'
|
||||
|
||||
dependencies {
|
||||
compile group: 'org.jruby', name: 'jruby-complete', version: '1.7.15'
|
||||
|
||||
gems group: 'rubygems', name: 'protobuf', version: '3.0.+'
|
||||
gems group: 'rubygems', name: 'concurrent-ruby', version: '0.7.+'
|
||||
|
||||
jrubyExec group: 'rubygems', name: 'rspec', version: '3.1.+'
|
||||
}
|
||||
|
||||
configurations {
|
||||
jrubyExec {
|
||||
extendsFrom gems
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
gems group: 'rubygems', name: 'protobuf', version: '3.0.+'
|
||||
jrubyJavaBootstrap {
|
||||
jruby {
|
||||
initScript = 'blick-agent'
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
// Pull the contents of lib and bin into the root of the created jar file
|
||||
sourceSets {
|
||||
main {
|
||||
resources.srcDirs = ['lib', 'bin']
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
baseName 'blick-agent'
|
||||
exclude '*.sw*', '*.gitkeep', '*.md'
|
||||
jruby {
|
||||
// Use the default GEM installation directory
|
||||
defaultGems()
|
||||
// Make the JAR executable and use the default main class
|
||||
defaultMainClass()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
task spec(type: JRubyExec) {
|
||||
group 'JRuby'
|
||||
description 'Execute the RSpecs in JRuby'
|
||||
jrubyArgs '-S', 'rspec'
|
||||
scriptArgs '--color', '--order', 'random'
|
||||
}
|
||||
|
||||
// vim: ft=groovy
|
||||
|
|
Loading…
Reference in New Issue