diff --git a/common-scripts.gradle b/common-scripts.gradle index 8126179f9..6b40b69f4 100644 --- a/common-scripts.gradle +++ b/common-scripts.gradle @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +apply plugin: 'maven-publish' android { @@ -54,6 +55,31 @@ ext { setUpSigning = this.&setUpSigning } +afterEvaluate { + publishing { + publications { + maven(MavenPublication) { + groupId = library.publishGroupId + artifactId = getArtifactId(project) + version = library.publishVersion + from components.release + + customizePom(pom) + } + } + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/tangem/tangem-sdk-android") + credentials { + username = "$githubUser" + password = "$githubPass" + } + } + } + } +} + String getNamespace(Project project) { return "${library.groupId}.${project.name.replace("-", ".")}" } @@ -76,22 +102,3 @@ void customizePom(MavenPom pom) { } } } - -boolean isReleaseVersion() { - return !project.version.endsWith("SNAPSHOT") -} - -void setUpRepositories(RepositoryHandler handler) { - handler.maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/tangem/vico") - credentials { - username = "$githubUser" - password = "$githubPass" - } - } -} - -void setUpSigning(SigningExtension signing, MavenPublication publication) { - -} diff --git a/vico/compose-m2/build.gradle b/vico/compose-m2/build.gradle index a72434e01..07b46020f 100644 --- a/vico/compose-m2/build.gradle +++ b/vico/compose-m2/build.gradle @@ -44,28 +44,6 @@ android { } } -afterEvaluate { - - publishing { - - publications { - - maven(MavenPublication) { - - groupId = library.publishGroupId - artifactId = getArtifactId(project) - version = library.publishVersion - from components.release - - customizePom(pom) - setUpRepositories(repositories) - } - } - } - - setUpSigning(signing, publishing.publications.VicoComposeM2) -} - dependencies { api project(":vico:compose") diff --git a/vico/compose-m3/build.gradle b/vico/compose-m3/build.gradle index 5942c1391..896512e51 100644 --- a/vico/compose-m3/build.gradle +++ b/vico/compose-m3/build.gradle @@ -45,28 +45,6 @@ android { } } -afterEvaluate { - - publishing { - - publications { - - maven(MavenPublication) { - - groupId = library.publishGroupId - artifactId = getArtifactId(project) - version = library.publishVersion - from components.release - - customizePom(pom) - setUpRepositories(repositories) - } - } - } - - setUpSigning(signing, publishing.publications.VicoComposeM3) -} - dependencies { api project(":vico:compose") diff --git a/vico/compose/build.gradle b/vico/compose/build.gradle index a48392bf6..4e24b6554 100644 --- a/vico/compose/build.gradle +++ b/vico/compose/build.gradle @@ -45,28 +45,6 @@ android { } } -afterEvaluate { - - publishing { - - publications { - - maven(MavenPublication) { - - groupId = library.publishGroupId - artifactId = getArtifactId(project) - version = library.publishVersion - from components.release - - customizePom(pom) - setUpRepositories(repositories) - } - } - } - - setUpSigning(signing, publishing.publications.VicoCompose) -} - dependencies { api project(":vico:core") diff --git a/vico/core/build.gradle b/vico/core/build.gradle index 87d8c46e1..d26fa0af3 100644 --- a/vico/core/build.gradle +++ b/vico/core/build.gradle @@ -36,28 +36,6 @@ android { } } -afterEvaluate { - - publishing { - - publications { - - maven(MavenPublication) { - - groupId = library.publishGroupId - artifactId = getArtifactId(project) - version = library.publishVersion - from components.release - - customizePom(pom) - setUpRepositories(repositories) - } - } - } - - setUpSigning(signing, publishing.publications.VicoCore) -} - dependencies { implementation libs.androidXAnnotation implementation libs.coroutinesCore diff --git a/vico/views/build.gradle b/vico/views/build.gradle index 7340d4af3..2ce295b00 100644 --- a/vico/views/build.gradle +++ b/vico/views/build.gradle @@ -34,28 +34,6 @@ android { } } -afterEvaluate { - - publishing { - - publications { - - maven(MavenPublication) { - - groupId = library.publishGroupId - artifactId = getArtifactId(project) - version = library.publishVersion - from components.release - - customizePom(pom) - setUpRepositories(repositories) - } - } - } - - setUpSigning(signing, publishing.publications.VicoView) -} - dependencies { api project(":vico:core")