-
Notifications
You must be signed in to change notification settings - Fork 8
chore: add support to customize ios and android sdk versions #4
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -122,10 +122,33 @@ repositories { | |
|
|
||
| def kotlin_version = getExtOrDefault("kotlinVersion") | ||
|
|
||
| def getRiveAndroidVersion() { | ||
| if (rootProject.ext.has('RiveRuntimeAndroidVersion')) { | ||
|
Contributor
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. When/how will this be set? Should we document this option as well? I see on iOS we also have an environment option. Does Android need the same?
Collaborator
Author
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. I've looked into various libraries, some use this ext method some env variables. Not sure we need all 3. What do you think?
Contributor
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. No, I also don't think we need all the options. But is there then an argument to remove the option completely. Instead of just not documenting? |
||
| return rootProject.ext.get('RiveRuntimeAndroidVersion') | ||
| } | ||
|
|
||
| if (project.hasProperty('Rive_RiveRuntimeAndroidVersion')) { | ||
| return project.property('Rive_RiveRuntimeAndroidVersion') | ||
| } | ||
|
|
||
| def packageJson = file("${projectDir}/../package.json") | ||
| if (packageJson.exists()) { | ||
| def json = new groovy.json.JsonSlurper().parseText(packageJson.text) | ||
| if (json.runtimeVersions?.android) { | ||
| return json.runtimeVersions.android | ||
| } | ||
| } | ||
|
|
||
| throw new GradleException("Failed to determine Rive Android SDK version. Please ensure package.json contains 'runtimeVersions.android'") | ||
| } | ||
|
|
||
| def riveAndroidVersion = getRiveAndroidVersion() | ||
| println "react-native-rive: Rive Android SDK ${riveAndroidVersion}" | ||
|
|
||
| dependencies { | ||
| implementation "com.facebook.react:react-android" | ||
| implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
| implementation 'app.rive:rive-android:10.5.0' | ||
| implementation "app.rive:rive-android:${riveAndroidVersion}" | ||
| implementation "androidx.startup:startup-runtime:1.2.0" | ||
| implementation project(":react-native-nitro-modules") | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,10 @@ | |
| "url": "https://github.com/rive-app/rive-nitro-react-native/issues" | ||
| }, | ||
| "homepage": "https://github.com/rive-app/rive-nitro-react-native#readme", | ||
| "runtimeVersions": { | ||
|
Contributor
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. So nice |
||
| "ios": "6.12.0", | ||
| "android": "10.5.0" | ||
| }, | ||
| "publishConfig": { | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
|
|
||
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.
Should we document the environment option as well?
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.
Or alternatively simplify and only support one option (for now)