@norcy/react-native-toolkit 0.1.154 → 0.1.156

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.
@@ -1,26 +1,23 @@
1
- /**
2
- * Norcy Toolkit - Common Android Build Configuration
3
- * 提供通用的 Android 构建配置和依赖管理函数
4
- */
5
-
6
- ext.applyNorcyDefaultConfig = { targetProject, options = [:] ->
7
- def enableSeparateBuildPerCPUArchitecture = options.enableSeparateBuildPerCPUArchitecture ?: false
8
- def abiFiltersList = options.abiFilters ?: ["armeabi-v7a", "arm64-v8a"]
9
-
1
+ ext.applyDefaultConfig = { targetProject ->
10
2
  targetProject.android {
3
+ compileSdkVersion targetProject.rootProject.ext.compileSdkVersion
4
+
11
5
  defaultConfig {
6
+ minSdkVersion targetProject.rootProject.ext.minSdkVersion
7
+ targetSdkVersion targetProject.rootProject.ext.targetSdkVersion
12
8
  multiDexEnabled true
9
+ missingDimensionStrategy 'store', 'play'
13
10
  ndk {
14
- abiFilters(*abiFiltersList)
11
+ abiFilters "armeabi-v7a", "arm64-v8a"
15
12
  }
16
13
  }
17
14
 
18
15
  splits {
19
16
  abi {
20
17
  reset()
21
- enable enableSeparateBuildPerCPUArchitecture
18
+ enable false
22
19
  universalApk true
23
- include(*abiFiltersList)
20
+ include "armeabi-v7a", "arm64-v8a"
24
21
  }
25
22
  }
26
23
 
@@ -31,11 +28,22 @@ ext.applyNorcyDefaultConfig = { targetProject, options = [:] ->
31
28
  keyAlias 'androiddebugkey'
32
29
  keyPassword 'android'
33
30
  }
31
+ release {
32
+ if (targetProject.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
33
+ storeFile targetProject.file(targetProject.MYAPP_RELEASE_STORE_FILE)
34
+ storePassword targetProject.MYAPP_RELEASE_STORE_PASSWORD
35
+ keyAlias targetProject.MYAPP_RELEASE_KEY_ALIAS
36
+ keyPassword targetProject.MYAPP_RELEASE_KEY_PASSWORD
37
+ }
38
+ }
34
39
  }
35
40
  }
36
41
  }
37
42
 
38
- ext.applyNorcyCommonDependencies = { targetProject, enableHermes, jscFlavor ->
43
+ ext.applyCommonDependencies = { targetProject ->
44
+ def enableHermes = targetProject.ext.react.get("enableHermes", false)
45
+ def jscFlavor = 'org.webkit:android-jsc:+'
46
+
39
47
  targetProject.dependencies {
40
48
  implementation fileTree(dir: "libs", include: ["*.jar"])
41
49
 
@@ -61,24 +69,25 @@ ext.applyNorcyCommonDependencies = { targetProject, enableHermes, jscFlavor ->
61
69
  }
62
70
  }
63
71
 
64
- ext.applyNorcyBuildTypes = { targetProject, options = [:] ->
65
- def enableProguardInReleaseBuilds = options.enableProguardInReleaseBuilds ?: false
66
-
72
+ ext.applyBuildTypes = { targetProject ->
67
73
  targetProject.android {
68
74
  buildTypes {
69
75
  debug {
70
76
  signingConfig signingConfigs.debug
77
+ resValue "string", "app_name", "@string/app_name_debug"
71
78
  }
72
79
  release {
73
- minifyEnabled enableProguardInReleaseBuilds
80
+ signingConfig signingConfigs.debug
81
+ minifyEnabled false
74
82
  proguardFiles targetProject.android.getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
75
83
  crunchPngs false
84
+ resValue "string", "app_name", "@string/app_name_release"
76
85
  }
77
86
  }
78
87
  }
79
88
  }
80
89
 
81
- ext.applyNorcyCommonAndroidConfig = { targetProject ->
90
+ ext.applyCommonAndroidConfig = { targetProject ->
82
91
  targetProject.android {
83
92
  compileOptions {
84
93
  sourceCompatibility JavaVersion.VERSION_1_8
@@ -114,9 +123,7 @@ ext.applyNorcyCommonAndroidConfig = { targetProject ->
114
123
  }
115
124
  }
116
125
 
117
- ext.applyNorcyCommonPlugins = { targetProject, options = [:] ->
118
- def sentryPropertiesPath = options.sentryPropertiesPath ?: "../sentry.properties"
119
-
126
+ ext.applyCommonPlugins = { targetProject ->
120
127
  targetProject.apply from: targetProject.file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle")
121
128
  targetProject.applyNativeModulesAppBuildGradle(targetProject)
122
129
 
@@ -125,7 +132,17 @@ ext.applyNorcyCommonPlugins = { targetProject, options = [:] ->
125
132
 
126
133
  targetProject.ext.sentryCli = [
127
134
  logLevel: "debug",
128
- sentryProperties: sentryPropertiesPath
135
+ sentryProperties: "../sentry.properties"
129
136
  ]
130
137
  }
131
138
 
139
+ ext.applyAll = { targetProject ->
140
+ targetProject.ext.react = [enableHermes: false]
141
+ targetProject.apply from: targetProject.file("../../node_modules/react-native/react.gradle")
142
+
143
+ applyDefaultConfig(targetProject)
144
+ applyBuildTypes(targetProject)
145
+ applyCommonAndroidConfig(targetProject)
146
+ applyCommonPlugins(targetProject)
147
+ }
148
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norcy/react-native-toolkit",
3
- "version": "0.1.154",
3
+ "version": "0.1.156",
4
4
  "description": "My Toolkit",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",