[go: nahoru, domu]

Skip to content

Commit

Permalink
jarjar-gradle: Better example project.
Browse files Browse the repository at this point in the history
  • Loading branch information
shevek committed Nov 13, 2018
1 parent 061f2aa commit 2e20edd
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions jarjar-gradle/example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}

dependencies {
def properties = new Properties();
file('../../gradle.properties').withReader { properties.load(it); }
classpath "org.anarres.jarjar:jarjar-gradle:${properties.version}"
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.1'
}
}

Expand Down Expand Up @@ -119,6 +121,58 @@ project(':sub2') {

}

project(':sub3') {
apply plugin: 'com.github.johnrengelman.shadow'

shadowJar {
mergeServiceFiles()

dependencies {
include dependency("org.apache.hive:.*:.*")
include dependency("org.apache.hadoop:.*:.*")
include dependency("com.google.guava:guava:.*")
}

// Exclusions from hive-exec
exclude "org/apache/commons/**"
exclude "org/apache/thrift/**"
exclude "org/slf4j/**"
exclude "org/json/**"
exclude "org/codehaus/jackson/**"
exclude "parquet/org/codehaus/jackson/**"
// Some random WAT from hive-exec.
exclude "minlog-1.2.jar"
exclude "objenesis-1.2.jar"
exclude "reflectasm-1.07-shaded.jar"
exclude "META-INF/maven/**"

// exclude "*.jar"
// exclude "org/log4j/**"

def target = "org.anarres.hadoop"
// relocate "org.json", "${target}.json" // From hive-exec
// relocate "org.iq80", "${target}.iq80" // From hive-exec
relocate "com.google", "${target}.google"
relocate "parquet", "${target}.parquet"
relocate "javolution", "${target}.javolution"
relocate "com.esotericsoftware.kryo", "${target}.kryo"

}

dependencies {
compile 'org.apache.hive:hive-exec:0.13.0.2.1.5.0-695', {
exclude group: 'net.hydromatic', module: 'optiq-core'
}
}
}

project(':sub4') {
dependencies {
compile project(path: ':sub3', configuration: 'shadow')
// compile project(':sub3')
}
}

/*
project(':sub3') {
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jarjar-gradle/example/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name='jarjar-gradle-example'
include 'sub0', 'sub1', 'sub2' // , 'sub3'
include 'sub0', 'sub1', 'sub2', 'sub3', 'sub4'

0 comments on commit 2e20edd

Please sign in to comment.