diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99a0053d..d38f337e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,12 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - name: Set Up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '17' + - name: Build and Test run: ./gradlew testDebugUnitTest jacocoTestDebugUnitTestReport @@ -21,8 +27,9 @@ jobs: echo $ENCODED | base64 -di > "${GITHUB_WORKSPACE}/demoapp/keystore.jks" ./gradlew assembleRelease - - name: Javadoc - run: ./gradlew javadoc +# TODO: get javadoc working again at some point +# - name: Javadoc +# run: ./gradlew javadoc - name: Code Coverage run: bash <(curl -s https://codecov.io/bash) diff --git a/androidplot-core/build.gradle b/androidplot-core/build.gradle index 389a5cfd..b37b2b4a 100644 --- a/androidplot-core/build.gradle +++ b/androidplot-core/build.gradle @@ -16,7 +16,7 @@ plugins { id 'com.android.library' - id 'com.dicedmelon.gradle.jacoco-android' + id 'com.mxalbert.gradle.jacoco-android' id 'maven-publish' id 'signing' } @@ -31,13 +31,14 @@ class AttrMarkdown extends DefaultTask { def input = project.file(inFile) def output = project.file(outFile) - if(output.exists()) { + if (output.exists()) { output.delete() } output.parentFile.mkdirs() - input.text.findAll(//) { match, g1 -> g1 - if(!g1.startsWith("NODOC")) { + input.text.findAll(//) { match, g1 -> + g1 + if (!g1.startsWith("NODOC")) { output.append(g1) output.append "\n\n" } @@ -53,14 +54,20 @@ class AttrMarkdown extends DefaultTask { * The generated doc will appear in / replace androidplot/docs/attrs.md */ task generateAttrsMarkdown(type: AttrMarkdown) { - inFile = { "src/main/res/values/attrs.xml"} + inFile = { "src/main/res/values/attrs.xml" } outFile = { "../docs/attrs.md" } } android { - compileSdkVersion theCompileSdkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + defaultConfig { + compileSdk theCompileSdkVersion minSdkVersion theMinSdkVersion targetSdkVersion theTargetSdkVersion testApplicationId "com.androidplot.test" @@ -77,7 +84,14 @@ android { lint { abortOnError false } + namespace 'com.androidplot' + publishing { + singleVariant("release") { + withSourcesJar() + withJavadocJar() + } + } } group = 'com.androidplot' @@ -89,44 +103,38 @@ def gitUrl = 'https://github.com/halfhp/androidplot.git' dependencies { implementation 'com.halfhp.fig:figlib:1.0.11' - implementation 'com.android.support:support-annotations:28.0.0' + implementation 'androidx.annotation:annotation:1.8.2' - testImplementation "org.mockito:mockito-core:4.0.0" + testImplementation "org.mockito:mockito-core:5.7.0" testImplementation group: 'junit', name: 'junit', version: '4.13.2' testImplementation "org.robolectric:robolectric:4.7.3" } -task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - failOnError false - options { - links "http://docs.oracle.com/javase/7/docs/api/" - linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference" - } - exclude '**/BuildConfig.java' - exclude '**/R.java' -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs -} - -javadoc { - options.overview = "src/main/java/overview.html" -} +// TODO: get javadoc working again at some point +//task javadoc(type: Javadoc) { +// source = android.sourceSets.main.java.srcDirs +// classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +// failOnError false +// options { +// links "http://docs.oracle.com/javase/7/docs/api/" +// linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference" +// } +// exclude '**/BuildConfig.java' +// exclude '**/R.java' +//} +// + + +// TODO: get javadoc working again at some point +//javadoc { +// options.overview = "src/main/java/overview.html" +//} afterEvaluate { publishing { repositories { maven { - name = "Maven Central" + name = "MavenCentral" url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" credentials { username = System.getenv("OSSRH_ACTOR") @@ -137,7 +145,6 @@ afterEvaluate { publications { release(MavenPublication) { - from components.release // You can then customize attributes of the publication as shown below. @@ -167,7 +174,6 @@ afterEvaluate { connection = gitUrl developerConnection = gitUrl url = gitUrl - } } } @@ -175,16 +181,9 @@ afterEvaluate { } } -afterEvaluate { - signing { - def signingKey = System.getenv("SIGNING_KEY") - def signingPassword = System.getenv("SIGNING_PASSWORD") - useInMemoryPgpKeys(signingKey, signingPassword) - sign publishing.publications.release - } -} - -artifacts { - archives javadocJar - archives sourcesJar +signing { + def signingKey = System.getenv("SIGNING_KEY") + def signingPassword = System.getenv("SIGNING_PASSWORD") + useInMemoryPgpKeys(signingKey, signingPassword) + sign(publishing.publications) } diff --git a/androidplot-core/src/main/AndroidManifest.xml b/androidplot-core/src/main/AndroidManifest.xml index e83183d1..3043c930 100644 --- a/androidplot-core/src/main/AndroidManifest.xml +++ b/androidplot-core/src/main/AndroidManifest.xml @@ -16,5 +16,5 @@ - + \ No newline at end of file diff --git a/androidplot-core/src/test/java/com/androidplot/PlotTest.java b/androidplot-core/src/test/java/com/androidplot/PlotTest.java index 5a750afd..9e4753bf 100644 --- a/androidplot-core/src/test/java/com/androidplot/PlotTest.java +++ b/androidplot-core/src/test/java/com/androidplot/PlotTest.java @@ -34,6 +34,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -44,7 +45,8 @@ public class PlotTest extends AndroidplotTest { @Test public void testInit_withoutAttrs() { - Plot plot = mock(Plot.class); + //Plot plot = mock(Plot.class); + Plot plot = spy(new MockPlot("MockPlot")); plot.init(RuntimeEnvironment.application, null, 0); verify(plot, times(1)).onPreInit(); @@ -53,10 +55,12 @@ public void testInit_withoutAttrs() { @Test public void testInit_withAttrs() { - Plot plot = new MockPlot("MockPlot"); + Plot plot = spy(new MockPlot("MockPlot")); AttributeSet attrs = mock(AttributeSet.class); plot.init(RuntimeEnvironment.application, attrs, 0); - // TODO: verifications + + verify(plot, times(1)).onPreInit(); + verify(plot, times(1)).onAfterConfig(); } @Test diff --git a/build.gradle b/build.gradle index 6360970f..4b5e18de 100644 --- a/build.gradle +++ b/build.gradle @@ -15,11 +15,11 @@ */ ext { - theCompileSdkVersion = 32 - theTargetSdkVersion = 32 + theCompileSdkVersion = 34 + theTargetSdkVersion = 34 theMinSdkVersion = 5 - theVersionName = '1.5.10' - theVersionCode = 226 + theVersionName = '1.5.11' + theVersionCode = 227 gitUrl = 'https://github.com/halfhp/androidplot.git' } @@ -32,8 +32,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' - classpath 'com.dicedmelon.gradle:jacoco-android:0.1.5' + classpath 'com.android.tools.build:gradle:8.5.2' + classpath 'com.mxalbert.gradle:jacoco-android:0.2.0' } } diff --git a/demoapp-wearable/build.gradle b/demoapp-wearable/build.gradle index 3bfc0ee0..666b353e 100644 --- a/demoapp-wearable/build.gradle +++ b/demoapp-wearable/build.gradle @@ -38,9 +38,10 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } + buildTypes { release { minifyEnabled false diff --git a/demoapp/build.gradle b/demoapp/build.gradle index 8c8c8d2c..2c2fbd52 100644 --- a/demoapp/build.gradle +++ b/demoapp/build.gradle @@ -15,7 +15,7 @@ */ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '2.0.0' repositories { mavenCentral() } @@ -33,15 +33,25 @@ plugins { apply plugin: 'kotlin-android' dependencies { - implementation "androidx.core:core-ktx:1.8.0" + implementation "androidx.core:core-ktx:1.13.1" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation project(':androidplot-core') - implementation 'androidx.recyclerview:recyclerview:1.2.1' + implementation 'androidx.recyclerview:recyclerview:1.3.2' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1' } +kotlin { + jvmToolchain(17) +} + android { + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + compileSdkVersion theCompileSdkVersion buildFeatures { @@ -51,7 +61,7 @@ android { defaultConfig { versionCode theVersionCode versionName theVersionName - minSdkVersion 14 + minSdkVersion 19 targetSdkVersion theTargetSdkVersion applicationId "com.androidplot.demos" } @@ -78,6 +88,7 @@ android { lint { abortOnError false } + namespace 'com.androidplot.demos' } diff --git a/demoapp/project.properties b/demoapp/project.properties index 29656f2d..90a2cb18 100644 --- a/demoapp/project.properties +++ b/demoapp/project.properties @@ -39,5 +39,3 @@ #proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt # using config with optimization enabled so that things like log statement removal will work: proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt -# Project target. -target=android-16 diff --git a/demoapp/src/main/AndroidManifest.xml b/demoapp/src/main/AndroidManifest.xml index eaf69362..5b73a2b7 100644 --- a/demoapp/src/main/AndroidManifest.xml +++ b/demoapp/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ ~ limitations under the License. --> - + diff --git a/docs/index.md b/docs/index.md index 4959db92..90a8a021 100644 --- a/docs/index.md +++ b/docs/index.md @@ -42,7 +42,9 @@ Source code examples of the various plot types. # XML Attributes A complete list of XML attributes is [available here](attrs.md). # Javadoc -The latest Javadocs are [available here](https://javadoc.io/doc/com.androidplot/androidplot-core). +Javadocs for versions through 1.5.7 are [available here](https://javadoc.io/doc/com.androidplot/androidplot-core). Due to a build issue +producing Javadocs for the latest releases has been paused. There have been very +few changes to the API since 1.5.7 so the Javadocs should still be useful in the mean time. # Release Notes Full release notes are [available here](release_notes.md) diff --git a/docs/quickstart.md b/docs/quickstart.md index 6c0878a2..3bd87c3d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -14,7 +14,7 @@ To use the library in your gradle project add the following to your build.gradle ```groovy dependencies { - implementation "com.androidplot:androidplot-core:1.5.10" + implementation "com.androidplot:androidplot-core:1.5.11" } ``` diff --git a/docs/release_notes.md b/docs/release_notes.md index e0c6cb82..50d52c11 100644 --- a/docs/release_notes.md +++ b/docs/release_notes.md @@ -2,6 +2,10 @@ For details on what to expect in general when updating to a new version of Androiplot, check out the [versioning doc](versioning.md). +# 1.5.11 +* Update project to latest gradle / build tools +* Fix issue with jetifier flagging an outdated dependency + # 1.5.10 * Update project to use latest gradle / build tools * (#114) fix `setLinesPerRangeLabel` & `setLinesPerDomainLabel` diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4bde2d74..e9defc20 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip