Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Tiem Song | ee0da74 | 2024-01-03 14:08:46 -0800 | [diff] [blame] | 17 | /** |
| 18 | * This file was created using the `create_project.py` script located in the |
| 19 | * `<AndroidX root>/development/project-creator` directory. |
| 20 | * |
| 21 | * Please use that script when creating a new project, rather than copying an existing project and |
| 22 | * modifying its settings. |
| 23 | */ |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 24 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 25 | |
| 26 | plugins { |
| 27 | id("AndroidXPlugin") |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 28 | id("com.android.application") |
Ian Lake | bc09a55 | 2020-08-28 17:30:15 -0700 | [diff] [blame] | 29 | id("org.jetbrains.kotlin.android") |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 30 | id("com.google.protobuf") |
Aurimas Liutikas | 8c32457 | 2022-03-10 13:22:00 -0800 | [diff] [blame] | 31 | alias(libs.plugins.kotlinSerialization) |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 32 | } |
| 33 | |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 34 | dependencies { |
Rohit Sathyanarayana | b18c860 | 2020-07-27 12:14:25 -0700 | [diff] [blame] | 35 | // For DataStore with Preferences |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 36 | implementation(project(":datastore:datastore-preferences")) |
| 37 | |
| 38 | // For DataStore with protos |
rohitsat13 | c9bbc6f | 2020-09-29 09:36:28 -0700 | [diff] [blame] | 39 | implementation(project(":datastore:datastore")) |
rohitsat13 | 145577b | 2020-08-20 13:28:44 -0700 | [diff] [blame] | 40 | |
Rohit Sathyanarayana | b18c860 | 2020-07-27 12:14:25 -0700 | [diff] [blame] | 41 | |
Aurimas Liutikas | eba77aa | 2021-06-04 14:11:01 -0700 | [diff] [blame] | 42 | implementation(libs.protobufLite) |
| 43 | implementation(libs.kotlinStdlib) |
rohitsat13 | 145577b | 2020-08-20 13:28:44 -0700 | [diff] [blame] | 44 | implementation("androidx.appcompat:appcompat:1.2.0") |
Clara Fok | de8ee00 | 2022-11-16 16:40:33 -0800 | [diff] [blame] | 45 | implementation("androidx.activity:activity-ktx:1.5.0") |
rohitsat13 | 2a8e7b0 | 2021-01-15 12:22:23 -0800 | [diff] [blame] | 46 | |
| 47 | // For settings fragment |
| 48 | implementation("androidx.preference:preference:1.1.1") |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 49 | |
Aurimas Liutikas | b3483fd | 2021-06-04 16:56:37 -0700 | [diff] [blame] | 50 | implementation(libs.constraintLayout) |
rohitsat13 | 2a8e7b0 | 2021-01-15 12:22:23 -0800 | [diff] [blame] | 51 | implementation("androidx.navigation:navigation-fragment-ktx:2.3.2") |
| 52 | |
| 53 | // For kotlin serialization |
| 54 | implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1") |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | protobuf { |
| 58 | protoc { |
Aurimas Liutikas | ef122cd | 2021-10-28 08:37:38 -0700 | [diff] [blame] | 59 | artifact = libs.protobufCompiler.get() |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 60 | } |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 61 | generateProtoTasks { |
| 62 | all().each { task -> |
| 63 | task.builtins { |
| 64 | java { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 65 | option "lite" |
Rohit Sathyanarayana | 8daa17a | 2020-05-29 15:51:47 -0700 | [diff] [blame] | 66 | } |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
Aurimas Liutikas | dcfa035 | 2022-03-14 16:05:33 -0700 | [diff] [blame] | 72 | android { |
| 73 | namespace "com.example.datastoresampleapp" |
| 74 | } |
Jeff Gaston | 8ee2f6e | 2022-11-30 13:24:25 -0500 | [diff] [blame] | 75 | |