Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Commit f749131

Browse files
authored
Merge pull request #404 from CAAPIM/maven_publish_changes
Maven publish changes
2 parents 46dd8f9 + de25606 commit f749131

File tree

9 files changed

+469
-295
lines changed

9 files changed

+469
-295
lines changed

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ buildscript {
1414
google()
1515
}
1616
dependencies {
17-
classpath 'com.android.tools.build:gradle:3.5.0'
17+
classpath 'com.android.tools.build:gradle:4.0.1'
1818
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1919
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.2'
2020
classpath 'com.google.gms:google-services:3.1.1'
2121
}
2222
}
2323

24+
description = 'Android Mobile SDK Framework'
25+
2426
allprojects {
2527
repositories {
2628
jcenter()
2729
google()
2830
}
2931
}
3032

33+
34+
3135
ext {
3236
supportLibsVersion = '28.0.0'
3337
appAuthVersion = '0.7.0'

gradle.properties

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,27 @@ org.gradle.jvmargs=-Xmx4096M
2828
bintray_user=
2929
bintray_api_key=
3030
mag_version=
31-
mas_version=
31+
masVersion=
3232

3333
siteUrl = 'https://www.ca.com/us/developers/mas.html'
3434
gitUrl = 'https://github.com/CAAPIM/Android-MAS-SDK.git'
3535
issueUrl = 'https://github.com/CAAPIM/Android-MAS-SDK/issues'
3636
android.useAndroidX=true
37-
android.enableJetifier=true
37+
android.enableJetifier=true
38+
39+
# sonarqube (uses system properties)
40+
systemProp.sonar.host.url=https://sonarqube.broadcom.net/
41+
systemProp.sonar.login=
42+
43+
# GPG signing
44+
# https://central.sonatype.org/pages/gradle.html
45+
# https://www.gnupg.org
46+
# https://gist.github.com/phit/bd3c6d156a2fa5f3b1bc15fa94b3256c
47+
signJar=false
48+
signing.keyId=
49+
signing.password=
50+
signing.secretKeyRingFile=
51+
52+
# maven central account
53+
ossrhUsername=
54+
ossrhPassword=
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Aug 27 09:33:28 IST 2019
1+
#Mon Dec 20 16:22:05 IST 2021
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

mas-connecta/build.gradle

Lines changed: 85 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
3-
apply plugin: 'com.jfrog.bintray'
43
apply plugin: 'jacoco'
4+
apply plugin: 'signing'
5+
apply plugin:'base'
56

67
repositories {
78
mavenCentral()
@@ -69,10 +70,10 @@ task jacocoTestReport(type: JacocoReport, dependsOn: "connectedDebugAndroidTest"
6970

7071
def mainSrc = "${project.projectDir}/src/main/java"
7172

72-
sourceDirectories = files([mainSrc])
73-
classDirectories = files([debugTree])
73+
sourceDirectories.from = files([mainSrc])
74+
classDirectories.from = files([debugTree])
7475

75-
executionData = fileTree(dir: project.projectDir, includes:
76+
executionData.from = fileTree(dir: project.projectDir, includes:
7677
['**/*.exec', '**/*.ec'])
7778

7879
project.gradle.taskGraph.whenReady {
@@ -116,75 +117,101 @@ task javadoc(type: Javadoc) {
116117
include '**/*MAS*.java'
117118
}
118119

119-
//jcenter integration
120120
group 'com.ca'
121121

122-
project.version = mas_version
123-
bintray {
124-
user = bintray_user
125-
key = bintray_api_key
126-
127-
configurations = ['archives'] //When uploading configuration files
128-
pkg {
129-
repo = 'maven'
130-
name = 'mas-connecta'
131-
userOrg = 'caapim'
132-
133-
desc = 'MASConnecta is the core messaging framework of the Android Mobile SDK,' +
134-
' which is part of CA Mobile API Gateway. It gives developers the ability ' +
135-
'to create social collaborative apps where users can message and send data to each other.'
136-
websiteUrl = siteUrl
137-
issueTrackerUrl = issueUrl
138-
vcsUrl = gitUrl
139-
licenses = ['MIT']
140-
labels = ['aar', 'android', 'oauth', 'security']
141-
publicDownloadNumbers = true
142-
143-
version {
144-
name = project.version
145-
desc = 'CA Mobile App Services'
146-
}
147-
}
148-
}
149-
150-
install {
151-
repositories.mavenInstaller {
152-
pom {
153-
project {
154-
packaging 'aar'
155-
name 'CA Mobile App Services'
156-
url siteUrl
157-
licenses {
158-
license {
159-
name 'MIT'
160-
url 'https://github.com/CAAPIM/Android-MAS-SDK/blob/develop/LICENSE'
161-
}
162-
}
163-
scm {
164-
connection gitUrl
165-
developerConnection gitUrl
166-
url siteUrl
167-
168-
}
169-
}
170-
}
171-
}
172-
}
122+
project.version = masVersion
173123

174124
task sourcesJar(type: Jar) {
175125
from android.sourceSets.main.java.srcDirs
176-
classifier = 'sources'
126+
archiveClassifier.set("sources")
177127
}
178128

179129
task javadocJar(type: Jar, dependsOn: javadoc) {
180-
classifier = 'javadoc'
130+
archiveClassifier.set("javadoc")
181131
from javadoc.destinationDir
182132
}
183133
artifacts {
184134
archives javadocJar
185135
archives sourcesJar
186136
}
187137

138+
afterEvaluate {
139+
apply plugin: 'maven-publish'
140+
publishing {
141+
publications {
142+
release(MavenPublication) {
143+
groupId 'com.ca.apim'
144+
artifactId 'mas-connecta'
145+
version masVersion
146+
147+
// Two artifacts, the `aar` (or `jar`) and the sources
148+
if (project.plugins.findPlugin("com.android.library")) {
149+
from components.release
150+
} else {
151+
from components.java
152+
}
153+
154+
artifact sourcesJar
155+
artifact javadocJar
156+
157+
// Mostly self-explanatory metadata
158+
pom {
159+
name = 'CA Mobile App Services'
160+
description = 'Android Mobile SDK Framework'
161+
url = siteUrl
162+
organization {
163+
name = 'CA API Management'
164+
url = 'https://github.com/CAAPIM'
165+
}
166+
licenses {
167+
license {
168+
name = 'MIT'
169+
url = 'https://github.com/CAAPIM/Android-MAS-SDK/blob/develop/LICENSE'
170+
}
171+
}
172+
173+
scm {
174+
connection = gitUrl
175+
developerConnection = gitUrl
176+
url = siteUrl
177+
}
178+
issueManagement {
179+
system = 'github'
180+
url = issueUrl
181+
}
182+
developers {
183+
developer {
184+
id = 'apigatewayopensource'
185+
name = 'CA API Gateway Bot'
186+
187+
organization = 'CA API Gateway'
188+
organizationUrl = 'https://github.com/CAAPIM'
189+
}
190+
}
191+
}
192+
}
193+
}
194+
}
195+
196+
publishing.repositories {
197+
maven {
198+
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
199+
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
200+
url = version.endsWith('SNAPSHOT') ? snapshotRepo : releaseRepo
201+
credentials {
202+
username = ossrhUsername
203+
password = ossrhPassword
204+
}
205+
}
206+
}
207+
208+
signing {
209+
if (signJar == "true") {
210+
sign publishing.publications
211+
}
212+
}
213+
}
214+
188215
task findConventions doLast {
189216
println project.getConvention()
190217
}

0 commit comments

Comments
 (0)