git ssb

1+

Daan Patchwork / manyverse



Tree: 4d25708b0421d60ffaf4fc458e8f42fb5b9c3f62

Files: 4d25708b0421d60ffaf4fc458e8f42fb5b9c3f62 / android / app / build.gradle

11950 bytesRaw
1apply plugin: "com.android.application"
2
3import com.android.build.OutputFile
4
5/**
6 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 * and bundleReleaseJsAndAssets).
8 * These basically call `react-native bundle` with the correct arguments during the Android build
9 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 * bundle directly from the development server. Below you can see all the possible configurations
11 * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 *
14 * project.ext.react = [
15 * // the name of the generated asset file containing your JS bundle
16 * bundleAssetName: "index.android.bundle",
17 *
18 * // the entry file for bundle generation. If none specified and
19 * // "index.android.js" exists, it will be used. Otherwise "index.js" is
20 * // default. Can be overridden with ENTRY_FILE environment variable.
21 * entryFile: "index.android.js",
22 *
23 * // https://reactnative.dev/docs/performance#enable-the-ram-format
24 * bundleCommand: "ram-bundle",
25 *
26 * // whether to bundle JS and assets in debug mode
27 * bundleInDebug: false,
28 *
29 * // whether to bundle JS and assets in release mode
30 * bundleInRelease: true,
31 *
32 * // whether to bundle JS and assets in another build variant (if configured).
33 * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
34 * // The configuration property can be in the following formats
35 * // 'bundleIn${productFlavor}${buildType}'
36 * // 'bundleIn${buildType}'
37 * // bundleInFreeDebug: true,
38 * // bundleInPaidRelease: true,
39 * // bundleInBeta: true,
40 *
41 * // whether to disable dev mode in custom build variants (by default only disabled in release)
42 * // for example: to disable dev mode in the staging build type (if configured)
43 * devDisabledInStaging: true,
44 * // The configuration property can be in the following formats
45 * // 'devDisabledIn${productFlavor}${buildType}'
46 * // 'devDisabledIn${buildType}'
47 *
48 * // the root of your project, i.e. where "package.json" lives
49 * root: "../../",
50 *
51 * // where to put the JS bundle asset in debug mode
52 * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
53 *
54 * // where to put the JS bundle asset in release mode
55 * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
56 *
57 * // where to put drawable resources / React Native assets, e.g. the ones you use via
58 * // require('./image.png')), in debug mode
59 * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
60 *
61 * // where to put drawable resources / React Native assets, e.g. the ones you use via
62 * // require('./image.png')), in release mode
63 * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
64 *
65 * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
66 * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
67 * // date; if you have any other folders that you want to ignore for performance reasons (gradle
68 * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
69 * // for example, you might want to remove it from here.
70 * inputExcludes: ["android/**", "ios/**"],
71 *
72 * // override which node gets called and with what additional arguments
73 * nodeExecutableAndArgs: ["node"],
74 *
75 * // supply additional arguments to the packager
76 * extraPackagerArgs: []
77 * ]
78 */
79
80project.ext.vectoricons = [
81 iconFontNames: [ 'MaterialIcons.ttf', 'MaterialCommunityIcons.ttf' ]
82]
83project.ext.react = [
84 enableHermes: true, // clean and rebuild if changing
85 hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermesc",
86 inputExcludes: [
87 "android/**",
88 "benchmark/**",
89 "desktop/**",
90 "e2e/**",
91 "ios/**",
92 "nodejs-assets/**",
93 "src/**",
94 "tools/**"
95 ],
96]
97apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
98apply from: "../../node_modules/react-native/react.gradle"
99
100/**
101 * Set this to true to create two separate APKs instead of one:
102 * - An APK that only works on ARM devices
103 * - An APK that only works on x86 devices
104 * The advantage is the size of the APK is reduced by about 4MB.
105 * Upload all the APKs to the Play Store and people will download
106 * the correct one based on the CPU architecture of their device.
107 */
108def enableSeparateBuildPerCPUArchitecture = false
109
110/**
111 * Run Proguard to shrink the Java bytecode in release builds.
112 */
113def enableProguardInReleaseBuilds = false
114
115/**
116 * The preferred build flavor of JavaScriptCore.
117 *
118 * For example, to use the international variant, you can use:
119 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
120 *
121 * The international variant includes ICU i18n library and necessary data
122 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
123 * give correct results when using with locales other than en-US. Note that
124 * this variant is about 6MiB larger per architecture than default.
125 */
126def jscFlavor = 'org.webkit:android-jsc:+'
127
128/**
129 * Whether to enable the Hermes VM.
130 *
131 * This should be set on project.ext.react and mirrored here. If it is not set
132 * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
133 * and the benefits of using Hermes will therefore be sharply reduced.
134 */
135def enableHermes = project.ext.react.get("enableHermes", false);
136
137android {
138 compileSdkVersion rootProject.ext.compileSdkVersion
139
140 compileOptions {
141 sourceCompatibility JavaVersion.VERSION_1_8
142 targetCompatibility JavaVersion.VERSION_1_8
143 }
144
145 flavorDimensions "store"
146
147 defaultConfig {
148 versionCode 97
149 versionName "0.2103.19-beta"
150 applicationId "se.manyver"
151 minSdkVersion rootProject.ext.minSdkVersion
152 targetSdkVersion rootProject.ext.targetSdkVersion
153 ndk {
154 abiFilters "armeabi-v7a", "arm64-v8a" // , "x86", "x86_64"
155 }
156 aaptOptions {
157 ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
158 }
159 vectorDrawables.useSupportLibrary = true
160 }
161
162 // dexOptions {
163 // javaMaxHeapSize "4g"
164 // }
165
166 productFlavors {
167 indie {
168 dimension "store"
169 versionNameSuffix "-indie"
170 }
171
172 fdroid {
173 dimension "store"
174 versionNameSuffix "-fdroid"
175 }
176
177 googlePlay {
178 dimension "store"
179 versionNameSuffix "-googlePlay"
180 targetSdkVersion rootProject.ext.targetSdkVersionForGooglePlay
181 }
182 }
183
184 signingConfigs {
185 // debug {
186 // storeFile file('debug.keystore')
187 // storePassword 'android'
188 // keyAlias 'androiddebugkey'
189 // keyPassword 'android'
190 // }
191 release {
192 if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
193 storeFile file(MYAPP_RELEASE_STORE_FILE)
194 storePassword MYAPP_RELEASE_STORE_PASSWORD
195 keyAlias MYAPP_RELEASE_KEY_ALIAS
196 keyPassword MYAPP_RELEASE_KEY_PASSWORD
197 } else {
198 throw new Exception('Refusing to make release build with wrong keystore')
199 }
200 }
201 }
202
203 splits {
204 abi {
205 reset()
206 enable enableSeparateBuildPerCPUArchitecture
207 universalApk false // If true, also generate a universal APK
208 include "armeabi-v7a", "arm64-v8a"//, "x86", "x86_64"
209 }
210 }
211
212 buildTypes {
213 debug {
214 signingConfig signingConfigs.debug
215 }
216 release {
217 // Caution! In production, you need to generate your own keystore file.
218 // see https://reactnative.dev/docs/signed-apk-android.
219 // signingConfig signingConfigs.debug
220 minifyEnabled enableProguardInReleaseBuilds
221 proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
222 if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
223 signingConfig signingConfigs.release
224 } else {
225 throw new Exception('Refusing to make release build with wrong keystore')
226 }
227 }
228 }
229
230 // applicationVariants are e.g. debug, release
231 applicationVariants.all { variant ->
232 variant.outputs.each { output ->
233 // For each separate APK per architecture, set a unique version code as described here:
234 // https://developer.android.com/studio/build/configure-apk-splits.html
235 def versionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2] //, "x86":3, "x86_64":4]
236 def abi = output.getFilter(OutputFile.ABI)
237 if (abi != null) { // null for the universal-debug, universal-release variants
238 output.versionCodeOverride =
239 versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
240 }
241 }
242 }
243}
244
245def acraVersion = '5.5.0'
246
247dependencies {
248 //noinspection GradleDynamicVersion
249 implementation "ch.acra:acra-core:$acraVersion"
250 implementation "ch.acra:acra-mail:$acraVersion"
251 implementation "ch.acra:acra-dialog:$acraVersion"
252 implementation project(':nodejs-mobile-react-native')
253 implementation project(':@react-native-community_async-storage')
254 implementation project(':react-native-bluetooth-socket-bridge')
255 implementation project(':react-native-dialogs')
256 implementation project(':react-native-vector-icons')
257 implementation project(':react-native-os-staltz')
258 implementation project(':react-native-image-crop-picker')
259 implementation project(':react-native-navigation')
260 implementation project(':react-native-has-internet')
261 implementation project(':react-native-flag-secure-android')
262 implementation project(':react-native-orientation-locker')
263 implementation project(':react-native-fs')
264 implementation project(':react-native-splash-screen')
265 implementation project(':@react-native-community_viewpager')
266 implementation project(':@react-native-community_slider')
267 implementation project(':@react-native-community_audio-toolkit')
268 implementation project(':react-native-system-setting')
269 implementation project(':react-native-localize')
270 implementation fileTree(dir: "libs", include: ["*.jar"])
271 implementation 'androidx.appcompat:appcompat:1.0.2'
272 implementation("com.facebook.react:react-native:+") {
273 force = true
274 }
275 implementation 'com.facebook.fresco:animated-gif:1.3.0'
276 implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
277 debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
278 exclude group:'com.facebook.fbjni'
279 }
280 debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
281 exclude group:'com.facebook.flipper'
282 exclude group:'com.squareup.okhttp3', module:'okhttp'
283 }
284 debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
285 exclude group:'com.facebook.flipper'
286 }
287
288 if (enableHermes) {
289 def hermesPath = "../../node_modules/hermes-engine/android/";
290 debugImplementation files(hermesPath + "hermes-debug.aar")
291 releaseImplementation files(hermesPath + "hermes-release.aar")
292 } else {
293 implementation jscFlavor
294 }
295}
296
297// Run this once to be able to run the application with BUCK
298// puts all compile dependencies into folder libs for BUCK to use
299task copyDownloadableDepsToLibs(type: Copy) {
300 from configurations.compile
301 into 'libs'
302}
303
304apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
305applyNativeModulesAppBuildGradle(project)

Built with git-ssb-web