Skip to content

Commit

Permalink
ANDROID-14153 Update AGP, target SDK, Kotlin and Compose (#326)
Browse files Browse the repository at this point in the history
* ANDROID-14153 Update AGP to 8.1.2 and target sdk to 34

* ANDROID-14153 set up java 17 in GH Actions

* ANDROID-14153 fix typo in PR template

* ANDROID-14153 remove package attribute from manifest

* ANDROID-14153 revert kotlin bump version by mistake

* ANDROID-14153 move DummyActivity to debug variant

* ANDROID-14153 use ubuntu latest in test workflow

* ANDROID-14153 fix lint

* ANDROID-14153 Move DummyActivity to specific test module

* ANDROID-14153 Update kotlin and compose version

* ANDROID-14153 revert TextInput binding removal

* ANDROID-14153 revert extra lines

* check default java version during tests execution

* ANDROID-14153 remove java 17 setup on github workflows

* Revert "ANDROID-14153 remove java 17 setup on github workflows"

This reverts commit 8cbbb1a.

* Revert "check default java version during tests execution"

This reverts commit c0f3765.
  • Loading branch information
yamal-alm authored Jan 12, 2024
1 parent afb1e1a commit c112355
Show file tree
Hide file tree
Showing 27 changed files with 182 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _Provide a description of the implementation. A list of steps would be ideal._
### ☑️ Checks
- [ ] I updated the documentation, including readmes and wikis. If this is a breaking change, update [UPGRADING.md](../UPGRADING.md) to inform users how to proceed. If no updates are necessary, indicate so.
- [ ] Tested with dark mode.
- [ ] Tested with API 23.
- [ ] Tested with API 21.

### :test_tube: How can I test this?
_If it cannot be tested explain why._
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ jobs:
catalog:
runs-on: ubuntu-latest
steps:
- name: Check pull request status
if: "!github.event.pull_request.merged == true"
run: 'echo "Skipping generation, pull request is not merged"'
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Checkout repo
if: github.event.pull_request.merged == true
uses: actions/checkout@v2
- name: Check pull request status
if: "!github.event.pull_request.merged == true"
run: 'echo "Skipping generation, pull request is not merged"'

- name: Publish catalog
if: github.event.pull_request.merged == true
env:
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
run: 'bash ./gradlew clean check appCenterAssembleAndUploadDebug -Dappcenter_app_name=Mistica'
- name: Checkout repo
if: github.event.pull_request.merged == true
uses: actions/checkout@v2

- name: Publish catalog
if: github.event.pull_request.merged == true
env:
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
run: 'bash ./gradlew clean check appCenterAssembleAndUploadDebug -Dappcenter_app_name=Mistica'
6 changes: 6 additions & 0 deletions .github/workflows/compare_screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Checkout repo
uses: actions/checkout@v3

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/debug_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ jobs:
debug-catalog:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Checkout repo
uses: actions/checkout@v3

- name: Publish catalog
env:
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
run: 'bash ./gradlew clean check appCenterAssembleAndUploadDebug -Dappcenter_app_name=Mistica-Catalog -Dappcenter_notify=false
run: 'bash ./gradlew clean appCenterAssembleAndUploadDebug -Dappcenter_app_name=Mistica-Catalog -Dappcenter_notify=false
-Dappcenter_notes="Testing catalog for PR #${{ github.event.number }} ${{ github.sha }}"'

- name: Get version ID
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/import-design-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
import-design-tokens:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- uses: actions/checkout@v3

- name: Checkout mistica-design repo with the tokens
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ jobs:
promote:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Checkout repo
uses: actions/checkout@v2

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Checkout repo
uses: actions/checkout@v2

Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ concurrency:

jobs:
tests:
runs-on: self-hosted-novum
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: "Build Android project"
uses: docker://docker.tuenti.io/android/novum_android_api31:2
with:
args: 'bash ./gradlew clean check assemble'
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Upload Lint results
uses: github/codeql-action/upload-sarif@v2
if: success() || failure()
with:
sarif_file: app/build/reports/lint-results-debug.sarif
category: lint
- name: Checkout repo
uses: actions/checkout@v2

- name: "Build Android project"
run: 'bash ./gradlew clean check assemble'

- name: Upload Lint results
uses: github/codeql-action/upload-sarif@v2
if: success() || failure()
with:
sarif_file: app/build/reports/lint-results-debug.sarif
category: lint
6 changes: 6 additions & 0 deletions .github/workflows/update_screenshot_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ jobs:
screenshots_baseline:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

- name: Checkout repo
uses: actions/checkout@v2

Expand Down
19 changes: 16 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ def appCenterProjects = new Properties()
file("appcenter_projects.properties").withInputStream { appCenterProjects.load(it) }

android {
compileSdkVersion 33
compileSdk target_sdk_version
namespace "com.telefonica.mistica.app"

defaultConfig {
applicationId "com.telefonica.mistica.app"
minSdkVersion 21
targetSdkVersion 33
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode versionCodeDate()
versionName "1.0.0"

Expand Down Expand Up @@ -51,6 +52,18 @@ android {
}
}

buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}
}

