Skip to content

Commit

Permalink
Migrate to modern gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitletondor committed Apr 16, 2023
1 parent 05fecf8 commit b912ac0
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 241 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.idea
.DS_Store
fabric.properties
batch.gradle
key
iap.gradle
Android/EasyBudget/.idea/misc.xml
Android/EasyBudget/caldroid/build
2 changes: 1 addition & 1 deletion Android/EasyBudget/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions Android/EasyBudget/EasyBudget.iml

This file was deleted.

3 changes: 3 additions & 0 deletions Android/EasyBudget/app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/build
batch.gradle.kts
iap.gradle.kts
fabric.properties
2 changes: 2 additions & 0 deletions Android/EasyBudget/app/batch.gradle.kts.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
val batchDevKey by rootProject.extra("BATCH_DEV_API_KEY")
val batchLiveKey by rootProject.extra("BATCH_LIVE_API_KEY")
4 changes: 0 additions & 4 deletions Android/EasyBudget/app/batch.gradle.sample

This file was deleted.

158 changes: 0 additions & 158 deletions Android/EasyBudget/app/build.gradle

This file was deleted.

162 changes: 162 additions & 0 deletions Android/EasyBudget/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
* Copyright 2023 Benoit LETONDOR
*
* 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.
*/
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("com.google.firebase.crashlytics")
id("dagger.hilt.android.plugin")
id("com.google.devtools.ksp")
id("com.google.gms.google-services")
}

apply {
from("batch.gradle.kts")
from("iap.gradle.kts")
}

android {
namespace = "com.benoitletondor.easybudgetapp"

defaultConfig {
applicationId = "com.benoitletondor.easybudgetapp"
compileSdk = 33
minSdk = 21
targetSdk = 33
versionCode = 86
versionName = "2.5.3"
vectorDrawables.useSupportLibrary = true

javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf(
"room.incremental" to "true"
)
}
}
}

buildTypes {
debug {
val batchDevKey = rootProject.extra["batchDevKey"] as String
val licenceKey = rootProject.extra["licenceKey"] as String

buildConfigField("boolean", "DEBUG_LOG", "true")
buildConfigField("boolean", "CRASHLYTICS_ACTIVATED", "false")
buildConfigField("String", "BATCH_API_KEY", "\"$batchDevKey\"")
buildConfigField("boolean", "ANALYTICS_ACTIVATED", "false")
buildConfigField("boolean", "DEV_PREFERENCES", "true")
buildConfigField("String", "LICENCE_KEY", "\"$licenceKey\"")

signingConfig = signingConfigs.getByName("debug")
}
release {
val batchLiveKey = rootProject.extra["batchLiveKey"] as String
val licenceKey = rootProject.extra["licenceKey"] as String

buildConfigField("boolean", "DEBUG_LOG", "false")
buildConfigField("boolean", "CRASHLYTICS_ACTIVATED", "true")
buildConfigField("String", "BATCH_API_KEY", "\"$batchLiveKey\"")
buildConfigField("boolean", "ANALYTICS_ACTIVATED", "true")
buildConfigField("boolean", "DEV_PREFERENCES", "false")
buildConfigField("String", "LICENCE_KEY", "\"$licenceKey\"")

isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
signingConfigs {
getByName("debug") {
storeFile = file("../key/debug.jks")
storePassword = "uFdRPMWz69R28t6m9zV53jmw9hJVK3"
keyAlias = "easybudget"
keyPassword = "uFdRPMWz69R28t6m9zV53jmw9hJVK3"
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

isCoreLibraryDesugaringEnabled = true
}

kotlinOptions {
jvmTarget = "11"
}

buildFeatures {
viewBinding = true
buildConfig = true
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

dependencies {
val kotlinVersion: String by rootProject.extra
val hiltVersion: String by rootProject.extra

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion")

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")

implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.core:core-ktx:1.10.0")
implementation("com.google.android.material:material:1.8.0")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.activity:activity-ktx:1.7.0")
implementation("androidx.fragment:fragment-ktx:1.5.6")
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
implementation("androidx.work:work-runtime-ktx:2.8.1")
implementation("androidx.work:work-gcm:2.8.1")
implementation("com.google.android.play:core:1.10.3")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")

implementation(platform("com.google.firebase:firebase-bom:31.5.0"))
implementation("com.google.firebase:firebase-messaging-ktx")
implementation("com.google.firebase:firebase-storage")
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.firebaseui:firebase-ui-auth:8.0.2")

implementation("com.android.billingclient:billing-ktx:5.2.0")

implementation(project(":caldroid"))
implementation("me.relex:circleindicator:2.1.6@aar")
implementation("com.batch.android:batch-sdk:1.19.4")

implementation("com.google.dagger:hilt-android:$hiltVersion")
implementation("androidx.hilt:hilt-work:1.0.0")
kapt("androidx.hilt:hilt-compiler:1.0.0")
kapt("com.google.dagger:hilt-compiler:$hiltVersion")

ksp("androidx.room:room-compiler:2.5.1")
implementation("androidx.room:room-runtime:2.5.1")
implementation("androidx.room:room-ktx:2.5.1")

implementation("net.lingala.zip4j:zip4j:2.5.2")
}
2 changes: 2 additions & 0 deletions Android/EasyBudget/app/iap.gradle.kts.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
val licenceKey by rootProject.extra("LICENCE_KEY")

3 changes: 0 additions & 3 deletions Android/EasyBudget/app/iap.gradle.sample

This file was deleted.

2 changes: 1 addition & 1 deletion Android/EasyBudget/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /Users/benoit/Android/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
Loading

0 comments on commit b912ac0

Please sign in to comment.