diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 83abf25..dc532bf 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -1,55 +1,48 @@ name: Android CI +env: + # The name of the main module repository + main_project_module: app + + # The name of the Play Store + playstore_name: Frogobox ID + on: - # workflow_dispatch - for clicking # Triggers the workflow on push or pull request events but only for default and protected branches push: branches: [ master ] pull_request: branches: [ master ] + workflow_dispatch: + # The workflow will be dispatched to the default queue + jobs: build: + runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - - name: Set Up JDK 11 - uses: actions/setup-java@v1 + # Set Current Date As Env Variable + - name: Set current date as env variable + run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + # Set Repository Name As Env Variable + - name: Set repository name as env variable + run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV + + - name: Set Up JDK + uses: actions/setup-java@v3 with: - java-version: 11 + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '17' + cache: 'gradle' - name: Change wrapper permissions run: chmod +x ./gradlew - - name: Run tests - run: ./gradlew test - # Run Build Project - - name: Build project - run: ./gradlew build - - # Create APK Debug - - name: Build apk debug project (APK) - run: ./gradlew assembleDebug - - # Create APK Release - - name: Build apk release project (APK) - run: ./gradlew assemble - - # Create Bundle AAB Release - # Noted for main module build [module-name]:bundleRelease - - name: Build app bundle release (AAB) - run: ./gradlew app:bundleRelease - - # Upload Artifact Build - # Noted For Output [module-name]/build/outputs/ - - name: Upload build APK / AAB - uses: actions/upload-artifact@v2 - with: - name: App bundle(s) and APK(s) generated - path: app/build/outputs/ \ No newline at end of file + - name: Build gradle project + run: ./gradlew build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1abc10c..3486116 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") - id("kotlin-kapt") + id("com.google.devtools.ksp") } android { @@ -71,13 +71,13 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } - tasks.withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of("17")) } } diff --git a/build.gradle.kts b/build.gradle.kts index 1e6fa7b..090d665 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "7.4.2" apply false - id("com.android.library") version "7.4.2" apply false + id("com.android.application") version "8.0.2" apply false + id("com.android.library") version "8.0.2" apply false + id("com.google.devtools.ksp") version "1.8.21-1.0.11" apply false id("org.jetbrains.kotlin.android") version DependencyGradle.KOTLIN_VERSION apply false } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ad435fc..1431279 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -11,5 +11,5 @@ repositories { dependencies{ // library open-build-src - implementation("com.github.frogobox:open-build-src:2.1.1") + implementation("com.github.frogobox:open-build-src:2.1.8") } \ No newline at end of file diff --git a/frogolib/build.gradle.kts b/frogolib/build.gradle.kts index 26a5f66..7e47da6 100644 --- a/frogolib/build.gradle.kts +++ b/frogolib/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("com.android.library") id("org.jetbrains.kotlin.android") - id("kotlin-kapt") + id("com.google.devtools.ksp") `maven-publish` } @@ -38,13 +38,13 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } - tasks.withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of("17")) } } diff --git a/gradle.properties b/gradle.properties index b9dd0f9..c24680d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,8 +23,8 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -# Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior -android.disableAutomaticComponentCreation=true gpr.user=amirisback -gpr.key= \ No newline at end of file +gpr.key= +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fdf70fd..1eef549 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip \ No newline at end of file diff --git a/jitpack.yml b/jitpack.yml index adb3fe1..f29a667 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,2 +1,5 @@ jdk: - - openjdk11 + - openjdk17 +before_install: + - sdk install java 17.0.1-open + - sdk use java 17.0.1-open \ No newline at end of file