diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd6647f3..e54cd320 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,12 +29,11 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: '11' - distribution: 'temurin' - + distribution: "temurin" + java-version: "17" + - name: Download Dependencies run: ./gradlew androidDependencies diff --git a/app/build.gradle b/app/build.gradle index e4f93259..2aa4b699 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,33 +33,18 @@ android { abortOnError false } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - buildFeatures { viewBinding true + buildConfig true } + namespace 'org.maplibre.android.plugins.testapp' } -// Disable Leak Canary for UI and unit test. -configurations.all { config -> - if (config.name.contains('UnitTest') || config.name.contains('AndroidTest')) { - config.resolutionStrategy.eachDependency { details -> - if (details.requested.group == 'com.squareup.leakcanary' - && details.requested.name == 'leakcanary-android') { - details.useTarget(group: details.requested.group, name: 'leakcanary-android-no-op', - version: details.requested.version) - } - } - } +kotlin { + jvmToolchain(11) } dependencies { - // Kotlin - implementation dependenciesList.kotlin - // MapLibre implementation(dependenciesList.mapLibreAndroidSdk, { exclude group: 'android.arch.lifecycle' @@ -88,14 +73,14 @@ dependencies { testImplementation dependenciesList.mockito // Instrumentation testing - androidTestImplementation dependenciesList.mockitoAndroid + androidTestImplementation "org.mockito:mockito-android:5.13.0" androidTestImplementation dependenciesList.supportAppcompatV7 androidTestImplementation dependenciesList.testRunner androidTestImplementation dependenciesList.testRules androidTestImplementation dependenciesList.testEspressoCore androidTestImplementation dependenciesList.testRoom androidTestImplementation dependenciesList.testArchCore - androidTestImplementation(dependenciesList.mockitoCore, { + androidTestImplementation("org.mockito:mockito-core:5.13.0", { exclude group: 'net.bytebuddy' }) @@ -103,9 +88,7 @@ dependencies { implementation dependenciesList.timber // Leak canary - debugImplementation dependenciesList.leakCanaryDebug - releaseImplementation dependenciesList.leakCanaryRelease - testImplementation dependenciesList.leakCanaryTest + debugImplementation "com.squareup.leakcanary:leakcanary-android:2.14" // Plugin modules implementation project(':plugin-offline') diff --git a/app/src/debug/AndroidManifest.xml b/app/src/debug/AndroidManifest.xml index 80a24758..7aa196f5 100644 --- a/app/src/debug/AndroidManifest.xml +++ b/app/src/debug/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6b1c235c..21fb90f5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/app/src/main/java/org/maplibre/android/plugins/testapp/PluginApplication.kt b/app/src/main/java/org/maplibre/android/plugins/testapp/PluginApplication.kt index 66678817..8a42bd87 100644 --- a/app/src/main/java/org/maplibre/android/plugins/testapp/PluginApplication.kt +++ b/app/src/main/java/org/maplibre/android/plugins/testapp/PluginApplication.kt @@ -1,7 +1,6 @@ package org.maplibre.android.plugins.testapp import android.app.Application -import com.squareup.leakcanary.LeakCanary import org.maplibre.android.MapLibre import timber.log.Timber @@ -9,11 +8,6 @@ class PluginApplication : Application() { override fun onCreate() { super.onCreate() - if (LeakCanary.isInAnalyzerProcess(this)) { - return - } - - LeakCanary.install(this) initializeLogger() MapLibre.getInstance(this) } diff --git a/build.gradle b/build.gradle index c0dd2e39..4cde42b7 100644 --- a/build.gradle +++ b/build.gradle @@ -12,10 +12,10 @@ buildscript { } dependencies { - classpath pluginDependencies.gradle - classpath pluginDependencies.kotlin - classpath pluginDependencies.kotlinLint - classpath pluginDependencies.gradleNexus + classpath 'com.android.tools.build:gradle:8.6.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0" + classpath "org.jlleitschuh.gradle:ktlint-gradle:8.1.0" + classpath "io.github.gradle-nexus:publish-plugin:1.1.0" } } diff --git a/gradle.properties b/gradle.properties index c2dd1e35..a591f815 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,6 +25,8 @@ POM_DEVELOPER_NAME=MapLibre org.gradle.jvmargs=-Xmx2560M android.useAndroidX=true android.enableJetifier=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index b9f33c1a..4942edfe 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -3,11 +3,11 @@ androidVersions = [ minSdkVersion : 21, targetSdkVersion : 30, - compileSdkVersion: 33, + compileSdkVersion: 34, ] version = [ - mapLibreAndroidSdk : '11.0.0', + mapLibreAndroidSdk : '11.3.0', mapLibreJava : '5.9.0', mapLibreTurf : '5.9.0', playLocation : '16.0.0', @@ -18,7 +18,6 @@ constraintLayout : '1.1.2', mockito : '5.2.0', mockk : '1.9.3', - leakCanary : '1.6.3', timber : '4.7.1', testRunner : '1.0.2', espresso : '3.0.2', @@ -30,15 +29,6 @@ robolectric : '4.10.3' ] - pluginVersion = [ - checkstyle: '8.10.1', - gradle : '7.4.0', - kotlin : '1.8.10', - dokka : '0.9.17', - kotlinLint: '8.1.0', - gradleNexus: "1.1.0" - ] - dependenciesList = [ // MapLibre mapLibreAndroidSdk : "org.maplibre.gl:android-sdk:${version.mapLibreAndroidSdk}", @@ -57,7 +47,7 @@ // support supportAnnotation : 'androidx.annotation:annotation:1.0.0', - supportAppcompatV7 : 'androidx.appcompat:appcompat:1.0.0', + supportAppcompatV7 : 'androidx.appcompat:appcompat:1.7.0', supportV4 : 'androidx.legacy:legacy-support-v4:1.0.0', supportDesign : 'com.google.android.material:material:1.0.0', supportRecyclerView : 'androidx.recyclerview:recyclerview:1.0.0', @@ -72,9 +62,6 @@ // square crew timber : "com.jakewharton.timber:timber:${version.timber}", - leakCanaryDebug : "com.squareup.leakcanary:leakcanary-android:${version.leakCanary}", - leakCanaryRelease : "com.squareup.leakcanary:leakcanary-android-no-op:${version.leakCanary}", - leakCanaryTest : "com.squareup.leakcanary:leakcanary-android-no-op:${version.leakCanary}", // instrumentation test testRunner : 'androidx.test.ext:junit:1.1.1', @@ -91,16 +78,6 @@ junit : "junit:junit:${version.junit}", mockito : "org.mockito:mockito-inline:${version.mockito}", androidArchCore : 'androidx.arch.core:core-testing:2.0.0', - robolectric : "org.robolectric:robolectric:${version.robolectric}", - kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${pluginVersion.kotlin}", - ] - - pluginDependencies = [ - gradle : "com.android.tools.build:gradle:${pluginVersion.gradle}", - checkstyle: "com.puppycrawl.tools:checkstyle:${pluginVersion.checkstyle}", - kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${pluginVersion.kotlin}", - dokka : "org.jetbrains.dokka:dokka-android-gradle-plugin:${pluginVersion.dokka}", - kotlinLint: "org.jlleitschuh.gradle:ktlint-gradle:${pluginVersion.kotlinLint}", - gradleNexus: "io.github.gradle-nexus:publish-plugin:${pluginVersion.gradleNexus}" + robolectric : "org.robolectric:robolectric:${version.robolectric}" ] } diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 2d2329a2..9f7cad2c 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -13,12 +13,12 @@ task androidJavadocs(type: Javadoc) { } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'dokka' + archiveClassifier = 'dokka' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { - classifier = 'sources' + archiveClassifier = 'sources' from android.sourceSets.main.java.sourceFiles } @@ -35,7 +35,7 @@ afterEvaluate { groupId this.group artifactId project.ext.mapLibreArtifactId - from components.release + from components.findByName('release') artifact androidSourcesJar artifact androidJavadocsJar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33c..20db9ad5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/ktx-mapbox-maps/build.gradle b/ktx-mapbox-maps/build.gradle index b10be9f4..1c4b2a84 100644 --- a/ktx-mapbox-maps/build.gradle +++ b/ktx-mapbox-maps/build.gradle @@ -1,5 +1,7 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' +plugins { + id 'com.android.library' + id 'kotlin-android' +} android { compileSdkVersion androidVersions.compileSdkVersion @@ -21,20 +23,23 @@ android { testOptions { unitTests.returnDefaultValues true } + namespace 'org.maplibre.android.plugins.maps' tasks.withType(Javadoc).all { enabled = false } } +kotlin { + jvmToolchain(11) +} + dependencies { - implementation dependenciesList.kotlin implementation dependenciesList.mapLibreAndroidSdk javadocDeps dependenciesList.mapLibreAndroidSdk testImplementation dependenciesList.junit testImplementation dependenciesList.mockito testImplementation dependenciesList.robolectric - testImplementation dependenciesList.kotlin } apply from: "${rootDir}/gradle/javadoc.gradle" diff --git a/ktx-mapbox-maps/src/main/AndroidManifest.xml b/ktx-mapbox-maps/src/main/AndroidManifest.xml index 401c899d..cc947c56 100644 --- a/ktx-mapbox-maps/src/main/AndroidManifest.xml +++ b/ktx-mapbox-maps/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/plugin-annotation/README.md b/plugin-annotation/README.md index f491ed72..62242df6 100644 --- a/plugin-annotation/README.md +++ b/plugin-annotation/README.md @@ -20,16 +20,6 @@ repositories { In the app-level `build.gradle` file: ```groovy -android { - - // The Annotation Plugin requires Java 8 usage - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - -} - dependencies { implementation 'com.maplibre.maplibresdk:maplibre-android-plugin-annotation-v9:0.9.0' } diff --git a/plugin-annotation/build.gradle b/plugin-annotation/build.gradle index 5b3a76ba..fe838387 100644 --- a/plugin-annotation/build.gradle +++ b/plugin-annotation/build.gradle @@ -20,6 +20,7 @@ android { testOptions { unitTests.returnDefaultValues true } + namespace 'org.maplibre.android.plugins.annotation' } dependencies { diff --git a/plugin-annotation/scripts/annotation.java.ejs b/plugin-annotation/scripts/annotation.java.ejs index f12290f1..0fb3cffd 100644 --- a/plugin-annotation/scripts/annotation.java.ejs +++ b/plugin-annotation/scripts/annotation.java.ejs @@ -22,7 +22,7 @@ import org.maplibre.android.geometry.LatLng; import org.maplibre.android.style.layers.Property; import org.maplibre.android.style.layers.PropertyFactory; import org.maplibre.android.utils.ColorUtils; -import com.mapbox.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveDistancesObject; import org.maplibre.android.maps.Projection; import java.util.ArrayList; diff --git a/plugin-annotation/src/main/AndroidManifest.xml b/plugin-annotation/src/main/AndroidManifest.xml index 2f674dca..cc947c56 100644 --- a/plugin-annotation/src/main/AndroidManifest.xml +++ b/plugin-annotation/src/main/AndroidManifest.xml @@ -1 +1 @@ - + diff --git a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Annotation.java b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Annotation.java index ba039f02..37ea0295 100644 --- a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Annotation.java +++ b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Annotation.java @@ -4,7 +4,7 @@ import androidx.annotation.Nullable; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.mapbox.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveDistancesObject; import org.maplibre.android.maps.Projection; import org.maplibre.geojson.Geometry; diff --git a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Circle.java b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Circle.java index e0bba533..084b7341 100644 --- a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Circle.java +++ b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Circle.java @@ -17,7 +17,7 @@ import org.maplibre.android.style.layers.Property; import org.maplibre.android.style.layers.PropertyFactory; import org.maplibre.android.utils.ColorUtils; -import com.mapbox.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveDistancesObject; import org.maplibre.android.maps.Projection; import java.util.ArrayList; diff --git a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/DraggableAnnotationController.java b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/DraggableAnnotationController.java index 05950a52..97ba3e17 100644 --- a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/DraggableAnnotationController.java +++ b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/DraggableAnnotationController.java @@ -8,9 +8,9 @@ import androidx.annotation.Nullable; import androidx.annotation.UiThread; import androidx.annotation.VisibleForTesting; -import com.mapbox.android.gestures.AndroidGesturesManager; -import com.mapbox.android.gestures.MoveDistancesObject; -import com.mapbox.android.gestures.MoveGestureDetector; +import org.maplibre.android.gestures.AndroidGesturesManager; +import org.maplibre.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveGestureDetector; import org.maplibre.android.maps.MapLibreMap; import org.maplibre.android.maps.MapView; import org.maplibre.geojson.Geometry; diff --git a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Fill.java b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Fill.java index c2d45c7e..0b0534c8 100644 --- a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Fill.java +++ b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Fill.java @@ -17,7 +17,7 @@ import org.maplibre.android.style.layers.Property; import org.maplibre.android.style.layers.PropertyFactory; import org.maplibre.android.utils.ColorUtils; -import com.mapbox.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveDistancesObject; import org.maplibre.android.maps.Projection; import java.util.ArrayList; diff --git a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Line.java b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Line.java index 2ff63ce7..e830455e 100644 --- a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Line.java +++ b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Line.java @@ -17,7 +17,7 @@ import org.maplibre.android.style.layers.Property; import org.maplibre.android.style.layers.PropertyFactory; import org.maplibre.android.utils.ColorUtils; -import com.mapbox.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveDistancesObject; import org.maplibre.android.maps.Projection; import java.util.ArrayList; diff --git a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Symbol.java b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Symbol.java index aa891ecb..5505575c 100644 --- a/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Symbol.java +++ b/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/Symbol.java @@ -17,7 +17,7 @@ import org.maplibre.android.style.layers.Property; import org.maplibre.android.style.layers.PropertyFactory; import org.maplibre.android.utils.ColorUtils; -import com.mapbox.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveDistancesObject; import org.maplibre.android.maps.Projection; import java.util.ArrayList; diff --git a/plugin-annotation/src/test/java/org/maplibre/android/plugins/annotation/DraggableAnnotationControllerTest.java b/plugin-annotation/src/test/java/org/maplibre/android/plugins/annotation/DraggableAnnotationControllerTest.java index 79f4cf93..61c8d235 100644 --- a/plugin-annotation/src/test/java/org/maplibre/android/plugins/annotation/DraggableAnnotationControllerTest.java +++ b/plugin-annotation/src/test/java/org/maplibre/android/plugins/annotation/DraggableAnnotationControllerTest.java @@ -1,9 +1,9 @@ package org.maplibre.android.plugins.annotation; import android.graphics.PointF; -import com.mapbox.android.gestures.AndroidGesturesManager; -import com.mapbox.android.gestures.MoveDistancesObject; -import com.mapbox.android.gestures.MoveGestureDetector; +import org.maplibre.android.gestures.AndroidGesturesManager; +import org.maplibre.android.gestures.MoveDistancesObject; +import org.maplibre.android.gestures.MoveGestureDetector; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/plugin-building/build.gradle b/plugin-building/build.gradle index fba202f9..2c9b171f 100644 --- a/plugin-building/build.gradle +++ b/plugin-building/build.gradle @@ -16,6 +16,7 @@ android { lintOptions { abortOnError false } + namespace 'org.maplibre.android.plugins.building' } dependencies { diff --git a/plugin-building/src/main/AndroidManifest.xml b/plugin-building/src/main/AndroidManifest.xml index 4131c852..568741e5 100644 --- a/plugin-building/src/main/AndroidManifest.xml +++ b/plugin-building/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/plugin-localization/build.gradle b/plugin-localization/build.gradle index 4effdc58..bdf153ab 100644 --- a/plugin-localization/build.gradle +++ b/plugin-localization/build.gradle @@ -16,6 +16,7 @@ android { lintOptions { abortOnError false } + namespace 'org.maplibre.android.plugins.localization' } dependencies { diff --git a/plugin-localization/src/main/AndroidManifest.xml b/plugin-localization/src/main/AndroidManifest.xml index 73e7e565..568741e5 100644 --- a/plugin-localization/src/main/AndroidManifest.xml +++ b/plugin-localization/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/plugin-markerview/build.gradle b/plugin-markerview/build.gradle index db4f2333..0fec3c41 100644 --- a/plugin-markerview/build.gradle +++ b/plugin-markerview/build.gradle @@ -20,6 +20,7 @@ android { testOptions { unitTests.returnDefaultValues true } + namespace 'org.maplibre.android.plugins.markerview' } dependencies { diff --git a/plugin-markerview/src/main/AndroidManifest.xml b/plugin-markerview/src/main/AndroidManifest.xml index 36ca68fa..97330b77 100644 --- a/plugin-markerview/src/main/AndroidManifest.xml +++ b/plugin-markerview/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/plugin-offline/build.gradle b/plugin-offline/build.gradle index 97cd2aa9..78bb64f2 100644 --- a/plugin-offline/build.gradle +++ b/plugin-offline/build.gradle @@ -20,6 +20,7 @@ android { // Avoid naming conflicts resourcePrefix 'maplibre_' + namespace 'org.maplibre.android.plugins.offline' } dependencies { diff --git a/plugin-offline/src/main/AndroidManifest.xml b/plugin-offline/src/main/AndroidManifest.xml index 36b3321c..9708e145 100644 --- a/plugin-offline/src/main/AndroidManifest.xml +++ b/plugin-offline/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + \ No newline at end of file + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index b5b13d71..4f4ad8ff 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,7 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' +} + include ':app' include ':plugin-building' include ':plugin-offline'