mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Change detox config to generate dynamic path for the apks
This commit is contained in:
65
.detoxrc.js
Normal file
65
.detoxrc.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const { version } = require("./package.json");
|
||||
const fs = require("fs");
|
||||
|
||||
const buildGradle = fs.readFileSync("./android/app/build.gradle", "utf8");
|
||||
const versionCode = buildGradle.match(/versionCode (\d+)/)[1];
|
||||
const apkFilenamePrefix = `com.inaturalistreactnative-v${version}+${versionCode}`;
|
||||
|
||||
/** @type {Detox.DetoxConfig} */
|
||||
module.exports = {
|
||||
testRunner: "jest",
|
||||
runnerConfig: "e2e/config.json",
|
||||
skipLegacyWorkersInjection: true,
|
||||
apps: {
|
||||
"ios.debug": {
|
||||
type: "ios.app",
|
||||
binaryPath:
|
||||
"ios/build/Build/Products/Debug-iphonesimulator/iNaturalistReactNative.app",
|
||||
build:
|
||||
"xcodebuild -workspace ios/iNaturalistReactNative.xcworkspace -scheme iNaturalistReactNative -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
|
||||
},
|
||||
"ios.release": {
|
||||
type: "ios.app",
|
||||
binaryPath:
|
||||
"ios/build/Build/Products/Release-iphonesimulator/iNaturalistReactNative.app",
|
||||
build:
|
||||
"xcodebuild -workspace ios/iNaturalistReactNative.xcworkspace -scheme iNaturalistReactNative -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
|
||||
},
|
||||
"android.release": {
|
||||
type: "android.apk",
|
||||
binaryPath: `android/app/build/outputs/apk/release/${apkFilenamePrefix}-release.apk`,
|
||||
testBinaryPath:
|
||||
`android/app/build/outputs/apk/androidTest/release/${apkFilenamePrefix}-release-androidTest.apk`,
|
||||
build:
|
||||
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
|
||||
},
|
||||
},
|
||||
devices: {
|
||||
simulator: {
|
||||
type: "ios.simulator",
|
||||
device: {
|
||||
type: "iPhone 13",
|
||||
},
|
||||
},
|
||||
emulator: {
|
||||
type: "android.emulator",
|
||||
device: {
|
||||
avdName: "Pixel_5_API_31_AOSP",
|
||||
},
|
||||
},
|
||||
},
|
||||
configurations: {
|
||||
"ios.debug": {
|
||||
device: "simulator",
|
||||
app: "ios.debug",
|
||||
},
|
||||
"ios.release": {
|
||||
device: "simulator",
|
||||
app: "ios.release",
|
||||
},
|
||||
"android.release": {
|
||||
device: "emulator",
|
||||
app: "android.release",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"testRunner": "jest",
|
||||
"runnerConfig": "e2e/config.json",
|
||||
"skipLegacyWorkersInjection": true,
|
||||
"apps": {
|
||||
"ios.debug": {
|
||||
"type": "ios.app",
|
||||
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/iNaturalistReactNative.app",
|
||||
"build": "xcodebuild -workspace ios/iNaturalistReactNative.xcworkspace -scheme iNaturalistReactNative -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build"
|
||||
},
|
||||
"ios.release": {
|
||||
"type": "ios.app",
|
||||
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/iNaturalistReactNative.app",
|
||||
"build": "xcodebuild -workspace ios/iNaturalistReactNative.xcworkspace -scheme iNaturalistReactNative -configuration Release -sdk iphonesimulator -derivedDataPath ios/build"
|
||||
},
|
||||
"android.release": {
|
||||
"type": "android.apk",
|
||||
"binaryPath": "android/app/build/outputs/apk/release/com.inaturalistreactnative-v0.1.1+32-release.apk",
|
||||
"testBinaryPath": "android/app/build/outputs/apk/androidTest/release/com.inaturalistreactnative-v0.1.1+32-release-androidTest.apk",
|
||||
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd .."
|
||||
}
|
||||
},
|
||||
"devices": {
|
||||
"simulator": {
|
||||
"type": "ios.simulator",
|
||||
"device": {
|
||||
"type": "iPhone 13"
|
||||
}
|
||||
},
|
||||
"emulator": {
|
||||
"type": "android.emulator",
|
||||
"device": {
|
||||
"avdName": "Pixel_5_API_31_AOSP"
|
||||
}
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"ios.debug": {
|
||||
"device": "simulator",
|
||||
"app": "ios.debug"
|
||||
},
|
||||
"ios.release": {
|
||||
"device": "simulator",
|
||||
"app": "ios.release"
|
||||
},
|
||||
"android.release": {
|
||||
"device": "emulator",
|
||||
"app": "android.release"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user