From 29d62fc436904c0383b2bf56b8d7c32c334db39f Mon Sep 17 00:00:00 2001 From: Ridam Arora Date: Thu, 9 Jul 2026 12:47:04 -0700 Subject: [PATCH 1/2] change gradle API used by buildsystem plugin --- plugins/buildsystem/build.gradle | 20 ++++++++++++++++++- plugins/buildsystem/changelog | 4 ++++ .../identity/buildsystem/BuildPlugin.java | 10 +++++----- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/plugins/buildsystem/build.gradle b/plugins/buildsystem/build.gradle index 8ed9d8ab..1827759c 100644 --- a/plugins/buildsystem/build.gradle +++ b/plugins/buildsystem/build.gradle @@ -10,7 +10,7 @@ plugins { } group 'com.microsoft.identity' -version '0.2.5' +version '0.2.6-dev' tasks.withType(JavaCompile) { sourceCompatibility = '11' @@ -51,6 +51,24 @@ repositories { } } +// Publish target for the internal NewAndroid Azure Artifacts feed. +// The java-gradle-plugin + maven-publish plugins auto-create the plugin's +// publications (the plugin jar/pom and the plugin-marker artifact); this block +// only tells Gradle WHERE to push them. Consuming repos resolve the plugin from +// this same feed via their settings.gradle pluginManagement block. +publishing { + repositories { + maven { + name "vsts-maven-new-android" + url "https://identitydivision.pkgs.visualstudio.com/_packaging/NewAndroid/maven/v1" + credentials { + username System.getenv("ENV_VSTS_MVN_CRED_USERNAME") != null ? System.getenv("ENV_VSTS_MVN_CRED_USERNAME") : project.findProperty("vstsUsername") + password System.getenv("ENV_VSTS_MVN_CRED_ACCESSTOKEN") != null ? System.getenv("ENV_VSTS_MVN_CRED_ACCESSTOKEN") : project.findProperty("vstsMavenAccessToken") + } + } + } +} + dependencies { testImplementation "org.junit.jupiter:junit-jupiter-api:${rootProject.ext.jupiterApiVersion}" testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' diff --git a/plugins/buildsystem/changelog b/plugins/buildsystem/changelog index d1406ed0..10044df5 100644 --- a/plugins/buildsystem/changelog +++ b/plugins/buildsystem/changelog @@ -1,5 +1,9 @@ Plugin Overview: https://github.com/AzureAD/android-complete/blob/master/plugins/buildsystem/docs/Overview.md +Version 0.2.6 +---------------------------- +[MINOR] Remove use of deleted gradle APIs + Version 0.2.3 ---------------------------- [PATCH] Allow ability to enable/disable code coverage - disabled by default diff --git a/plugins/buildsystem/src/main/java/com/microsoft/identity/buildsystem/BuildPlugin.java b/plugins/buildsystem/src/main/java/com/microsoft/identity/buildsystem/BuildPlugin.java index 32216c28..f1a0838f 100644 --- a/plugins/buildsystem/src/main/java/com/microsoft/identity/buildsystem/BuildPlugin.java +++ b/plugins/buildsystem/src/main/java/com/microsoft/identity/buildsystem/BuildPlugin.java @@ -27,15 +27,13 @@ import org.gradle.api.JavaVersion; import org.gradle.api.Plugin; import org.gradle.api.Project; +import org.gradle.api.plugins.JavaPluginExtension; public class BuildPlugin implements Plugin { private final static String ANDROID_LIBRARY_PLUGIN_ID = "com.android.library"; private final static String JAVA_LIBRARY_PLUGIN_ID = "java-library"; - private final static String JAVA_SOURCE_COMPATIBILITY_PROPERTY = "sourceCompatibility"; - private final static String JAVA_TARGET_COMPATIBILITY_PROPERTY = "targetCompatibility"; - @Override public void apply(final Project project) { @@ -70,8 +68,10 @@ private void applyDesugaringToAndroidProject(final Project project){ private void applyJava8ToJavaProject(final Project project) { project.getPluginManager().withPlugin(JAVA_LIBRARY_PLUGIN_ID, appliedPlugin -> { - project.setProperty(JAVA_SOURCE_COMPATIBILITY_PROPERTY, JavaVersion.VERSION_1_8); - project.setProperty(JAVA_TARGET_COMPATIBILITY_PROPERTY, JavaVersion.VERSION_1_8); + final JavaPluginExtension javaPluginExtension = project.getExtensions() + .getByType(JavaPluginExtension.class); + javaPluginExtension.setSourceCompatibility(JavaVersion.VERSION_1_8); + javaPluginExtension.setTargetCompatibility(JavaVersion.VERSION_1_8); }); } } From 304d5112aa2c5116b610bb7e6e3eba2e35b6e6fa Mon Sep 17 00:00:00 2001 From: Ridam Arora Date: Thu, 9 Jul 2026 13:45:34 -0700 Subject: [PATCH 2/2] remove unwated publishing changes --- plugins/buildsystem/build.gradle | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/plugins/buildsystem/build.gradle b/plugins/buildsystem/build.gradle index 1827759c..561231c0 100644 --- a/plugins/buildsystem/build.gradle +++ b/plugins/buildsystem/build.gradle @@ -51,24 +51,6 @@ repositories { } } -// Publish target for the internal NewAndroid Azure Artifacts feed. -// The java-gradle-plugin + maven-publish plugins auto-create the plugin's -// publications (the plugin jar/pom and the plugin-marker artifact); this block -// only tells Gradle WHERE to push them. Consuming repos resolve the plugin from -// this same feed via their settings.gradle pluginManagement block. -publishing { - repositories { - maven { - name "vsts-maven-new-android" - url "https://identitydivision.pkgs.visualstudio.com/_packaging/NewAndroid/maven/v1" - credentials { - username System.getenv("ENV_VSTS_MVN_CRED_USERNAME") != null ? System.getenv("ENV_VSTS_MVN_CRED_USERNAME") : project.findProperty("vstsUsername") - password System.getenv("ENV_VSTS_MVN_CRED_ACCESSTOKEN") != null ? System.getenv("ENV_VSTS_MVN_CRED_ACCESSTOKEN") : project.findProperty("vstsMavenAccessToken") - } - } - } -} - dependencies { testImplementation "org.junit.jupiter:junit-jupiter-api:${rootProject.ext.jupiterApiVersion}" testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'