Skip to content

Instantly share code, notes, and snippets.

@bmuschko
Created February 26, 2016 15:45
Show Gist options
  • Save bmuschko/f29dc12e304daee5f978 to your computer and use it in GitHub Desktop.
Save bmuschko/f29dc12e304daee5f978 to your computer and use it in GitHub Desktop.
JarJar for Gradle API
dependencies {
runtime project(':core')
runtime project(':dependencyManagement')
runtime project(':pluginUse')
runtime project(':toolingApi')
}
task jarJarJar(type: org.gradle.build.JarJarJar) {
ext.shadedPackage = 'org.gradle.jarjar'
from sourceSets.main.output
from { configurations.runtime.collect { zipTree(it) } }
exclude 'api-mapping.txt'
exclude 'default-imports.txt'
exclude 'META-INF/**'
exclude 'gradle-plugins.properties'
exclude 'fr/jayasoft/ivy/ant/**'
exclude 'net/rubygrapefruit/platform/**'
exclude 'com/sun/jna/**'
exclude 'org/fusesource/jansi/**'
exclude 'images/**'
exclude 'license/**'
exclude 'licenses/**'
exclude 'LICENSE.txt'
exclude 'mozilla/**'
exclude 'module.properties'
exclude '*.html'
rule('org.gradle.**', '@0')
rule('org.apache.tools.ant.**', '@0')
rule('groovy.**', '@0')
rule('org.slf4j.**', '@0')
rule('javax.inject.Inject', '@0')
rule('org.**', "${shadedPackage}.@0")
rule('com.**', "${shadedPackage}.@0")
rule('net.**', "${shadedPackage}.@0")
rule('jcifs.**', "${shadedPackage}.@0")
keep('org.gradle.**')
Date start
doFirst {
start = new Date()
}
doLast {
Date stop = new Date()
def td = groovy.time.TimeCategory.minus( stop, start )
logger.quiet "Elapsed time to generate Gradle API jarJar: $td"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment