Skip to content

Commit

Permalink
build: bump AGP & KAP version
Browse files Browse the repository at this point in the history
  • Loading branch information
aistra0528 committed Dec 2, 2024
1 parent 1546bf9 commit 414037b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 32 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ jobs:
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: 'temurin'
java-version: '21'
- name: Build with Gradle
run: ./gradlew assembleDebug
run: |
echo "commit=$(echo ${{ github.sha }} | cut -c-7)" >> $GITHUB_ENV
./gradlew assembleDebug
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: Debug
path: app/build/outputs/apk/debug
retention-days: 7
name: Hail@${{ env.commit }}
path: app/build/outputs/apk/debug/*.apk
46 changes: 25 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ plugins {
}

android {
val signingProps = file("../signing.properties")
val commitShort = providers.exec {
workingDir = rootDir
commandLine = "git rev-parse --short HEAD".split(" ")
}.standardOutput.asText.get().trim()

namespace = "com.aistra.hail"
buildToolsVersion = "35.0.0"
compileSdk = 35
Expand All @@ -16,28 +22,23 @@ android {
versionName = "1.9.0"
}

// Do not compress the dex files, so the apk can be imported as a privileged app
androidResources {
noCompress += "dex"
}

val signing = if (file("../signing.properties").exists()) {
signingConfigs.create("release") {
val props = `java.util`.Properties().apply { load(file("../signing.properties").reader()) }
storeFile = file(props.getProperty("storeFile"))
storePassword = props.getProperty("storePassword")
keyAlias = props.getProperty("keyAlias")
keyPassword = props.getProperty("keyPassword")
}
} else signingConfigs.getByName("debug")
buildTypes {
debug {
applicationIdSuffix = ".debug"
versionNameSuffix = ".$commitShort"
}
release {
isMinifyEnabled = true
isShrinkResources = true
signingConfig = signing
signingConfig = if (signingProps.exists()) {
val props = `java.util`.Properties().apply { load(signingProps.reader()) }
signingConfigs.create("release") {
storeFile = file(props.getProperty("storeFile"))
storePassword = props.getProperty("storePassword")
keyAlias = props.getProperty("keyAlias")
keyPassword = props.getProperty("keyPassword")
}
} else signingConfigs.getByName("debug")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
Expand All @@ -49,15 +50,18 @@ android {
"Hail-v$versionName.apk"
}
}
compileOptions {
sourceCompatibility(JavaVersion.VERSION_17)
targetCompatibility(JavaVersion.VERSION_17)
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
kotlinOptions {
jvmTarget = "17"
kotlin {
jvmToolchain(21)
}
androidResources {
generateLocaleConfig = true
// Do not compress the dex files, so the apk can be imported as a privileged app
noCompress += "dex"
}
buildFeatures {
viewBinding = true
Expand Down Expand Up @@ -89,6 +93,6 @@ dependencies {
implementation("io.github.iamr0s:Dhizuku-API:2.5.3")
implementation("me.zhanghai.android.appiconloader:appiconloader:1.5.0")
implementation("org.apache.commons:commons-text:1.12.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3")
}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.5.2" apply false
kotlin("android") version "2.0.0" apply false
id("com.android.application") version "8.7.0" apply false
kotlin("android") version "2.0.20" apply false
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Apr 16 14:14:36 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 414037b

Please sign in to comment.