Browse Source

support for android test release builds, fixed #1154

Daniel Zlotin 7 years ago
parent
commit
0786940ef8
4 changed files with 31 additions and 2 deletions
  1. 1
    1
      package.json
  2. 19
    0
      playground/android/app/build.gradle
  3. 10
    0
      scripts/install-android.js
  4. 1
    1
      scripts/test.e2e.android.js

+ 1
- 1
package.json View File

27
   "scripts": {
27
   "scripts": {
28
     "build": ":",
28
     "build": ":",
29
     "xcode": "open playground/ios/playground.xcodeproj",
29
     "xcode": "open playground/ios/playground.xcodeproj",
30
-    "install-android": "cd playground/android && ./gradlew installDebug",
30
+    "install-android": "node ./scripts/install-android.js",
31
     "uninstall-android": "cd playground/android && ./gradlew uninstallAll",
31
     "uninstall-android": "cd playground/android && ./gradlew uninstallAll",
32
     "clean": "node ./scripts/clean.js",
32
     "clean": "node ./scripts/clean.js",
33
     "start": "node ./scripts/start.js",
33
     "start": "node ./scripts/start.js",

+ 19
- 0
playground/android/app/build.gradle View File

1
 apply plugin: "com.android.application"
1
 apply plugin: "com.android.application"
2
+
3
+project.ext.react = [
4
+        root     : "../../../",
5
+        entryFile: "playground/index.android.js"
6
+]
7
+
2
 apply from: "../../../node_modules/react-native/react.gradle"
8
 apply from: "../../../node_modules/react-native/react.gradle"
3
 
9
 
4
 android {
10
 android {
12
         versionCode 1
18
         versionCode 1
13
         versionName "1.0"
19
         versionName "1.0"
14
     }
20
     }
21
+    signingConfigs {
22
+        release {
23
+            storeFile file('../playground.jks')
24
+            storePassword "playground"
25
+            keyAlias "playground"
26
+            keyPassword "playground"
27
+        }
28
+    }
29
+    buildTypes {
30
+        release {
31
+            signingConfig signingConfigs.release
32
+        }
33
+    }
15
 }
34
 }
16
 
35
 
17
 dependencies {
36
 dependencies {

+ 10
- 0
scripts/install-android.js View File

1
+const _ = require('lodash');
2
+const exec = require('shell-utils').exec;
3
+
4
+const release = _.includes(process.argv, 'release');
5
+
6
+run();
7
+
8
+function run() {
9
+  exec.execSync(`cd playground/android && ./gradlew ${release ? 'installRelease' : 'installDebug'}`);
10
+}

+ 1
- 1
scripts/test.e2e.android.js View File

10
   }
10
   }
11
 
11
 
12
   exec.execSync(`yarn run uninstall-android`);
12
   exec.execSync(`yarn run uninstall-android`);
13
-  exec.execSync(`yarn run install-android`);
13
+  exec.execSync(`yarn run install-android ${release ? '-- release' : ''}`);
14
   exec.execSync(`cd AndroidE2E && ./gradlew connectedDebugAndroidTest`);
14
   exec.execSync(`cd AndroidE2E && ./gradlew connectedDebugAndroidTest`);
15
 }
15
 }
16
 
16