Skip to content

Commit

Permalink
fix!: updated Gradle version, plugins and libraries (#212)
Browse files Browse the repository at this point in the history
* BREAKING CHANGE: remove v3 beta

* chore: updated docs

* chore: updated Gradle version, plugins and libraries

* feat: updated Kotlin and dokka

* chore: removed deprecated method
  • Loading branch information
kikoso authored Sep 26, 2023
1 parent ca9b017 commit d622499
Show file tree
Hide file tree
Showing 27 changed files with 255 additions and 438 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ jobs:
echo "Creating tar for generated docs"
cd $GITHUB_WORKSPACE/maps-utils-ktx/build/documentation && tar cvf ~/maps-utils-docs.tar .
cd $GITHUB_WORKSPACE/maps-ktx/build/documentation && tar cvf ~/maps-docs.tar .
cd $GITHUB_WORKSPACE/maps-v3-ktx/build/documentation && tar cvf ~/maps-v3-docs.tar .
cd $GITHUB_WORKSPACE/maps-utils-v3-ktx/build/documentation && tar cvf ~/maps-utils-v3-docs.tar .
echo "Unpacking tar into gh-pages branch"
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
cd $GITHUB_WORKSPACE && git checkout gh-pages && tar xvf ~/maps-docs.tar && tar xvf ~/maps-utils-docs.tar && tar xvf ~/maps-v3-docs.tar && tar xvf ~/maps-utils-v3-docs.tar
cd $GITHUB_WORKSPACE && git checkout gh-pages && tar xvf ~/maps-docs.tar && tar xvf ~/maps-utils-docs.tar
# Commit changes and create a PR
- name: PR Changes
Expand Down
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,6 @@ dependencies {
// KTX for the Maps SDK for Android Utility Library
implementation 'com.google.maps.android:maps-utils-ktx:3.4.0'
// It is recommended to also include the latest Maps SDK and/or Utility Library versions
// as well to ensure that you have the latest features and bug fixes.
implementation 'com.google.android.gms:play-services-maps:<latest-version>'
implementation 'com.google.maps.android:android-maps-utils:<latest-version>'
}
```

(**Deprecated**) ~Alternatively, if you are using the Maps SDK through the standalone V3 BETA distribution:~

```groovy
dependencies {
// KTX for the Maps SDK for Android V3 BETA Library
implementation 'com.google.maps.android:maps-v3-ktx:3.4.0'
// KTX for the Maps SDK for Android V3 BETA Utility Library
implementation 'com.google.maps.android:maps-utils-v3-ktx:3.4.0'
// It is recommended to also include the latest Maps SDK and/or Utility Library versions
// as well to ensure that you have the latest features and bug fixes.
implementation 'com.google.android.libraries.maps:maps:3.4.0-beta'
implementation 'com.google.maps.android:android-maps-utils-v3:<latest-version>'
}
```

Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020 Google Inc.
* Copyright 2023 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,11 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.android.secrets-gradle-plugin' version '1.1.0'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}

android {
compileSdkVersion versions.android.compileSdk
buildToolsVersion versions.android.buildTools
compileSdk versions.android.compileSdk

defaultConfig {
applicationId "com.google.maps.android.ktx.demo"
Expand All @@ -47,6 +46,7 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
namespace 'com.google.maps.android.ktx.demo'
}

// [START maps_android_utils_ktx_install_snippet]
Expand All @@ -58,7 +58,7 @@ dependencies {
implementation deps.androidx.coreKtx
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
// implementation 'com.google.maps.android:maps-ktx:3.0.1'
// implementation 'com.google.maps.android:maps-ktx:3.4.0'
implementation project(':maps-ktx')
// implementation project(':maps-utils-ktx')
// [END_EXCLUDE]
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.maps.android.ktx.demo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -11,7 +10,8 @@
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
83 changes: 30 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020 Google Inc.
* Copyright 2023 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,12 +17,12 @@
buildscript {
ext.versions = [
'android' : [
"buildTools": "29.0.3",
"compileSdk": 31,
"buildTools": "30.0.3",
"compileSdk": 34,
"minSdk" : 19,
"targetSdk" : 31
"targetSdk" : 34
],
'androidMapsUtils' : '2.2.3',
'androidMapsUtils' : '3.5.3',
'androidx' : [
'appcompat': '1.1.0',
'coreKtx' : '1.2.0',
Expand All @@ -31,19 +31,17 @@ buildscript {
'junit' : '1.1.1',
],
'junit' : '4.12',
'kotlin' : '1.6.10',
'kotlin' : '1.8.21',
'kotlinxCoroutines': '1.6.0',
'mapsBeta' : '3.1.0-beta',
'mockito' : '3.0.0',
'mockitoKotlin' : '2.2.0',
'playServices' : '18.0.0',
'playServices' : '18.1.0',
'volley' : '1.2.0',
]

ext.deps = [
'androidMapsUtils' : [
'gms': "com.google.maps.android:android-maps-utils:$versions.androidMapsUtils",
'v3' : "com.google.maps.android:android-maps-utils-v3:$versions.androidMapsUtils"
'gms': "com.google.maps.android:android-maps-utils:$versions.androidMapsUtils"
],
'androidx' : [
'appcompat': "androidx.appcompat:appcompat:$versions.androidx.appcompat",
Expand All @@ -65,23 +63,22 @@ buildscript {
]

repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.10.1'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.9.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath 'com.hiya:jacoco-android:0.2'
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
}
}

ext.projectArtifactId = { project ->
if (project.name == 'maps-utils-ktx' ||
project.name == 'maps-ktx' ||
project.name == 'maps-v3-ktx' ||
project.name == 'maps-utils-v3-ktx') {
project.name == 'maps-ktx') {
return project.name
} else {
return null
Expand Down Expand Up @@ -118,15 +115,16 @@ subprojects { project ->
apply plugin: 'signing'

// Documentation
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/documentation"
configuration {
includeNonPublic = false
skipEmptyPackages = true
skipDeprecated = true
reportUndocumented = true
jdkVersion = 8
tasks.named("dokkaHtml") {
outputDirectory.set(file("${buildDir}/documentation"))
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
jdkVersion.set(8)
skipEmptyPackages.set(true)
reportUndocumented.set(true)
displayName.set("JVM")
}
}
}

Expand All @@ -135,18 +133,20 @@ subprojects { project ->
toolVersion = "0.8.7"
}

tasks.withType(Test) {

tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}

task sourcesJar(type: Jar) {
tasks.register('sourcesJar', Jar) {
from android.sourceSets.main.java.source
archiveClassifier = "sources"
}

task dokkaJar(type: Jar, dependsOn: dokka) {
from dokka.outputDirectory
tasks.register('dokkaJar', Jar) {
dependsOn dokkaHtml
from dokkaHtml.outputDirectory
archiveClassifier = "javadoc"
}

Expand Down Expand Up @@ -223,30 +223,7 @@ subprojects { project ->
}


task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}

/**
* This task will copy all of the source code in this module into the `maps-v3-ktx` module
* and change its imports from the Maps SDK on Play Services to the Standalone V3 Beta Maps SDK.
*/
task copyGmsToV3Beta(type: Copy) {
from 'maps-ktx/src'
into 'maps-v3-ktx/src'
filter { line ->
line.replace('com.google.android.gms.maps', 'com.google.android.libraries.maps')
}
}

/**
* This task will copy all of the source code in this module into the `maps-v3-ktx` module
* and change its imports from the Maps SDK on Play Services to the Standalone V3 Beta Maps SDK.
*/
task copyGmsUtilsToV3Beta(type: Copy) {
from 'maps-utils-ktx/src'
into 'maps-utils-v3-ktx/src'
filter { line ->
line.replace('com.google.android.gms.maps', 'com.google.android.libraries.maps')
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 27 13:34:12 PST 2021
#Fri Sep 15 07:45:22 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
Loading

0 comments on commit d622499

Please sign in to comment.