| apply plugin: "com.android.application" |
| apply plugin: "org.jetbrains.kotlin.android" |
| apply plugin: "com.facebook.react" |
|
|
| def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath() |
|
|
| |
| |
| |
| |
| react { |
| entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim()) |
| reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile() |
| hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc" |
| 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() |
|
|
| enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean() |
| |
| |
| cliFile = new File(["node", "--print", "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim()) |
| bundleCommand = "export:embed" |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
|
|
| |
| autolinkLibrariesWithApp() |
| } |
|
|
| |
| |
| |
| def enableMinifyInReleaseBuilds = (findProperty('android.enableMinifyInReleaseBuilds') ?: false).toBoolean() |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' |
|
|
| android { |
| ndkVersion rootProject.ext.ndkVersion |
|
|
| buildToolsVersion rootProject.ext.buildToolsVersion |
| compileSdk rootProject.ext.compileSdkVersion |
|
|
| namespace 'com.anonymous.staticplaysd1mobile' |
| defaultConfig { |
| applicationId 'com.anonymous.staticplaysd1mobile.v2' |
| minSdkVersion rootProject.ext.minSdkVersion |
| targetSdkVersion rootProject.ext.targetSdkVersion |
| versionCode 1 |
| versionName "1.0.0" |
|
|
| buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\"" |
| } |
| signingConfigs { |
| debug { |
| storeFile file('debug.keystore') |
| storePassword 'android' |
| keyAlias 'androiddebugkey' |
| keyPassword 'android' |
| } |
| } |
| buildTypes { |
| debug { |
| signingConfig signingConfigs.debug |
| } |
| release { |
| |
| |
| signingConfig signingConfigs.debug |
| def enableShrinkResources = findProperty('android.enableShrinkResourcesInReleaseBuilds') ?: 'false' |
| shrinkResources enableShrinkResources.toBoolean() |
| minifyEnabled enableMinifyInReleaseBuilds |
| proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" |
| def enablePngCrunchInRelease = findProperty('android.enablePngCrunchInReleaseBuilds') ?: 'true' |
| crunchPngs enablePngCrunchInRelease.toBoolean() |
| } |
| } |
| packagingOptions { |
| jniLibs { |
| def enableLegacyPackaging = findProperty('expo.useLegacyPackaging') ?: 'false' |
| useLegacyPackaging enableLegacyPackaging.toBoolean() |
| } |
| } |
| androidResources { |
| ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~' |
| } |
| } |
|
|
| |
| |
| |
| ["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop -> |
| |
| def options = (findProperty("android.packagingOptions.$prop") ?: "").split(","); |
| |
| for (i in 0..<options.size()) options[i] = options[i].trim(); |
| |
| options -= "" |
|
|
| if (options.length > 0) { |
| println "android.packagingOptions.$prop += $options ($options.length)" |
| |
| options.each { |
| android.packagingOptions[prop] += it |
| } |
| } |
| } |
|
|
| dependencies { |
| |
| implementation("com.microsoft.onnxruntime:onnxruntime-android:1.18.0") |
| implementation("com.facebook.react:react-android") |
|
|
| def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true"; |
| def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true"; |
| def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true"; |
|
|
| if (isGifEnabled) { |
| |
| implementation("com.facebook.fresco:animated-gif:${expoLibs.versions.fresco.get()}") |
| } |
|
|
| if (isWebpEnabled) { |
| |
| implementation("com.facebook.fresco:webpsupport:${expoLibs.versions.fresco.get()}") |
| if (isWebpAnimatedEnabled) { |
| |
| implementation("com.facebook.fresco:animated-webp:${expoLibs.versions.fresco.get()}") |
| } |
| } |
|
|
| if (hermesEnabled.toBoolean()) { |
| implementation("com.facebook.react:hermes-android") |
| } else { |
| implementation jscFlavor |
| } |
| } |
|
|