|
1 | 1 | apply plugin: 'com.android.library' |
2 | 2 | apply plugin: 'com.github.dcendents.android-maven' |
3 | | -apply plugin: 'com.jfrog.bintray' |
4 | 3 | apply plugin: 'jacoco' |
| 4 | +apply plugin: 'signing' |
| 5 | +apply plugin:'base' |
5 | 6 |
|
6 | 7 | repositories { |
7 | 8 | mavenCentral() |
@@ -69,10 +70,10 @@ task jacocoTestReport(type: JacocoReport, dependsOn: "connectedDebugAndroidTest" |
69 | 70 |
|
70 | 71 | def mainSrc = "${project.projectDir}/src/main/java" |
71 | 72 |
|
72 | | - sourceDirectories = files([mainSrc]) |
73 | | - classDirectories = files([debugTree]) |
| 73 | + sourceDirectories.from = files([mainSrc]) |
| 74 | + classDirectories.from = files([debugTree]) |
74 | 75 |
|
75 | | - executionData = fileTree(dir: project.projectDir, includes: |
| 76 | + executionData.from = fileTree(dir: project.projectDir, includes: |
76 | 77 | ['**/*.exec', '**/*.ec']) |
77 | 78 |
|
78 | 79 | project.gradle.taskGraph.whenReady { |
@@ -116,75 +117,101 @@ task javadoc(type: Javadoc) { |
116 | 117 | include '**/*MAS*.java' |
117 | 118 | } |
118 | 119 |
|
119 | | -//jcenter integration |
120 | 120 | group 'com.ca' |
121 | 121 |
|
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 |
173 | 123 |
|
174 | 124 | task sourcesJar(type: Jar) { |
175 | 125 | from android.sourceSets.main.java.srcDirs |
176 | | - classifier = 'sources' |
| 126 | + archiveClassifier.set("sources") |
177 | 127 | } |
178 | 128 |
|
179 | 129 | task javadocJar(type: Jar, dependsOn: javadoc) { |
180 | | - classifier = 'javadoc' |
| 130 | + archiveClassifier.set("javadoc") |
181 | 131 | from javadoc.destinationDir |
182 | 132 | } |
183 | 133 | artifacts { |
184 | 134 | archives javadocJar |
185 | 135 | archives sourcesJar |
186 | 136 | } |
187 | 137 |
|
| 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 | + |
188 | 215 | task findConventions doLast { |
189 | 216 | println project.getConvention() |
190 | 217 | } |
0 commit comments