-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[go] add android sdk49 versioned code (expo#23110)
# Why for sdk 49 # How - [go] add android sdk 49 versioned code - [tools] minor fix for android versioning # Test Plan ci passed
- Loading branch information
Showing
1,963 changed files
with
226,020 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"sdkVersions":["47.0.0","48.0.0"]} | ||
{"sdkVersions":["47.0.0","48.0.0","49.0.0"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 152 additions & 0 deletions
152
android/vendored/sdk49/@react-native-async-storage/async-storage/android/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
import java.nio.file.Paths | ||
|
||
def resolveModulePath(packageName) { | ||
def basePath = rootDir.toPath().normalize() | ||
|
||
// Node's module resolution algorithm searches up to the root directory, | ||
// after which the base path will be null | ||
while (basePath) { | ||
def candidatePath = Paths.get(basePath.toString(), 'node_modules', packageName) | ||
if (candidatePath.toFile().exists()) { | ||
return candidatePath.toString() | ||
} | ||
|
||
basePath = basePath.getParent() | ||
} | ||
|
||
return null | ||
} | ||
|
||
def safeExtGet(prop, fallback) { | ||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback | ||
} | ||
|
||
def getFlagOrDefault(flagName, defaultValue) { | ||
rootProject.hasProperty(flagName) ? rootProject.properties[flagName] == "true" : defaultValue | ||
} | ||
|
||
def getVersionOrDefault(String flagName, String defaultVersion) { | ||
rootProject.hasProperty(flagName) ? rootProject.properties[flagName] : defaultVersion | ||
} | ||
|
||
configurations { | ||
compileClasspath | ||
} | ||
|
||
buildscript { | ||
// kotlin version is dictated by rootProject extension or property in gradle.properties | ||
ext.asyncStorageKtVersion = rootProject.ext.has('kotlinVersion') | ||
? rootProject.ext['kotlinVersion'] | ||
: rootProject.hasProperty('AsyncStorage_kotlinVersion') | ||
? rootProject.properties['AsyncStorage_kotlinVersion'] | ||
: '1.8.10' | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
} | ||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$asyncStorageKtVersion" | ||
} | ||
} | ||
|
||
// AsyncStorage has default size of 6MB. | ||
// This is a sane limit to protect the user from the app storing too much data in the database. | ||
// This also protects the database from filling up the disk cache and becoming malformed. | ||
// If you really need bigger size, please keep in mind the potential consequences. | ||
long dbSizeInMB = 6L | ||
def newDbSize = rootProject.properties['AsyncStorage_db_size_in_MB'] | ||
if (newDbSize != null && newDbSize.isLong()) { | ||
dbSizeInMB = newDbSize.toLong() | ||
} | ||
|
||
// Instead of reusing AsyncTask thread pool, AsyncStorage can use its own executor | ||
def useDedicatedExecutor = getFlagOrDefault('AsyncStorage_dedicatedExecutor', false) | ||
|
||
// Use next storage implementation | ||
def useNextStorage = getFlagOrDefault("AsyncStorage_useNextStorage", false) | ||
|
||
apply plugin: 'com.android.library' | ||
if (useNextStorage) { | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-kapt' | ||
apply from: './testresults.gradle' | ||
} | ||
|
||
android { | ||
compileSdkVersion safeExtGet('compileSdkVersion', 32) | ||
defaultConfig { | ||
minSdkVersion safeExtGet('minSdkVersion', 23) | ||
targetSdkVersion safeExtGet('targetSdkVersion', 32) | ||
buildConfigField "Long", "AsyncStorage_db_size", "${dbSizeInMB}L" | ||
buildConfigField "boolean", "AsyncStorage_useDedicatedExecutor", "${useDedicatedExecutor}" | ||
buildConfigField "boolean", "AsyncStorage_useNextStorage", "${useNextStorage}" | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
if (useNextStorage) { | ||
testOptions { | ||
unitTests { | ||
returnDefaultValues = true | ||
includeAndroidResources = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
url "${resolveModulePath("react-native")}/android" | ||
} | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
|
||
if (useNextStorage) { | ||
def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.3') | ||
def coroutines_version = "1.6.4" | ||
def coroutinesTest_version = "1.6.4" | ||
// if we don't provide explicit dependency on reflection, kotlin plugin | ||
// would add one automatically, probably a version that is not compatible with | ||
// used kotlin | ||
def kotlinReflect_version = project.ext.asyncStorageKtVersion | ||
def junit_version = "4.13.2" | ||
def robolectric_version = "4.7.3" | ||
def truth_version = "1.1.3" | ||
def androidxtest_version = "1.4.0" | ||
def androidtest_junit_version = "1.1.3" | ||
|
||
implementation "androidx.room:room-runtime:$room_version" | ||
implementation "androidx.room:room-ktx:$room_version" | ||
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinReflect_version" | ||
|
||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" | ||
kapt "androidx.room:room-compiler:$room_version" | ||
|
||
testImplementation "junit:junit:$junit_version" | ||
testImplementation "androidx.test:runner:$androidxtest_version" | ||
testImplementation "androidx.test:rules:$androidxtest_version" | ||
testImplementation "androidx.test.ext:junit:$androidtest_junit_version" | ||
testImplementation "org.robolectric:robolectric:$robolectric_version" | ||
testImplementation "com.google.truth:truth:$truth_version" | ||
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesTest_version" | ||
} | ||
|
||
//noinspection GradleDynamicVersion | ||
implementation 'host.exp:reactandroid-abi49_0_0:1.0.0' | ||
compileOnly 'com.facebook.fbjni:fbjni:+' | ||
compileOnly 'com.facebook.yoga:proguard-annotations:+' | ||
compileOnly 'com.facebook.soloader:soloader:+' | ||
compileOnly 'com.facebook.fresco:fbcore:+' | ||
compileOnly 'com.facebook.infer.annotation:infer-annotation:+' | ||
compileOnly 'androidx.annotation:annotation:+' | ||
compileOnly 'com.google.code.findbugs:jsr305:+' | ||
compileOnly 'androidx.appcompat:appcompat:+' | ||
compileOnly 'androidx.swiperefreshlayout:swiperefreshlayout:+' | ||
// From node_modules | ||
} |
1 change: 1 addition & 0 deletions
1
android/vendored/sdk49/@react-native-async-storage/async-storage/android/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
android.useAndroidX=true |
6 changes: 6 additions & 0 deletions
6
...ored/sdk49/@react-native-async-storage/async-storage/android/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="abi49_0_0.com.reactnativecommunity.asyncstorage"> | ||
|
||
</manifest> | ||
|
Oops, something went wrong.