summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorGravatar Shadowfacts2016-08-17 14:53:39 -0400
committerGravatar Shadowfacts2016-08-17 14:54:49 -0400
commit2d17567a996393064d5b652e6ae7d9f8f7eb5796 (patch)
tree8e53fae0e1eef248b2fde77361b4a8fa24e2a6de /build.gradle
parentFix #4, at least to the extent we currently need it (diff)
downloadenigma-2d17567a996393064d5b652e6ae7d9f8f7eb5796.tar.gz
enigma-2d17567a996393064d5b652e6ae7d9f8f7eb5796.tar.xz
enigma-2d17567a996393064d5b652e6ae7d9f8f7eb5796.zip
Deploy shadow jar and lib jar to maven
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle36
1 files changed, 3 insertions, 33 deletions
diff --git a/build.gradle b/build.gradle
index f267b6a7..ca61c1e2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -139,28 +139,11 @@ shadowJar {
139 exclude 'META-INF/maven/**' 139 exclude 'META-INF/maven/**'
140} 140}
141 141
142// Now make the deployable application jar with extra classes stripped out using
143// ProGuard (don't use JavaExec because we want to redirect output to a file).
144task('thinJar', dependsOn: shadowJar) << {
145 javaexec {
146 main 'proguard.ProGuard'
147 classpath configurations.proGuard
148
149 args '@proguard-build.conf', '-injars', shadowJar.archivePath,
150 // well this works...
151 '-outjars', file("build/libs/$project.name-${version}-thin.jar")
152
153 // Cut down on console spam
154 standardOutput new File(buildDir, 'proguard.log').newOutputStream();
155 }
156 println 'Saved ProGuard output to build/proguard.log'
157}
158
159// Create a library jar, containing only the deobfuscation code, for use at 142// Create a library jar, containing only the deobfuscation code, for use at
160// runtime. This will be deployed to Maven Local with a POM, and can be uploaded 143// runtime. This will be deployed to Maven Local with a POM, and can be uploaded
161// to a remote server manually (for now anyway). 144// to a remote server manually (for now anyway).
162task('libJar', type: Jar, dependsOn: classes) { 145task('libJar', type: Jar, dependsOn: classes) {
163 baseName = 'enigma-lib' 146 classifier = 'lib'
164 147
165 from("$buildDir/classes/main") { 148 from("$buildDir/classes/main") {
166 exclude 'cuchaz/enigma/gui/**' 149 exclude 'cuchaz/enigma/gui/**'
@@ -172,26 +155,13 @@ task('libJar', type: Jar, dependsOn: classes) {
172 exclude 'cuchaz/enigma/ConvertMain*.class' 155 exclude 'cuchaz/enigma/ConvertMain*.class'
173 } 156 }
174} 157}
175artifacts.archives libJar { name 'enigma-lib' }
176 158
177artifacts { 159artifacts {
178 archives shadowJar 160 archives shadowJar
179} 161 archives libJar
180
181// Here we need a bit of hackery to remove the default Maven deployment and just
182// deploy enigma-lib. Works, but not ideal :(
183configurations.archives {
184 artifacts.iterator().with {
185 while (it.hasNext()) {
186 if (it.next().name == 'enigma') {
187 it.remove()
188 }
189 }
190 }
191} 162}
192 163
193// And finally, make the build generate / install the jars. 164// And finally, make the build generate / install the jars.
194assemble.dependsOn thinJar
195build.dependsOn install 165build.dependsOn install
196 166
197uploadArchives { 167uploadArchives {