-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4319 from wix/fix/revert-patch
chore(iOS): revert boost.podspec patch from #4317.
- Loading branch information
Showing
2 changed files
with
6 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,16 @@ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const cp = require('child_process'); | ||
|
||
const patchBoostPodspec = () => { | ||
const log = message => console.log(`[POST-INSTALL] ${message}`); | ||
const boostPodspecPath = `${process.cwd()}/node_modules/react-native/third-party-podspecs/boost.podspec`; | ||
const originalUrl = 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'; | ||
const patchedUrl = 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2'; | ||
|
||
if (!fs.existsSync(boostPodspecPath)) { | ||
log('boost.podspec does not exist, skipping patch...'); | ||
return; | ||
} | ||
|
||
let boostPodspec = fs.readFileSync(boostPodspecPath, 'utf8'); | ||
|
||
if (!boostPodspec.includes(originalUrl)) { | ||
log('boost.podspec is already patched or the URL is different, skipping patch...'); | ||
return; | ||
} | ||
|
||
log('Applying boost.podspec patch...'); | ||
boostPodspec = boostPodspec.replace(originalUrl, patchedUrl); | ||
fs.writeFileSync(boostPodspecPath, boostPodspec, 'utf8'); | ||
}; | ||
|
||
function podInstallIfRequired() { | ||
if (process.platform === 'darwin' && !process.env.DETOX_DISABLE_POD_INSTALL) { | ||
console.log('[POST-INSTALL] Running pod install...'); | ||
patchBoostPodspec(); | ||
console.log('[POST-INSTALL] Running test-app pod install...'); | ||
|
||
cp.execSync('pod install', { | ||
cwd: `${process.cwd()}/ios`, | ||
stdio: 'inherit' | ||
}); | ||
|
||
console.log('[POST-INSTALL] test-app pod install completed') | ||
} | ||
} | ||
|
||
console.log('[POST-INSTALL] Running Detox\'s test-app post-install script...'); | ||
podInstallIfRequired(); | ||
console.log('[POST-INSTALL] Completed!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,16 @@ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const cp = require('child_process'); | ||
|
||
const patchBoostPodspec = () => { | ||
const log = message => console.log(`[POST-INSTALL] ${message}`); | ||
const boostPodspecPath = `${process.cwd()}/node_modules/react-native/third-party-podspecs/boost.podspec`; | ||
const originalUrl = 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'; | ||
const patchedUrl = 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2'; | ||
|
||
if (!fs.existsSync(boostPodspecPath)) { | ||
log('boost.podspec does not exist, skipping patch...'); | ||
return; | ||
} | ||
|
||
let boostPodspec = fs.readFileSync(boostPodspecPath, 'utf8'); | ||
|
||
if (!boostPodspec.includes(originalUrl)) { | ||
log('boost.podspec is already patched or the URL is different, skipping patch...'); | ||
return; | ||
} | ||
|
||
log('Applying boost.podspec patch...'); | ||
boostPodspec = boostPodspec.replace(originalUrl, patchedUrl); | ||
fs.writeFileSync(boostPodspecPath, boostPodspec, 'utf8'); | ||
}; | ||
|
||
function podInstallIfRequired() { | ||
if (process.platform === 'darwin' && !process.env.DETOX_DISABLE_POD_INSTALL) { | ||
console.log('[POST-INSTALL] Running pod install...'); | ||
patchBoostPodspec(); | ||
console.log('[POST-INSTALL] Running example-app pod install...'); | ||
|
||
cp.execSync('pod install', { | ||
cwd: `${process.cwd()}/ios`, | ||
stdio: 'inherit' | ||
}); | ||
|
||
console.log('[POST-INSTALL] example-app pod install completed') | ||
} | ||
} | ||
|
||
console.log('[POST-INSTALL] Running Detox\'s example-app post-install script...'); | ||
podInstallIfRequired(); | ||
console.log('[POST-INSTALL] Completed!'); |