Skip to content

Commit 589770c

Browse files
committed
add code to update to sdk 51
1 parent 85e0967 commit 589770c

38 files changed

+2640
-1572
lines changed

.changeset/fair-taxis-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@balloman/expo-google-maps": major
3+
---
4+
5+
Initial Release and support for sdk 51

android/build.gradle

Lines changed: 26 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,55 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
3-
apply plugin: 'maven-publish'
42

5-
group = 'expo.modules.googlemaps'
6-
version = '0.1.0'
3+
group = 'com.balloman.expo.googlemaps'
4+
version = '1.0.0'
75

8-
buildscript {
9-
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10-
if (expoModulesCorePlugin.exists()) {
11-
apply from: expoModulesCorePlugin
12-
applyKotlinExpoModulesCorePlugin()
13-
}
14-
15-
// Simple helper that allows the root project to override versions declared by this library.
16-
ext.safeExtGet = { prop, fallback ->
17-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18-
}
6+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7+
apply from: expoModulesCorePlugin
8+
applyKotlinExpoModulesCorePlugin()
9+
useCoreDependencies()
10+
useExpoPublishing()
1911

20-
// Ensures backward compatibility
21-
ext.getKotlinVersion = {
22-
if (ext.has("kotlinVersion")) {
23-
ext.kotlinVersion()
24-
} else {
25-
ext.safeExtGet("kotlinVersion", "1.8.21")
26-
}
27-
}
12+
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
13+
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
14+
// Most of the time, you may like to manage the Android SDK versions yourself.
2815

29-
repositories {
30-
mavenCentral()
31-
}
32-
33-
dependencies {
34-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
35-
}
36-
}
16+
def useManagedAndroidSDKVersions = true
3717

