You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
188 lines
6.8 KiB
188 lines
6.8 KiB
/*
|
|
* Copyright 2022 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
import com.google.samples.apps.nowinandroid.NiaBuildType
|
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
|
|
|
|
plugins {
|
|
alias(libs.plugins.nowinandroid.cmp.application)
|
|
alias(libs.plugins.nowinandroid.di.koin)
|
|
// alias(libs.plugins.baselineprofile)
|
|
alias(libs.plugins.roborazzi)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
}
|
|
|
|
android {
|
|
defaultConfig {
|
|
applicationId = "com.google.samples.apps.nowinandroid"
|
|
versionCode = 8
|
|
versionName = "0.1.2" // X.Y.Z; X = Major, Y = minor, Z = Patch level
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables {
|
|
useSupportLibrary = true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix = NiaBuildType.DEBUG.applicationIdSuffix
|
|
}
|
|
release {
|
|
isMinifyEnabled = true
|
|
applicationIdSuffix = NiaBuildType.RELEASE.applicationIdSuffix
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
|
|
|
|
// To publish on the Play store a private signing key is required, but to allow anyone
|
|
// who clones the code to sign and run the release variant, use the debug signing key.
|
|
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
|
|
signingConfig = signingConfigs.named("debug").get()
|
|
// Ensure Baseline Profile is fresh for release builds.
|
|
// baselineProfile.automaticGenerationDuringBuild = true
|
|
}
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
|
|
}
|
|
}
|
|
testOptions {
|
|
unitTests {
|
|
isIncludeAndroidResources = true
|
|
}
|
|
}
|
|
namespace = "com.google.samples.apps.nowinandroid"
|
|
}
|
|
|
|
kotlin {
|
|
androidTarget {
|
|
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
|
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
|
|
}
|
|
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
implementation(projects.shared)
|
|
implementation(compose.runtime)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material)
|
|
implementation(compose.material3)
|
|
implementation(compose.material3AdaptiveNavigationSuite)
|
|
implementation(compose.ui)
|
|
implementation(compose.components.resources)
|
|
implementation(compose.components.uiToolingPreview)
|
|
implementation(libs.coil.core)
|
|
implementation(libs.coil.compose)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.jetbrains.compose.material3.adaptive.navigation)
|
|
}
|
|
|
|
androidMain.dependencies {
|
|
implementation(compose.preview)
|
|
implementation(project.dependencies.platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.compose.material3.adaptive)
|
|
implementation(libs.androidx.compose.material3.adaptive.layout)
|
|
implementation(libs.androidx.compose.material3.adaptive.navigation)
|
|
implementation(libs.androidx.compose.material3.windowSizeClass)
|
|
implementation(libs.androidx.compose.runtime.tracing)
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.core.splashscreen)
|
|
implementation(libs.androidx.lifecycle.runtimeCompose)
|
|
implementation(libs.androidx.navigation.compose)
|
|
implementation(libs.androidx.profileinstaller)
|
|
implementation(libs.androidx.tracing.ktx)
|
|
implementation(libs.androidx.window.core)
|
|
implementation(libs.kotlinx.coroutines.guava)
|
|
implementation(libs.koin.android)
|
|
implementation(libs.koin.androidx.compose)
|
|
implementation(libs.koin.androidx.startup)
|
|
}
|
|
|
|
commonTest.dependencies {
|
|
implementation(projects.core.dataTest)
|
|
implementation(projects.core.testing)
|
|
implementation(projects.core.screenshotTesting)
|
|
// implementation(projects.sync.syncTest)
|
|
implementation(libs.kotlin.test)
|
|
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
|
|
implementation(compose.uiTest)
|
|
}
|
|
|
|
androidInstrumentedTest.dependencies {
|
|
implementation(projects.core.dataTest)
|
|
implementation(projects.core.testing)
|
|
implementation(libs.androidx.navigation.testing)
|
|
implementation(project.dependencies.platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.compose.ui.test)
|
|
}
|
|
|
|
jvmMain.dependencies {
|
|
implementation(compose.desktop.currentOs)
|
|
implementation(libs.kotlinx.coroutines.swing)
|
|
implementation(libs.logback.classic)
|
|
}
|
|
|
|
jvmTest.dependencies {
|
|
implementation(compose.desktop.uiTestJUnit4)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
debugImplementation(compose.uiTooling)
|
|
androidTestImplementation(libs.androidx.compose.ui.test.android)
|
|
androidTestImplementation(libs.androidx.compose.ui.testManifest)
|
|
}
|
|
|
|
compose.desktop {
|
|
application {
|
|
mainClass = "com.google.sample.apps.nowinandroid.MainKt"
|
|
|
|
nativeDistributions {
|
|
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
|
packageName = "com.google.sample.apps.nowinandroid"
|
|
packageVersion = "1.0.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
//dependencies {
|
|
//
|
|
// debugImplementation(libs.androidx.compose.ui.testManifest)
|
|
// debugImplementation(projects.uiTestHiltManifest)
|
|
//
|
|
//
|
|
//
|
|
// testDemoImplementation(libs.robolectric)
|
|
// testDemoImplementation(libs.roborazzi)
|
|
// testDemoImplementation(projects.core.screenshotTesting)
|
|
//
|
|
// baselineProfile(projects.benchmarks)
|
|
//}
|
|
//
|
|
//baselineProfile {
|
|
// // Don't build on every iteration of a full assemble.
|
|
// // Instead enable generation directly for the release build variant.
|
|
// automaticGenerationDuringBuild = false
|
|
//
|
|
// // Make use of Dex Layout Optimizations via Startup Profiles
|
|
// dexLayoutOptimization = true
|
|
//}
|
|
//
|