Cull exported dependencies, add thin jar, remove some build script cruft

This commit is contained in:
Mumfrey committed 2017-01-31 21:08:55 +00:00
1 parent f4aaa20f09
commit 3595312c5c
1 file changed
+44 -16
+44 -16
View File
@@ -67,13 +67,6 @@ configurations {
compile.exclude module: 'asm-debug-all'
}
configurations.all {
// Force use of Guava 17.0 so that srg2source doesn't evict it
resolutionStrategy {
force 'com.google.guava:guava:17.0'
}
}
// Include annotation processor sourceSet
sourceSets {
ap {
@@ -131,11 +124,9 @@ eclipseClasspath.dependsOn(renamedASM)
// Project dependencies
dependencies {
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'com.google.guava:guava:17.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'commons-io:commons-io:2.4'
compile 'commons-codec:commons-codec:1.9'
apCompile 'com.google.guava:guava:17.0'
testCompile 'junit:junit:4.11'
testCompile 'org.hamcrest:hamcrest-library:1.3'
@@ -169,7 +160,6 @@ dependencies {
}
// asm bridge
compile 'org.ow2.asm:asm-commons:5.0.3'
bridgeCompile 'org.ow2.asm:asm-commons:5.0.3'
bridgeCompile 'org.apache.logging.log4j:log4j-core:2.0-beta9'
}
@@ -253,9 +243,40 @@ jar {
"Premain-Class": "org.spongepowered.tools.agent.MixinAgent",
"Agent-Class": "org.spongepowered.tools.agent.MixinAgent",
"Can-Redefine-Classes": true,
"Can-Retransform-Classes": true)
"Can-Retransform-Classes": true
)
}
task thinJar(type: Jar) {
from sourceSets.main.output
from zipTree(tasks.renamedASM.outputs.files[0])
classifier = 'thin'
exclude 'org/objectweb/**'
exclude 'org/spongepowered/asm/lib/commons/**'
exclude 'org/spongepowered/asm/lib/signature/**'
exclude 'org/spongepowered/asm/lib/tree/analysis/**'
exclude 'org/spongepowered/asm/lib/util/**'
exclude 'org/spongepowered/asm/lib/xml/**'
exclude 'org/spongepowered/asm/launch/**'
exclude 'org/spongepowered/asm/obfuscation/**'
exclude 'org/spongepowered/asm/mixin/gen/**'
exclude 'org/spongepowered/asm/mixin/injection/invoke/**'
exclude 'org/spongepowered/asm/mixin/injection/modify/**'
exclude 'org/spongepowered/asm/mixin/transformer/*.class'
exclude 'org/spongepowered/asm/mixin/transformer/debug/**'
exclude 'org/spongepowered/asm/mixin/transformer/verify/**'
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": name,
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
"Implementation-Vendor": url,
)
}
build.dependsOn(thinJar)
// generate shadow jar so we can use the AP standalone
shadowJar {
from sourceSets.ap.output
@@ -265,8 +286,6 @@ shadowJar {
include(dependency('com.google.guava:guava'))
include(dependency('com.google.code.gson:gson'))
include(dependency('commons-io:commons-io'))
include(dependency('net.minecraftforge.srg2source:Srg2Source'))
include(dependency('net.sf.jopt-simple:jopt-simple'))
include(dependency('org.apache.logging.log4j:log4j-core'))
include(dependency('org.apache.logging.log4j:log4j-api'))
}
@@ -304,10 +323,19 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
artifacts {
archives jar
archives thinJar
archives sourceJar
archives javadocJar
}
ext.excludePomDeps = [
'fernflower',
'jarjar',
'hamcrest-library',
'junit',
'mockito-core'
]
uploadArchives {
repositories {
@@ -328,7 +356,7 @@ uploadArchives {
project {
name project.archivesBaseName
packaging 'jar'
description 'Sponge API'
description project.projectName
url 'http://www.spongepowered.org/'
scm {
@@ -352,7 +380,7 @@ uploadArchives {
}
whenConfigured {
dependencies = dependencies.findAll {
!it.artifactId.contains('fernflower')
!it.artifactId.matches(excludePomDeps.join('|'))
}
}
}
@@ -363,7 +391,7 @@ uploadArchives {
install.repositories.mavenInstaller.pom {
whenConfigured {
dependencies = dependencies.findAll {
!it.artifactId.contains('fernflower')
!it.artifactId.matches(excludePomDeps.join('|'))
}
}
}