|
| 1 | +import java.io.FileInputStream |
| 2 | +import java.util.Properties |
| 3 | + |
| 4 | +plugins { |
| 5 | + alias(libs.plugins.generic.application) |
| 6 | + alias(libs.plugins.generic.baseline.profm) |
| 7 | +} |
| 8 | + |
| 9 | +android { |
| 10 | + namespace = "com.shifthackz.aisdv1.app" |
| 11 | + defaultConfig { |
| 12 | + applicationId = "com.shifthackz.aisdv1.app" |
| 13 | + versionName = libs.versions.versionName.get() |
| 14 | + versionCode = libs.versions.versionCode.get().toInt() |
| 15 | + |
| 16 | + buildConfigField("String", "IMAGE_CDN_URL", "\"https://random.imagecdn.app/\"") |
| 17 | + buildConfigField("String", "HUGGING_FACE_URL", "\"https://huggingface.co/\"") |
| 18 | + buildConfigField("String", "HUGGING_FACE_INFERENCE_URL", "\"https://api-inference.huggingface.co/\"") |
| 19 | + buildConfigField("String", "HORDE_AI_URL", "\"https://stablehorde.net/\"") |
| 20 | + buildConfigField("String", "OPEN_AI_URL", "\"https://api.openai.com/\"") |
| 21 | + buildConfigField("String", "STABILITY_AI_URL", "\"https://api.stability.ai/\"") |
| 22 | + |
| 23 | + buildConfigField("String", "HORDE_AI_SIGN_UP_URL", "\"https://stablehorde.net/register\"") |
| 24 | + buildConfigField("String", "HUGGING_FACE_INFO_URL", "\"https://huggingface.co/docs/api-inference/index\"") |
| 25 | + buildConfigField("String", "OPEN_AI_INFO_URL", "\"https://platform.openai.com/api-keys\"") |
| 26 | + buildConfigField("String", "STABILITY_AI_INFO_URL", "\"https://platform.stability.ai/\"") |
| 27 | + buildConfigField("String", "UPDATE_API_URL", "\"https://sdai.moroz.cc\"") |
| 28 | + buildConfigField("String", "DEMO_MODE_API_URL", "\"https://sdai.moroz.cc\"") |
| 29 | + buildConfigField("String", "POLICY_URL", "\"https://sdai.moroz.cc/policy.html\"") |
| 30 | + buildConfigField("String", "DONATE_URL", "\"https://www.buymeacoffee.com/shifthackz\"") |
| 31 | + buildConfigField("String", "GITHUB_SOURCE_URL", "\"https://github.com/ShiftHackZ/Stable-Diffusion-Android\"") |
| 32 | + buildConfigField("String", "SETUP_INSTRUCTIONS_URL", "\"https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki\"") |
| 33 | + buildConfigField("String", "SWARM_UI_INFO_URL", "\"https://github.com/mcmonkeyprojects/SwarmUI/tree/master/docs\"") |
| 34 | + |
| 35 | + resourceConfigurations += listOf("en", "ru", "uk", "tr", "zh") |
| 36 | + } |
| 37 | + |
| 38 | + val hasPropertiesFile = File("app/keystore/signing.properties").exists() |
| 39 | + if (hasPropertiesFile) { |
| 40 | + val props = Properties() |
| 41 | + props.load(FileInputStream(file("keystore/signing.properties"))) |
| 42 | + val alias = props["keystore.alias"] as String |
| 43 | + signingConfigs { |
| 44 | + create("release") { |
| 45 | + storeFile = file(props["keystore"] as String) |
| 46 | + storePassword = props["keystore.password"] as String |
| 47 | + keyAlias = alias |
| 48 | + keyPassword = props["keystore.password"] as String |
| 49 | + } |
| 50 | + } |
| 51 | + println("[Signature] -> Build will be signed with signature: $alias") |
| 52 | + buildTypes.getByName("release").signingConfig = signingConfigs.getByName("release") |
| 53 | + } |
| 54 | + |
| 55 | + flavorDimensions += "type" |
| 56 | + productFlavors { |
| 57 | + create("dev") { |
| 58 | + dimension = "type" |
| 59 | + applicationIdSuffix = ".dev" |
| 60 | + resValue("string", "app_name", "SDAI Dev") |
| 61 | + buildConfigField("String", "BUILD_FLAVOR_TYPE", "\"FOSS\"") |
| 62 | + } |
| 63 | + create("foss") { |
| 64 | + dimension = "type" |
| 65 | + applicationIdSuffix = ".foss" |
| 66 | + resValue("string", "app_name", "SDAI FOSS") |
| 67 | + buildConfigField("String", "BUILD_FLAVOR_TYPE", "\"FOSS\"") |
| 68 | + } |
| 69 | + create("playstore") { |
| 70 | + dimension = "type" |
| 71 | + resValue("string", "app_name", "SDAI") |
| 72 | + buildConfigField("String", "BUILD_FLAVOR_TYPE", "\"GOOGLE_PLAY\"") |
| 73 | + } |
| 74 | + } |
| 75 | +} |
| 76 | + |
| 77 | +dependencies { |
| 78 | + implementation(project(":core:common")) |
| 79 | + implementation(project(":core:imageprocessing")) |
| 80 | + implementation(project(":core:notification")) |
| 81 | + implementation(project(":core:validation")) |
| 82 | + implementation(project(":presentation")) |
| 83 | + implementation(project(":network")) |
| 84 | + implementation(project(":storage")) |
| 85 | + implementation(project(":domain")) |
| 86 | + implementation(project(":feature:auth")) |
| 87 | + implementation(project(":feature:diffusion")) |
| 88 | + implementation(project(":feature:work")) |
| 89 | + implementation(project(":data")) |
| 90 | + implementation(project(":demo")) |
| 91 | + implementation(libs.koin.core) |
| 92 | + implementation(libs.koin.android) |
| 93 | + implementation(libs.koin.compose) |
| 94 | + implementation(libs.rx.kotlin) |
| 95 | + implementation(libs.rx.android) |
| 96 | + implementation(libs.timber) |
| 97 | + implementation(libs.shifthackz.catppuccin.splash) |
| 98 | + implementation(libs.shifthackz.catppuccin.legacy) |
| 99 | + implementation(libs.androidx.work.runtime) |
| 100 | +} |
| 101 | + |
| 102 | +kapt { |
| 103 | + correctErrorTypes = true |
| 104 | +} |
0 commit comments