made android client
This commit is contained in:
70
android/app/build.gradle.kts
Normal file
70
android/app/build.gradle.kts
Normal file
@@ -0,0 +1,70 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
}
|
||||
|
||||
val apiUrl = providers.gradleProperty("PSU_API_URL")
|
||||
.orElse(providers.environmentVariable("PSU_API_URL"))
|
||||
.orElse("http://10.0.2.2:3010/")
|
||||
.map { if (it.endsWith("/")) it else "$it/" }
|
||||
|
||||
android {
|
||||
namespace = "ritm.schedule"
|
||||
compileSdk {
|
||||
version = release(37) { minorApiLevel = 1 }
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "ritm.schedule"
|
||||
minSdk = 26
|
||||
targetSdk = 36
|
||||
versionCode = 1
|
||||
versionName = "0.1.0"
|
||||
buildConfigField("String", "API_URL", "\"${apiUrl.get()}\"")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
// A release build must talk to a public HTTPS server.
|
||||
require(apiUrl.get().startsWith("https://") || !gradle.startParameter.taskNames.any { "Release" in it }) {
|
||||
"Для релиза укажите HTTPS-адрес: -PPSU_API_URL=https://…"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform(libs.compose.bom))
|
||||
implementation(libs.compose.ui)
|
||||
implementation(libs.compose.material3)
|
||||
implementation(libs.compose.icons)
|
||||
implementation(libs.compose.ui.tooling.preview)
|
||||
debugImplementation(libs.compose.ui.tooling)
|
||||
implementation(libs.activity.compose)
|
||||
implementation(libs.lifecycle.viewmodel.compose)
|
||||
implementation(libs.lifecycle.runtime.compose)
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.coroutines.android)
|
||||
implementation(libs.serialization.json)
|
||||
implementation(libs.okhttp)
|
||||
implementation(libs.datastore.preferences)
|
||||
implementation(libs.glance.appwidget)
|
||||
implementation(libs.glance.material3)
|
||||
implementation(libs.work.runtime)
|
||||
coreLibraryDesugaring(libs.desugar)
|
||||
testImplementation(libs.junit)
|
||||
}
|
||||
Reference in New Issue
Block a user