Skip to content
Draft
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
15 changes: 15 additions & 0 deletions apps/example/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())
}

def isRNRepoEnabled() {
// return false // Uncomment to disable RNRepo locally
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 apps/example/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 apps/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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

platform :ios, min_ios_version_supported
prepare_react_native_project!

Expand All @@ -29,6 +47,9 @@ target 'EnrichedMarkdownExample' 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 apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@react-native/babel-preset": "0.84.1",
"@react-native/metro-config": "0.84.1",
"@react-native/typescript-config": "0.84.1",
"@rnrepo/build-tools": "~0.1.3-beta.0",
"@types/react": "^19.2.0",
"react-native-builder-bob": "^0.40.18",
"react-native-monorepo-config": "^0.3.3",
Expand Down
6 changes: 6 additions & 0 deletions apps/example/rnrepo.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"denyList": {
"android": ["react-native-enriched-markdown"],
"ios": ["react-native-enriched-markdown"]
}
}
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4846,6 +4846,13 @@ __metadata:
languageName: node
linkType: hard

"@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 @@ -13434,6 +13441,7 @@ __metadata:
"@react-native/typescript-config": "npm:0.84.1"
"@react-navigation/native": "npm:^7.2.2"
"@react-navigation/native-stack": "npm:^7.14.12"
"@rnrepo/build-tools": "npm:~0.1.3-beta.0"
"@types/react": "npm:^19.2.0"
react: "npm:19.2.3"
react-native: "npm:0.84.1"
Expand Down
Loading