From c5aa864c30362629b0b7d67487af901489060e51 Mon Sep 17 00:00:00 2001 From: faskN Date: Tue, 3 Jan 2023 01:45:28 +0300 Subject: [PATCH] Update build.gradle --- library/build.gradle | 56 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/library/build.gradle b/library/build.gradle index daa6fce..93032ff 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' group='com.erkutaras.statelayout' @@ -11,7 +12,7 @@ android { minSdkVersion 14 targetSdkVersion 29 versionCode 24 - versionName "1.5.0" + versionName "1.0.0" vectorDrawables.useSupportLibrary = true } @@ -25,11 +26,64 @@ android { } +ext { + mGroupId = "com.ozanlimited" + mArtifactId = "statelayout" + mVersionCode = 1 + mVersionName = "1.0.0" + + mLibraryName = "StateLayout" + mLibraryDescription = "" +} + +task androidSourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs +} + + +afterEvaluate { + publishing { + publications { + maven(MavenPublication) { + groupId mGroupId + artifactId mArtifactId + version mVersionName + + from components.release + + artifact androidSourcesJar + + pom { + name = mLibraryName + description = mLibraryDescription + } + } + } + + repositories { + maven { + url System.getenv("GITLAB_REPO_URL") + credentials(HttpHeaderCredentials) { + name = System.getenv("GITLAB_DEPLOY_KEY") + value = System.getenv("GITLAB_DEPLOY_TOKEN") + } + authentication { + header(HttpHeaderAuthentication) + } + } + } + } +} + +publish.dependsOn assemble + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' } + repositories { mavenCentral() }