|
| 1 | +/* |
| 2 | + * Copyright (C) 2019 Google Inc. |
| 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 | + |
| 17 | +apply plugin: 'com.android.application' |
| 18 | +apply plugin: 'kotlin-android' |
| 19 | +apply plugin: 'kotlin-kapt' |
| 20 | +apply plugin: "androidx.navigation.safeargs" |
| 21 | +apply plugin: 'kotlin-android-extensions' |
| 22 | + |
| 23 | +android { |
| 24 | + compileSdkVersion 32 |
| 25 | + defaultConfig { |
| 26 | + applicationId "com.example.android.devbyteviewer" |
| 27 | + minSdkVersion 19 |
| 28 | + targetSdkVersion 32 |
| 29 | + versionCode 1 |
| 30 | + versionName "1.0" |
| 31 | + vectorDrawables.useSupportLibrary = true |
| 32 | + multiDexEnabled true |
| 33 | + } |
| 34 | + buildTypes { |
| 35 | + release { |
| 36 | + minifyEnabled true |
| 37 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + buildFeatures { |
| 42 | + dataBinding true |
| 43 | + } |
| 44 | + compileOptions { |
| 45 | + sourceCompatibility JavaVersion.VERSION_1_8 |
| 46 | + targetCompatibility JavaVersion.VERSION_1_8 |
| 47 | + } |
| 48 | + |
| 49 | + kotlinOptions { |
| 50 | + jvmTarget = JavaVersion.VERSION_1_8.toString() |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | +dependencies { |
| 55 | + implementation fileTree(dir: 'libs', include: ['*.jar']) |
| 56 | + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
| 57 | + |
| 58 | + // support libraries |
| 59 | + implementation 'androidx.appcompat:appcompat:1.4.1' |
| 60 | + implementation 'androidx.legacy:legacy-support-v4:1.0.0' |
| 61 | + implementation 'com.google.android.material:material:1.5.0' |
| 62 | + |
| 63 | + // Android KTX |
| 64 | + implementation 'androidx.core:core-ktx:1.7.0' |
| 65 | + |
| 66 | + // constraint layout |
| 67 | + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' |
| 68 | + |
| 69 | + // navigation |
| 70 | + def nav_version = "1.0.0" |
| 71 | + implementation "android.arch.navigation:navigation-fragment-ktx:$nav_version" |
| 72 | + implementation "android.arch.navigation:navigation-ui-ktx:$nav_version" |
| 73 | + |
| 74 | + // coroutines for getting off the UI thread |
| 75 | + def coroutines = "1.6.0" |
| 76 | + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines" |
| 77 | + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines" |
| 78 | + |
| 79 | + // retrofit for networking |
| 80 | + implementation 'com.squareup.retrofit2:retrofit:2.9.0' |
| 81 | + implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2' |
| 82 | + implementation 'com.squareup.retrofit2:converter-moshi:2.9.0' |
| 83 | + |
| 84 | + // moshi for parsing the JSON format |
| 85 | + def moshi_version = "1.13.0" |
| 86 | + implementation "com.squareup.moshi:moshi:$moshi_version" |
| 87 | + implementation "com.squareup.moshi:moshi-kotlin:$moshi_version" |
| 88 | + kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" |
| 89 | + |
| 90 | + // joda time library for dealing with time |
| 91 | + implementation 'joda-time:joda-time:2.10' |
| 92 | + |
| 93 | + // arch components |
| 94 | + // ViewModel and LiveData |
| 95 | + def lifecycle_version = "2.4.1" |
| 96 | +// implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" |
| 97 | + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" |
| 98 | + |
| 99 | + // logging |
| 100 | + implementation 'com.jakewharton.timber:timber:4.7.1' |
| 101 | + |
| 102 | + // glide for images |
| 103 | + implementation 'com.github.bumptech.glide:glide:4.8.0' |
| 104 | + kapt 'com.github.bumptech.glide:compiler:4.7.1' |
| 105 | + |
| 106 | + // Room dependency |
| 107 | + def room_version = "2.4.1" |
| 108 | + implementation "androidx.room:room-runtime:$room_version" |
| 109 | + kapt "androidx.room:room-compiler:$room_version" |
| 110 | + |
| 111 | +} |
0 commit comments