Permalink
Switch branches/tags
last_OK jenkins-tomk-hadoop-1 jenkins-tomas_jenkins-7 jenkins-tomas_jenkins-6 jenkins-tomas_jenkins-5 jenkins-tomas_jenkins-4 jenkins-tomas_jenkins-3 jenkins-tomas_jenkins-2 jenkins-tomas_jenkins-1 jenkins-sample-docs-3 jenkins-sample-docs-2 jenkins-sample-docs-1 jenkins-rel-wright-8 jenkins-rel-wright-7 jenkins-rel-wright-6 jenkins-rel-wright-5 jenkins-rel-wright-4 jenkins-rel-wright-3 jenkins-rel-wright-2 jenkins-rel-wright-1 jenkins-rel-wolpert-11 jenkins-rel-wolpert-10 jenkins-rel-wolpert-9 jenkins-rel-wolpert-8 jenkins-rel-wolpert-7 jenkins-rel-wolpert-6 jenkins-rel-wolpert-5 jenkins-rel-wolpert-4 jenkins-rel-wolpert-3 jenkins-rel-wolpert-2 jenkins-rel-wolpert-1 jenkins-rel-wheeler-12 jenkins-rel-wheeler-11 jenkins-rel-wheeler-10 jenkins-rel-wheeler-9 jenkins-rel-wheeler-8 jenkins-rel-wheeler-7 jenkins-rel-wheeler-6 jenkins-rel-wheeler-5 jenkins-rel-wheeler-4 jenkins-rel-wheeler-3 jenkins-rel-wheeler-2 jenkins-rel-wheeler-1 jenkins-rel-weierstrass-7 jenkins-rel-weierstrass-6 jenkins-rel-weierstrass-5 jenkins-rel-weierstrass-4 jenkins-rel-weierstrass-3 jenkins-rel-weierstrass-2 jenkins-rel-weierstrass-1 jenkins-rel-vapnik-1 jenkins-rel-vajda-4 jenkins-rel-vajda-3 jenkins-rel-vajda-2 jenkins-rel-vajda-1 jenkins-rel-ueno-12 jenkins-rel-ueno-11 jenkins-rel-ueno-10 jenkins-rel-ueno-9 jenkins-rel-ueno-8 jenkins-rel-ueno-7 jenkins-rel-ueno-6 jenkins-rel-ueno-5 jenkins-rel-ueno-4 jenkins-rel-ueno-3 jenkins-rel-ueno-2 jenkins-rel-ueno-1 jenkins-rel-tverberg-6 jenkins-rel-tverberg-5 jenkins-rel-tverberg-4 jenkins-rel-tverberg-3 jenkins-rel-tverberg-2 jenkins-rel-tverberg-1 jenkins-rel-tutte-2 jenkins-rel-tutte-1 jenkins-rel-turnbull-2 jenkins-rel-turnbull-1 jenkins-rel-turing-10 jenkins-rel-turing-9 jenkins-rel-turing-8 jenkins-rel-turing-7 jenkins-rel-turing-6 jenkins-rel-turing-5 jenkins-rel-turing-4 jenkins-rel-turing-3 jenkins-rel-turing-2 jenkins-rel-turing-1 jenkins-rel-turin-4 jenkins-rel-turin-3 jenkins-rel-turin-2 jenkins-rel-turin-1 jenkins-rel-turchin-11 jenkins-rel-turchin-10 jenkins-rel-turchin-9 jenkins-rel-turchin-8 jenkins-rel-turchin-7 jenkins-rel-turchin-6 jenkins-rel-turchin-5 jenkins-rel-turchin-4 jenkins-rel-turchin-3
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
148 lines (131 sloc) 5.52 KB
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'com.github.hierynomus.license'
description = "H2O Application Assembly"
// Exclude unwanted dependencies
configurations {
compile.exclude module: 'junit'
compile.exclude module: 'mockito-all'
compile.exclude module: 'zookeeper'
compile.exclude module: 'javax.mail.glassfish'
compile.exclude module: 'servlet-api'
compile.exclude group: 'org.mortbay.jetty' // exclude the whole group, nothing good in there
}
// Dependencies
dependencies {
compile project(":h2o-app")
compile project(":h2o-web")
compile project(":h2o-avro-parser")
compile project(":h2o-persist-gcs")
compile project(":h2o-persist-s3")
compile project(":h2o-persist-http")
compile project(":h2o-persist-hdfs")
if (project.hasProperty("doIncludeOrc") && project.doIncludeOrc == "true") {
compile project(":h2o-orc-parser")
}
compile project(":h2o-parquet-parser")
compile "org.slf4j:slf4j-log4j12:1.7.10"
}
//
// Bundle optional modules
// The process is defined by convention. There are two flags:
// - -Pwith${componentName}=true - enables component "componentName" and includes it in assembly
// - -P${componentName}Version=3.14 - overrides default component version
//
for (comp in optionalComponents) {
def compName = comp['name']
def compVersion = comp['version']
def compEnabled = comp['enabled']
def compPropName = "with${compName.capitalize()}"
def compPropVersionName = "${compName}Version"
if (!project.hasProperty(compPropVersionName)) {
project.ext.set(compPropVersionName, compVersion)
}
if (compEnabled || project.hasProperty(compPropName) && project.property(compPropName)) {
logger.lifecycle("== ${project.path}: Using optional component: ${compName}, version ${project.findProperty(compPropVersionName)}")
apply from: "$rootDir/gradle/components/${compName}.gradle"
}
}
shadowJar {
mergeServiceFiles()
classifier = ''
// CDH 5.3.0 provides joda-time v1.6 which is too old, shadow the library instead
if (!project.hasProperty("jacocoCoverage")) {
relocate 'org.joda.time', 'ai.h2o.org.joda.time'
}
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.SF'
exclude 'synchronize.properties'
exclude 'uploader.properties'
exclude 'test.properties'
exclude 'cockpitlite.properties'
exclude 'devpay_products.properties'
manifest {
attributes 'Main-Class': 'water.H2OApp'
}
transform(com.github.jengelman.gradle.plugins.shadow.transformers.IncludeResourceTransformer.class) {
file = file("${buildDir}/reports/license/dependency-license.xml")
resource = "META-INF/license/h2o-depenencies-licenses.xml"
}
}
artifacts {
archives shadowJar
}
//
// Support make infrastructure by copying the resulting assembly into parent
// project build directory
//
def assembly = "main.jar"
def allInOne = "h2o.jar"
task copyJar(type: Copy) {
from ("${project.buildDir}/libs"){
include assembly
}
into "${project.parent.parent.buildDir}"
rename { it.replace(assembly, allInOne) }
}
downloadLicenses {
ext.apacheTwo = license('Apache License, Version 2.0', 'http://opensource.org/licenses/Apache-2.0')
ext.bsd = license('BSD License', 'http://www.opensource.org/licenses/bsd-license.php')
licenses = [
'commons-beanutils:commons-beanutils:1.7.0': apacheTwo,
'asm:asm-parent:3.1': bsd,
'org.codehaus.jettison:jettison:1.1': apacheTwo,
'javax.servlet.jsp:jsp-api:2.1': license('CDDL + GPLv2 with classpath exception', 'https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html'),
'org.apache.zookeeper:zookeeper:3.4.6': apacheTwo
]
aliases = [
(apacheTwo) : ['The Apache Software License, Version 2.0', 'Apache 2', 'Apache License Version 2.0', 'Apache License, Version 2.0', 'Apache License 2.0', license('Apache License', 'http://www.apache.org/licenses/LICENSE-2.0')],
(bsd) : ['BSD', license('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php')]
]
}
task licenseReport(dependsOn: project.tasks.getByName('downloadLicenses')) {
doLast {
def jsonLicensesFile = file("${buildDir}/reports/license/dependency-license.json")
def csvLicensesFile = file("${buildDir}/reports/license/dependency-license.csv")
def licenses = new groovy.json.JsonSlurper().parseText(jsonLicensesFile.text)
csvLicensesFile.withWriter('UTF-8') { w ->
boolean xgboostDefined = false
w.write('"Dependency","File","License Name","License URL"\n')
licenses.dependencies.each { dep ->
dep.licenses.each {
boolean licenseValid = it.name != "No license found"
if (! licenseValid) {
if (dep.name == "asm:asm-parent:3.1") {
// FIXME: manual override, this doesn't work for some reason!
w.write("${dep.name},${dep.file},\"BSD License\",http://www.opensource.org/licenses/bsd-license.php\n")
} else
throw new StopExecutionException("License not found for dependency ${dep.name}. Please define dependency manually.")
}
w.write("${dep.name},${dep.file},\"${it.name}\",${it.url}\n")
}
}
}
}
}
// Include licences
shadowJar.dependsOn(licenseReport)
// Execute always copyJar
shadowJar.finalizedBy copyJar
// Run shadowJar as par of build
jar.finalizedBy shadowJar