|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2023 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
|
||||
|
||||
http://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.
|
||||
-->
|
||||
<resources>
|
||||
<!-- Allow users to distinguish between build variants by having a different background color
|
||||
for the launcher icon. See https://github.com/android/nowinandroid/pull/989. -->
|
||||
<color name="ic_launcher_background_tint">#000000</color>
|
||||
<color name="ic_launcher_foreground_tint">#FF006780</color>
|
||||
</resources>
|
||||
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright 2024 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.android.build.api.dsl.ApplicationExtension
|
||||
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
|
||||
import com.android.build.gradle.BaseExtension
|
||||
import com.android.build.gradle.LibraryExtension
|
||||
import com.google.samples.apps.nowinandroid.configureBadgingTasks
|
||||
import com.google.samples.apps.nowinandroid.configureGradleManagedDevices
|
||||
import com.google.samples.apps.nowinandroid.configureKotlinAndroid
|
||||
import com.google.samples.apps.nowinandroid.configureKotlinMultiplatform
|
||||
import com.google.samples.apps.nowinandroid.configurePrintApksTask
|
||||
import com.google.samples.apps.nowinandroid.libs
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.configure
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||
|
||||
// Convention plugin for the Compose Multiplatform feature module
|
||||
class CmpApplicationConventionPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
pluginManager.apply {
|
||||
apply("com.android.application")
|
||||
apply("org.jetbrains.kotlin.multiplatform")
|
||||
apply("org.jetbrains.kotlin.plugin.compose")
|
||||
apply("org.jetbrains.compose")
|
||||
// apply("com.dropbox.dependency-guard")
|
||||
}
|
||||
configureComposeMultiplatformApp()
|
||||
extensions.configure<ApplicationExtension> {
|
||||
configureKotlinAndroid(this)
|
||||
defaultConfig.targetSdk = 34
|
||||
@Suppress("UnstableApiUsage")
|
||||
testOptions.animationsDisabled = true
|
||||
configureGradleManagedDevices(this)
|
||||
}
|
||||
extensions.configure<ApplicationAndroidComponentsExtension> {
|
||||
configurePrintApksTask(this)
|
||||
configureBadgingTasks(extensions.getByType<BaseExtension>(), this)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
add("commonMainImplementation", project(":core:ui"))
|
||||
add("commonMainImplementation", project(":core:designsystem"))
|
||||
add("commonMainImplementation", libs.findLibrary("jetbrains.compose.viewmodel").get())
|
||||
add("commonMainImplementation", libs.findLibrary("jetbrains.compose.navigation").get())
|
||||
add("commonMainImplementation", libs.findLibrary("koin.compose").get())
|
||||
add("commonMainImplementation", libs.findLibrary("koin.compose.viewmodel").get())
|
||||
add("commonMainImplementation", libs.findLibrary("koin.compose.viewmodel.navigation").get())
|
||||
|
||||
add("androidMainImplementation", libs.findLibrary("androidx.lifecycle.runtimeCompose").get())
|
||||
add("androidMainImplementation", libs.findLibrary("androidx.lifecycle.viewModelCompose").get())
|
||||
add("androidMainImplementation", libs.findLibrary("androidx.tracing.ktx").get())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Project.configureComposeMultiplatformApp() {
|
||||
extensions.configure<KotlinMultiplatformExtension> {
|
||||
// Enable native group by default
|
||||
// https://kotlinlang.org/docs/whatsnew1820.html#new-approach-to-source-set-hierarchy
|
||||
applyDefaultHierarchyTemplate()
|
||||
|
||||
// Configure JVM target for Android
|
||||
androidTarget {
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_11)
|
||||
}
|
||||
}
|
||||
|
||||
// Add JVM target for desktop
|
||||
jvm()
|
||||
|
||||
// Configure iOS targets
|
||||
listOf(
|
||||
iosX64(),
|
||||
iosArm64(),
|
||||
iosSimulatorArm64()
|
||||
).forEach { iosTarget ->
|
||||
iosTarget.binaries.framework {
|
||||
baseName = "NowInAndroid"
|
||||
isStatic = true
|
||||
}
|
||||
}
|
||||
|
||||
// Other targets
|
||||
macosX64()
|
||||
macosArm64()
|
||||
|
||||
// Suppress 'expect'/'actual' classes are in Beta.
|
||||
targets.configureEach {
|
||||
compilations.configureEach {
|
||||
compilerOptions.configure {
|
||||
freeCompilerArgs.addAll("-Xexpect-actual-classes")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fixes Cannot locate tasks that match ':core:model:testClasses' as task 'testClasses'
|
||||
// not found in project ':core:model'. Some candidates are: 'jsTestClasses', 'jvmTestClasses'.
|
||||
project.tasks.create("testClasses") {
|
||||
dependsOn("allTests")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||