include git revision in assets/ dir (.gitignore it)

Makes it easier to see what's been built into an apk if the file's name
has changed.
This commit is contained in:
Eric House 2017-05-24 07:09:11 -07:00
parent 340a559eb7
commit d58c601bf3
2 changed files with 10 additions and 22 deletions

View file

@ -5,4 +5,4 @@ XWords4-gcm/
**.iml **.iml
local.properties local.properties
.idea .idea
app/src/main/assets/build-info.txt

View file

@ -232,25 +232,13 @@ task cleanNDK(type: Exec) {
commandLine lst commandLine lst
} }
// def getVersionName() { task makeBuildAssets() {
// try { def assetsDir = android.sourceSets.main.assets.srcDirs.toArray()[0]
// def stdout = new ByteArrayOutputStream() String path = new File(assetsDir, 'build-info.txt').getAbsolutePath()
// exec { File file = new File(path);
// commandLine 'git', 'describe', '--dirty' file.write("git: ${GITREV}\n");
// standardOutput = stdout }
// }
// return stdout.toString().trim()
// }
// catch (ignored) {
// return null;
// }
// }
// def renameArtifact(variant) { gradle.projectsEvaluated {
// variant.outputs.each { output -> build.dependsOn(makeBuildAssets)
// def name = String.format( "XWords4-%s-%s.apk", variant.name, }
// getVersionName() )
// output.outputFile = new File( (String)output.outputFile.parent,
// (String)name )
// }
// }