Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/android-build-test-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
run: yarn
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}/android
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
run: ./gradlew :app:assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
15 changes: 15 additions & 0 deletions FabricExample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

def isCIEnabled() {
return ["1", "true"].contains(System.getenv("CI")?.toLowerCase())
}

// System.setProperty("DISABLE_RNREPO", "1") // Uncomment to disable RNRepo even in CI
def isRNRepoEnabled() {
return System.getenv("DISABLE_RNREPO") == null
}

// Use RNRepo in CI builds.
// Set DISABLE_RNREPO to any value to disable RNRepo.
if (isCIEnabled() && isRNRepoEnabled()) {
apply plugin: "org.rnrepo.tools.prebuilds-plugin"
}

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
Expand Down
12 changes: 12 additions & 0 deletions FabricExample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ buildscript {
google()
mavenCentral()
}
// RNRepo plugin classpath for CI builds (plugin applied in app/build.gradle).
// To disable RNRepo support, set DISABLE_RNREPO environment variable to ANY value.
def rnrepoClasspath = {
def rnrepoDir = new File(
providers.exec {
workingDir(rootDir)
commandLine("node", "--print", "require.resolve('@rnrepo/build-tools/package.json')")
}.standardOutput.asText.get().trim()
).getParentFile().absolutePath
return fileTree(dir: "${rnrepoDir}/gradle-plugin/build/libs", include: ["prebuilds-plugin.jar"])
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath rnrepoClasspath()
}
}

Expand Down
21 changes: 21 additions & 0 deletions FabricExample/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ require Pod::Executable.execute_command('node', ['-p',
{paths: [process.argv[1]]},
)', __dir__]).strip

def is_ci_enabled?
%w[1 true].include?(ENV['CI'].to_s.downcase)
end

# ENV['DISABLE_RNREPO'] = "1" # Uncomment to disable RNRepo even in CI
def is_rnrepo_enabled?
ENV['DISABLE_RNREPO'].nil?
end

# Use RNRepo in CI builds. Set DISABLE_RNREPO to any value to disable RNRepo.
if is_ci_enabled? && is_rnrepo_enabled?
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"@rnrepo/build-tools/cocoapods-plugin/lib/plugin.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
end

require_relative '../../scripts/ios/rns_update_info_plist'
require_relative '../../scripts/ios/rns_set_swift_compilation_flags'

Expand All @@ -30,6 +48,9 @@ target 'FabricExample' do
)

post_install do |installer|
if is_ci_enabled? && is_rnrepo_enabled?
rnrepo_post_install(installer)
end
react_native_post_install(
installer,
config[:reactNativePath],
Expand Down
1 change: 1 addition & 0 deletions FabricExample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@react-native/jest-preset": "0.85.0",
"@react-native/metro-config": "0.85.0",
"@react-native/typescript-config": "0.85.0",
"@rnrepo/build-tools": "~0.1.3-beta.0",
"@types/jest": "^29.5.13",
"@types/react": "^19.2.0",
"@types/react-test-renderer": "^19.1.0",
Expand Down
8 changes: 8 additions & 0 deletions FabricExample/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,13 @@ __metadata:
languageName: node
linkType: soft

"@rnrepo/build-tools@npm:~0.1.3-beta.0":
version: 0.1.3-beta.0
resolution: "@rnrepo/build-tools@npm:0.1.3-beta.0"
checksum: 10c0/83d2c2b05d87ab038d139c56b2e8ea1df071c41a51094a6464d9c7bc5794f25eb289b8b9298418e829d9ebfe723a77d5556fb1eaf69d87b25dda1f7d19d2d5fb
languageName: node
linkType: hard

"@sideway/address@npm:^4.1.5":
version: 4.1.5
resolution: "@sideway/address@npm:4.1.5"
Expand Down Expand Up @@ -3515,6 +3522,7 @@ __metadata:
"@react-navigation/native-stack": "link:../react-navigation/packages/native-stack/"
"@react-navigation/routers": "link:../react-navigation/packages/routers/"
"@react-navigation/stack": "link:../react-navigation/packages/stack/"
"@rnrepo/build-tools": "npm:~0.1.3-beta.0"
"@types/jest": "npm:^29.5.13"
"@types/react": "npm:^19.2.0"
"@types/react-test-renderer": "npm:^19.1.0"
Expand Down
Loading