Browse Source

android compiles

Daniel Zlotin 7 years ago
parent
commit
780944acc3

+ 2
- 2
android/app/build.gradle View File

@@ -47,8 +47,8 @@ android {
47 47
 dependencies {
48 48
     compile fileTree(dir: "libs", include: ["*.jar"])
49 49
 
50
-    compile 'com.android.support:design:25.0.1'
51
-    compile "com.android.support:appcompat-v7:25.0.1"
50
+    compile 'com.android.support:design:25.1.1'
51
+    compile "com.android.support:appcompat-v7:25.1.1"
52 52
 
53 53
     // node_modules
54 54
     compile "com.facebook.react:react-native:+"

+ 20
- 0
android/app/src/test/java/com/reactnativenavigation/EnvironmentTest.java View File

@@ -1,5 +1,10 @@
1 1
 package com.reactnativenavigation;
2 2
 
3
+import android.support.design.widget.FloatingActionButton;
4
+import android.support.v7.app.AppCompatActivity;
5
+
6
+import com.facebook.react.common.ReactConstants;
7
+
3 8
 import org.junit.Test;
4 9
 import org.junit.runner.RunWith;
5 10
 import org.robolectric.RobolectricTestRunner;
@@ -12,4 +17,19 @@ public class EnvironmentTest {
12 17
     public void assertJ() {
13 18
         assertThat(1 + 2).isEqualTo(3).isGreaterThan(2).isLessThan(4).isNotNegative().isPositive().isNotZero();
14 19
     }
20
+
21
+    @Test
22
+    public void react() {
23
+        assertThat(ReactConstants.TAG).isNotEmpty();
24
+    }
25
+
26
+    @Test
27
+    public void supportV7AppCompat() {
28
+        assertThat(AppCompatActivity.class).isNotNull();
29
+    }
30
+
31
+    @Test
32
+    public void supportDesign() {
33
+        assertThat(FloatingActionButton.class).isNotNull();
34
+    }
15 35
 }

+ 0
- 2
android/gradle.properties View File

@@ -16,5 +16,3 @@
16 16
 # This option should only be used with decoupled projects. More details, visit
17 17
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 18
 # org.gradle.parallel=true
19
-
20
-android.useDeprecatedNdk=true

BIN
android/gradle/wrapper/gradle-wrapper.jar View File


+ 1
- 1
android/gradle/wrapper/gradle-wrapper.properties View File

@@ -1,4 +1,4 @@
1
-#Mon Sep 12 16:05:44 IDT 2016
1
+#Mon Dec 28 10:00:20 PST 2015
2 2
 distributionBase=GRADLE_USER_HOME
3 3
 distributionPath=wrapper/dists
4 4
 zipStoreBase=GRADLE_USER_HOME

+ 21
- 25
android/gradlew View File

@@ -6,30 +6,12 @@
6 6
 ##
7 7
 ##############################################################################
8 8
 
9
-# Attempt to set APP_HOME
10
-# Resolve links: $0 may be a link
11
-PRG="$0"
12
-# Need this for relative symlinks.
13
-while [ -h "$PRG" ] ; do
14
-    ls=`ls -ld "$PRG"`
15
-    link=`expr "$ls" : '.*-> \(.*\)$'`
16
-    if expr "$link" : '/.*' > /dev/null; then
17
-        PRG="$link"
18
-    else
19
-        PRG=`dirname "$PRG"`"/$link"
20
-    fi
21
-done
22
-SAVED="`pwd`"
23
-cd "`dirname \"$PRG\"`/" >/dev/null
24
-APP_HOME="`pwd -P`"
25
-cd "$SAVED" >/dev/null
9
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10
+DEFAULT_JVM_OPTS=""
26 11
 
27 12
 APP_NAME="Gradle"
28 13
 APP_BASE_NAME=`basename "$0"`
29 14
 
30
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
-DEFAULT_JVM_OPTS=""
32
-
33 15
 # Use the maximum available, or set MAX_FD != -1 to use that value.
34 16
 MAX_FD="maximum"
35 17
 
@@ -48,7 +30,6 @@ die ( ) {
48 30
 cygwin=false
49 31
 msys=false
50 32
 darwin=false
51
-nonstop=false
52 33
 case "`uname`" in
53 34
   CYGWIN* )
54 35
     cygwin=true
@@ -59,11 +40,26 @@ case "`uname`" in
59 40
   MINGW* )
60 41
     msys=true
61 42
     ;;
62
-  NONSTOP* )
63
-    nonstop=true
64
-    ;;
65 43
 esac
