1- apply plugin : ' com.android.library'
2- apply plugin : ' kotlin-android'
3- apply plugin : ' kotlin-android-extensions'
4- apply plugin : ' com.github.dcendents.android-maven'
5- apply plugin : ' com.jfrog.bintray'
6-
7- version = " 4.0.1"
1+ plugins {
2+ id ' com.android.library'
3+ id ' kotlin-android'
4+ id ' maven-publish'
5+ id ' signing'
6+ }
87
98android {
109 compileSdkVersion 30
@@ -45,8 +44,7 @@ dependencies {
4544 androidTestImplementation(' androidx.test.espresso:espresso-core:3.1.0' , {
4645 exclude group : ' com.android.support' , module : ' support-annotations'
4746 })
48- implementation ' androidx.appcompat:appcompat:1.2.0'
49- implementation ' org.jetbrains.anko:anko:0.10.8'
47+ implementation ' androidx.appcompat:appcompat:1.3.0'
5048 implementation ' org.apache.commons:commons-lang3:3.9'
5149 testImplementation ' junit:junit:4.12'
5250 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
@@ -55,39 +53,11 @@ dependencies {
5553def siteUrl = ' https://github.com/StringCare/AndroidLibrary'
5654def gitUrl = ' https://github.com/StringCare/AndroidLibrary.git'
5755
58- group = " com.stringcare"
56+ group = " io.github.stringcare"
57+ version = " 4.2.1"
5958
60- install {
61- repositories. mavenInstaller {
62- // This generates POM.xml with proper parameters
63- pom {
64- project {
65- packaging ' aar'
66- name ' StringCareAndroidLibrary'
67- url siteUrl
68- // Set your license
69- licenses {
70- license {
71- name ' The Apache Software License, Version 2.0'
72- url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
73- }
74- }
75- developers {
76- developer {
77- id ' efraespada'
78- name ' efraespada'
79- email ' efraespada@gmail.com'
80- }
81- }
82- scm {
83- connection gitUrl
84- developerConnection gitUrl
85- url siteUrl
86- }
87- }
88- }
89- }
90- }
59+ Properties properties = new Properties ()
60+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
9161
9262task sourcesJar (type : Jar ) {
9363 classifier = ' sources'
@@ -106,26 +76,54 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
10676 from javadoc. destinationDir
10777}
10878
109- artifacts {
110- archives javadocJar
111- archives sourcesJar
112- }
79+ afterEvaluate {
80+ publishing {
81+ publications {
82+ library(MavenPublication ) {
83+ artifacts = [javadocJar, sourcesJar]
84+ from components. release
85+ artifactId = " library"
86+ pom {
87+ packaging = ' aar'
88+ name = ' StringCareAndroidLibrary'
89+ description = " Stringcare Android library"
90+ url = siteUrl
91+ scm {
92+ connection = gitUrl
93+ developerConnection = gitUrl
94+ url = siteUrl
95+ }
96+ licenses {
97+ license {
98+ name = ' The Apache License, Version 2.0'
99+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
100+ }
101+ }
102+ developers {
103+ developer {
104+ id = ' efraespada'
105+ name = ' efraespada'
106+ email = ' efraespada@gmail.com'
107+ }
108+ }
109+ }
110+ }
111+ }
112+ repositories {
113+ maven {
114+ // def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
115+ // def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
116+ url = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
117+ credentials {
118+ username = properties[" nexusUsername" ]
119+ password = properties[" nexusPassword" ]
120+ }
121+ }
122+ }
123+ }
113124
114- Properties properties = new Properties ()
115- properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
116- bintray {
117- user = properties. getProperty(" bintrayUser" )
118- key = properties. getProperty(" bintrayApiKey" )
119- configurations = [' archives' ]
120- pkg {
121- repo = " maven"
122- name = " StringCareAndroidLibrary"
123- websiteUrl = siteUrl
124- vcsUrl = gitUrl
125- licenses = [" Apache-2.0" ]
126- publish = true
125+ signing {
126+ useGpgCmd()
127+ sign publishing. publications. library
127128 }
128129}
129- repositories {
130- mavenCentral()
131- }
0 commit comments