From 39a3d0ba420f54f447d084b34db0e470f045c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Ribo=CC=81?= Date: Tue, 16 Jul 2024 12:48:35 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20add=20repositories=20inside=20publishing?= =?UTF-8?q?=20Signed-off-by:=20Javier=20Ribo=CC=81=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 22d57f967..654e770de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,14 +15,6 @@ buildscript { gradlePluginPortal() google() mavenCentral() - maven { - name = "OSSRH" - url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2") - credentials { - username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("OSSRH_USERNAME") - password = project.findProperty("sonatypePassword") as String? ?: System.getenv("OSSRH_TOKEN") - } - } } dependencies { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23") @@ -47,6 +39,16 @@ allprojects { val allowedProjectsToPublish = listOf("apollo") if (allowedProjectsToPublish.contains(project.name) && project.name.contains("androidDebug")) { publishing { + repositories { + maven { + name = "OSSRH" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2") + credentials { + username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("OSSRH_USERNAME") + password = project.findProperty("sonatypePassword") as String? ?: System.getenv("OSSRH_TOKEN") + } + } + } publications { withType { groupId = publishedMavenId