Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
App RN build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-lemon committed Jul 25, 2019
1 parent c5d97a1 commit 49eb4e1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tipsi-travis-scripts",
"version": "1.1.0",
"version": "1.2.0",
"description": "Scripts to run builds and tests for 3rd-party modules on Travis CI",
"main": "index.js",
"scripts": {
Expand Down
55 changes: 30 additions & 25 deletions scripts/buildIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,44 @@ import log from './utils/log'

const isProjectUsingPods = config.get('usePods')

function buildIOSProject(projectPath) {
const iosFolder = path.resolve(projectPath, 'ios')
const whatToBuild = isProjectUsingPods
? '-workspace example.xcworkspace'
: '-project example.xcodeproj'
function buildIOSProject(projectPath, isReactNativeBuild) {
if (isReactNativeBuild) {
run('react-native run-ios --simulator="iPhone 6" --configuration=release', projectPath)
} else {
const iosFolder = path.resolve(projectPath, 'ios')
const whatToBuild = isProjectUsingPods
? '-workspace example.xcworkspace'
: '-project example.xcodeproj'

log('RUN RELEASE BUILD', 'info')
const xcodebuildArguments = [
'build',
whatToBuild,
'-scheme example',
'-configuration Release',
'-sdk iphonesimulator',
"-destination 'platform=iOS Simulator,name=iPhone 6'",
'-derivedDataPath build',
'ONLY_ACTIVE_ARCH=NO',
"OTHER_LDFLAGS='$(inherited) -ObjC -lc++'",
].join(' ')
log('RUN RELEASE BUILD', 'info')
const xcodebuildArguments = [
'build',
whatToBuild,
'-scheme example',
'-configuration Release',
'-sdk iphonesimulator',
"-destination 'platform=iOS Simulator,name=iPhone 6'",
'-derivedDataPath build',
'ONLY_ACTIVE_ARCH=NO',
'-UseModernBuildSystem=NO',
"OTHER_LDFLAGS='$(inherited) -ObjC -lc++'",
].join(' ')

const formatter = commandExists.sync('xcpretty') ? '| xcpretty' : ''
run(`xcodebuild ${xcodebuildArguments} ${formatter}`, iosFolder)
const formatter = commandExists.sync('xcpretty') ? '| xcpretty' : ''
run(`xcodebuild ${xcodebuildArguments} ${formatter}`, iosFolder)
}
}

export default function buildIOS() {
export default function buildIOS(isReactNativeBuild = false) {
if (IS_MACOS && IS_IOS) {
log('', 'empty') // only for beautiful stdout
log('BUILD IOS DEFAULT')
buildIOSProject(DEFAULT_TESTS_FOLDER)

if (isProjectUsingPods) {
log('', 'empty') // only for beautiful stdout
log('BUILD IOS PODSPEC')
buildIOSProject(PODSPEC_TESTS_FOLDER)
buildIOSProject(PODSPEC_TESTS_FOLDER, isReactNativeBuild)
} else {
log('', 'empty') // only for beautiful stdout
log('BUILD IOS DEFAULT')
buildIOSProject(DEFAULT_TESTS_FOLDER, isReactNativeBuild)
}

log('', 'empty') // only for beautiful stdout
Expand Down

0 comments on commit 49eb4e1

Please sign in to comment.