Skip to content

Commit

Permalink
Upgrade AGP to 8.5.2 and Bump Compile Version to API 35 (#278)
Browse files Browse the repository at this point in the history
* Update compile sdk to version 35.

* Update build version.

* Remove Jacoco for now.

* Update CHANGELOG.

* Bump GitHub Actions Java Version to 17 to match Android Studio Default JDK Version.

* Remove test_coverage workflow for now until we migrate to Kover.

* Fix Android lint errors.

* Update build versions.

* Ignore Android Gradle Plugin Versions for now.

* Remove explicit toolchain target.

* Make Demo app use same source and target compatability versions as all modules.

* Revert Java 17 Demo app settings.
  • Loading branch information
sshropshire authored Oct 28, 2024
1 parent dcc46f9 commit a0c65d0
Show file tree
Hide file tree
Showing 33 changed files with 103 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
#After decoding the secret key, place the file in ~ /. Gradle/ secring.gpg
- name: Decode Signing Key
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
#After decoding the secret key, place the file in ~ /. Gradle/ secring.gpg
- name: Decode Signing Key
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -130,7 +130,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Decode Signing Key
uses: ./.github/actions/decode_signing_key_action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Decode Demo Keystore
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
#After decoding the secret key, place the file in ~ /. Gradle/ secring.gpg
- name: Decode Signing Key
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -92,7 +92,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -107,7 +107,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
Expand All @@ -133,7 +133,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Decode Signing Key
uses: ./.github/actions/decode_signing_key_action
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Detekt
run: ./gradlew detekt
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Lint
run: ./gradlew lint
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'

# Assemble artifacts from main branch
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'

# Run Diffuse analysis
- name: Run Diffuse Analysis - CardPayments
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/test_coverage.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'microsoft'
- name: Run Unit Tests
run: ./gradlew --stacktrace testDebug
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# PayPal Android SDK Release Notes

## 1.6.0 (2024-10-24)
## unreleased
* Gradle
* Update Android Gradle Plugin (AGP) to version `8.5.2`
* Remove jacoco code coverage integration that was causing build failures after upgrading to latest AGP version
* Remove hardcoded compileSdk version from each module's `build.gradle` file
* Update Demo app to use Java 17 to fix kapt build errors
* GitHub Actions
* Bump Java Version to 17 for all build actions

## 1.6.0 (2024-10-24)
* All Modules
* Upgrade compileSdkVersion and targetSdkVersion to API 35
* CardPayments
Expand Down
10 changes: 5 additions & 5 deletions CardPayments/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins {
alias libs.plugins.android.library
alias libs.plugins.kotlinAndroid
alias libs.plugins.jacocoAndroid
alias libs.plugins.kotlinParcelize
}

android {
compileSdkVersion 31
namespace 'com.paypal.android.cardpayments'

defaultConfig {
compileSdk modules.androidCompileSdk
minSdkVersion modules.androidMinSdkVersion
targetSdkVersion modules.androidTargetVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -23,11 +23,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility modules.sourceCompatibility
targetCompatibility modules.targetCompatibility
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = modules.kotlinJvmTarget
}

lintOptions {
Expand Down
3 changes: 1 addition & 2 deletions CardPayments/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paypal.android.cardpayments">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
11 changes: 5 additions & 6 deletions CorePayments/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins {
alias libs.plugins.android.library
alias libs.plugins.kotlinAndroid
alias libs.plugins.jacocoAndroid
alias libs.plugins.kotlinParcelize
}

android {
compileSdkVersion 31
namespace 'com.paypal.android.corepayments'

defaultConfig {
compileSdk modules.androidCompileSdk
minSdkVersion modules.androidMinSdkVersion
targetSdkVersion modules.androidTargetVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -24,11 +24,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility modules.sourceCompatibility
targetCompatibility modules.targetCompatibility
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = modules.kotlinJvmTarget
}
lintOptions {
lintConfig file('../lint.xml')
Expand All @@ -53,7 +53,6 @@ android {
}
}
}

}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions CorePayments/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paypal.android.corepayments">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PaymentsJSON(val json: JSONObject) {
var node: JSONObject? = json
while (keys.size > 1) {
node = node?.optJSONObject(keys[0])
keys.removeFirst()
keys.removeAt(0)
}

return node?.optString(keys[0])
Expand All @@ -39,7 +39,7 @@ class PaymentsJSON(val json: JSONObject) {
var node: JSONObject? = json
while (keys.size > 0) {
node = node?.optJSONObject(keys[0])
keys.removeFirst()
keys.removeAt(0)
}
return node?.let { PaymentsJSON(it) }
}
Expand All @@ -50,7 +50,7 @@ class PaymentsJSON(val json: JSONObject) {
val keys = keyPath.split(".").toMutableList()
while (keys.size > 1) {
node = node.getJSONObject(keys[0])
keys.removeFirst()
keys.removeAt(0)
}
return NodeResult(node, keys)
}
Expand All @@ -69,7 +69,7 @@ class PaymentsJSON(val json: JSONObject) {
var node: JSONObject? = json
while (keys.size > 1) {
node = node?.optJSONObject(keys[0])
keys.removeFirst()
keys.removeAt(0)
}

return node?.optJSONArray(keys[0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal class DeviceInspector @VisibleForTesting constructor(
deviceManufacturer = deviceManufacturer,
deviceModel = deviceModel,
isSimulator = isSimulator,
merchantAppVersion = merchantAppVersion,
merchantAppVersion = merchantAppVersion ?: "",
)
}
}
Loading

0 comments on commit a0c65d0

Please sign in to comment.