From 96d2a96ce5a614a954300f7243703368520c0af2 Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Tue, 30 Jul 2024 21:18:51 -0400 Subject: [PATCH] Simplify access to various extensions In Kotlin script files (`*.kts`), we can use extension methods that various plugins add. IntelliJ IDEA understands these too, so we still get static-type-aware autocompletion and other nice IDE features. --- .../kotlin/com/ibm/wala/gradle/publishing.gradle.kts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build-logic/src/main/kotlin/com/ibm/wala/gradle/publishing.gradle.kts b/build-logic/src/main/kotlin/com/ibm/wala/gradle/publishing.gradle.kts index b7181b83c..ae5703ac5 100644 --- a/build-logic/src/main/kotlin/com/ibm/wala/gradle/publishing.gradle.kts +++ b/build-logic/src/main/kotlin/com/ibm/wala/gradle/publishing.gradle.kts @@ -1,6 +1,5 @@ package com.ibm.wala.gradle -import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.SonatypeHost plugins { @@ -22,7 +21,7 @@ val testFixturesJavadocJar by from(testFixturesJavadoc.map { it.destinationDir!! }) } -configure { +mavenPublishing { configureBasedOnAppliedPlugins() publishToMavenCentral(SonatypeHost.DEFAULT) signAllPublications() @@ -92,7 +91,7 @@ configure { } } -configure { +publishing { repositories.maven { name = "fakeRemote" setUrl(rootProject.layout.buildDirectory.dir("maven-fake-remote-repository")) @@ -100,7 +99,7 @@ configure { publications.named("maven") { groupId = "com.ibm.wala" - artifactId = the().archivesName.get() + artifactId = base.archivesName.get() val testFixturesCodeElementsNames = listOf("testFixturesApiElements", "testFixturesRuntimeElements") @@ -122,7 +121,7 @@ configure { } } -configure { +signing { setRequired { // Signatures are a hard requirement if publishing a non-snapshot to Maven Central. !isSnapshot &&