Skip to content

Commit

Permalink
Build: fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Jun 5, 2024
1 parent 4d644fb commit 991da7b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
build:
name: "Gradle build"
runs-on: ubuntu-latest
env:
GRADLE_MICROG_VERSION_WITHOUT_GIT: 1

steps:
- name: "Checkout sources"
Expand Down Expand Up @@ -41,7 +43,9 @@ jobs:
echo "Matcher configured: ${NAME:?}"
fi
done
- name: "Inspect Gradle tasks"
run: "./gradlew tasks"
- name: "Execute Gradle assemble"
run: "./gradlew --no-daemon assemble"
run: "./gradlew assemble"
- name: "Execute Gradle check"
run: "./gradlew --no-daemon check"
run: "./gradlew check"
31 changes: 17 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,30 @@ def execResult(... args) {
providers.exec { commandLine args }.standardOutput.asText.get()
}

def ignoreGit = providers.environmentVariable('GRADLE_MICROG_VERSION_WITHOUT_GIT').getOrElse('0') == '1'
def gmsVersion = "24.09.13"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def vendingVersion = "40.2.26"
def vendingVersionCode = Integer.parseInt(vendingVersion.replaceAll('\\.', ''))
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').trim().substring(1)
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD").trim())
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').trim().split(' ')[0]
def gitVersionBase = !ignoreGit ? execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').trim().substring(1) : "v0.0.0.$gmsVersionCode"
def gitCommitCount = !ignoreGit ? Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD").trim()) : 0
def gitCommitId = !ignoreGit ? execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').trim().split(' ')[0] : '0000000'
def gitDirty = false
execResult('git', 'status', '--porcelain').lines().each { stat ->
def status = stat.substring(0,2)
def file = stat.substring(3)
if (status == '??') {
if (subprojects.any { p -> file.startsWith(p.name + '/') }) {
logger.lifecycle('Dirty file: {} (untracked)', file)
gitDirty = true
if (!ignoreGit) {
execResult('git', 'status', '--porcelain').lines().each { stat ->
def status = stat.substring(0,2)
def file = stat.substring(3)
if (status == '??') {
if (subprojects.any { p -> file.startsWith(p.name + '/') }) {
logger.lifecycle('Dirty file: {} (untracked)', file)
gitDirty = true
} else {
logger.info('New file outside module: {} (ignored for dirty check)', file)
}
} else {
logger.info('New file outside module: {} (ignored for dirty check)', file)
logger.lifecycle('Dirty file: {} (changed)', file)
gitDirty = true
}
} else {
logger.lifecycle('Dirty file: {} (changed)', file)
gitDirty = true
}
}
def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.'))
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.useAndroidX=true
org.gradle.configuration-cache=true
org.gradle.jvmargs=-Xmx2048m -XX:+UseParallelGC --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED

0 comments on commit 991da7b

Please sign in to comment.