Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ext {
// Plugins
gradleVersion = '8.10.0'
kotlinVersion = '1.8.0'
spotBugsGradlePluginVersion = '4.7.1'
spotBugsGradlePluginVersion = '6.5.8'
jupiterApiVersion = '5.6.0'

//Java Language Support
Expand Down
22 changes: 20 additions & 2 deletions plugins/buildsystem/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group 'com.microsoft.identity'
version '0.2.5'
version '0.2.6'

tasks.withType(JavaCompile) {
sourceCompatibility = '11'
Expand Down Expand Up @@ -51,11 +51,29 @@ 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 "NewAndroid"
url "https://pkgs.dev.azure.com/IdentityDivision/_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'
implementation "com.android.tools.build:gradle:${rootProject.ext.gradleVersion}"
implementation "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:${rootProject.ext.spotBugsGradlePluginVersion}"
implementation "com.github.spotbugs.snom:spotbugs-gradle-plugin:${rootProject.ext.spotBugsGradlePluginVersion}"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${rootProject.ext.kotlinVersion}"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${rootProject.ext.kotlinVersion}"
Expand Down
5 changes: 5 additions & 0 deletions plugins/buildsystem/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
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
[MINOR] Bump SpotBugs Gradle plugin 4.7.1 -> 6.5.8 (4.x used the removed JavaPluginConvention); groupId changed to com.github.spotbugs.snom

Version 0.2.3
----------------------------
[PATCH] Allow ability to enable/disable code coverage - disabled by default
Expand Down
45 changes: 44 additions & 1 deletion plugins/buildsystem/docs/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,47 @@ pluginManagement {

## Plugins/Settings applied by BuildPlugin

- [SpotBugs](Spotbugs.md)
- [SpotBugs](Spotbugs.md)

## Publishing (manual)

> This plugin is **published manually** — it is intentionally **not** wired into any CI/CD
> pipeline (daily, weekly, or release). Publish a new version by hand using the steps below.

The `build.gradle` already declares the `NewAndroid` Azure Artifacts feed as a `publishing`
target, so no build changes are needed to publish.

**Steps:**

1. **Bump the version** in [`build.gradle`](../build.gradle) (the `version '...'` line) and add a
matching entry to the [`changelog`](../changelog). Feed versions are **immutable** — you cannot
overwrite an already-published version.

2. **Generate a PAT** with **Packaging → Read & write** scope at
<https://dev.azure.com/IdentityDivision/_usersSettings/tokens>.

3. **Provide credentials.** The username is arbitrary for Azure Artifacts (use `VSTS`); the PAT is
what authenticates. Either set env vars:

```powershell
$env:ENV_VSTS_MVN_CRED_USERNAME = "VSTS"
$env:ENV_VSTS_MVN_CRED_ACCESSTOKEN = "<your-PAT>"
```

…or add `vstsUsername` / `vstsMavenAccessToken` to `~/.gradle/gradle.properties`
(never commit the PAT).

4. **Publish from the android-complete root** (the plugin only builds in the root context — the root
`settings.gradle` `pluginManagement` supplies the Kotlin plugin version):

```powershell
.\gradlew.bat :AcaPlugin:publish
```

This uploads both artifacts to the feed:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the final steps? There is a separate external publish location for this artifact right?

- `com.microsoft.identity:AcaPlugin:<version>` — the plugin jar
- `com.microsoft.identity.buildsystem:com.microsoft.identity.buildsystem.gradle.plugin:<version>` — the plugin marker consumers resolve

5. **Verify** the new version at
<https://dev.azure.com/identitydivision/Engineering/_artifacts/feed/NewAndroid>, then bump
consumers' `id 'com.microsoft.identity.buildsystem' version '<version>'` declarations.
2 changes: 1 addition & 1 deletion plugins/buildsystem/gradle/versions.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Variables for plugins project
ext {
kotlinVersion = '1.8.0'
spotBugsGradlePluginVersion = '4.7.1'
spotBugsGradlePluginVersion = '6.5.8'
jupiterApiVersion = '5.6.0'
gradleVersion = '8.10.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {

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) {

Expand Down Expand Up @@ -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);
});
}
}
Loading