mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
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:
parent
340a559eb7
commit
d58c601bf3
2 changed files with 10 additions and 22 deletions
2
xwords4/android/.gitignore
vendored
2
xwords4/android/.gitignore
vendored
|
@ -5,4 +5,4 @@ XWords4-gcm/
|
|||
**.iml
|
||||
local.properties
|
||||
.idea
|
||||
|
||||
app/src/main/assets/build-info.txt
|
||||
|
|
|
@ -232,25 +232,13 @@ task cleanNDK(type: Exec) {
|
|||
commandLine lst
|
||||
}
|
||||
|
||||
// def getVersionName() {
|
||||
// try {
|
||||
// def stdout = new ByteArrayOutputStream()
|
||||
// exec {
|
||||
// commandLine 'git', 'describe', '--dirty'
|
||||
// standardOutput = stdout
|
||||
// }
|
||||
// return stdout.toString().trim()
|
||||
// }
|
||||
// catch (ignored) {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
task makeBuildAssets() {
|
||||
def assetsDir = android.sourceSets.main.assets.srcDirs.toArray()[0]
|
||||
String path = new File(assetsDir, 'build-info.txt').getAbsolutePath()
|
||||
File file = new File(path);
|
||||
file.write("git: ${GITREV}\n");
|
||||
}
|
||||
|
||||
// def renameArtifact(variant) {
|
||||
// variant.outputs.each { output ->
|
||||
// def name = String.format( "XWords4-%s-%s.apk", variant.name,
|
||||
// getVersionName() )
|
||||
// output.outputFile = new File( (String)output.outputFile.parent,
|
||||
// (String)name )
|
||||
// }
|
||||
// }
|
||||
gradle.projectsEvaluated {
|
||||
build.dependsOn(makeBuildAssets)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue