blob: d7c2c16c428b5598cf62962b34d1b71d47a46976 [file] [log] [blame]
/*
* Copyright 2020 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.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.protobuf")
alias(libs.plugins.kotlinSerialization)
}
dependencies {
implementation(libs.protobufLite)
implementation(libs.kotlinStdlib)
implementation('androidx.core:core-ktx:1.7.0')
implementation('androidx.lifecycle:lifecycle-runtime-ktx:2.3.1')
implementation('androidx.activity:activity-compose:1.3.1')
implementation("androidx.compose.ui:ui:1.0.0")
implementation("androidx.compose.ui:ui-tooling-preview:1.0.0")
implementation("androidx.compose.material:material:1.0.0")
testImplementation('junit:junit:4.13.2')
debugImplementation("androidx.compose.ui:ui-tooling:1.1.0-rc01")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.1.0-rc01")
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("com.google.protobuf:protobuf-javalite:3.19.4")
// For kotlin serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1")
}
android {
namespace 'com.example.datastorecomposesamples'
defaultConfig {
minSdk 28
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.1.0-rc02'
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.19.4"
}
// Generates the java Protobuf-lite code for the Protobufs in this project. See
// https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation
// for more informatio
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option 'lite'
}
}
}
}
}
// Allow usage of Kotlin's @OptIn.
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
}
}