Daniel Zlotin 7 anni fa
parent
commit
4224a7f340

+ 31
- 29
.travis.yml Vedi File

@@ -1,42 +1,44 @@
1
+env:
2
+  global:
3
+    - RCT_NO_LAUNCH_PACKAGER=true
4
+
1 5
 matrix:
2 6
   include:
3
-    - os: osx
7
+    - env:
8
+      - TYPE=iOS
9
+      os: osx
4 10
       osx_image: xcode9
5 11
       language: objective-c
6
-
7
-env:
8
-  global:
9
-    - RCT_NO_LAUNCH_PACKAGER=true
12
+      install:
13
+        - source ./scripts/env/env.ios.sh
14
+      script:
15
+        - ./scripts/travis.ios.sh
16
+    - env:
17
+      - TYPE=Android
18
+      os: linux
19
+      jdk: oraclejdk8
20
+      language: java
21
+      install:
22
+        - source ./scripts/env/env.android.sh
23
+      script:
24
+        - ./scripts/travis.android.sh
25
+      before_cache:
26
+        - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
27
+        - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
28
+      cache:
29
+        directories:
30
+          - $HOME/.m2
31
+          - $HOME/.gradle/caches/
32
+          - $HOME/.gradle/wrapper/
33
+          - $HOME/.android/build-cache
10 34
 
11 35
 branches:
12 36
   only:
13 37
   - master
14 38
   - v2
15 39
 
16
-before_cache:
17
-  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
18
-  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
19
-cache:
20
-  directories:
21
-    - $HOME/.m2
22
-    - $HOME/.gradle/caches/
23
-    - $HOME/.gradle/wrapper/
24
-    - $HOME/.android/build-cache
25
-
26
-install:
27
-        # node:
28
-  - source ./scripts/env/installNode.sh
29
-        # android sdk:
30
-  - source ./scripts/env/installAndroidSDK.sh
31
-        # AppleSimUtils
32
-  - source ./scripts/env/installAppleSimUtils.sh
33
-        # xcpretty
34
-  - source ./scripts/env/installXcpretty.sh
35
-
36
-script:
37
-  - set -e
38
-  - ./scripts/travis.sh
39
-  - set +e
40
+before_install:
41
+  - nvm install 8
40 42
 
41 43
 after_script:
42 44
   - echo "BUILD FINISHED"

+ 8
- 5
scripts/clean.js Vedi File

@@ -6,9 +6,12 @@ function run() {
6 6
   exec.killPort(8081);
7 7
   exec.execSync(`watchman watch-del-all || true`);
8 8
   exec.execSync(`adb reverse tcp:8081 tcp:8081 || true`);
9
-  exec.execSync(`rm -rf lib/ios/DerivedData/`);
10
-  exec.execSync(`rm -rf playground/ios/DerivedData/`);
11
-  exec.execSync(`cd lib/android && ./gradlew clean`);
12
-  exec.execSync(`cd playground/android && ./gradlew clean`);
13
-  exec.execSync(`cd AndroidE2E && ./gradlew clean`);
9
+  exec.execSync(`rm -rf lib/ios/DerivedData`);
10
+  exec.execSync(`rm -rf playground/ios/DerivedData`);
11
+  exec.execSync(`rm -rf lib/android/build`);
12
+  exec.execSync(`rm -rf lib/android/app/build`);
13
+  exec.execSync(`rm -rf playground/android/build`);
14
+  exec.execSync(`rm -rf playground/android/app/build`);
15
+  exec.execSync(`rm -rf AndroidE2E/android/build`);
16
+  exec.execSync(`rm -rf AndroidE2E/android/app/build`);
14 17
 }

scripts/env/installAndroidSDK.sh → scripts/env/env.android.sh Vedi File


scripts/env/installAppleSimUtils.sh → scripts/env/env.ios.sh Vedi File

@@ -2,3 +2,5 @@
2 2
 
3 3
 brew tap wix/brew
4 4
 brew install wix/brew/applesimutils
