Skip to content

Commit

Permalink
Merge pull request #192 from DeployGate/jmatsu/feat/support_agp_830
Browse files Browse the repository at this point in the history
Fix an inaccessible property in packaging task class since AGP 8.3.0
  • Loading branch information
jmatsu authored Mar 8, 2024
2 parents a07427d + ff3089c commit b619c3b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
- '8.0.0'
- '8.1.0'
- '8.2.0'
- '8.3.0'
include:
- agp_version: '4.2.0'
gradle_version: '6.7.1'
Expand All @@ -127,7 +128,10 @@ jobs:
gradle_version: '8.0'
java_version: '17'
- agp_version: '8.2.0'
gradle_version: '8.3'
gradle_version: '8.2'
java_version: '17'
- agp_version: '8.3.0'
gradle_version: '8.4'
java_version: '17'

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ local.properties
out/

src/main/resources/VERSION_NAME
lib/
3 changes: 2 additions & 1 deletion run_acceptance_tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ done < <(cat<<EOF
7.4.0 7.5
8.0.0 8.0
8.1.0 8.0
8.2.0 8.3
8.2.0 8.2
8.3.0 8.4
EOF
)
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ class PackageAppTaskCompat {

@PackageScope
static boolean hasSigningConfig(packageAppTask) {
return packageAppTask.signingConfigData.resolve() != null
if (AndroidGradlePlugin.isInternalSigningConfigData()) {
return packageAppTask.signingConfigVersions.any { it.exists() }
} else {
return packageAppTask.signingConfigData.resolve() != null
}
}

static File getOutputDirectory(packageAppTask) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class AndroidGradlePlugin {
return AGP_VERSION
}

/**
* @since AGP 8.3.0 https://cs.android.com/android-studio/platform/tools/base/+/ff361912406f0eafc42b6ff2a293ee8a17ff77ee:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/PackageAndroidArtifact.kt;dlc=c2e97e2ca61a5575ccfb48f9528a11c38d651841
*/
static boolean isInternalSigningConfigData() {
def version = getVersion()
return version.major >= 8 && version.minor >= 3
}

/**
* @since AGP 8.1.0 https://android.googlesource.com/platform/tools/base/+/da5cbdf59f91f7480a5d9615a20f766d19c6034a%5E%21/#F32
*/
Expand Down

0 comments on commit b619c3b

Please sign in to comment.