mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-28 08:26:44 +00:00
build(android): avoid xmake task in local environment
This commit is contained in:
@@ -100,16 +100,18 @@ dependencies {
|
||||
}
|
||||
|
||||
// Custom tasks
|
||||
preBuild.doLast {
|
||||
// save the combined build info into assets/build.info file
|
||||
def repo = org.ajoberstar.grgit.Grgit.open(dir: System.env.XMAKE_PROJECTDIR)
|
||||
def result_line = "${repo.branch.current().getName()}-${repo.head().abbreviatedId} (${new Date().toString()})\n"
|
||||
def assetsDir = android.sourceSets.main.assets.srcDirs.toArray()[1]
|
||||
delete(assetsDir)
|
||||
mkdir(assetsDir)
|
||||
def buildInfoFile = new File(assetsDir, 'build_gradle.info').getAbsolutePath()
|
||||
new File(buildInfoFile).write(result_line)
|
||||
repo.close()
|
||||
if (project.hasProperty("xmake")) {
|
||||
preBuild.doLast {
|
||||
// save the combined build info into assets/build.info file
|
||||
def repo = org.ajoberstar.grgit.Grgit.open(dir: System.env.XMAKE_PROJECTDIR)
|
||||
def result_line = "${repo.branch.current().getName()}-${repo.head().abbreviatedId} (${new Date().toString()})\n"
|
||||
def assetsDir = android.sourceSets.main.assets.srcDirs.toArray()[1]
|
||||
delete(assetsDir)
|
||||
mkdir(assetsDir)
|
||||
def buildInfoFile = new File(assetsDir, 'build_gradle.info').getAbsolutePath()
|
||||
new File(buildInfoFile).write(result_line)
|
||||
repo.close()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user