@norcy/react-native-toolkit 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
buildscript {
|
|
2
|
-
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
-
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeToolkit_kotlinVersion']
|
|
4
|
-
|
|
5
|
-
repositories {
|
|
6
|
-
google()
|
|
7
|
-
jcenter()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
dependencies {
|
|
11
|
-
classpath 'com.android.tools.build:gradle:3.2.1'
|
|
12
|
-
// noinspection DifferentKotlinGradleVersion
|
|
13
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
1
|
apply plugin: 'com.android.library'
|
|
18
2
|
apply plugin: 'kotlin-android'
|
|
19
3
|
|
|
@@ -28,109 +12,39 @@ def getExtOrIntegerDefault(name) {
|
|
|
28
12
|
android {
|
|
29
13
|
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
30
14
|
buildToolsVersion getExtOrDefault('buildToolsVersion')
|
|
15
|
+
namespace "com.norcy.reactnativetoolkit"
|
|
31
16
|
defaultConfig {
|
|
32
|
-
minSdkVersion
|
|
17
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
33
18
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
34
19
|
versionCode 1
|
|
35
20
|
versionName "1.0"
|
|
36
|
-
|
|
37
21
|
}
|
|
38
|
-
|
|
22
|
+
|
|
39
23
|
buildTypes {
|
|
40
24
|
release {
|
|
41
25
|
minifyEnabled false
|
|
42
26
|
}
|
|
43
27
|
}
|
|
44
|
-
|
|
28
|
+
lint {
|
|
45
29
|
disable 'GradleCompatible'
|
|
46
30
|
}
|
|
47
31
|
compileOptions {
|
|
48
|
-
sourceCompatibility JavaVersion.
|
|
49
|
-
targetCompatibility JavaVersion.
|
|
32
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
33
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
50
34
|
}
|
|
51
35
|
}
|
|
52
36
|
|
|
53
37
|
repositories {
|
|
54
38
|
mavenCentral()
|
|
55
|
-
jcenter()
|
|
56
39
|
google()
|
|
57
|
-
|
|
58
|
-
def found = false
|
|
59
|
-
def defaultDir = null
|
|
60
|
-
def androidSourcesName = 'React Native sources'
|
|
61
|
-
|
|
62
|
-
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
63
|
-
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
64
|
-
} else {
|
|
65
|
-
defaultDir = new File(
|
|
66
|
-
projectDir,
|
|
67
|
-
'/../../../node_modules/react-native/android'
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (defaultDir.exists()) {
|
|
72
|
-
maven {
|
|
73
|
-
url defaultDir.toString()
|
|
74
|
-
name androidSourcesName
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
78
|
-
found = true
|
|
79
|
-
} else {
|
|
80
|
-
def parentDir = rootProject.projectDir
|
|
81
|
-
|
|
82
|
-
1.upto(5, {
|
|
83
|
-
if (found) return true
|
|
84
|
-
parentDir = parentDir.parentFile
|
|
85
|
-
|
|
86
|
-
def androidSourcesDir = new File(
|
|
87
|
-
parentDir,
|
|
88
|
-
'node_modules/react-native'
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
def androidPrebuiltBinaryDir = new File(
|
|
92
|
-
parentDir,
|
|
93
|
-
'node_modules/react-native/android'
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
if (androidPrebuiltBinaryDir.exists()) {
|
|
97
|
-
maven {
|
|
98
|
-
url androidPrebuiltBinaryDir.toString()
|
|
99
|
-
name androidSourcesName
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
103
|
-
found = true
|
|
104
|
-
} else if (androidSourcesDir.exists()) {
|
|
105
|
-
maven {
|
|
106
|
-
url androidSourcesDir.toString()
|
|
107
|
-
name androidSourcesName
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
111
|
-
found = true
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (!found) {
|
|
117
|
-
throw new GradleException(
|
|
118
|
-
"${project.name}: unable to locate React Native android sources. " +
|
|
119
|
-
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
40
|
}
|
|
123
41
|
|
|
124
|
-
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
125
|
-
|
|
126
42
|
dependencies {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
130
|
-
|
|
43
|
+
implementation "com.facebook.react:react-android:+"
|
|
44
|
+
|
|
131
45
|
// react-native-splash-screen 强制依赖 - 宿主 App 必须安装
|
|
132
46
|
implementation project(':react-native-splash-screen')
|
|
133
|
-
|
|
47
|
+
|
|
134
48
|
// 友盟统计
|
|
135
49
|
implementation 'com.umeng.umsdk:common:9.6.3'
|
|
136
50
|
implementation 'com.umeng.umsdk:asms:1.8.0'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
ext.applyBuildscriptExt = {
|
|
2
|
-
ext.buildToolsVersion = "
|
|
3
|
-
ext.minSdkVersion =
|
|
4
|
-
ext.compileSdkVersion =
|
|
2
|
+
ext.buildToolsVersion = "35.0.0"
|
|
3
|
+
ext.minSdkVersion = 24
|
|
4
|
+
ext.compileSdkVersion = 35
|
|
5
5
|
ext.targetSdkVersion = 34
|
|
6
|
-
ext.ndkVersion = "
|
|
7
|
-
ext.kotlinVersion = "
|
|
6
|
+
ext.ndkVersion = "27.1.12297006"
|
|
7
|
+
ext.kotlinVersion = "2.0.21"
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
ext.applyBuildscriptRepos = { handler ->
|
|
@@ -5,8 +5,10 @@ import android.app.Application;
|
|
|
5
5
|
import com.facebook.react.ReactApplication;
|
|
6
6
|
import com.facebook.react.ReactNativeHost;
|
|
7
7
|
import com.facebook.react.ReactPackage;
|
|
8
|
+
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
|
8
9
|
import com.facebook.soloader.SoLoader;
|
|
9
10
|
|
|
11
|
+
import java.io.IOException;
|
|
10
12
|
import java.util.List;
|
|
11
13
|
|
|
12
14
|
public abstract class BaseToolkitApplication extends Application implements ReactApplication {
|
|
@@ -57,7 +59,11 @@ public abstract class BaseToolkitApplication extends Application implements Reac
|
|
|
57
59
|
@Override
|
|
58
60
|
public void onCreate() {
|
|
59
61
|
super.onCreate();
|
|
60
|
-
|
|
62
|
+
try {
|
|
63
|
+
SoLoader.init(this, OpenSourceMergedSoMapping.INSTANCE);
|
|
64
|
+
} catch (IOException e) {
|
|
65
|
+
throw new RuntimeException(e);
|
|
66
|
+
}
|
|
61
67
|
UMengManager.getInstance().setup(this, getUmengAppKey());
|
|
62
68
|
}
|
|
63
69
|
}
|