chore: indirect aar dependency

This commit is contained in:
Dylan Oliver 2022-09-19 14:32:13 -04:00
parent db0525f971
commit 2f47456a2d
8 changed files with 55 additions and 36 deletions

View File

@ -1,21 +1,32 @@
buildscript { buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNative_kotlinVersion']
repositories { ext.getExtOrDefault = { name ->
google() return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNative_' + name]
mavenCentral()
} }
dependencies { if (project == rootProject) {
classpath 'com.android.tools.build:gradle:3.5.3' repositories {
// noinspection DifferentKotlinGradleVersion google()
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
}
} else {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
}
} }
} }
def isNewArchitectureEnabled() { def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
} }
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
@ -55,6 +66,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
buildToolsVersion ReactNative_buildToolsVersion
} }
repositories { repositories {
@ -68,10 +80,7 @@ repositories {
if (rootProject.ext.has('reactNativeAndroidRoot')) { if (rootProject.ext.has('reactNativeAndroidRoot')) {
defaultDir = rootProject.ext.get('reactNativeAndroidRoot') defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
} else { } else {
defaultDir = new File( defaultDir = new File( projectDir, '/../../../node_modules/react-native/android' )
projectDir,
'/../../../node_modules/react-native/android'
)
} }
if (defaultDir.exists()) { if (defaultDir.exists()) {
@ -89,15 +98,9 @@ repositories {
if (found) return true if (found) return true
parentDir = parentDir.parentFile parentDir = parentDir.parentFile
def androidSourcesDir = new File( def androidSourcesDir = new File( parentDir, 'node_modules/react-native' )
parentDir,
'node_modules/react-native'
)
def androidPrebuiltBinaryDir = new File( def androidPrebuiltBinaryDir = new File( parentDir, 'node_modules/react-native/android' )
parentDir,
'node_modules/react-native/android'
)
if (androidPrebuiltBinaryDir.exists()) { if (androidPrebuiltBinaryDir.exists()) {
maven { maven {
@ -122,7 +125,7 @@ repositories {
if (!found) { if (!found) {
throw new GradleException( throw new GradleException(
"${project.name}: unable to locate React Native android sources. " + "${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." "Ensure you have you installed React Native as a dependency in your project and try again."
) )
} }
} }
@ -133,8 +136,8 @@ dependencies {
//noinspection GradleDynamicVersion //noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation files('libs/gowaku.aar') compileOnly files('libs/gowaku.aar')
// From node_modules // From node_modules
} }
if (isNewArchitectureEnabled()) { if (isNewArchitectureEnabled()) {

View File

@ -1,5 +1,9 @@
ReactNative_kotlinVersion=1.7.0 ReactNative_kotlinVersion=1.6.0
ReactNative_minSdkVersion=21 ReactNative_minSdkVersion=21
ReactNative_targetSdkVersion=31 ReactNative_targetSdkVersion=31
ReactNative_compileSdkVersion=31 ReactNative_compileSdkVersion=31
ReactNative_ndkversion=21.4.7075529 ReactNative_ndkversion=24.0.8215888
ReactNative_buildToolsVersion=31.0.0
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-XX:+UseParallelGC

View File

@ -260,8 +260,7 @@ android {
} }
dependencies { dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"]) implementation fileTree(dir: "../../../android/libs", include: ["*.aar", "*.jar"])
//noinspection GradleDynamicVersion //noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules implementation "com.facebook.react:react-native:+" // From node_modules

View File

@ -22,17 +22,19 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:7.0.4") classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.facebook.react:react-native-gradle-plugin") classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2") // classpath("de.undercouch:gradle-download-task:4.1.2")
// NOTE: Do not place your application dependencies here; they belong classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
} }
allprojects { allprojects {
repositories { repositories {
maven { // maven { url("$rootDir/../android/gowaku") }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android") url("$rootDir/../node_modules/react-native/android")
} }

View File

@ -366,7 +366,7 @@ PODS:
- React-logger (= 0.68.2) - React-logger (= 0.68.2)
- React-perflogger (= 0.68.2) - React-perflogger (= 0.68.2)
- SocketRocket (0.6.0) - SocketRocket (0.6.0)
- waku-react-native (0.0.4): - waku-react-native (0.0.5):
- React-Core - React-Core
- Yoga (1.14.0) - Yoga (1.14.0)
- YogaKit (1.18.1): - YogaKit (1.18.1):
@ -567,7 +567,7 @@ SPEC CHECKSUMS:
React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23 React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23
ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2 ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
waku-react-native: 569e0f4efd02ca2ddea2db168365841891db973c waku-react-native: 0d820d39e9348de21d150d4a258b4e24edb65d97
Yoga: 99652481fcd320aefa4a7ef90095b95acd181952 Yoga: 99652481fcd320aefa4a7ef90095b95acd181952
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

View File

@ -11,6 +11,7 @@
"postinstall": "patch-package" "postinstall": "patch-package"
}, },
"dependencies": { "dependencies": {
"@waku/react-native": "../",
"react": "17.0.2", "react": "17.0.2",
"react-native": "0.68.2" "react-native": "0.68.2"
}, },

View File

@ -1027,6 +1027,11 @@
dependencies: dependencies:
"@types/yargs-parser" "*" "@types/yargs-parser" "*"
"@waku/react-native@../":
version "0.0.5"
dependencies:
base-64 "^1.0.0"
"@yarnpkg/lockfile@^1.1.0": "@yarnpkg/lockfile@^1.1.0":
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
@ -1274,6 +1279,11 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
base-64@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/base-64/-/base-64-1.0.0.tgz#09d0f2084e32a3fd08c2475b973788eee6ae8f4a"
integrity sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==
base64-js@^1.1.2, base64-js@^1.3.1, base64-js@^1.5.1: base64-js@^1.1.2, base64-js@^1.3.1, base64-js@^1.5.1:
version "1.5.1" version "1.5.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"

View File

@ -71,7 +71,7 @@
"pod-install": "^0.1.0", "pod-install": "^0.1.0",
"prettier": "^2.0.5", "prettier": "^2.0.5",
"react": "17.0.2", "react": "17.0.2",
"react-native": "0.68.2", "react-native": "^0.69",
"react-native-builder-bob": "^0.18.3", "react-native-builder-bob": "^0.18.3",
"release-it": "^15.0.0", "release-it": "^15.0.0",
"typescript": "^4.5.2" "typescript": "^4.5.2"