static def versionCodeDate() {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.telefonica.mistica.app">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
compose_ui_version = "1.3.3"
compose_core_version = '1.3.1'
compose_compiler_version = '1.4.7'
kotlin_version = "1.8.21"
min_sdk_version = 21
target_sdk_version = 34
compose_ui_version = "1.5.4"
compose_compiler_version = '1.5.7'
kotlin_version = "1.9.21"
androidx_appcompat_version = "1.6.0"
androidx_activity_compose_version = "1.6.0"
accompanist_version = "0.30.1"
accompanist_version = "0.32.0"
coil_version = '2.2.2'
constraintComposeVersion = '1.0.1'
roborazzi_version = "1.7.0"
Expand All @@ -19,7 +20,7 @@ buildscript {
}
}
dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "com.android.tools.build:gradle:8.1.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "gradle.plugin.com.betomorrow.gradle:appcenter-plugin:2.0.3"
}
Expand Down
22 changes: 16 additions & 6 deletions catalog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ plugins {
}

android {
compileSdkVersion 33
compileSdk target_sdk_version
namespace = "com.telefonica.mistica.catalog"

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version

buildConfigField "String", "APPCENTER_KEY", "\"" + System.env.APPCENTER_KEY + "\""
vectorDrawables {
useSupportLibrary true
}
}


lintOptions {
warningsAsErrors true
}
Expand All @@ -27,15 +27,25 @@ android {
}
buildFeatures {
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion compose_compiler_version
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}
}

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
archiveClassifier = "sources"
}

dependencies {
Expand All @@ -45,7 +55,7 @@ dependencies {
implementation "androidx.constraintlayout:constraintlayout-compose:$constraintComposeVersion"
implementation 'androidx.activity:activity-compose:1.4.0'
implementation "androidx.navigation:navigation-compose:2.5.3"
implementation "androidx.compose.material:material:$compose_core_version"
implementation "androidx.compose.material:material:$compose_ui_version"
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"

Expand Down
4 changes: 1 addition & 3 deletions catalog/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.telefonica.mistica.catalog"
>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity
Expand Down
6 changes: 1 addition & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ android.useAndroidX=true

kapt.incremental.apt=true

# This will be default on AGP 8.0
android.r8.failOnMissingClasses=true

###### Project settings ######
android.databinding.incremental=true
android.nonTransitiveRClass = false
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri May 19 13:07:06 CEST 2023
#Tue Jan 09 09:55:03 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
43 changes: 43 additions & 0 deletions library-test-utils/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.telefonica.mistica'
compileSdk target_sdk_version

defaultConfig {
minSdk min_sdk_version
targetSdk target_sdk_version

vectorDrawables {
useSupportLibrary true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

buildFeatures {
compose true
}

composeOptions {
kotlinCompilerExtensionVersion compose_compiler_version
}
}

dependencies {
implementation project(':library')

implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.telefonica.mistica"
>

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.VIBRATE" />

<application>
<activity
android:name=".DummyActivity"
Expand Down
Loading

0 comments on commit c112355

Please sign in to comment.