@@ -35,77 +35,20 @@ react {
35
35
hermesCommand = new File ([" node" , " --print" , " require.resolve('react-native/package.json')" ]. execute(null , rootDir). text. trim()). getParentFile(). getAbsolutePath() + " /sdks/hermesc/%OS-BIN%/hermesc"
36
36
codegenDir = new File ([" node" , " --print" , " require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })" ]. execute(null , rootDir). text. trim()). getParentFile(). getAbsoluteFile()
37
37
38
- // Use Expo CLI to bundle the app, this ensures the Metro config
39
- // works correctly with Expo projects.
40
38
cliFile = new File ([" node" , " --print" , " require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })" ]. execute(null , rootDir). text. trim())
41
39
bundleCommand = " export:embed"
42
40
43
- /* Folders */
44
- // The root of your project, i.e. where "package.json" lives. Default is '..'
45
- // root = file("../")
46
- // The folder where the react-native NPM package is. Default is ../node_modules/react-native
47
- // reactNativeDir = file("../node_modules/react-native")
48
- // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
49
- // codegenDir = file("../node_modules/@react-native/codegen")
50
-
51
- /* Variants */
52
- // The list of variants to that are debuggable. For those we're going to
53
- // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
54
- // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
55
- // debuggableVariants = ["liteDebug", "prodDebug"]
56
-
57
- /* Bundling */
58
- // A list containing the node command and its flags. Default is just 'node'.
59
- // nodeExecutableAndArgs = ["node"]
60
-
61
- //
62
- // The path to the CLI configuration file. Default is empty.
63
- // bundleConfig = file(../rn-cli.config.js)
64
- //
65
- // The name of the generated asset file containing your JS bundle
66
- // bundleAssetName = "MyApplication.android.bundle"
67
- //
68
- // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
69
- // entryFile = file("../js/MyApplication.android.js")
70
- //
71
- // A list of extra flags to pass to the 'bundle' commands.
72
- // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
73
- // extraPackagerArgs = []
74
-
75
- /* Hermes Commands */
76
- // The hermes compiler command to run. By default it is 'hermesc'
77
- // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
78
- //
79
- // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
80
- // hermesFlags = ["-O", "-output-source-map"]
81
-
82
41
if (rnVersion >= versionToNumber(0 , 75 , 0 )) {
83
- /* Autolinking */
84
42
autolinkLibrariesWithApp()
85
43
}
86
44
}
87
45
88
- /**
89
- * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
90
- */
91
46
def enableProguardInReleaseBuilds = (findProperty(' android.enableProguardInReleaseBuilds' ) ?: false ). toBoolean()
92
-
93
- /**
94
- * The preferred build flavor of JavaScriptCore (JSC)
95
- *
96
- * For example, to use the international variant, you can use:
97
- * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
98
- *
99
- * The international variant includes ICU i18n library and necessary data
100
- * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
101
- * give correct results when using with locales other than en-US. Note that
102
- * this variant is about 6MiB larger per architecture than default.
103
- */
47
+ def enableHermes = project. hasProperty(" expo.jsEngine" ) && project. ext[" expo.jsEngine" ] == " hermes"
104
48
def jscFlavor = ' org.webkit:android-jsc:+'
105
49
106
50
android {
107
51
ndkVersion rootProject. ext. ndkVersion
108
-
109
52
buildToolsVersion rootProject. ext. buildToolsVersion
110
53
compileSdk rootProject. ext. compileSdkVersion
111
54
@@ -117,7 +60,7 @@ android {
117
60
versionCode 1
118
61
versionName " 1.0.0"
119
62
}
120
- signingConfigs {
63
+ signingConfigs {
121
64
release {
122
65
if (project. hasProperty(' MYAPP_UPLOAD_STORE_FILE' )) {
123
66
storeFile file(" ./my-upload-key.keystore" )
@@ -128,11 +71,8 @@ android {
128
71
}
129
72
}
130
73
buildTypes {
131
- // debug {
132
- // signingConfig signingConfigs.debug
133
- // }
134
74
release {
135
- signingConfig signingConfigs. release // ! Updated here
75
+ signingConfig signingConfigs. release
136
76
shrinkResources (findProperty(' android.enableShrinkResourcesInReleaseBuilds' )?. toBoolean() ?: false )
137
77
minifyEnabled enableProguardInReleaseBuilds
138
78
proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
@@ -146,49 +86,38 @@ android {
146
86
}
147
87
}
148
88
149
- // Apply static values from `gradle.properties` to the `android.packagingOptions`
150
- // Accepts values in comma delimited lists, example:
151
- // android.packagingOptions.pickFirsts=/LICENSE,**/picasa.ini
152
89
[" pickFirsts" , " excludes" , " merges" , " doNotStrip" ]. each { prop ->
153
- // Split option: 'foo,bar' -> ['foo', 'bar']
154
90
def options = (findProperty(" android.packagingOptions.$prop " ) ?: " " ). split(" ," );
155
- // Trim all elements in place.
156
91
for (i in 0 .. < options. size()) options[i] = options[i]. trim();
157
- // `[] - ""` is essentially `[""].filter(Boolean)` removing all empty strings.
158
92
options - = " "
159
93
160
94
if (options. length > 0 ) {
161
95
println " android.packagingOptions.$prop += $options ($options . length )"
162
- // Ex: android.packagingOptions.pickFirsts += '**/SCCS/**'
163
96
options. each {
164
97
android. packagingOptions[prop] + = it
165
98
}
166
99
}
167
100
}
168
101
169
102
dependencies {
170
- // The version of react-native is set by the React Native Gradle Plugin
171
103
implementation(" com.facebook.react:react-android" )
172
104
173
105
def isGifEnabled = (findProperty(' expo.gif.enabled' ) ?: " " ) == " true" ;
174
106
def isWebpEnabled = (findProperty(' expo.webp.enabled' ) ?: " " ) == " true" ;
175
107
def isWebpAnimatedEnabled = (findProperty(' expo.webp.animated' ) ?: " " ) == " true" ;
176
108
177
109
if (isGifEnabled) {
178
- // For animated gif support
179
110
implementation(" com.facebook.fresco:animated-gif:${ reactAndroidLibs.versions.fresco.get()} " )
180
111
}
181
112
182
113
if (isWebpEnabled) {
183
- // For webp support
184
114
implementation(" com.facebook.fresco:webpsupport:${ reactAndroidLibs.versions.fresco.get()} " )
185
115
if (isWebpAnimatedEnabled) {
186
- // Animated webp support
187
116
implementation(" com.facebook.fresco:animated-webp:${ reactAndroidLibs.versions.fresco.get()} " )
188
117
}
189
118
}
190
119
191
- if (hermesEnabled . toBoolean() ) {
120
+ if (enableHermes ) {
192
121
implementation(" com.facebook.react:hermes-android" )
193
122
} else {
194
123
implementation jscFlavor
0 commit comments