瀏覽代碼

fix: Android stand-alone build.gradle with .gitignore (#33)

Rapsssito 4 年之前
父節點
當前提交
c1c143bcad
共有 2 個文件被更改,包括 26 次插入0 次删除
  1. 2
    0
      .gitignore
  2. 24
    0
      android/build.gradle

+ 2
- 0
.gitignore 查看文件

38
 .gradle
38
 .gradle
39
 local.properties
39
 local.properties
40
 *.iml
40
 *.iml
41
+android/gradle
42
+android/gradlew*
41
 
43
 
42
 # BUCK
44
 # BUCK
43
 buck-out/
45
 buck-out/

+ 24
- 0
android/build.gradle 查看文件

2
   return rootProject.ext.has(name) ? rootProject.ext.get(name) : defaultVaue
2
   return rootProject.ext.has(name) ? rootProject.ext.get(name) : defaultVaue
3
 }
3
 }
4
 
4
 
5
+buildscript {
6
+    // The Android Gradle plugin is only required when opening the android folder stand-alone.
7
+    // This avoids unnecessary downloads and potential conflicts when the library is included as a
8
+    // module dependency in an application project.
9
+    if (project == rootProject) {
10
+        repositories {
11
+            google()
12
+            jcenter()
13
+        }
14
+        dependencies {
15
+            classpath 'com.android.tools.build:gradle:3.5.0'
16
+        }
17
+    }
18
+}
19
+
5
 apply plugin: 'com.android.library'
20
 apply plugin: 'com.android.library'
6
 
21
 
7
 android {
22
 android {
16
   }
31
   }
17
 }
32
 }
18
 
33
 
34
+repositories {
35
+    google()
36
+    maven {
37
+        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
38
+        url "$rootDir/../node_modules/react-native/android"
39
+    }
40
+    jcenter()
41
+}
42
+
19
 dependencies {
43
 dependencies {
20
   //noinspection GradleDynamicVersion
44
   //noinspection GradleDynamicVersion
21
   implementation 'com.facebook.react:react-native:+'
45
   implementation 'com.facebook.react:react-native:+'