38-
afterEvaluate {
39-
publishing {
40-
publications {
41-
release(MavenPublication) {
42-
from components.release
43-
}
18+
if (useManagedAndroidSDKVersions) {
19+
useDefaultAndroidSdkVersions()
20+
} else {
21+
buildscript {
22+
// Simple helper that allows the root project to override versions declared by this library.
23+
ext.safeExtGet = { prop, fallback ->
24+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
4425
}
45-
repositories {
46-
maven {
47-
url = mavenLocal().url
48-
}
26+
}
27+
project.android {
28+
compileSdkVersion safeExtGet("compileSdkVersion", 34)
29+
defaultConfig {
30+
minSdkVersion safeExtGet("minSdkVersion", 23)
31+
targetSdkVersion safeExtGet("targetSdkVersion", 34)
4932
}
5033
}
5134
}
5235

5336
android {
54-
compileSdkVersion safeExtGet("compileSdkVersion", 34)
55-
compileSdk(34)
56-
57-
compileOptions {
58-
sourceCompatibility JavaVersion.VERSION_17
59-
targetCompatibility JavaVersion.VERSION_17
60-
}
61-
62-
kotlinOptions {
63-
jvmTarget = JavaVersion.VERSION_17.majorVersion
64-
}
65-
66-
namespace "expo.modules.googlemaps"
37+
namespace "com.balloman.expo.googlemaps"
6738
defaultConfig {
68-
minSdkVersion safeExtGet("minSdkVersion", 23)
69-
targetSdkVersion safeExtGet("targetSdkVersion", 34)
7039
versionCode 1
71-
versionName "0.1.0"
40+
versionName "1.0.0"
7241
}
7342
lintOptions {
7443
abortOnError false
7544
}
76-
publishing {
77-
singleVariant("release") {
78-
withSourcesJar()
79-
}
80-
}
8145
}
8246

8347
repositories {
8448
mavenCentral()
8549
}
8650

8751
dependencies {
88-
implementation project(':expo-modules-core')
8952
implementation "com.facebook.react:react-native:0.20.1"
90-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
9153
implementation "com.google.android.gms:play-services-maps:18.2.0"
9254
implementation 'androidx.appcompat:appcompat:1.6.1'
9355
implementation 'com.google.maps.android:android-maps-utils:3.8.0'

android/src/main/java/expo/modules/googlemaps/ExpoGoogleMapsModule.kt renamed to android/src/main/java/com/balloman/expo/googlemaps/ExpoGoogleMapsModule.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package expo.modules.googlemaps
1+
package com.balloman.expo.googlemaps
22

33
import android.annotation.SuppressLint
44
import android.util.Log
55
import com.google.android.gms.maps.CameraUpdateFactory
66
import com.google.android.gms.maps.model.MapStyleOptions
7-
import expo.modules.googlemaps.views.ExpoMapView
8-
import expo.modules.googlemaps.views.ExpoMarkerView
7+
import com.balloman.expo.googlemaps.views.ExpoMapView
8+
import com.balloman.expo.googlemaps.views.ExpoMarkerView
99
import expo.modules.kotlin.modules.Module
1010
import expo.modules.kotlin.modules.ModuleDefinition
1111
import kotlin.math.roundToInt

android/src/main/java/expo/modules/googlemaps/ExpoGoogleMapsPackage.kt renamed to android/src/main/java/com/balloman/expo/googlemaps/ExpoGoogleMapsPackage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expo.modules.googlemaps
1+
package com.balloman.expo.googlemaps
22

33
import android.content.Context
44
import expo.modules.core.interfaces.Package

android/src/main/java/expo/modules/googlemaps/ExpoGoogleMapsReactActivityLifecycleListener.kt renamed to android/src/main/java/com/balloman/expo/googlemaps/ExpoGoogleMapsReactActivityLifecycleListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package expo.modules.googlemaps
1+
package com.balloman.expo.googlemaps
22

33
import android.app.Activity
44
import expo.modules.core.interfaces.ReactActivityLifecycleListener
5-
import expo.modules.googlemaps.views.ExpoMapView
5+
import com.balloman.expo.googlemaps.views.ExpoMapView
66

77
class ExpoGoogleMapsReactActivityLifecycleListener : ReactActivityLifecycleListener {
88
override fun onPause(activity: Activity?) {

android/src/main/java/expo/modules/googlemaps/ExpoGoogleMapsTypes.kt renamed to android/src/main/java/com/balloman/expo/googlemaps/ExpoGoogleMapsTypes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expo.modules.googlemaps
1+
package com.balloman.expo.googlemaps
22

33
import com.google.android.gms.maps.model.CameraPosition
44
import com.google.android.gms.maps.model.LatLng

android/src/main/java/expo/modules/googlemaps/views/ExpoMapView.kt renamed to android/src/main/java/com/balloman/expo/googlemaps/views/ExpoMapView.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expo.modules.googlemaps.views
1+
package com.balloman.expo.googlemaps.views
22

33
import android.annotation.SuppressLint
44
import android.content.Context
@@ -18,9 +18,9 @@ import com.google.android.gms.maps.model.MapStyleOptions
1818
import com.google.android.gms.maps.model.Marker
1919
import com.google.android.gms.maps.model.Polygon
2020
import com.google.android.gms.maps.model.PolygonOptions
21-
import expo.modules.googlemaps.AnimateOptions
22-
import expo.modules.googlemaps.Camera
23-
import expo.modules.googlemaps.PolygonRecord
21+
import com.balloman.expo.googlemaps.AnimateOptions
22+
import com.balloman.expo.googlemaps.Camera
23+
import com.balloman.expo.googlemaps.PolygonRecord
2424
import expo.modules.kotlin.AppContext
2525
import expo.modules.kotlin.viewevent.EventDispatcher
2626
import expo.modules.kotlin.views.ExpoView

android/src/main/java/expo/modules/googlemaps/views/ExpoMarkerView.kt renamed to android/src/main/java/com/balloman/expo/googlemaps/views/ExpoMarkerView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expo.modules.googlemaps.views
1+
package com.balloman.expo.googlemaps.views
22

33
import android.annotation.SuppressLint
44
import android.content.Context
@@ -9,7 +9,7 @@ import androidx.core.view.isVisible
99
import com.google.android.gms.maps.model.BitmapDescriptorFactory
1010
import com.google.android.gms.maps.model.Marker
1111
import com.google.android.gms.maps.model.MarkerOptions
12-
import expo.modules.googlemaps.MarkerRecord
12+
import com.balloman.expo.googlemaps.MarkerRecord
1313
import expo.modules.kotlin.AppContext
1414
import expo.modules.kotlin.viewevent.EventDispatcher
1515
import expo.modules.kotlin.views.ExpoView

example/.env.local.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
API_KEY=YOUR_API_KEY
1+
EXPO_PUBLIC_API_KEY=YOUR_API_KEY

example/android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build/
1010
local.properties
1111
*.iml
1212
*.hprof
13+
.cxx/
1314

1415
# Bundle artifacts
1516
*.jsbundle

0 commit comments

Comments
 (0)