Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
Update and rename build.gradle to build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
amirisback authored Mar 15, 2022
1 parent c90b9e6 commit b156d71
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 37 deletions.
37 changes: 0 additions & 37 deletions app/build.gradle

This file was deleted.

95 changes: 95 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-kapt")
}

android {

compileSdk = ProjectSetting.PROJECT_COMPILE_SDK

defaultConfig {
applicationId = ProjectSetting.PROJECT_APP_ID
minSdk = ProjectSetting.PROJECT_MIN_SDK
targetSdk = ProjectSetting.PROJECT_TARGET_SDK
versionCode = ProjectSetting.PROJECT_VERSION_CODE
versionName = ProjectSetting.PROJECT_VERSION_NAME

multiDexEnabled = true
vectorDrawables.useSupportLibrary = true

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

// Declaration build config
buildConfigField("String", "DATABASE_NAME", ProjectSetting.DB)

// Naming APK // AAB
setProperty("archivesBaseName", "${ProjectSetting.NAME_APK}(${versionName})")

// Declaration apps name debug mode
val debugAttribute = "Development"
val nameAppDebug = "${ProjectSetting.NAME_APP} $debugAttribute"
resourceConfigurations += setOf("en", "id")

// Inject app name for debug
resValue("string", "app_name", nameAppDebug)

}

signingConfigs {
create("release") {
// You need to specify either an absolute path or include the
// keystore file in the same directory as the build.gradle file.
// [PROJECT FOLDER NAME/app/[COPY YOUT KEY STORE] .jks in here
storeFile = file(ProjectSetting.PLAYSTORE_STORE_FILE)
storePassword = ProjectSetting.PLAYSTORE_STORE_PASSWORD
keyAlias = ProjectSetting.PLAYSTORE_KEY_ALIAS
keyPassword = ProjectSetting.PLAYSTORE_KEY_PASSWORD
}
}

buildTypes {
getByName("release") {
isMinifyEnabled = false

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)

// Generated Signed APK / AAB
signingConfig = signingConfigs.getByName("release")

// Inject app name for release
resValue("string", "app_name", ProjectSetting.APP_NAME)

}
}

buildFeatures {
viewBinding = true
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

}

dependencies {

implementation(Androidx.appCompat)
implementation(Androidx.appCompatResources)
implementation(Androidx.constraintLayout)
implementation(Androidx.Core.ktx)
implementation(Androidx.Work.runtimeKtx)

implementation(project(":library"))
}

0 comments on commit b156d71

Please sign in to comment.