5
+
6
+gem install xcpretty

+ 0
- 3
scripts/env/installNode.sh Vedi File

@@ -1,3 +0,0 @@
1
-#!/bin/bash -e
2
-
3
-nvm install 8

+ 0
- 3
scripts/env/installXcpretty.sh Vedi File

@@ -1,3 +0,0 @@
1
-#!/bin/bash -e
2
-
3
-gem install xcpretty

+ 18
- 0
scripts/travis-fold.sh Vedi File

@@ -0,0 +1,18 @@
1
+#!/bin/bash -e
2
+
3
+lightCyan='\033[1;36m'
4
+green='\033[0;32m'
5
+nocolor='\033[0m'
6
+
7
+cmd="${1}"
8
+name=${cmd//[ ]/_}
9
+
10
+echo "travis_fold:start:$name"
11
+echo -e "${lightCyan}\t\t $cmd ${nocolor}"
12
+SECONDS=0
13
+
14
+($cmd)
15
+
16
+duration=$SECONDS
17
+echo "travis_fold:end:$name"
18
+echo -e "${green}\t\t\t --> $(($duration / 60)) minutes and $(($duration % 60)) seconds ${nocolor}\n"

+ 5
- 0
scripts/travis.android.sh Vedi File

@@ -0,0 +1,5 @@
1
+./scripts/travis-fold.sh "npm install"
2
+./scripts/travis-fold.sh "npm run clean"
3
+./scripts/travis-fold.sh "npm run test-js"
4
+./scripts/travis-fold.sh "npm run test-unit-android -- --release"
5
+./scripts/travis-fold.sh "npm run test-e2e-android -- --release"

+ 5
- 0
scripts/travis.ios.sh Vedi File

@@ -0,0 +1,5 @@
1
+./scripts/travis-fold.sh "npm install"
2
+./scripts/travis-fold.sh "npm run clean"
3
+./scripts/travis-fold.sh "npm run test-js"
4
+./scripts/travis-fold.sh "npm run test-unit-ios -- --release"
5
+./scripts/travis-fold.sh "npm run test-e2e-ios -- --release"

+ 8
- 0
scripts/travis.js.sh Vedi File

@@ -0,0 +1,8 @@
1
+./scripts/travis-fold.sh "npm install"
2
+./scripts/travis-fold.sh "npm run clean"
3
+./scripts/travis-fold.sh "npm run test-js"
4
+./scripts/travis-fold.sh "npm run test-unit-android -- --release"
5
+./scripts/travis-fold.sh "npm run test-unit-ios -- --release"
6
+./scripts/travis-fold.sh "npm run test-e2e-android -- --release"
7
+./scripts/travis-fold.sh "npm run test-e2e-ios -- --release"
8
+# ./scripts/travis-fold.sh "npm run release"

+ 0
- 29
scripts/travis.sh Vedi File

@@ -1,29 +0,0 @@
1
-#!/bin/bash -e
2
-
3
-lightCyan='\033[1;36m'
4
-green='\033[0;32m'
5
-nocolor='\033[0m'
6
-
7
-run_f () {
8
-  cmd="${1}"
9
-  name=${cmd//[ ]/_}
10
-
11
-  echo "travis_fold:start:$name"
12
-  echo -e "${lightCyan}\t\t $cmd ${nocolor}"
13
-  SECONDS=0
14
-
15
-  ($cmd)
16
-
17
-  duration=$SECONDS
18
-  echo "travis_fold:end:$name"
19
-  echo -e "${green}\t\t\t --> $(($duration / 60)) minutes and $(($duration % 60)) seconds ${nocolor}\n"
20
-}
21
-
22
-run_f "npm install"
23
-run_f "npm run clean"
24
-run_f "npm run test-js"
25
-run_f "npm run test-unit-android -- --release"
26
-run_f "npm run test-unit-ios -- --release"
27
-run_f "npm run test-e2e-android -- --release"
28
-run_f "npm run test-e2e-ios -- --release"
29
-run_f "npm run release"