Commit 7ae69fb2 authored by Matyáš Latner's avatar Matyáš Latner

#14 Removed need of creating jar for calculating checksum of assets in gradle build

parent 2c4d0a7f
......@@ -98,7 +98,7 @@ tasks.whenTaskAdded { compileTask ->
// for all selected tasks create dependency task "checksum{BUILD_TYPE}Assets"
task("checksum${buildName}Assets") {
// calculated checksum is dependency
dependsOn(':util:checksum:runJarChecksum')
dependsOn(':util:checksum:runChecksum')
// wait for generating android sources
dependsOn("generate${buildName}Sources")
......
......@@ -54,9 +54,9 @@ artifacts {
jar.enabled = false
debugJar.dependsOn classes
debugJar.dependsOn(':util:checksum:runJarChecksum')
debugJar.dependsOn(':util:checksum:runChecksum')
releaseJar.dependsOn classes
releaseJar.dependsOn(':util:checksum:runJarChecksum')
releaseJar.dependsOn(':util:checksum:runChecksum')
eclipse {
project {
......
......@@ -119,7 +119,7 @@ launchIPhoneSimulator.dependsOn assemble
launchIPhoneSimulator.dependsOn updateRoboVMXML
launchIOSDevice.dependsOn assemble
launchIOSDevice.dependsOn updateRoboVMXML
updateRoboVMXML.dependsOn(':util:checksum:runJarChecksum')
updateRoboVMXML.dependsOn(':util:checksum:runChecksum')
updateRoboVMXML.dependsOn copyNatives
build.dependsOn createDebugIPA
......
final CHECKSUM_DIR = "/checksum/"
final LIBS_DIR = "${buildDir}/libs/"
final JAR_NAME = "checksum.jar"
final MAIN_CLASS = "cz.nic.tablexia.checksum.Checksum"
apply plugin: "java"
sourceSets.main.java.srcDirs = [ "src/" ]
jar() {
archiveName = JAR_NAME
manifest {
attributes 'Main-Class': MAIN_CLASS
}
}
task runJarChecksum(dependsOn: jar) {
task runChecksum(dependsOn: classes) {
doLast {
def sourceDir = new File(project(":core").projectDir.absolutePath + "/assets")
sourceDir.eachDir() { dir ->
......@@ -28,11 +19,11 @@ task runJarChecksum(dependsOn: jar) {
into destDir
}.execute()
task ("runJarChecksum_" + dir.getName(), type: JavaExec) {
classpath = files(LIBS_DIR + JAR_NAME)
classpath += sourceSets.main.runtimeClasspath
task ("runChecksum_" + dir.getName(), type: JavaExec) {
main = MAIN_CLASS
args = [destDir]
classpath sourceSets.main.output.classesDir
classpath += sourceSets.main.runtimeClasspath
def stdout = new ByteArrayOutputStream()
standardOutput = stdout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment