Browse Source

chore: fix example project build (#604)

* fix: example project build

* fix rn version

* ..
master
Henning Hall 2 years ago
committed by GitHub
parent
commit
2e3235a321
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions
  1. +4
    -1
      examples/detox/android/app/build.gradle
  2. +10
    -0
      examples/detox/fix-rn-version.ts
  3. +1
    -1
      examples/detox/package.json

+ 4
- 1
examples/detox/android/app/build.gradle View File

@ -74,7 +74,10 @@ dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
// noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
implementation ('com.facebook.react:react-native:0.59.9') {
force = true
}
androidTestImplementation('com.wix:detox:+') { transitive = true }
androidTestImplementation 'junit:junit:4.12'

+ 10
- 0
examples/detox/fix-rn-version.ts View File

@ -0,0 +1,10 @@
import fs from 'fs'
const file = '../../android/build.gradle'
const replace = /implementation 'com.facebook.react:react-native:\+'/g
const replacement = "implementation 'com.facebook.react:react-native:0.59.9'"
const encoding = 'utf8'
const data = fs.readFileSync(file, encoding)
const result = data.replace(replace, replacement)
fs.writeFileSync(file, result, encoding)

+ 1
- 1
examples/detox/package.json View File

@ -5,7 +5,7 @@
"scripts": {
"start": "react-native start",
"postinstall": "yarn make-example-runnable",
"make-example-runnable": "(cd ../../ && npm i react react-native --no-save)",
"make-example-runnable": "(cd ../../ && npm i react react-native --no-save) && npx tsx ./fix-rn-version.ts",
"build:ios": "detox build --configuration ios.debug",
"build:android-debug": "detox build --configuration android.debug",
"build:android-ci": "detox build --configuration android.ci",

Loading…
Cancel
Save