Skip to content

Commit

Permalink
feat: support Expo SDK 51 (#59)
Browse files Browse the repository at this point in the history
* Bump to expo 51

* fix gradle build

* update gradle build

* fix deps / fix gradle build
  • Loading branch information
achorein authored May 9, 2024
1 parent dbd538a commit 5a6994a
Show file tree
Hide file tree
Showing 10 changed files with 6,715 additions and 6,279 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Ensure you use versions that work together

| Expo | Supported `expo-share-intent` version |
| ---------- | ------------------------------------- |
| **SDK 51** | 2.0+ |
| **SDK 50** | 1.0+ |
| **SDK 49** | 0.2+ |

Expand Down
96 changes: 10 additions & 86 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,107 +1,31 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

group = 'expo.modules.shareintent'
version = '0.1.0'
version = '2.0.0'

def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
if (expoModulesCorePlugin.exists()) {
apply from: expoModulesCorePlugin
applyKotlinExpoModulesCorePlugin()
// Remove this check, but keep the contents after SDK49 support is dropped
if (safeExtGet("expoProvidesDefaultConfig", false)) {
useExpoPublishing()
useCoreDependencies()
}
}

apply from: expoModulesCorePlugin
applyKotlinExpoModulesCorePlugin()
useExpoPublishing()
useCoreDependencies()
// use the managed Android SDK versions from expo-modules-core
useDefaultAndroidSdkVersions()

buildscript {
// 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
}

// Ensures backward compatibility
ext.getKotlinVersion = {
if (ext.has("kotlinVersion")) {
ext.kotlinVersion()
} else {
ext.safeExtGet("kotlinVersion", "1.8.10")
}
}

repositories {
mavenCentral()
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
}
}

// Remove this if and it's contents, when support for SDK49 is dropped
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
repositories {
maven {
url = mavenLocal().url
}
}
}
}
}

android {
// Remove this if and it's contents, when support for SDK49 is dropped
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
compileSdkVersion safeExtGet("compileSdkVersion", 34)

defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 23)
targetSdkVersion safeExtGet("targetSdkVersion", 34)
}

publishing {
singleVariant("release") {
withSourcesJar()
}
}

lintOptions {
abortOnError false
}
}

def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
}
}

namespace "expo.modules.shareintent"
namespace "${group}"
defaultConfig {
versionCode 1
versionName "0.1.0"
}
}

dependencies {
// Remove this if and it's contents, when support for SDK49 is dropped
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
versionName "${version}"
}
}
18 changes: 9 additions & 9 deletions example/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
"postinstall": "patch-package"
},
"dependencies": {
"expo": "~50.0.17",
"expo-dev-client": "~3.3.11",
"expo-splash-screen": "~0.26.5",
"expo-status-bar": "~1.11.1",
"expo-updates": "~0.24.12",
"expo": "~51.0.2",
"expo-dev-client": "~4.0.13",
"expo-splash-screen": "~0.27.4",
"expo-status-bar": "~1.12.1",
"expo-updates": "~0.25.11",
"patch-package": "^8.0.0",
"react": "18.2.0",
"react-native": "0.73.6"
"react-native": "0.74.1"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.45",
"@babel/core": "^7.24.0",
"@types/react": "~18.2.79",
"babel-plugin-module-resolver": "^5.0.0",
"eslint": "^8.50.0",
"eslint-config-universe": "^12.0.0",
"prettier": "^3.0.3",
"typescript": "^5.3.0"
"typescript": "~5.3.3"
},
"private": true,
"expo": {
Expand Down
Loading

0 comments on commit 5a6994a

Please sign in to comment.