Skip to content

Commit d892ac9

Browse files
committed
Move post release plugin to publishing plugin
1 parent 2b9caa7 commit d892ac9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class FirebaseLibraryPlugin : BaseFirebaseLibraryPlugin() {
5454

5555
project.apply<DackkaPlugin>()
5656
project.apply<GitSubmodulePlugin>()
57-
project.apply<PostReleasePlugin>()
5857
project.tasks.getByName("preBuild").dependsOn("updateGitSubmodules")
5958
}
6059

buildSrc/src/main/java/com/google/firebase/gradle/plugins/PublishingPlugin.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import org.gradle.api.Project
3030
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
3131
import org.gradle.api.tasks.Copy
3232
import org.gradle.api.tasks.bundling.Zip
33+
import org.gradle.kotlin.dsl.apply
3334
import org.gradle.kotlin.dsl.named
3435
import org.gradle.kotlin.dsl.register
3536

@@ -60,6 +61,9 @@ import org.gradle.kotlin.dsl.register
6061
* - [PUBLISH_RELEASING_LIBS_TO_LOCAL_TASK][registerPublishReleasingLibrariesToMavenLocalTask]
6162
* - [SEMVER_CHECK_TASK][registerSemverCheckForReleaseTask]
6263
* - [PUBLISH_ALL_TO_BUILD_TASK][registerPublishAllToBuildDir]
64+
*
65+
* Additionally, this plugin registers the [PostReleasePlugin] via [registerPostReleasePlugin] for
66+
* each releasing library.
6367
*/
6468
abstract class PublishingPlugin : Plugin<Project> {
6569
override fun apply(project: Project) {
@@ -91,6 +95,7 @@ abstract class PublishingPlugin : Plugin<Project> {
9195
registerPublishReleasingLibrariesToMavenLocalTask(project, releasingProjects)
9296
registerSemverCheckForReleaseTask(project, releasingProjects)
9397
registerPublishAllToBuildDir(project, allFirebaseLibraries)
98+
registerPostReleasePlugin(releasingProjects)
9499

95100
val buildMavenZip =
96101
project.tasks.register<Zip>(BUILD_MAVEN_ZIP_TASK) {
@@ -444,6 +449,13 @@ abstract class PublishingPlugin : Plugin<Project> {
444449
}
445450
}
446451

452+
/** Registers the [PostReleasePlugin] to each releaing project. */
453+
private fun registerPostReleasePlugin(releasingProjects: List<Project>) {
454+
for (releasingProject in releasingProjects) {
455+
releasingProject.apply<PostReleasePlugin>()
456+
}
457+
}
458+
447459
companion object {
448460
const val RELEASE_CONFIG_FILE = "release.json"
449461
const val RELEASE_REPORT_MD_FILE = "release_report.md"
@@ -476,7 +488,6 @@ abstract class PublishingPlugin : Plugin<Project> {
476488
*
477489
* @property releasingLibraries A list of libraries that should be released
478490
* @property name The name of the release (such as `m123`)
479-
*
480491
* @see computeReleaseMetadata
481492
*/
482493
data class ReleaseMetadata(

0 commit comments

Comments
 (0)