From 363387f3f752df174d7f2890ca6fba3ac4b227c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:13:52 -0500 Subject: [PATCH] actions: bump `lifecycle_version` to 2.8.0-alpha01 (fixes #1872) (#1841) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dogi Co-authored-by: Gideon Okuro --- .github/workflows/android-release.yml | 36 +++++++++---------- app/build.gradle | 15 ++++---- .../remote/ui/services/ServicesViewModel.kt | 15 +++++--- build.gradle | 4 +-- gradle.properties | 3 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 39 insertions(+), 36 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 8e4ebd181..bd87a6ce7 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -14,18 +14,16 @@ jobs: ANDROID_NDK_VERSION: "21.3.6528147" BUILD_TOOLS_VERSION: "34.0.0" steps: - - name: run number with offset - id: version + - name: set more env env: NUM: ${{ github.run_number }} - run: echo "::set-output name=id::$(($NUM+6050))" + run: | + echo "VERSION="$(($NUM+6050)) >> $GITHUB_ENV + echo "BRANCH="${GITHUB_REF##*/} >> $GITHUB_ENV - name: checkout repository code uses: actions/checkout@v4 - - name: set more env - run: echo "BRANCHNAME="${GITHUB_REF##*/} >> $GITHUB_ENV - - name: setup JDK 17 uses: actions/setup-java@v4 with: @@ -53,11 +51,11 @@ jobs: ls -alR app/build/outputs mkdir -p sign cp app/build/outputs/bundle/release/app-release.aab sign/. - cp app/build/outputs/apk/release/remote-${{ steps.version.outputs.id }}.apk sign/app-release-unsigned.apk + cp app/build/outputs/apk/release/remote-${{ env.VERSION }}.apk sign/app-release-unsigned.apk ls -al sign - name: sign release APK and AAB - uses: dogi/sign-android-release@v4.0.1 + uses: dogi/sign-android-release@v5 with: releaseDirectory: sign signingKeyBase64: ${{ secrets.SIGNING_KEY }} @@ -82,7 +80,7 @@ jobs: packageName: io.treehouses.remote releaseFiles: output/remote.aab track: internal - releaseName: "${{ steps.version.outputs.id }}" + releaseName: "${{ env.VERSION }}" status: completed # - name: mobile security framework @@ -107,11 +105,11 @@ jobs: - name: rename APK and AAB with version and branch for artifact if: github.ref != 'refs/heads/master' run: | - mv output/remote.apk output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.apk - mv output/remote.apk.sha256 output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.apk.sha256 - mv output/remote.aab output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.aab - mv output/remote.aab.sha256 output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.aab.sha256 - #mv output/remote-${{ steps.version.outputs.id }}.pdf output/remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }}.pdf + mv output/remote.apk output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.apk + mv output/remote.apk.sha256 output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.apk.sha256 + mv output/remote.aab output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.aab + mv output/remote.aab.sha256 output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.aab.sha256 + #mv output/remote-${{ env.VERSION }}.pdf output/remote-${{ env.VERSION }}-${{ env.BRANCH }}.pdf #cp app/build/outputs/mapping/release/mapping.txt output/mapping.txt ls -alR output @@ -119,17 +117,17 @@ jobs: if: github.ref != 'refs/heads/master' uses: actions/upload-artifact@v4 with: - name: remote-${{ steps.version.outputs.id }}-${{ env.BRANCHNAME }} + name: remote-${{ env.VERSION }}-${{ env.BRANCH }} path: output/* retention-days: 9 - name: release APK and AAB on GitHub if: github.ref == 'refs/heads/master' - uses: svenstaro/upload-release-action@v2 + uses: dogi/upload-release-action@v2.7.1 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: output/* - tag: v${{ steps.version.outputs.id }} + tag: v${{ env.VERSION }} overwrite: true file_glob: true @@ -138,5 +136,5 @@ jobs: run: | sudo npm install -g @treehouses/cli export discord_channel="${{ secrets.CHANNEL }}" - echo "https://github.com/treehouses/remote/releases/tag/v${{ steps.version.outputs.id }}" - treehouses feedback "new remote app: https://github.com/treehouses/remote/releases/tag/v${{ steps.version.outputs.id }}" + echo "https://github.com/treehouses/remote/releases/tag/v${{ env.VERSION }}" + treehouses feedback "new remote app: https://github.com/treehouses/remote/releases/tag/v${{ env.VERSION }}" diff --git a/app/build.gradle b/app/build.gradle index acfd3fa21..65f39296d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,14 +8,14 @@ android { compileSdkVersion 34 defaultConfig { applicationId "io.treehouses.remote" - minSdkVersion 15 + minSdkVersion 19 targetSdkVersion 34 ndkVersion '21.3.6528147' multiDexEnabled true versionCode appVersionCode versionName appVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - applicationVariants.all { variant -> + applicationVariants.configureEach { variant -> variant.outputs.all { output -> outputFileName = new File("remote-" + android.defaultConfig.versionCode + ".apk") } @@ -23,6 +23,7 @@ android { } buildFeatures { viewBinding = true + buildConfig true } buildTypes { release { @@ -55,7 +56,7 @@ android.defaultConfig.vectorDrawables.useSupportLibrary = true dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1', { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'androidx.appcompat:appcompat:1.2.0' @@ -82,22 +83,22 @@ dependencies { implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation "androidx.preference:preference:1.1.1" testImplementation 'junit:junit:4.13' - implementation 'com.github.parse-community:ParseLiveQuery-Android:1.1.0' + implementation 'com.github.parse-community:ParseLiveQuery-Android:1.2.2' implementation 'com.github.parse-community.Parse-SDK-Android:parse:1.26.0' implementation 'com.google.code.gson:gson:2.8.6' - androidTestImplementation 'androidx.test:runner:1.3.0' + androidTestImplementation 'androidx.test:runner:1.5.2' implementation 'me.aflak.libraries:bluetooth:1.3.4' implementation 'com.caverock:androidsvg-aar:1.4' implementation "androidx.core:core-ktx:1.3.1" implementation 'com.android.support:multidex:1.0.3' - implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5' + implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.3.3' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha07' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'org.connectbot:sshlib:2.2.9' - def lifecycle_version = "2.3.0-alpha07" + def lifecycle_version = "2.8.0-alpha01" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" diff --git a/app/src/main/kotlin/io/treehouses/remote/ui/services/ServicesViewModel.kt b/app/src/main/kotlin/io/treehouses/remote/ui/services/ServicesViewModel.kt index 27127d724..6baf2921c 100644 --- a/app/src/main/kotlin/io/treehouses/remote/ui/services/ServicesViewModel.kt +++ b/app/src/main/kotlin/io/treehouses/remote/ui/services/ServicesViewModel.kt @@ -1,11 +1,10 @@ package io.treehouses.remote.ui.services import android.app.Application -import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.Transformations +import androidx.lifecycle.map import androidx.preference.PreferenceManager import com.google.gson.Gson import com.google.gson.JsonParseException @@ -16,8 +15,14 @@ import io.treehouses.remote.pojo.ServicesData import io.treehouses.remote.pojo.enum.Resource import io.treehouses.remote.pojo.enum.Status.LOADING import io.treehouses.remote.pojo.enum.Status.SUCCESS -import io.treehouses.remote.utils.* +import io.treehouses.remote.utils.RESULTS import io.treehouses.remote.utils.Utils.convertToObject +import io.treehouses.remote.utils.constructServiceListFromData +import io.treehouses.remote.utils.containsServiceAction +import io.treehouses.remote.utils.formatServices +import io.treehouses.remote.utils.isURL +import io.treehouses.remote.utils.logE +import io.treehouses.remote.utils.match class ServicesViewModel(application: Application) : FragmentViewModel(application) { @@ -55,7 +60,7 @@ class ServicesViewModel(application: Application) : FragmentViewModel(applicatio /** * Format for fast retrieval of a services info; Publicly observable */ - val servicesData : LiveData>> = Transformations.map(rawServicesData) { + val servicesData : LiveData>> = rawServicesData.map { return@map when (it.status) { SUCCESS -> { val services = constructServiceListFromData(it.data) @@ -112,7 +117,7 @@ class ServicesViewModel(application: Application) : FragmentViewModel(applicatio val rawData = data?.convertToObject(ServicesData::class.java) if (rawData?.available != null) { logE("SUCCESSFUL R CACHE GOT:$rawData") - cacheServiceData.value = rawData!! + cacheServiceData.value = rawData } } diff --git a/build.gradle b/build.gradle index 79526f9c0..6b706c16c 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' + classpath 'com.android.tools.build:gradle:8.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong @@ -29,6 +29,6 @@ allprojects { } } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/gradle.properties b/gradle.properties index acf6f52b3..00c138f2f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,6 +22,5 @@ org.gradle.parallel=true android.useAndroidX=true android.enableJetifier=true -android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false -android.nonFinalResIds=false \ No newline at end of file +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da1db5f04..15de90249 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists