diff --git a/build.gradle.kts b/build.gradle.kts index 22d955f..5b88361 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,36 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -buildscript { - repositories { - mavenLocal() - google() - mavenCentral() - maven { - url = uri("https://maven.pkg.github.com/google/secrets-gradle-plugin") - credentials { - username = project.findProperty("ghGprUser") as String? ?: System.getenv("ghGprUser") - password = project.findProperty("ghGprToken") as String? ?: System.getenv("ghGprToken") - } - } - } - - dependencies { - classpath(libs.gradle.v842) - classpath(libs.kotlin.gradle.plugin) - classpath(libs.secrets.gradle.plugin) - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle.kts files - } -} - -allprojects { - repositories { - google() - mavenCentral() - } +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.kotlin.jvm) apply false } tasks.register("clean") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f411814..00c6b52 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,21 +1,23 @@ [versions] gradle = "7.0.4" -gradleVersion = "8.4.2" +agp = "8.4.2" junit = "4.13.2" kotlin = "1.9.24" kotlinGradlePlugin = "2.0.0" material = "1.12.0" appcompat = "1.7.0" mockitoKotlin = "2.2.0" -secretsGradlePlugin = "2.0.1" [libraries] gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } -gradle-v842 = { module = "com.android.tools.build:gradle", version.ref = "gradleVersion" } junit = { module = "junit:junit", version.ref = "junit" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" } kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version.ref = "mockitoKotlin" } -secrets-gradle-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/sample-app/build.gradle.kts b/sample-app/build.gradle.kts index 12a3223..1172a85 100644 --- a/sample-app/build.gradle.kts +++ b/sample-app/build.gradle.kts @@ -13,10 +13,8 @@ // limitations under the License. plugins { - id("com.android.application") - id("kotlin-android") - - // 1. Include the plugin + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") } diff --git a/secrets-gradle-plugin/build.gradle.kts b/secrets-gradle-plugin/build.gradle.kts index 1266e69..4cc1076 100644 --- a/secrets-gradle-plugin/build.gradle.kts +++ b/secrets-gradle-plugin/build.gradle.kts @@ -15,7 +15,7 @@ plugins { `java-gradle-plugin` `maven-publish` - id("kotlin") + alias(libs.plugins.kotlin.jvm) } java { @@ -91,9 +91,7 @@ publishing { } } -project(":secrets-gradle-plugin") { - version = PluginInfo.version -} +version = PluginInfo.version object PluginInfo { const val artifactId = diff --git a/secrets-gradle-plugin/settings.gradle.kts b/secrets-gradle-plugin/settings.gradle.kts new file mode 100644 index 0000000..ba313ea --- /dev/null +++ b/secrets-gradle-plugin/settings.gradle.kts @@ -0,0 +1,20 @@ +dependencyResolutionManagement { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + } + + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +rootProject.name = "secrets-gradle-plugin" diff --git a/settings.gradle.kts b/settings.gradle.kts index 86fc5b1..2fdf71e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,13 +12,35 @@ // See the License for the specific language governing permissions and // limitations under the License. -include(":secrets-gradle-plugin") -include(":sample-app") - pluginManagement { repositories { - mavenLocal() - maven(url = "./plugin/build/repository") + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() gradlePluginPortal() } + + includeBuild("secrets-gradle-plugin") +} + +dependencyResolutionManagement { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + } } + +rootProject.name = "secrets-gradle-plugin-root" + +include(":sample-app")