Skip to content

Commit 6079afc

Browse files
authored
Project updates (#110)
1 parent b275635 commit 6079afc

33 files changed

+124
-139
lines changed

.circleci/config.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
# CircleCI maintains a library of pre-built images
1818
# documented at https://circleci.com/docs/2.0/circleci-images/
19-
- image: circleci/android:api-28-alpha
19+
- image: circleci/android:api-30
2020

2121
working_directory: ~/repo
2222

@@ -87,17 +87,10 @@ jobs:
8787
path: androidplot-core/build/test-results/
8888

8989
- deploy:
90-
name: "Deploy to Bintray"
90+
name: "Publish"
9191
command: |
92-
if [ "${CIRCLE_BRANCH}" == "master" ];
93-
then ./gradlew bintrayUpload;
94-
fi
95-
96-
- deploy:
97-
name: "Deploy to Google Play"
98-
command: |
99-
if [ "${CIRCLE_BRANCH}" == "master" ];
92+
if [ "${CIRCLE_BRANCH}" == "project-updates" ];
10093
then
10194
./misc/download_google_publisher_json.sh;
102-
./gradlew publishApkRelease
95+
./gradlew publish;
10396
fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Technical questions should be posted using the [androidplot tag](http://stackove
4343
# License
4444
Androidplot has been made available under the Apache 2.0 license:
4545

46-
Copyright 2018 Androidplot.com
46+
Copyright 2021 Androidplot.com
4747

4848
Licensed under the Apache License, Version 2.0 (the "License");
4949
you may not use this file except in compliance with the License.

androidplot-core/build.gradle

Lines changed: 66 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
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

2224
class 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

9190
dependencies {
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

104100
task 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

185188
artifacts {

androidplot-core/src/main/java/com/androidplot/Plot.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
import android.graphics.RectF;
2727
import android.os.Build;
2828
import android.os.Looper;
29-
import android.support.annotation.Nullable;
3029
import android.util.AttributeSet;
3130
import android.util.Log;
3231
import android.view.View;
3332

33+
import androidx.annotation.Nullable;
34+
3435
import com.androidplot.ui.Anchor;
3536
import com.androidplot.ui.BoxModel;
3637
import com.androidplot.ui.Formatter;

androidplot-core/src/main/java/com/androidplot/pie/PieLegendItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.androidplot.pie;
22

33

4-
import android.support.annotation.NonNull;
4+
import androidx.annotation.NonNull;
55

66
import com.androidplot.ui.widget.LegendItem;
77

androidplot-core/src/main/java/com/androidplot/pie/PieLegendWidget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import android.graphics.Canvas;
44
import android.graphics.RectF;
5-
import android.support.annotation.NonNull;
5+
import androidx.annotation.NonNull;
66

77
import com.androidplot.ui.LayoutManager;
88
import com.androidplot.ui.SeriesBundle;

androidplot-core/src/main/java/com/androidplot/ui/PositionMetrics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.androidplot.ui;
1818

19-
import android.support.annotation.NonNull;
19+
import androidx.annotation.NonNull;
2020

2121
public class PositionMetrics implements Comparable<PositionMetrics> {
2222

androidplot-core/src/main/java/com/androidplot/ui/widget/LegendWidget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import android.graphics.Color;
55
import android.graphics.Paint;
66
import android.graphics.RectF;
7-
import android.support.annotation.NonNull;
7+
import androidx.annotation.NonNull;
88
import com.androidplot.ui.LayoutManager;
99
import com.androidplot.ui.Size;
1010
import com.androidplot.ui.TableModel;

androidplot-core/src/main/java/com/androidplot/ui/widget/Widget.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.androidplot.ui.widget;
1818

1919
import android.graphics.*;
20-
import android.support.annotation.NonNull;
21-
import android.support.annotation.Nullable;
20+
import androidx.annotation.Nullable;
21+
import androidx.annotation.NonNull;
2222

2323
import com.androidplot.ui.*;
2424
import com.androidplot.util.DisplayDimensions;

androidplot-core/src/main/java/com/androidplot/util/FastNumber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.androidplot.util;
22

3-
import android.support.annotation.NonNull;
4-
import android.support.annotation.Nullable;
3+
import androidx.annotation.NonNull;
4+
import androidx.annotation.Nullable;
55

66
/**
77
* An extension of {@link Number} optimized for speed at the cost of memory.

0 commit comments

Comments
 (0)