1414 * limitations under the License.
1515 */
1616
17- apply plugin : ' com.android.library'
18- apply plugin : ' com.github.dcendents.android-maven'
19- apply plugin : ' com.jfrog.bintray'
20- apply plugin : ' jacoco-android'
17+ plugins {
18+ id ' com.android.library'
19+ id ' com.dicedmelon.gradle.jacoco-android'
20+ id ' maven-publish'
21+ id ' signing'
22+ }
2123
2224class AttrMarkdown extends DefaultTask {
2325
@@ -59,8 +61,6 @@ android {
5961 compileSdkVersion theCompileSdkVersion
6062
6163 defaultConfig {
62- versionCode theVersionCode
63- versionName theVersionName
6464 minSdkVersion theMinSdkVersion
6565 targetSdkVersion theTargetSdkVersion
6666 testApplicationId " com.androidplot.test"
@@ -70,14 +70,13 @@ android {
7070 unitTests. all {
7171 jacoco {
7272 includeNoLocationClasses = true
73+ jacoco. excludes = [' jdk.internal.*' ]
7374 }
7475 }
7576 }
7677
77- /**
78- * TODO: enable and address lint issues.
79- */
8078 lintOptions {
79+ // TODO: enable and address lint issues.
8180 abortOnError false
8281 }
8382}
@@ -90,15 +89,12 @@ def gitUrl = 'https://github.com/halfhp/androidplot.git'
9089
9190dependencies {
9291
93- implementation ' com.halfhp.fig:figlib:1.0.7 '
92+ implementation ' com.halfhp.fig:figlib:1.0.11 '
9493 implementation ' com.android.support:support-annotations:28.0.0'
95- testImplementation " org.mockito:mockito-core:3.0.0"
96- testImplementation group : ' junit' , name : ' junit' , version : ' 4.12'
97- testImplementation " org.robolectric:robolectric:4.2.1"
9894
99- // temp fix for:
100- // https://github.com/robolectric/robolectric/issues/1932
101- testImplementation ' org.khronos:opengl-api:gl1.1-android-2.1_r1 '
95+ testImplementation " org.mockito:mockito-core:3.9.0 "
96+ testImplementation group : ' junit ' , name : ' junit ' , version : ' 4.13.2 '
97+ testImplementation " org.robolectric:robolectric:4.5.1 "
10298}
10399
104100task javadoc (type : Javadoc ) {
@@ -123,63 +119,70 @@ task sourcesJar(type: Jar) {
123119 from android. sourceSets. main. java. srcDirs
124120}
125121
126- install {
127- repositories. mavenInstaller {
128- pom {
129- project {
130- packaging ' aar'
131- name ' Androidplot Core Library'
132- description = " Androidplot is a library for creating dynamic and static charts within your Android application."
133- url siteUrl
134- licenses {
135- license {
136- name ' The Apache Software License, Version 2.0'
137- url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
138- }
139- }
140- developers {
141- developer {
142- id ' halfhp'
143- name ' Nick Fellows'
144- 145- }
146- }
147- scm {
148- connection gitUrl
149- developerConnection gitUrl
150- url siteUrl
122+ javadoc {
123+ options. overview = " src/main/java/overview.html"
124+ }
151125
126+ afterEvaluate {
127+ publishing {
128+ repositories {
129+ maven {
130+ name = " Maven Central"
131+ url = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
132+ credentials {
133+ username = System . getenv(" OSSRH_ACTOR" )
134+ password = System . getenv(" OSSRH_TOKEN" )
152135 }
153136 }
154137 }
155- }
156- }
157-
158- bintray {
159-
160- // these environment vars must be set when deploying to bintray.
161- // note: BINTRAY_PASSWORD is actually the api key, but naming it 'password'
162- // tells the CI environment to obfuscate the value in public logs.
163- user = System . getenv(' BINTRAY_USER' )
164- key = System . getenv(' BINTRAY_PASSWORD' )
165138
139+ publications {
140+ release(MavenPublication ) {
141+
142+ from components. release
143+
144+ // You can then customize attributes of the publication as shown below.
145+ groupId = ' com.androidplot'
146+ artifactId = ' androidplot'
147+ version = theVersionName
148+
149+ pom {
150+ packaging ' aar'
151+ name = ' Androidplot'
152+ description = " Configure any object from XML."
153+ url = gitUrl
154+ licenses {
155+ license {
156+ name = ' The Apache Software License, Version 2.0'
157+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
158+ }
159+ }
160+ developers {
161+ developer {
162+ id = ' halfhp'
163+ name = ' Nick Fellows'
164+ 165+ }
166+ }
167+ scm {
168+ connection = gitUrl
169+ developerConnection = gitUrl
170+ url = gitUrl
166171
167- configurations = [' archives' ]
168- pkg {
169- version {
170- name = theVersionName
172+ }
173+ }
174+ }
171175 }
172- repo = " androidplot"
173- name = " com.androidplot:androidplot-core"
174- issueTrackerUrl = " https://github.com/halfhp/androidplot/issues"
175- websiteUrl = siteUrl
176- vcsUrl = gitUrl
177- licenses = [" Apache-2.0" ]
178176 }
179177}
180178
181- javadoc {
182- options. overview = " src/main/java/overview.html"
179+ afterEvaluate {
180+ signing {
181+ def signingKey = System . getenv(" SIGNING_KEY" )
182+ def signingPassword = System . getenv(" SIGNING_PASSWORD" )
183+ useInMemoryPgpKeys(signingKey, signingPassword)
184+ sign publishing. publications. release
185+ }
183186}
184187
185188artifacts {
0 commit comments