Skip to content

Commit e393d5f

Browse files
committed
⚒️ Updated the build.gradle file.
1 parent b52d8b4 commit e393d5f

File tree

1 file changed

+4
-75
lines changed

1 file changed

+4
-75
lines changed

android/app/build.gradle

+4-75
Original file line numberDiff line numberDiff line change
@@ -35,77 +35,20 @@ react {
3535
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
3636
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()
3737

38-
// Use Expo CLI to bundle the app, this ensures the Metro config
39-
// works correctly with Expo projects.
4038
cliFile = new File(["node", "--print", "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim())
4139
bundleCommand = "export:embed"
4240

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-
8241
if (rnVersion >= versionToNumber(0, 75, 0)) {
83-
/* Autolinking */
8442
autolinkLibrariesWithApp()
8543
}
8644
}
8745

88-
/**
89-
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
90-
*/
9146
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"
10448
def jscFlavor = 'org.webkit:android-jsc:+'
10549

10650
android {
10751
ndkVersion rootProject.ext.ndkVersion
108-
10952
buildToolsVersion rootProject.ext.buildToolsVersion
11053
compileSdk rootProject.ext.compileSdkVersion
11154

@@ -117,7 +60,7 @@ android {
11760
versionCode 1
11861
versionName "1.0.0"
11962
}
120-
signingConfigs {
63+
signingConfigs {
12164
release {
12265
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
12366
storeFile file("./my-upload-key.keystore")
@@ -128,11 +71,8 @@ android {
12871
}
12972
}
13073
buildTypes {
131-
// debug {
132-
// signingConfig signingConfigs.debug
133-
// }
13474
release {
135-
signingConfig signingConfigs.release //! Updated here
75+
signingConfig signingConfigs.release
13676
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
13777
minifyEnabled enableProguardInReleaseBuilds
13878
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
@@ -146,49 +86,38 @@ android {
14686
}
14787
}
14888

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
15289
["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop ->
153-
// Split option: 'foo,bar' -> ['foo', 'bar']
15490
def options = (findProperty("android.packagingOptions.$prop") ?: "").split(",");
155-
// Trim all elements in place.
15691
for (i in 0..<options.size()) options[i] = options[i].trim();
157-
// `[] - ""` is essentially `[""].filter(Boolean)` removing all empty strings.
15892
options -= ""
15993

16094
if (options.length > 0) {
16195
println "android.packagingOptions.$prop += $options ($options.length)"
162-
// Ex: android.packagingOptions.pickFirsts += '**/SCCS/**'
16396
options.each {
16497
android.packagingOptions[prop] += it
16598
}
16699
}
167100
}
168101

169102
dependencies {
170-
// The version of react-native is set by the React Native Gradle Plugin
171103
implementation("com.facebook.react:react-android")
172104

173105
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
174106
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
175107
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
176108

177109
if (isGifEnabled) {
178-
// For animated gif support
179110
implementation("com.facebook.fresco:animated-gif:${reactAndroidLibs.versions.fresco.get()}")
180111
}
181112

182113
if (isWebpEnabled) {
183-
// For webp support
184114
implementation("com.facebook.fresco:webpsupport:${reactAndroidLibs.versions.fresco.get()}")
185115
if (isWebpAnimatedEnabled) {
186-
// Animated webp support
187116
implementation("com.facebook.fresco:animated-webp:${reactAndroidLibs.versions.fresco.get()}")
188117
}
189118
}
190119

191-
if (hermesEnabled.toBoolean()) {
120+
if (enableHermes) {
192121
implementation("com.facebook.react:hermes-android")
193122
} else {
194123
implementation jscFlavor

0 commit comments

Comments
 (0)