Skip to content

Instantly share code, notes, and snippets.

@thadguidry
Created October 21, 2015 19:47
Show Gist options
  • Save thadguidry/85df4b9664364282b962 to your computer and use it in GitHub Desktop.
Save thadguidry/85df4b9664364282b962 to your computer and use it in GitHub Desktop.
Example Gradle build for multi-project Java that copies jar files to specific paths
apply plugin: 'eclipse'
allprojects {
}
subprojects { apply plugin: 'java' }
project(':DMTableInput') {
dependencies { compile project(':DMUtils') }
}
project(':GroovyScript') {
}
// list all the libraries here that need to be copied to the biserver
def libSpec = copySpec {
from("DMUtils") { include "build/libs/*.jar" }
}
// list all the custom plugins here that need to be copied to the biserver
def stepsSpec = copySpec {
from(".") {
include "DMTableInput/build/libs/DMTableInput.jar"
include "DMTableInput/DMTableInput/*.*"
include "GroovyScript/*.*"
}
}
// This is where pentaho customized libaries and step plugins will reside
def bisvrLibsDir="${System.env.HOME}/git/emt/biserver-ce/tomcat/webapps/pentaho/WEB-INF/lib"
def bisvrStepsDir="${System.env.HOME}/git/emt/biserver-ce/pentaho-solutions/system/kettle/plugins"
def spoonLibsDir="${System.env.HOME}/git/data-integration/lib"
def spoonStepsDir="${System.env.HOME}/git/data-integration/plugins"
// custom steps to copy libraries and customer plugin steps to biserver
task copyLibs(dependsOn: subprojects.jar) {
copy {
into "$bisvrLibsDir"
with libSpec
eachFile { details -> details.path = details.name }
includeEmptyDirs = false
}
copy {
into "$spoonLibsDir"
with libSpec
eachFile { details -> details.path = details.name }
includeEmptyDirs = false
}
}
task copySteps(dependsOn: subprojects.jar) {
copy {
into "$bisvrStepsDir"
with stepsSpec
eachFile { details -> details.path = details.sourcePath.split("/")[0] + "/" + details.name }
includeEmptyDirs = false
}
copy {
into "$spoonStepsDir"
with stepsSpec
eachFile { details -> details.path = details.sourcePath.split("/")[0] + "/" + details.name }
includeEmptyDirs = false
}
}
task copyLocal(dependsOn: [':copyLibs', ':copySteps']) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment