Skip to content

Commit

Permalink
Android: small build tasks improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykMis committed Apr 23, 2023
1 parent 973b48f commit bd10c9e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tasks.register("checkData") {
}
}

tasks.register<Zip>("createDataArchive") {
val dataArchive = tasks.register<Zip>("createDataArchive") {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
archiveFileName.set("espeakdata.zip")
Expand All @@ -74,16 +74,14 @@ tasks.register<Zip>("createDataArchive") {
}
}

tasks.register<Checksum>("createDataHash") {
dependsOn("createDataArchive")
val dataHash = tasks.register<Checksum>("createDataHash") {
checksumAlgorithm.set(Checksum.Algorithm.SHA256)
inputFiles.setFrom(file("./src/main/res/raw/espeakdata.zip"))
inputFiles.setFrom(dataArchive)
outputDirectory.set(layout.buildDirectory.dir("intermediates/datahash"))
}

tasks.register<Copy>("createDataVersion") {
dependsOn("createDataHash")
from(layout.buildDirectory.file("intermediates/datahash/espeakdata.zip.sha256"))
from(dataHash)
rename("espeakdata.zip.sha256", "espeakdata_version")
into(file("./src/main/res/raw"))
}
Expand Down

0 comments on commit bd10c9e

Please sign in to comment.