-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ferrostar support for Expo Modules & React Native (Android only for now) #394
Changes from all commits
08c84d4
68c2356
4e03eaa
233d947
5ef5d78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['universe/native', 'universe/web'], | ||
ignorePatterns: ['build'], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
android/build | ||
android/gradle | ||
|
||
/node_modules/ | ||
|
||
android/local.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Exclude all top-level hidden directories by convention | ||
/.*/ | ||
|
||
# Exclude tarballs generated by `npm pack` | ||
/*.tgz | ||
|
||
__mocks__ | ||
__tests__ | ||
|
||
/babel.config.js | ||
/android/src/androidTest/ | ||
/android/src/test/ | ||
/android/build/ | ||
/example/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Expo Ferrostar | ||
|
||
This library is still in development and is not ready for production use. | ||
|
||
## Status | ||
|
||
- [x] Ferrostar Core Android Implementation | ||
- [x] Ferrostar View Android Implementation | ||
- [ ] Ferrostar Core iOS Implementation | ||
- [ ] Ferrostar View iOS Implementation | ||
- [ ] Documentation | ||
|
||
This is a library for using [Ferrostar](https://github.com/stadiamaps/ferrostar) navigation library for [Expo](https://expo.dev/). | ||
|
||
## Installation | ||
|
||
```sh | ||
expo install expo-ferrostar | ||
``` | ||
|
||
## Simple Usage | ||
|
||
```tsx | ||
import { Ferrostar } from "expo-ferrostar"; | ||
|
||
export default function App() { | ||
return ( | ||
<SafeAreaView style={styles.container}> | ||
<Ferrostar style={{ flex: 1, width: "100%" }} /> | ||
</SafeAreaView> | ||
); | ||
} | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
group = 'expo.modules.ferrostar' | ||
version = '0.6.0' | ||
|
||
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle") | ||
apply from: expoModulesCorePlugin | ||
applyKotlinExpoModulesCorePlugin() | ||
useCoreDependencies() | ||
useExpoPublishing() | ||
|
||
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true. | ||
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code. | ||
// Most of the time, you may like to manage the Android SDK versions yourself. | ||
buildscript { | ||
ext.kotlin_version = '1.9.24' | ||
// Simple helper that allows the root project to override versions declared by this library. | ||
ext.safeExtGet = { prop, fallback -> | ||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback | ||
} | ||
repositories { | ||
google() | ||
mavenCentral() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:8.3.2' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
project.android { | ||
compileSdkVersion safeExtGet("compileSdkVersion", 34) | ||
defaultConfig { | ||
minSdkVersion safeExtGet("minSdkVersion", 26) | ||
targetSdkVersion safeExtGet("targetSdkVersion", 34) | ||
} | ||
} | ||
|
||
android { | ||
// Enables Compose functionality | ||
buildFeatures { | ||
compose true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion '1.5.14' | ||
} | ||
|
||
namespace "expo.modules.ferrostar" | ||
defaultConfig { | ||
versionCode 1 | ||
versionName "0.6.0" | ||
} | ||
compileOptions { | ||
coreLibraryDesugaringEnabled true | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
dependencies { | ||
// Desugar | ||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.2' | ||
|
||
// Importing Jetpack Compose | ||
def composeBom = platform("androidx.compose:compose-bom:2024.11.00") | ||
implementation composeBom | ||
androidTestImplementation composeBom | ||
|
||
implementation "androidx.compose.ui:ui" | ||
implementation "androidx.compose.ui:ui-graphics" | ||
implementation "androidx.compose.material3:material3" | ||
implementation "androidx.activity:activity-compose" | ||
|
||
// Ferrostar | ||
def ferrostarVersion = '0.23.0' | ||
implementation "com.stadiamaps.ferrostar:core:${ferrostarVersion}" | ||
Comment on lines
+75
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to figure out how to either ensure this is synced with the other projects ( Can we reference the main Android gradle workspace? Can we reference its |
||
implementation "com.stadiamaps.ferrostar:maplibreui:${ferrostarVersion}" | ||
implementation "com.stadiamaps.ferrostar:composeui:${ferrostarVersion}" | ||
|
||
// Optional - if using Google Play Service's FusedLocation | ||
implementation "com.stadiamaps.ferrostar:google-play-services:${ferrostarVersion}" | ||
implementation "com.google.android.gms:play-services-location:21.3.0" | ||
|
||
// okhttp3 | ||
implementation platform("com.squareup.okhttp3:okhttp-bom:4.12.0") | ||
implementation 'com.squareup.okhttp3:okhttp' | ||
|
||
implementation "androidx.compose.ui:ui-tooling-preview" | ||
debugImplementation "androidx.compose.ui:ui-tooling" | ||
|
||
// React Native | ||
implementation "com.facebook.react:react-native:+" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can delete this per the review call. |
||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD whether this is actually required.