From 65ec68b37f77b4ce0cc1c9500fd0f2197e39c040 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Mon, 1 Jan 2024 03:47:18 +0800 Subject: [PATCH] Support BOM publishing (#4022) --- retrofit-bom/build.gradle | 26 ++++++++++++++++++++++++++ retrofit-bom/gradle.properties | 3 +++ settings.gradle | 1 + 3 files changed, 30 insertions(+) create mode 100644 retrofit-bom/build.gradle create mode 100644 retrofit-bom/gradle.properties diff --git a/retrofit-bom/build.gradle b/retrofit-bom/build.gradle new file mode 100644 index 0000000000..65507ef8e7 --- /dev/null +++ b/retrofit-bom/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'java-platform' + alias libs.plugins.mavenPublish +} + +// TODO: This could be simplified after updating maven publish plugin, see https://vanniktech.github.io/gradle-maven-publish-plugin/what/#java-platform. +publishing { + publications { + maven(MavenPublication) { + from components.javaPlatform + } + } +} + +dependencies { + constraints { + rootProject.subprojects { subproject -> + subproject.plugins.withId(libs.plugins.mavenPublish.get().pluginId) { + // Exclude self project from BOM. + if (subproject != this.project) { + api subproject + } + } + } + } +} diff --git a/retrofit-bom/gradle.properties b/retrofit-bom/gradle.properties new file mode 100644 index 0000000000..660234dfe3 --- /dev/null +++ b/retrofit-bom/gradle.properties @@ -0,0 +1,3 @@ +POM_ARTIFACT_ID=retrofit-bom +POM_NAME=Retrofit BOM +POM_DESCRIPTION=A BOM for managing Retrofit dependencies. diff --git a/settings.gradle b/settings.gradle index 381dc48d89..e7b4496dbf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,6 +5,7 @@ plugins { rootProject.name = 'retrofit-root' include ':retrofit' +include ':retrofit-bom' include ':retrofit:android-test' include ':retrofit:kotlin-test' include ':retrofit:robovm-test'