Skip to content

Commit 92e9a46

Browse files
authored
Merge pull request #24 from Couchbase-Ecosystem/8-ios---replication-api
Replication Suport - iOS
2 parents 2c79cc1 + 5d0c2f4 commit 92e9a46

File tree

159 files changed

+5589
-2653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+5589
-2653
lines changed

expo-example/android/app/build.gradle

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ apply plugin: "com.facebook.react"
44

55
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
66

7+
static def versionToNumber(major, minor, patch) {
8+
return patch * 100 + minor * 10000 + major * 1000000
9+
}
10+
11+
def getRNVersion() {
12+
def version = providers.exec {
13+
workingDir(projectDir)
14+
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
15+
}.standardOutput.asText.get().trim()
16+
17+
def coreVersion = version.split("-")[0]
18+
def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
19+
20+
return versionToNumber(
21+
major,
22+
minor,
23+
patch
24+
)
25+
}
26+
def rnVersion = getRNVersion()
27+
728
/**
829
* This is the configuration block to customize your React Native Android app.
930
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -57,6 +78,11 @@ react {
5778
//
5879
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5980
// hermesFlags = ["-O", "-output-source-map"]
81+
82+
if (rnVersion >= versionToNumber(0, 75, 0)) {
83+
/* Autolinking */
84+
autolinkLibrariesWithApp()
85+
}
6086
}
6187

6288
/**
@@ -169,5 +195,7 @@ dependencies {
169195
}
170196
}
171197

172-
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
173-
applyNativeModulesAppBuildGradle(project)
198+
if (rnVersion < versionToNumber(0, 75, 0)) {
199+
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
200+
applyNativeModulesAppBuildGradle(project)
201+
}

expo-example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ allprojects {
3939
maven { url 'https://www.jitpack.io' }
4040
}
4141
}
42-
apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"
42+
apply from: "../../android/build.gradle"apply from: "../../android/build.gradle"
-9 Bytes
Binary file not shown.

expo-example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
plugins {
4+
kotlin("jvm") version "1.9.24"
5+
id("java-gradle-plugin")
6+
}
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
gradlePlugin {
13+
plugins {
14+
create("reactSettingsPlugin") {
15+
id = "com.facebook.react.settings"
16+
implementationClass = "expo.plugins.ReactSettingsPlugin"
17+
}
18+
}
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package expo.plugins
2+
3+
import org.gradle.api.Plugin
4+
import org.gradle.api.initialization.Settings
5+
6+
class ReactSettingsPlugin : Plugin<Settings> {
7+
override fun apply(settings: Settings) {
8+
// Do nothing, just register the plugin.
9+
}
10+
}

expo-example/android/settings.gradle

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
pluginManagement {
2+
def version = providers.exec {
3+
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
4+
}.standardOutput.asText.get().trim()
5+
def (_, reactNativeMinor, reactNativePatch) = version.split("-")[0].tokenize('.').collect { it.toInteger() }
6+
7+
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile().toString())
8+
if(reactNativeMinor == 74 && reactNativePatch <= 3){
9+
includeBuild("react-settings-plugin")
10+
}
11+
}
12+
13+
plugins { id("com.facebook.react.settings") }
14+
15+
def getRNMinorVersion() {
16+
def version = providers.exec {
17+
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
18+
}.standardOutput.asText.get().trim()
19+
20+
def coreVersion = version.split("-")[0]
21+
def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
22+
23+
return minor
24+
}
25+
26+
if (getRNMinorVersion() >= 75) {
27+
extensions.configure(com.facebook.react.ReactSettingsExtension) { ex ->
28+
if (System.getenv('EXPO_UNSTABLE_CORE_AUTOLINKING') == '1') {
29+
println('\u001B[32mUsing expo-modules-autolinking as core autolinking source\u001B[0m')
30+
def command = [
31+
'node',
32+
'--no-warnings',
33+
'--eval',
34+
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
35+
'react-native-config',
36+
'--json',
37+
'--platform',
38+
'android'
39+
].toList()
40+
ex.autolinkLibrariesFromCommand(command)
41+
} else {
42+
ex.autolinkLibrariesFromCommand()
43+
}
44+
}
45+
}
46+
147
rootProject.name = 'expo-example'
248

349
dependencyResolutionManagement {
@@ -11,8 +57,10 @@ dependencyResolutionManagement {
1157
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
1258
useExpoModules()
1359

14-
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
15-
applyNativeModulesSettingsGradle(settings)
60+
if (getRNMinorVersion() < 75) {
61+
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
62+
applyNativeModulesSettingsGradle(settings)
63+
}
1664

1765
include ':app'
1866
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile())

expo-example/app/(tabs)/collection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
import { useCollectionNavigationSections } from '@/hooks/useCollectionNavigationSections';
4-
import NavigationSectionListing from '@/components/NavigationSectionListing';
4+
import NavigationSectionListing from '@/components/NavigationSectionListing/NavigationSectionListing';
55

66
export default function CollectionTabScreen() {
77
const sections = useCollectionNavigationSections();

expo-example/app/(tabs)/documents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
import { useDocumentNavigationSections } from '@/hooks/useDocumentNavigationSections';
4-
import NavigationSectionListing from '@/components/NavigationSectionListing';
4+
import NavigationSectionListing from '@/components/NavigationSectionListing/NavigationSectionListing';
55

66
export default function DocumentsTabScreen() {
77
const sections = useDocumentNavigationSections();

expo-example/app/(tabs)/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
import { useDatabaseNavigationSections } from '@/hooks/useDatabaseNavigationSections';
4-
import NavigationSectionListing from '@/components/NavigationSectionListing';
4+
import NavigationSectionListing from '@/components/NavigationSectionListing/NavigationSectionListing';
55

66
export default function DatabaseTabScreen() {
77
const sections = useDatabaseNavigationSections();

0 commit comments

Comments
 (0)