Skip to content

Commit

Permalink
chore: fix tutorial builds
Browse files Browse the repository at this point in the history
  • Loading branch information
wangela committed Oct 29, 2023
1 parent 652aaa2 commit ae1bfa8
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 52 deletions.
9 changes: 6 additions & 3 deletions tutorials/java/MapWithMarker/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ plugins {
}

android {
compileSdkVersion 33
compileSdk 33
defaultConfig {
applicationId "com.example.mapwithmarker"
minSdkVersion 19
targetSdkVersion 33
minSdk 19
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildFeatures {
buildConfig = true
}
buildTypes {
release {
minifyEnabled false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapwithmarker">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
11 changes: 7 additions & 4 deletions tutorials/java/Polygons/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ plugins {
}

android {
compileSdkVersion 33
compileSdk 33
defaultConfig {
applicationId "com.example.polygons"
minSdkVersion 19
targetSdkVersion 33
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildFeatures {
buildConfig = true
}
buildTypes {
release {
minifyEnabled false
Expand All @@ -25,7 +28,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
3 changes: 1 addition & 2 deletions tutorials/java/Polygons/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.polygons">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
45 changes: 24 additions & 21 deletions tutorials/java/StyledMap/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
apply plugin: 'com.android.application'

// Set the properties within `local.properties` into a `Properties` class so
// that values within `local.properties` (e.g. Maps API key) are accessible in
// this file.
Properties properties = new Properties()
if (rootProject.file("local.properties").exists()) {
properties.load(rootProject.file("local.properties").newDataInputStream())
plugins {
id 'com.android.application'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}
def mapsApiKey = properties.getProperty("MAPS_API_KEY", "")

android {
compileSdkVersion 33
compileSdk 33
defaultConfig {
applicationId "com.example.styledmap"
minSdkVersion 19
targetSdkVersion 33
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

// Read the API key from local.properties into R.string.maps_api_key
resValue "string", "maps_api_key", mapsApiKey

// To add your Maps API key to this project:
// 1. Open the root project's local.properties file
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
}
buildFeatures {
buildConfig = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
namespace "com.example.styledmap"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

secrets {
// Optionally specify a different file name containing your secrets.
// The plugin defaults to "local.properties"
propertiesFileName = "secrets.properties"

// A properties file containing default secret values. This file can be
// checked in version control.
defaultPropertiesFileName = 'local.defaults.properties'
}
5 changes: 2 additions & 3 deletions tutorials/java/StyledMap/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.styledmap">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -34,7 +33,7 @@
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/maps_api_key" />
android:value="${MAPS_API_KEY}" />

<activity android:name=".MapsActivityRaw"
android:exported="true"
Expand Down
1 change: 1 addition & 0 deletions tutorials/java/StyledMap/local.defaults.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAPS_API_KEY=STUB_API_KEY
15 changes: 11 additions & 4 deletions tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ plugins {
}

android {
compileSdkVersion 33
compileSdk 33
defaultConfig {
applicationId "com.example.currentplacedetailsonmap"
minSdkVersion 21
targetSdkVersion 33
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildFeatures {
buildConfig = true
}
buildTypes {
debug {
debuggable true
Expand All @@ -23,6 +26,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
namespace 'com.example.currentplacedetailsonmap'
}

Expand All @@ -42,10 +49,10 @@ dependencies {
}

secrets {
defaultPropertiesFileName 'local.defaults.properties'
// To add your Maps API key to this project:
// 1. Open the root project's local.properties file
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
defaultPropertiesFileName 'local.defaults.properties'
}

16 changes: 11 additions & 5 deletions tutorials/kotlin/MapWithMarker/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ plugins {
}

android {
compileSdkVersion 33
buildToolsVersion "30.0.3"
compileSdk 33
defaultConfig {
applicationId "com.example.mapwithmarker"
minSdkVersion 19
targetSdkVersion 33
minSdk 19
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildFeatures {
buildConfig = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
namespace "com.example.mapwithmarker"
}

Expand All @@ -38,9 +44,9 @@ dependencies {
}

secrets {
defaultPropertiesFileName 'local.defaults.properties'
// To add your Maps API key to this project:
// 1. Open the root project's local.properties file
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
defaultPropertiesFileName 'local.defaults.properties'
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapwithmarker">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
15 changes: 11 additions & 4 deletions tutorials/kotlin/Polygons/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@ plugins {
}

android {
compileSdkVersion 33
compileSdk 33
defaultConfig {
applicationId "com.example.polygons"
minSdkVersion 19
targetSdkVersion 33
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildFeatures {
buildConfig = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
namespace "com.example.polygons"
}

Expand All @@ -35,9 +42,9 @@ dependencies {
}

secrets {
defaultPropertiesFileName 'local.defaults.properties'
// To add your Maps API key to this project:
// 1. Open the root project's local.properties file
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
defaultPropertiesFileName 'local.defaults.properties'
}
3 changes: 1 addition & 2 deletions tutorials/kotlin/Polygons/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.polygons">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down

0 comments on commit ae1bfa8

Please sign in to comment.