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

Commit 49eb4e1

Browse files
committed
App RN build system.
1 parent c5d97a1 commit 49eb4e1

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tipsi-travis-scripts",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Scripts to run builds and tests for 3rd-party modules on Travis CI",
55
"main": "index.js",
66
"scripts": {

scripts/buildIOS.js

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,44 @@ import log from './utils/log'
1212

1313
const isProjectUsingPods = config.get('usePods')
1414

15-
function buildIOSProject(projectPath) {
16-
const iosFolder = path.resolve(projectPath, 'ios')
17-
const whatToBuild = isProjectUsingPods
18-
? '-workspace example.xcworkspace'
19-
: '-project example.xcodeproj'
15+
function buildIOSProject(projectPath, isReactNativeBuild) {
16+
if (isReactNativeBuild) {
17+
run('react-native run-ios --simulator="iPhone 6" --configuration=release', projectPath)
18+
} else {
19+
const iosFolder = path.resolve(projectPath, 'ios')
20+
const whatToBuild = isProjectUsingPods
21+
? '-workspace example.xcworkspace'
22+
: '-project example.xcodeproj'
2023

21-
log('RUN RELEASE BUILD', 'info')
22-
const xcodebuildArguments = [
23-
'build',
24-
whatToBuild,
25-
'-scheme example',
26-
'-configuration Release',
27-
'-sdk iphonesimulator',
28-
"-destination 'platform=iOS Simulator,name=iPhone 6'",
29-
'-derivedDataPath build',
30-
'ONLY_ACTIVE_ARCH=NO',
31-
"OTHER_LDFLAGS='$(inherited) -ObjC -lc++'",
32-
].join(' ')
24+
log('RUN RELEASE BUILD', 'info')
25+
const xcodebuildArguments = [
26+
'build',
27+
whatToBuild,
28+
'-scheme example',
29+
'-configuration Release',
30+
'-sdk iphonesimulator',
31+
"-destination 'platform=iOS Simulator,name=iPhone 6'",
32+
'-derivedDataPath build',
33+
'ONLY_ACTIVE_ARCH=NO',
34+
'-UseModernBuildSystem=NO',
35+
"OTHER_LDFLAGS='$(inherited) -ObjC -lc++'",
36+
].join(' ')
3337

34-
const formatter = commandExists.sync('xcpretty') ? '| xcpretty' : ''
35-
run(`xcodebuild ${xcodebuildArguments} ${formatter}`, iosFolder)
38+
const formatter = commandExists.sync('xcpretty') ? '| xcpretty' : ''
39+
run(`xcodebuild ${xcodebuildArguments} ${formatter}`, iosFolder)
40+
}
3641
}
3742

38-
export default function buildIOS() {
43+
export default function buildIOS(isReactNativeBuild = false) {
3944
if (IS_MACOS && IS_IOS) {
40-
log('', 'empty') // only for beautiful stdout
41-
log('BUILD IOS DEFAULT')
42-
buildIOSProject(DEFAULT_TESTS_FOLDER)
43-
4445
if (isProjectUsingPods) {
4546
log('', 'empty') // only for beautiful stdout
4647
log('BUILD IOS PODSPEC')
47-
buildIOSProject(PODSPEC_TESTS_FOLDER)
48+
buildIOSProject(PODSPEC_TESTS_FOLDER, isReactNativeBuild)
49+
} else {
50+
log('', 'empty') // only for beautiful stdout
51+
log('BUILD IOS DEFAULT')
52+
buildIOSProject(DEFAULT_TESTS_FOLDER, isReactNativeBuild)
4853
}
4954

5055
log('', 'empty') // only for beautiful stdout

0 commit comments

Comments
 (0)