Skip to content
This repository was archived by the owner on Jan 2, 2018. It is now read-only.

Adding verbose **optional** property #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class JarJarPluginExtension {
String outputDir = 'libs'

boolean ignoreJarJarResult = false
boolean verbose = false

boolean equals(o) {
if (this.is(o)) return true
Expand All @@ -22,6 +23,7 @@ class JarJarPluginExtension {
JarJarPluginExtension that = (JarJarPluginExtension) o

if (ignoreJarJarResult != that.ignoreJarJarResult) return false
if (verbose != that.verbose) return false
if (jarJarFile != that.jarJarFile) return false
if (outputDir != that.outputDir) return false
if (outputName != that.outputName) return false
Expand All @@ -39,6 +41,7 @@ class JarJarPluginExtension {
result = 31 * result + (outputName != null ? outputName.hashCode() : 0)
result = 31 * result + (outputDir != null ? outputDir.hashCode() : 0)
result = 31 * result + (ignoreJarJarResult ? 1 : 0)
result = 31 * result + (verbose ? 1 : 0)
return result
}

Expand All @@ -51,6 +54,7 @@ class JarJarPluginExtension {
", outputName='" + outputName + '\'' +
", outputDir='" + outputDir + '\'' +
", ignoreJarJarResult=" + ignoreJarJarResult +
", verbose=" + verbose +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ class RepackageTask extends DefaultTask {

project.exec {
workingDir project.projectDir
ignoreExitValue = JarJarPlugin.getExtension(project).ignoreJarJarResult

def extension = JarJarPlugin.getExtension(project)
ignoreExitValue = extension.ignoreJarJarResult

def args = []
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', 'java', '-jar', jarJarExeFile.absolutePath, 'process', rulesFile.absolutePath, rawFatJar.absolutePath, outJar.absolutePath
} else {
commandLine 'java', '-jar', jarJarExeFile.absolutePath, 'process', rulesFile.absolutePath, rawFatJar.absolutePath, outJar.absolutePath
args.addAll 'cmd', '/c'
}

args.addAll 'java',
"-Dverbose=$extension.verbose",
'-jar', jarJarExeFile.absolutePath,
'process', rulesFile.absolutePath,
rawFatJar.absolutePath,
outJar.absolutePath
commandLine args
}

String variantString = getVariant(project)
Expand Down