From d70f916ce13539efa3c80d9b1ec7e9786a002b90 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Thu, 4 Dec 2025 05:48:05 +0100 Subject: [PATCH 1/3] :wrench: --- apps/example/android/build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/example/android/build.gradle b/apps/example/android/build.gradle index d8bcc3aeb1..da96ed7f4f 100644 --- a/apps/example/android/build.gradle +++ b/apps/example/android/build.gradle @@ -13,12 +13,14 @@ buildscript { repositories { mavenCentral() google() + maven { url "https://packages.rnrepo.org/releases" } } dependencies { getReactNativeDependencies().each { dependency -> classpath(dependency) } + classpath("org.rnrepo.tools:prebuilds-plugin:0.1.0") } } @@ -39,5 +41,10 @@ allprojects { } mavenCentral() google() + maven { url "https://packages.rnrepo.org/releases" } } } + +project(":app") { + apply plugin: "org.rnrepo.tools.prebuilds-plugin" +} From 56cbfdcdd317210494a6b1ee4b51911469bffa78 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Thu, 4 Dec 2025 05:53:03 +0100 Subject: [PATCH 2/3] :wrench: --- .github/workflows/test-skia-package.yml | 98 +++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/.github/workflows/test-skia-package.yml b/.github/workflows/test-skia-package.yml index d4e17338dd..df3279e180 100644 --- a/.github/workflows/test-skia-package.yml +++ b/.github/workflows/test-skia-package.yml @@ -290,6 +290,104 @@ jobs: echo "Installing expo-dev-client..." npx expo install expo-dev-client + - name: Configure RNRepo for Android prebuild + working-directory: /Users/runner/skia-test-app/my-app + run: | + echo "Installing RNRepo Expo config plugin..." + npx expo install @rnrepo/expo-config-plugin + + CONFIG_FILE="" + for file in app.json app.config.json app.config.js app.config.ts app.config.mjs app.config.cjs; do + if [ -f "$file" ]; then + CONFIG_FILE="$file" + break + fi + done + + if [ -z "$CONFIG_FILE" ]; then + echo "Warning: no Expo config file found; skipping RNRepo plugin configuration" + exit 0 + fi + + echo "Updating $CONFIG_FILE with RNRepo plugin..." + if [[ "$CONFIG_FILE" == *.json ]]; then + EXPO_CONFIG_FILE="$CONFIG_FILE" node - <<'EOF' +const fs = require('fs'); +const file = process.env.EXPO_CONFIG_FILE; +const plugin = '@rnrepo/expo-config-plugin'; +const content = fs.readFileSync(file, 'utf8'); +let data; +try { + data = JSON.parse(content); +} catch (error) { + console.error(`Failed to parse ${file} as JSON:`, error); + process.exit(1); +} +data.expo = data.expo || {}; +data.expo.plugins = data.expo.plugins || []; +const hasPlugin = data.expo.plugins.some((entry) => { + if (typeof entry === 'string') { + return entry === plugin; + } + return Array.isArray(entry) && entry[0] === plugin; +}); +if (!hasPlugin) { + data.expo.plugins.push(plugin); + fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n'); + console.log(`Added ${plugin} to ${file}`); +} else { + console.log(`RNRepo plugin already present in ${file}`); +} +EOF + else + EXPO_CONFIG_FILE="$CONFIG_FILE" node - <<'EOF' +const fs = require('fs'); +const file = process.env.EXPO_CONFIG_FILE; +const plugin = '@rnrepo/expo-config-plugin'; +let content = fs.readFileSync(file, 'utf8'); +if (content.includes(plugin)) { + console.log(`RNRepo plugin already present in ${file}`); + process.exit(0); +} +const pluginsRegex = /(plugins\s*:\s*\[)([\s\S]*?)(\])/; +if (pluginsRegex.test(content)) { + content = content.replace(pluginsRegex, (match, start, inner, end) => { + if (inner.includes(plugin)) { + return match; + } + const startIndentMatch = start.match(/(\s*)plugins/); + const baseIndent = startIndentMatch ? startIndentMatch[1] : ' '; + const entryIndent = `${baseIndent} `; + const trimmedInner = inner.trim(); + let updatedInner; + if (trimmedInner.length > 0) { + const innerWithoutTrailingSpace = inner.replace(/\s*$/, ''); + const needsComma = !trimmedInner.endsWith(','); + const existingBlock = needsComma ? `${innerWithoutTrailingSpace},` : innerWithoutTrailingSpace; + updatedInner = `${existingBlock}\n${entryIndent}'${plugin}'\n${baseIndent}`; + } else { + updatedInner = `\n${entryIndent}'${plugin}'\n${baseIndent}`; + } + return `${start}${updatedInner}${end}`; + }); +} else { + const expoBlockRegex = /(expo\s*:\s*\{)/; + if (expoBlockRegex.test(content)) { + content = content.replace(expoBlockRegex, `$1\n plugins: ['${plugin}'],`); + } else { + const returnObjectRegex = /(return\s*\{\s*\n)/; + if (returnObjectRegex.test(content)) { + content = content.replace(returnObjectRegex, `$1 plugins: ['${plugin}'],\n`); + } else { + console.error('Could not find a place to insert the RNRepo plugin. Please update the Expo config manually.'); + process.exit(1); + } + } +} +fs.writeFileSync(file, content); +EOF + fi + - name: Prebuild native directories working-directory: /Users/runner/skia-test-app/my-app run: | From 5a9cc8bd0d1e7be59fd3c44eab28a86fed5b5f03 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Thu, 4 Dec 2025 05:59:14 +0100 Subject: [PATCH 3/3] Remove RNRepo plugin configuration from workflow Removed RNRepo configuration steps from the workflow. --- .github/workflows/test-skia-package.yml | 98 ------------------------- 1 file changed, 98 deletions(-) diff --git a/.github/workflows/test-skia-package.yml b/.github/workflows/test-skia-package.yml index df3279e180..d4e17338dd 100644 --- a/.github/workflows/test-skia-package.yml +++ b/.github/workflows/test-skia-package.yml @@ -290,104 +290,6 @@ jobs: echo "Installing expo-dev-client..." npx expo install expo-dev-client - - name: Configure RNRepo for Android prebuild - working-directory: /Users/runner/skia-test-app/my-app - run: | - echo "Installing RNRepo Expo config plugin..." - npx expo install @rnrepo/expo-config-plugin - - CONFIG_FILE="" - for file in app.json app.config.json app.config.js app.config.ts app.config.mjs app.config.cjs; do - if [ -f "$file" ]; then - CONFIG_FILE="$file" - break - fi - done - - if [ -z "$CONFIG_FILE" ]; then - echo "Warning: no Expo config file found; skipping RNRepo plugin configuration" - exit 0 - fi - - echo "Updating $CONFIG_FILE with RNRepo plugin..." - if [[ "$CONFIG_FILE" == *.json ]]; then - EXPO_CONFIG_FILE="$CONFIG_FILE" node - <<'EOF' -const fs = require('fs'); -const file = process.env.EXPO_CONFIG_FILE; -const plugin = '@rnrepo/expo-config-plugin'; -const content = fs.readFileSync(file, 'utf8'); -let data; -try { - data = JSON.parse(content); -} catch (error) { - console.error(`Failed to parse ${file} as JSON:`, error); - process.exit(1); -} -data.expo = data.expo || {}; -data.expo.plugins = data.expo.plugins || []; -const hasPlugin = data.expo.plugins.some((entry) => { - if (typeof entry === 'string') { - return entry === plugin; - } - return Array.isArray(entry) && entry[0] === plugin; -}); -if (!hasPlugin) { - data.expo.plugins.push(plugin); - fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n'); - console.log(`Added ${plugin} to ${file}`); -} else { - console.log(`RNRepo plugin already present in ${file}`); -} -EOF - else - EXPO_CONFIG_FILE="$CONFIG_FILE" node - <<'EOF' -const fs = require('fs'); -const file = process.env.EXPO_CONFIG_FILE; -const plugin = '@rnrepo/expo-config-plugin'; -let content = fs.readFileSync(file, 'utf8'); -if (content.includes(plugin)) { - console.log(`RNRepo plugin already present in ${file}`); - process.exit(0); -} -const pluginsRegex = /(plugins\s*:\s*\[)([\s\S]*?)(\])/; -if (pluginsRegex.test(content)) { - content = content.replace(pluginsRegex, (match, start, inner, end) => { - if (inner.includes(plugin)) { - return match; - } - const startIndentMatch = start.match(/(\s*)plugins/); - const baseIndent = startIndentMatch ? startIndentMatch[1] : ' '; - const entryIndent = `${baseIndent} `; - const trimmedInner = inner.trim(); - let updatedInner; - if (trimmedInner.length > 0) { - const innerWithoutTrailingSpace = inner.replace(/\s*$/, ''); - const needsComma = !trimmedInner.endsWith(','); - const existingBlock = needsComma ? `${innerWithoutTrailingSpace},` : innerWithoutTrailingSpace; - updatedInner = `${existingBlock}\n${entryIndent}'${plugin}'\n${baseIndent}`; - } else { - updatedInner = `\n${entryIndent}'${plugin}'\n${baseIndent}`; - } - return `${start}${updatedInner}${end}`; - }); -} else { - const expoBlockRegex = /(expo\s*:\s*\{)/; - if (expoBlockRegex.test(content)) { - content = content.replace(expoBlockRegex, `$1\n plugins: ['${plugin}'],`); - } else { - const returnObjectRegex = /(return\s*\{\s*\n)/; - if (returnObjectRegex.test(content)) { - content = content.replace(returnObjectRegex, `$1 plugins: ['${plugin}'],\n`); - } else { - console.error('Could not find a place to insert the RNRepo plugin. Please update the Expo config manually.'); - process.exit(1); - } - } -} -fs.writeFileSync(file, content); -EOF - fi - - name: Prebuild native directories working-directory: /Users/runner/skia-test-app/my-app run: |