Skip to content

Commit

Permalink
Project updates (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
halfhp authored Sep 19, 2021
1 parent b275635 commit 6079afc
Show file tree
Hide file tree
Showing 33 changed files with 124 additions and 139 deletions.
15 changes: 4 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

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

working_directory: ~/repo

Expand Down Expand Up @@ -87,17 +87,10 @@ jobs:
path: androidplot-core/build/test-results/

- deploy:
name: "Deploy to Bintray"
name: "Publish"
command: |
if [ "${CIRCLE_BRANCH}" == "master" ];
then ./gradlew bintrayUpload;
fi
- deploy:
name: "Deploy to Google Play"
command: |
if [ "${CIRCLE_BRANCH}" == "master" ];
if [ "${CIRCLE_BRANCH}" == "project-updates" ];
then
./misc/download_google_publisher_json.sh;
./gradlew publishApkRelease
./gradlew publish;
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Technical questions should be posted using the [androidplot tag](http://stackove
# License
Androidplot has been made available under the Apache 2.0 license:

Copyright 2018 Androidplot.com
Copyright 2021 Androidplot.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
129 changes: 66 additions & 63 deletions androidplot-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
* limitations under the License.
*/

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'jacoco-android'
plugins {
id 'com.android.library'
id 'com.dicedmelon.gradle.jacoco-android'
id 'maven-publish'
id 'signing'
}

class AttrMarkdown extends DefaultTask {

Expand Down Expand Up @@ -59,8 +61,6 @@ android {
compileSdkVersion theCompileSdkVersion

defaultConfig {
versionCode theVersionCode
versionName theVersionName
minSdkVersion theMinSdkVersion
targetSdkVersion theTargetSdkVersion
testApplicationId "com.androidplot.test"
Expand All @@ -70,14 +70,13 @@ android {
unitTests.all {
jacoco {
includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
}
}

/**
* TODO: enable and address lint issues.
*/
lintOptions {
// TODO: enable and address lint issues.
abortOnError false
}
}
Expand All @@ -90,15 +89,12 @@ def gitUrl = 'https://github.com/halfhp/androidplot.git'

dependencies {

implementation 'com.halfhp.fig:figlib:1.0.7'
implementation 'com.halfhp.fig:figlib:1.0.11'
implementation 'com.android.support:support-annotations:28.0.0'
testImplementation "org.mockito:mockito-core:3.0.0"
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation "org.robolectric:robolectric:4.2.1"

// temp fix for:
// https://github.com/robolectric/robolectric/issues/1932
testImplementation 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
testImplementation "org.mockito:mockito-core:3.9.0"
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation "org.robolectric:robolectric:4.5.1"
}

task javadoc(type: Javadoc) {
Expand All @@ -123,63 +119,70 @@ task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'Androidplot Core Library'
description = "Androidplot is a library for creating dynamic and static charts within your Android application."
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'halfhp'
name 'Nick Fellows'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
javadoc {
options.overview = "src/main/java/overview.html"
}

afterEvaluate {
publishing {
repositories {
maven {
name = "Maven Central"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("OSSRH_ACTOR")
password = System.getenv("OSSRH_TOKEN")
}
}
}
}
}

bintray {

// these environment vars must be set when deploying to bintray.
// note: BINTRAY_PASSWORD is actually the api key, but naming it 'password'
// tells the CI environment to obfuscate the value in public logs.
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_PASSWORD')

publications {
release(MavenPublication) {

from components.release

// You can then customize attributes of the publication as shown below.
groupId = 'com.androidplot'
artifactId = 'androidplot'
version = theVersionName

pom {
packaging 'aar'
name = 'Androidplot'
description = "Configure any object from XML."
url = gitUrl
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'halfhp'
name = 'Nick Fellows'
email = '[email protected]'
}
}
scm {
connection = gitUrl
developerConnection = gitUrl
url = gitUrl

configurations = ['archives']
pkg {
version {
name = theVersionName
}
}
}
}
repo = "androidplot"
name = "com.androidplot:androidplot-core"
issueTrackerUrl = "https://github.com/halfhp/androidplot/issues"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
}
}

javadoc {
options.overview = "src/main/java/overview.html"
afterEvaluate {
signing {
def signingKey = System.getenv("SIGNING_KEY")
def signingPassword = System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.release
}
}

artifacts {
Expand Down
3 changes: 2 additions & 1 deletion androidplot-core/src/main/java/com/androidplot/Plot.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
import android.graphics.RectF;
import android.os.Build;
import android.os.Looper;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;

import com.androidplot.ui.Anchor;
import com.androidplot.ui.BoxModel;
import com.androidplot.ui.Formatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.androidplot.pie;


import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.androidplot.ui.widget.LegendItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.androidplot.ui.LayoutManager;
import com.androidplot.ui.SeriesBundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.androidplot.ui;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

public class PositionMetrics implements Comparable<PositionMetrics> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.androidplot.ui.LayoutManager;
import com.androidplot.ui.Size;
import com.androidplot.ui.TableModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package com.androidplot.ui.widget;

import android.graphics.*;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import androidx.annotation.NonNull;

import com.androidplot.ui.*;
import com.androidplot.util.DisplayDimensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.androidplot.util;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* An extension of {@link Number} optimized for speed at the cost of memory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import android.graphics.Paint;
import android.graphics.PointF;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.androidplot.ui.RenderStack;
import com.androidplot.ui.SeriesRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.androidplot.xy;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.androidplot.util.FastNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.RectF;
import android.graphics.PointF;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.view.*;

import com.androidplot.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.androidplot.xy;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* Calculates the min/max constraints for an xy plane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import android.graphics.Paint;
import android.graphics.PointF;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.androidplot.R;
import com.androidplot.Region;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.androidplot.xy;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.androidplot.ui.widget.LegendItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.androidplot.xy;

import android.graphics.*;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.androidplot.ui.LayoutManager;
import com.androidplot.ui.SeriesBundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PointF;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.AttributeSet;

import com.androidplot.Plot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Canvas;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.androidplot.test.AndroidplotTest;
import com.androidplot.ui.Anchor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ public void seriesToScreenY_returnsScreenValue() {

@Test
public void setGridInsets_updatesGridRect() {
graphWidget.setGridInsets(new Insets(0, 0, 0, 0));
graphWidget.setGridInsets(new com.androidplot.ui.Insets(0, 0, 0, 0));
final RectF oldRect = graphWidget.getGridRect();

graphWidget.setGridInsets(new Insets(2, 2, 2, 2));
graphWidget.setGridInsets(new com.androidplot.ui.Insets(2, 2, 2, 2));
final RectF newRect = graphWidget.getGridRect();

assertEquals(oldRect.left + 2, newRect.left);
Expand Down
Loading

0 comments on commit 6079afc

Please sign in to comment.