66 44
 
45
+# Attempt to set APP_HOME
46
+# Resolve links: $0 may be a link
47
+PRG="$0"
48
+# Need this for relative symlinks.
49
+while [ -h "$PRG" ] ; do
50
+    ls=`ls -ld "$PRG"`
51
+    link=`expr "$ls" : '.*-> \(.*\)$'`
52
+    if expr "$link" : '/.*' > /dev/null; then
53
+        PRG="$link"
54
+    else
55
+        PRG=`dirname "$PRG"`"/$link"
56
+    fi
57
+done
58
+SAVED="`pwd`"
59
+cd "`dirname \"$PRG\"`/" >/dev/null
60
+APP_HOME="`pwd -P`"
61
+cd "$SAVED" >/dev/null
62
+
67 63
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 64
 
69 65
 # Determine the Java command to use to start the JVM.
@@ -89,7 +85,7 @@ location of your Java installation."
89 85
 fi
90 86
 
91 87
 # Increase the maximum file descriptors if we can.
92
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
88
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
93 89
     MAX_FD_LIMIT=`ulimit -H -n`
94 90
     if [ $? -eq 0 ] ; then
95 91
         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then

+ 4
- 4
android/gradlew.bat View File

@@ -8,14 +8,14 @@
8 8
 @rem Set local scope for the variables with windows NT shell
9 9
 if "%OS%"=="Windows_NT" setlocal
10 10
 
11
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12
+set DEFAULT_JVM_OPTS=
13
+
11 14
 set DIRNAME=%~dp0
12 15
 if "%DIRNAME%" == "" set DIRNAME=.
13 16
 set APP_BASE_NAME=%~n0
14 17
 set APP_HOME=%DIRNAME%
15 18
 
16
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
-set DEFAULT_JVM_OPTS=
18
-
19 19
 @rem Find java.exe
20 20
 if defined JAVA_HOME goto findJavaFromJavaHome
21 21
 
@@ -46,7 +46,7 @@ echo location of your Java installation.
46 46
 goto fail
47 47
 
48 48
 :init
49
-@rem Get command-line arguments, handling Windows variants
49
+@rem Get command-line arguments, handling Windowz variants
50 50
 
51 51
 if not "%OS%" == "Windows_NT" goto win9xME_args
52 52
 if "%@eval[2+2]" == "4" goto 4NT_args

+ 1
- 1
android/prepare-robolectric.gradle View File

@@ -1,4 +1,4 @@
1
-def robolectricDependenciesFolder = rootProject.buildDir.path + "/robolectric-dependencies"
1
+def robolectricDependenciesFolder = new File(gradle.gradleUserHomeDir, "/robolectric-dependencies-3.2.2")
2 2
 
3 3
 configurations.create('robolectricRuntime')
4 4
 

+ 1
- 31
playground/android/app/build.gradle View File

@@ -6,41 +6,11 @@ android {
6 6
     buildToolsVersion "25.0.2"
7 7
 
8 8
     defaultConfig {
9
-        applicationId "com.example"
9
+        applicationId "com.reactnativenavigation.playground"
10 10
         minSdkVersion 16
11 11
         targetSdkVersion 25
12 12
         versionCode 1
13 13
         versionName "1.0"
14
-        ndk {
15
-            abiFilters "armeabi-v7a", "x86"
16
-        }
17
-    }
18
-    splits {
19
-        abi {
20
-            reset()
21
-            enable false
22
-            universalApk false  // If true, also generate a universal APK
23
-            include "armeabi-v7a", "x86"
24
-        }
25
-    }
26
-    buildTypes {
27
-        release {
28
-            minifyEnabled false
29
-            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
30
-        }
31
-    }
32
-    // applicationVariants are e.g. debug, release
33
-    applicationVariants.all { variant ->
34
-        variant.outputs.each { output ->
35
-            // For each separate APK per architecture, set a unique version code as described here:
36
-            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
37
-            def versionCodes = ["armeabi-v7a": 1, "x86": 2]
38
-            def abi = output.getFilter(OutputFile.ABI)
39
-            if (abi != null) {  // null for the universal-debug, universal-release variants
40
-                output.versionCodeOverride =
41
-                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
42
-            }
43
-        }
44 14
     }
45 15
 }
46 16
 

+ 1
- 1
playground/android/app/src/main/res/values/strings.xml View File

@@ -1,3 +1,3 @@
1 1
 <resources>
2
-    <string name="app_name">example</string>
2
+    <string name="app_name">Playground</string>
3 3
 </resources>