aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Peltier <mikaelpeltier@google.com>2017-08-18 08:48:43 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-08-18 08:48:43 +0000
commit7e81006803f88ab4e40d9811952c7fc1c5658f4b (patch)
tree1ab846a1e533e705a4e37c1bdb435c4e0065cab6
parent5f3a94c12a4b2d981283e7187141d14571deee92 (diff)
parent809393113641616273671dd549e28b89e97a806a (diff)
downloadr8-7e81006803f88ab4e40d9811952c7fc1c5658f4b.tar.gz
Merge "Repackage all embedded libraries"
-rw-r--r--build.gradle17
1 files changed, 14 insertions, 3 deletions
diff --git a/build.gradle b/build.gradle
index 085666a85..7a007d46b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,6 +7,7 @@ import utils.Utils
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'com.google.protobuf'
+apply plugin: 'com.github.johnrengelman.shadow'
apply from: 'copyAdditionalJctfCommonFiles.gradle'
@@ -23,9 +24,11 @@ repositories {
buildscript {
repositories {
mavenCentral()
+ jcenter()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.1'
+ classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
@@ -326,17 +329,25 @@ task R8(type: Jar) {
}
}
-task D8(type: Jar) {
+task D8(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
from sourceSets.main.output
baseName 'd8'
+ classifier = null
+ version = null
manifest {
- attributes 'Main-Class': 'com.android.tools.r8.D8'
+ attributes 'Main-Class': 'com.android.tools.r8.D8'
}
// In order to build without dependencies, pass the exclude_deps property using:
// gradle -Pexclude_deps D8
if (!project.hasProperty('exclude_deps')) {
+ // Relocating dependencies to avoid conflicts.
+ relocate 'com.google', 'com.android.tools.r8.com.google'
+ relocate 'joptsimple', 'com.android.tools.r8.joptsimple'
+ relocate 'org', 'com.android.tools.r8.org'
+ relocate 'it.unimi.dsi.fastutil', 'com.android.tools.r8.it.unimi.dsi.fastutil'
+ relocate 'junit', 'com.android.tools.r8.junit'
// Also include dependencies
- from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
+ configurations = [project.configurations.compile]
}
}