-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for AGP 9.0.0 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c092442
31379fb
7f456be
c3c1f01
a8b6601
0c098d3
04a06f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| object Versions { // See https://mvnrepository.com | ||
| const val JUNIT_5 = "5.7.1" | ||
| const val JUNIT_5 = "5.13.4" | ||
| const val JUNIT_PLATFORM_LAUNCHER = "1.13.4" | ||
| } | ||
|
|
||
| object Dependencies { | ||
| const val JUNIT_5_ENGINE = "org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT_5}" | ||
| const val JUNIT_5_API = "org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT_5}" | ||
| const val JUNIT_5_PARAMS = "org.junit.jupiter:junit-jupiter-params:${Versions.JUNIT_5}" | ||
| const val JUNIT_PLATFORM_LAUNCHER = "org.junit.platform:junit-platform-launcher:${Versions.JUNIT_PLATFORM_LAUNCHER}" | ||
|
jeprubio marked this conversation as resolved.
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,18 +6,19 @@ plugins { | |
| } | ||
|
|
||
| group = "com.telefonica" | ||
| version = "1.0.2" // Also update the version in the README | ||
| version = "1.1.0" // Also update the version in the README | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new version of this plugin |
||
|
|
||
| val uber: Configuration by configurations.creating | ||
|
|
||
| dependencies { | ||
| compileOnly(gradleKotlinDsl()) | ||
| compileOnly("com.android.tools.build:gradle:7.0.0") | ||
| compileOnly("com.android.tools.build:gradle:9.0.0") | ||
|
|
||
| uber(project(":plugin-configurator-v1")) | ||
| uber(project(":plugin-core")) | ||
|
|
||
| testRuntimeOnly(Dependencies.JUNIT_5_ENGINE) | ||
| testRuntimeOnly(Dependencies.JUNIT_PLATFORM_LAUNCHER) | ||
| testImplementation(Dependencies.JUNIT_5_API) | ||
| testImplementation(Dependencies.JUNIT_5_PARAMS) | ||
| testImplementation(gradleKotlinDsl()) | ||
|
|
@@ -29,10 +30,12 @@ configurations { | |
|
|
||
| // Publish all modules as part of a single uber plugin JAR | ||
| tasks.withType<Jar>().configureEach { | ||
| dependsOn(":plugin-configurator-v1:jar", ":plugin-core:jar") | ||
| from(uber.asSequence().filter { it.startsWith(rootDir) }.map { zipTree(it) }.asIterable()) | ||
| } | ||
|
|
||
| tasks.withType<Test>().configureEach { | ||
| useJUnitPlatform() | ||
| dependsOn("publishToMavenLocal") | ||
| } | ||
|
|
||
|
|
@@ -45,9 +48,6 @@ gradlePlugin { | |
| implementationClass = "io.github.simonschiller.permissioncheck.PermissionCheckPlugin" | ||
| } | ||
| } | ||
| } | ||
| pluginBundle { | ||
| website = "https://github.com/Telefonica/android-permissioncheck" | ||
| vcsUrl = "https://github.com/Telefonica/android-permissioncheck" | ||
|
Comment on lines
51
to
52
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. website and vcsUrl have been moved from |
||
| tags = listOf("manifestcheck", "permissions") | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -298,7 +298,7 @@ class MultiVariantPermissionCheckIntegrationTest { | |
| assertEquals(TaskOutcome.UP_TO_DATE, buildResult.tasks.outcomeOf("checkPermissions")) | ||
|
|
||
| val manifestFile = androidProject.appDir.resolve("src").resolve("main").resolve("AndroidManifest.xml") | ||
| manifestFile.writeText(manifestFile.readText().replace("simonschiller", "johndoe")) // Trigger change | ||
| manifestFile.writeText(manifestFile.readText().replace("<manifest", "<!-- comment -->\n<manifest")) // Trigger change | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't update anymore the namespace which has been moved from the manifest to the gradle file so it seems safer to just add a comment in that file. |
||
|
|
||
| buildResult = androidProject.runTask( | ||
| "checkPermissions", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,15 +138,16 @@ class AndroidProjectExtension : BeforeEachCallback, AfterEachCallback { | |
| } | ||
|
|
||
| android { | ||
| namespace = "com.telefonica.manifestcheck.sample.app" | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The namespace has to be moved from the manifest files to the gradle files when upgrading. |
||
| compileSdkVersion(30) | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion(21) | ||
| targetSdkVersion(30) | ||
| } | ||
|
|
||
| lintOptions { | ||
| check("") | ||
| lint { | ||
| abortOnError = false | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -159,8 +160,7 @@ class AndroidProjectExtension : BeforeEachCallback, AfterEachCallback { | |
|
|
||
| val androidManifest = mainDir.resolve("AndroidManifest.xml") | ||
| androidManifest.writeText(""" | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="io.github.simonschiller.permissioncheck.sample.app"> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> | ||
| <uses-feature android:glEsVersion="0x00020000" android:required="true" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| package io.github.simonschiller.permissioncheck.testutil | ||
|
jeprubio marked this conversation as resolved.
|
||
|
|
||
| import org.gradle.util.VersionNumber | ||
| import org.junit.jupiter.api.extension.ExtensionContext | ||
| import org.junit.jupiter.params.provider.Arguments | ||
| import org.junit.jupiter.params.provider.ArgumentsProvider | ||
|
|
@@ -11,29 +10,21 @@ class TestVersions : ArgumentsProvider { | |
| override fun provideArguments(context: ExtensionContext): Stream<out Arguments> { | ||
| val arguments = AGP_VERSIONS.flatMap { agpVersion -> | ||
| GRADLE_VERSIONS | ||
| .filter { gradleVersion -> VersionNumber.parse(agpVersion).baseVersion isCompatibleWith VersionNumber.parse(gradleVersion).baseVersion } | ||
| .map { gradleVersion -> Arguments.of(gradleVersion, agpVersion) } | ||
| } | ||
| return arguments.stream() | ||
| } | ||
|
|
||
| // Checks if a AGP version (receiver) is compatible with a certain version of Gradle | ||
| private infix fun VersionNumber.isCompatibleWith(gradleVersion: VersionNumber) = when { | ||
| this >= VersionNumber.parse("7.0.0") -> gradleVersion >= VersionNumber.parse("7.0") | ||
| else -> false | ||
| } | ||
|
|
||
| companion object { | ||
|
|
||
| // See https://gradle.org/releases | ||
| private val GRADLE_VERSIONS = listOf( | ||
| "7.4.2", | ||
| "7.2", | ||
| "9.1.0", | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The gradle version we test |
||
| ) | ||
|
|
||
| // See https://developer.android.com/studio/releases/gradle-plugin | ||
| private val AGP_VERSIONS = listOf( | ||
| "7.0.0", | ||
| "9.0.0", | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The agp version we test |
||
| ) | ||
|
|
||
| val LATEST_GRADLE_VERSION = GRADLE_VERSIONS.first() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,16 +4,17 @@ plugins { | |
| } | ||
|
|
||
| android { | ||
| compileSdkVersion(33) | ||
| namespace = "com.telefonica.sampleapp" // Update to your actual package name | ||
| compileSdk = 36 | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion(23) | ||
| targetSdkVersion(33) | ||
| } | ||
| defaultConfig { | ||
| minSdk = 24 | ||
| targetSdk = 36 | ||
|
Comment on lines
+11
to
+12
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated the target and minSdk versions in this sample app project with more actual values |
||
| } | ||
|
|
||
| lintOptions { | ||
| checkOnly("") // Disable all Lint checks | ||
| } | ||
| lint { | ||
| abortOnError = false | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="io.github.simonschiller.permissioncheck.sample.app"> | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Package has to be removed and added as namespace in the gradle files |
||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> | ||
| <uses-feature android:glEsVersion="0x00020000" android:required="true" /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was failing as actions/cache@v2 is deprecated: https://github.com/Telefonica/android-permissioncheck/actions/runs/21857243109 so I've updated both actions.