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

App RN build system. #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ matrix:
include:
- os: osx
language: objective-c
osx_image: xcode9.4
osx_image: xcode10.2
env:
- OS: 'ios'

- os: linux
language: android
jdk: oraclejdk8
sudo: required
before_script:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
android:
components:
- platform-tools
Expand Down Expand Up @@ -42,7 +44,7 @@ script:
- source ~/.nvm/nvm.sh

# Installi a lts version of Node
- nvm install --lts
- nvm install 11.6.0

# Run build script
- npm run ci
Expand Down
8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.57.0",
"react-native": "0.57.8",
"tipsi-travis-scripts": "file:../tipsi-travis-scripts-latest.tgz"
},
"devDependencies": {
"appium": "1.8.1",
"appium": "1.14.0",
"babel-jest": "23.6.0",
"metro-react-native-babel-preset": "0.45.2",
"jest": "23.6.0",
"react-test-renderer": "16.5.0",
"tape-async": "2.3.0",
"tipsi-appium-helper": "3.0.0",
"webdriverio": "4.7.1",
"tipsi-appium-helper": "3.3.0",
"webdriverio": "5.11.7",
"wml": "0.0.83"
},
"jest": {
Expand Down
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