Skip to content

Commit b786f47

Browse files
authored
Fix/multiple publications (#3)
* update Gradle 8.1.1 * update JUnit, Kotest, BCV-MU * improve settings.gradle.kts used in tests, to filter repository content to only include the dev-publish plugin * tidy up settings.gradle.kts * big ol' refactor - split up DevPublishPlugin into smaller classes - fix problem where a change in a single publication would cause the other publications to be lost - create a build service to prevent concurrency issues - create base DevRepoTask for all dev-publish tasks - mark some properties as `@DevPublishInternalApi` * update KDoc for DevPublishPluginExtension properties * actually update Gradle to 8.1.1... * remove most of the shared-build-service config because it's not really necessary, and even if it was necessary it doesn't really work gradle/gradle#17559
1 parent 757e9f6 commit b786f47

21 files changed

+715
-320
lines changed

api/dev-publish-plugin.api

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ public final class dev/adamko/gradle/dev_publish/DevPublishPlugin : org/gradle/a
55
public static final field DEV_PUB__MAVEN_REPO_NAME Ljava/lang/String;
66
public static final field DEV_PUB__PUBLICATION_INCOMING_DEPENDENCIES Ljava/lang/String;
77
public static final field DEV_PUB__PUBLICATION_PROVIDED_DEPENDENCIES Ljava/lang/String;
8-
public static final field DEV_PUB__TASK_GROUP Ljava/lang/String;
9-
public static final field DEV_PUB__UPDATE_DEV_REPO_TASK_NAME Ljava/lang/String;
108
public fun <init> (Lorg/gradle/api/provider/ProviderFactory;Lorg/gradle/api/file/ProjectLayout;Lorg/gradle/api/file/FileSystemOperations;Lorg/gradle/api/model/ObjectFactory;)V
119
public synthetic fun apply (Ljava/lang/Object;)V
1210
public fun apply (Lorg/gradle/api/Project;)V
@@ -20,16 +18,9 @@ public final class dev/adamko/gradle/dev_publish/DevPublishPlugin$configureMaven
2018
public final synthetic fun execute (Ljava/lang/Object;)V
2119
}
2220

23-
public final class dev/adamko/gradle/dev_publish/DevPublishPlugin$inlined$sam$i$org_gradle_api_Action$0 : org/gradle/api/Action {
24-
public fun <init> (Lkotlin/jvm/functions/Function1;)V
25-
public final synthetic fun execute (Ljava/lang/Object;)V
26-
}
27-
2821
public abstract class dev/adamko/gradle/dev_publish/DevPublishPluginExtension {
2922
public fun <init> ()V
30-
public abstract fun getChecksumsStore ()Lorg/gradle/api/file/DirectoryProperty;
3123
public abstract fun getDevMavenRepo ()Lorg/gradle/api/file/DirectoryProperty;
32-
public abstract fun getStagingDevMavenRepo ()Lorg/gradle/api/file/DirectoryProperty;
3324
}
3425

3526
public abstract class dev/adamko/gradle/dev_publish/data/PublicationData : org/gradle/api/Named {
@@ -42,19 +33,33 @@ public abstract class dev/adamko/gradle/dev_publish/data/PublicationData : org/g
4233
public abstract interface annotation class dev/adamko/gradle/dev_publish/internal/DevPublishInternalApi : java/lang/annotation/Annotation {
4334
}
4435

45-
public abstract class dev/adamko/gradle/dev_publish/tasks/GeneratePublicationHashTask : org/gradle/api/DefaultTask {
36+
public abstract class dev/adamko/gradle/dev_publish/tasks/BaseDevPublishTask : org/gradle/api/DefaultTask {
37+
public static final field Companion Ldev/adamko/gradle/dev_publish/tasks/BaseDevPublishTask$Companion;
38+
public static final field TASK_GROUP Ljava/lang/String;
39+
public fun <init> ()V
40+
}
41+
42+
public final class dev/adamko/gradle/dev_publish/tasks/BaseDevPublishTask$Companion {
43+
}
44+
45+
public final class dev/adamko/gradle/dev_publish/tasks/DevPublishTasksContainer$inlined$sam$i$org_gradle_api_Action$0 : org/gradle/api/Action {
46+
public fun <init> (Lkotlin/jvm/functions/Function1;)V
47+
public final synthetic fun execute (Ljava/lang/Object;)V
48+
}
49+
50+
public abstract class dev/adamko/gradle/dev_publish/tasks/GeneratePublicationDataChecksumTask : dev/adamko/gradle/dev_publish/tasks/BaseDevPublishTask {
4651
public fun <init> (Lorg/gradle/api/file/FileSystemOperations;)V
4752
public final fun generate ()V
4853
public abstract fun getOutputDirectory ()Lorg/gradle/api/file/DirectoryProperty;
4954
public abstract fun getPublicationData ()Lorg/gradle/api/NamedDomainObjectContainer;
5055
}
5156

52-
public abstract class dev/adamko/gradle/dev_publish/tasks/UpdateDevRepoTask : org/gradle/api/DefaultTask {
57+
public abstract class dev/adamko/gradle/dev_publish/tasks/UpdateDevRepoTask : dev/adamko/gradle/dev_publish/tasks/BaseDevPublishTask {
5358
public fun <init> (Lorg/gradle/api/file/FileSystemOperations;)V
5459
public fun from (Lorg/gradle/api/provider/Provider;)V
5560
public abstract fun getDevRepo ()Lorg/gradle/api/file/DirectoryProperty;
61+
public abstract fun getPublicationsStore ()Lorg/gradle/api/file/DirectoryProperty;
5662
public abstract fun getRepositoryContents ()Lorg/gradle/api/file/ConfigurableFileCollection;
57-
public abstract fun getStagingRepo ()Lorg/gradle/api/file/DirectoryProperty;
5863
public final fun updateDevRepo ()V
5964
}
6065

buildSrc/settings.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ rootProject.name = "buildSrc"
22

33
pluginManagement {
44
repositories {
5-
gradlePluginPortal()
65
mavenCentral()
6+
gradlePluginPortal()
77
}
88
}
99

1010
@Suppress("UnstableApiUsage")
1111
dependencyResolutionManagement {
12-
1312
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
1413

1514
repositories {

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[versions]
22

3-
junit = "5.9.2"
4-
kotest = "5.5.5"
3+
junit = "5.9.3"
4+
kotest = "5.6.0"
55

66
gradlePlugin-pluginPublishPlugin = "1.1.0"
7-
gradlePlugin-bcvMu = "0.0.3"
7+
gradlePlugin-bcvMu = "0.0.5"
88

99
[libraries]
1010

gradle/wrapper/gradle-wrapper.jar

468 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

gradlew

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
197194
done
198195
fi
199196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
200201
# Collect all arguments for the java command;
201202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202203
# shell script including quotes and variable substitutions, so put them in

settings.gradle.kts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ rootProject.name = "dev-publish-plugin"
22

33
pluginManagement {
44
repositories {
5-
gradlePluginPortal()
65
mavenCentral()
6+
gradlePluginPortal()
77
}
88
}
99

@@ -13,16 +13,6 @@ dependencyResolutionManagement {
1313

1414
repositories {
1515
mavenCentral()
16-
gradlePluginPortal()
17-
18-
ivy("https://services.gradle.org/") {
19-
name = "Gradle Services"
20-
patternLayout {
21-
// https://services.gradle.org/distributions/gradle-8.0.2-bin.zip
22-
artifact("[organisation]/[module]-[revision]-bin.zip")
23-
}
24-
metadataSources { artifact() }
25-
}
2616
}
2717
}
2818

0 commit comments

Comments
 (0)