Merge pull request #3490 from ByteHamster/fix-about-screen-update

Fix about screen update
This commit is contained in:
H. Lehmann 2019-10-04 10:54:40 +02:00 committed by GitHub
commit e19b6e81e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 14 deletions

View File

@ -189,20 +189,14 @@ if (project.hasProperty("antennaPodServiceAccountEmail")) {
} }
} }
// about.html is templatized so that we can automatically insert task filterAbout(type: Copy) {
// our version string in to it at build time. from "src/main/templates/about.html"
task filterAbout { into "src/main/assets"
inputs.files files(["src/main/templates/about.html", filter(ReplaceTokens, tokens: [
"src/main/AndroidManifest.xml"]) versionname: android.defaultConfig.versionName,
outputs.file "src/main/assets/about.html" commit : "git rev-parse --short HEAD".execute().text,
} doLast { year : new Date().format('yyyy')])
copy { outputs.upToDateWhen { false }
from "src/main/templates/about.html"
into "src/main/assets"
filter(ReplaceTokens, tokens: [versionname: android.defaultConfig.versionName,
commit : "git rev-parse --short HEAD".execute().text,
year : new Date().format('yyyy')])
}
} }
task copyTextFiles(type: Copy) { task copyTextFiles(type: Copy) {
@ -212,6 +206,7 @@ task copyTextFiles(type: Copy) {
rename { String fileName -> rename { String fileName ->
fileName + ".txt" fileName + ".txt"
} }
outputs.upToDateWhen { false }
} }
preBuild.dependsOn filterAbout, copyTextFiles preBuild.dependsOn filterAbout, copyTextFiles