@react-native-community/cli-platform-ios
Advanced tools
Comparing version 3.0.5-alpha.0 to 3.0.5-alpha.1
@@ -175,3 +175,3 @@ "use strict"; | ||
const appName = await buildProject(xcodeProject, selectedSimulator.udid, scheme, args); | ||
const appPath = getBuildPath(args.configuration, appName, false, scheme); | ||
const appPath = getBuildPath(xcodeProject, args.configuration, appName, false, scheme); | ||
@@ -209,3 +209,3 @@ _cliTools().logger.info(`Installing "${_chalk().default.bold(appPath)}"`); | ||
const appName = await buildProject(xcodeProject, selectedDevice.udid, scheme, args); | ||
const iosDeployInstallArgs = ['--bundle', getBuildPath(args.configuration, appName, true, scheme), '--id', selectedDevice.udid, '--justlaunch']; | ||
const iosDeployInstallArgs = ['--bundle', getBuildPath(xcodeProject, args.configuration, appName, true, scheme), '--id', selectedDevice.udid, '--justlaunch']; | ||
@@ -227,3 +227,3 @@ _cliTools().logger.info(`Installing and launching your app on ${selectedDevice.name}`); | ||
return new Promise((resolve, reject) => { | ||
const xcodebuildArgs = [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, '-configuration', args.configuration, '-scheme', scheme, '-destination', `id=${udid}`, '-derivedDataPath', `build/${scheme}`]; | ||
const xcodebuildArgs = [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, '-configuration', args.configuration, '-scheme', scheme, '-destination', `id=${udid}`]; | ||
@@ -296,3 +296,8 @@ _cliTools().logger.info(`Building ${_chalk().default.dim(`(using "xcodebuild ${xcodebuildArgs.join(' ')}")`)}`); | ||
function getBuildPath(configuration, appName, isDevice, scheme) { | ||
function getTargetBuildDir(buildSettings) { | ||
const targetBuildMatch = /TARGET_BUILD_DIR = (.+)$/m.exec(buildSettings); | ||
return targetBuildMatch && targetBuildMatch[1] ? targetBuildMatch[1].trim() : null; | ||
} | ||
function getBuildPath(xcodeProject, configuration, appName, isDevice, scheme) { | ||
let device; | ||
@@ -308,9 +313,13 @@ | ||
let buildPath = `build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app`; // Check wether app file exist, sometimes `-derivedDataPath` option of `xcodebuild` not works as expected. | ||
const buildSettings = _child_process().default.execFileSync('xcodebuild', [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, '-scheme', scheme, '-sdk', device, '-configuration', configuration, '-showBuildSettings'], { | ||
encoding: 'utf8' | ||
}); | ||
if (!_fs().default.existsSync(_path().default.join(buildPath))) { | ||
return `DerivedData/Build/Products/${configuration}-${device}/${appName}.app`; | ||
const targetBuildDir = getTargetBuildDir(buildSettings); | ||
if (!targetBuildDir) { | ||
throw new (_cliTools().CLIError)('Failed to get the target build directory.'); | ||
} | ||
return buildPath; | ||
return `${targetBuildDir}/${appName}.app`; | ||
} | ||
@@ -317,0 +326,0 @@ |
{ | ||
"name": "@react-native-community/cli-platform-ios", | ||
"version": "3.0.5-alpha.0", | ||
"version": "3.0.5-alpha.1", | ||
"license": "MIT", | ||
@@ -24,3 +24,3 @@ "main": "build/index.js", | ||
], | ||
"gitHead": "51757572c704279c2ae9774cdfb719662a500318" | ||
"gitHead": "ae2ebe1e81c6ed2ff7816b82f0674961b92afb74" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152662
3414