-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade cpp to Kevin Heifner fork, example app to 0.73.6
- Loading branch information
Showing
94 changed files
with
11,038 additions
and
11,736 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
*.pbxproj -text | ||
# specific for windows script files | ||
*.bat text eol=crlf | ||
*.bat text eol=crlf | ||
# iOS Headers are mainly Objective-C++ | ||
ios/**/*.h linguist-language=Objective-C++ | ||
# Android Headers are C++ | ||
android/**/*.h linguist-language=C++ |
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,154 +1,124 @@ | ||
import java.nio.file.Paths | ||
import com.android.Version | ||
|
||
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION | ||
def agpVersionMajor = agpVersion.tokenize('.')[0].toInteger() | ||
def androidManifestPath = agpVersionMajor >= 7 ? 'src/main/AndroidManifest.xml' : 'src/hasNamespace/AndroidManifest.xml' | ||
|
||
buildscript { | ||
// Buildscript is evaluated before everything else so we can't use getExtOrDefault | ||
repositories { | ||
google() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.2.2' | ||
classpath 'com.android.tools.build:gradle:8.3.1' | ||
} | ||
} | ||
|
||
def resolveBuildType() { | ||
Gradle gradle = getGradle() | ||
String tskReqStr = gradle.getStartParameter().getTaskRequests()['args'].toString() | ||
|
||
return tskReqStr.contains('Release') ? 'release' : 'debug' | ||
} | ||
|
||
def isNewArchitectureEnabled() { | ||
// To opt-in for the New Architecture, you can either: | ||
// - Set `newArchEnabled` to true inside the `gradle.properties` file | ||
// - Invoke gradle with `-newArchEnabled=true` | ||
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` | ||
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" | ||
} | ||
|
||
if (isNewArchitectureEnabled()) { | ||
apply plugin: 'com.facebook.react' | ||
} | ||
apply plugin: 'com.android.library' | ||
|
||
def getExtOrDefault(name) { | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['QuickBase64_' + name] | ||
def safeExtGet(prop, fallback) { | ||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback | ||
} | ||
|
||
def getExtOrIntegerDefault(name) { | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['QuickBase64_' + name]).toInteger() | ||
def reactNativeArchitectures() { | ||
def value = project.getProperties().get("reactNativeArchitectures") | ||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] | ||
} | ||
|
||
static def findNodeModules(baseDir) { | ||
def basePath = baseDir.toPath().normalize() | ||
// Node's module resolution algorithm searches up to the root directory, | ||
// after which the base path will be null | ||
while (basePath) { | ||
def nodeModulesPath = Paths.get(basePath.toString(), "node_modules") | ||
def reactNativePath = Paths.get(nodeModulesPath.toString(), "react-native") | ||
if (nodeModulesPath.toFile().exists() && reactNativePath.toFile().exists()) { | ||
return nodeModulesPath.toString() | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
android { | ||
compileSdkVersion safeExtGet("compileSdkVersion", 28) | ||
if (agpVersionMajor >= 7) { | ||
namespace 'com.reactnativequickbase64' | ||
} | ||
|
||
if (agpVersionMajor >= 8) { | ||
buildFeatures { | ||
buildConfig = true | ||
} | ||
basePath = basePath.getParent() | ||
} | ||
throw new GradleException("react-native-quick-base64: Failed to find node_modules/ path!") | ||
} | ||
|
||
def nodeModules = findNodeModules(projectDir); | ||
logger.warn("react-native-quick-base64: node_modules/ found at: ${nodeModules}"); | ||
sourceSets { | ||
main { | ||
manifest.srcFile androidManifestPath | ||
} | ||
} | ||
|
||
android { | ||
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') | ||
buildToolsVersion getExtOrDefault('buildToolsVersion') | ||
ndkVersion getExtOrDefault('ndkVersion') | ||
// Used to override the NDK path/version on internal CI or by allowing | ||
// users to customize the NDK path/version from their root project (e.g. for M1 support) | ||
if (rootProject.hasProperty("ndkPath")) { | ||
ndkPath rootProject.ext.ndkPath | ||
} | ||
if (rootProject.hasProperty("ndkVersion")) { | ||
ndkVersion rootProject.ext.ndkVersion | ||
} | ||
|
||
buildFeatures { | ||
prefab true | ||
} | ||
|
||
defaultConfig { | ||
minSdkVersion 21 | ||
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') | ||
minSdkVersion safeExtGet('minSdkVersion', 21) | ||
targetSdkVersion safeExtGet('targetSdkVersion', 28) | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() | ||
externalNativeBuild { | ||
cmake { | ||
cppFlags "-O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all" | ||
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' | ||
arguments "-DNODE_MODULES_DIR=${nodeModules}" | ||
} | ||
} | ||
|
||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
path "CMakeLists.txt" | ||
cppFlags "-O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all" | ||
arguments "-DANDROID_STL=c++_shared" | ||
abiFilters (*reactNativeArchitectures()) | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
} | ||
} | ||
lintOptions { | ||
disable 'GradleCompatible' | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
|
||
def found = false | ||
def defaultDir = null | ||
def androidSourcesName = 'React Native sources' | ||
|
||
if (rootProject.ext.has('reactNativeAndroidRoot')) { | ||
defaultDir = rootProject.ext.get('reactNativeAndroidRoot') | ||
} else { | ||
defaultDir = file("$nodeModules/react-native/android") | ||
} | ||
|
||
if (defaultDir.exists()) { | ||
maven { | ||
url defaultDir.toString() | ||
name androidSourcesName | ||
externalNativeBuild { | ||
cmake { | ||
path "CMakeLists.txt" | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") | ||
found = true | ||
} else { | ||
def parentDir = rootProject.projectDir | ||
|
||
1.upto(5, { | ||
if (found) return true | ||
parentDir = parentDir.parentFile | ||
|
||
def androidSourcesDir = new File( | ||
parentDir, | ||
'node_modules/react-native' | ||
) | ||
|
||
def androidPrebuiltBinaryDir = new File( | ||
parentDir, | ||
'node_modules/react-native/android' | ||
) | ||
|
||
if (androidPrebuiltBinaryDir.exists()) { | ||
maven { | ||
url androidPrebuiltBinaryDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") | ||
found = true | ||
} else if (androidSourcesDir.exists()) { | ||
maven { | ||
url androidSourcesDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") | ||
found = true | ||
} | ||
}) | ||
} | ||
|
||
if (!found) { | ||
throw new GradleException( | ||
"${project.name}: unable to locate React Native android sources. " + | ||
"Ensure you have you installed React Native as a dependency in your project and try again." | ||
) | ||
packagingOptions { | ||
doNotStrip resolveBuildType() == 'debug' ? "**/**/*.so" : '' | ||
excludes = [ | ||
"META-INF", | ||
"META-INF/**", | ||
"**/libjsi.so", | ||
"**/libc++_shared.so" | ||
] | ||
} | ||
} | ||
|
||
dependencies { | ||
// noinspection GradleDynamicVersion | ||
api 'com.facebook.react:react-native:+' | ||
//noinspection GradleDynamicVersion | ||
implementation "com.facebook.react:react-android:+" | ||
} |
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,4 +1,3 @@ | ||
QuickBase64_kotlinVersion=1.6.0 | ||
QuickBase64_compileSdkVersion=30 | ||
QuickBase64_buildToolsVersion=30 | ||
QuickBase64_targetSdkVersion=30 |
Binary file not shown.
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,5 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.reactnativequickbase64" | ||
> | ||
|
||
</manifest> |
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,4 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.reactnativequickbase64"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
Oops, something went wrong.