Skip to content

Commit

Permalink
migrate to build.gradle.kts kotlin dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
amirisback committed Jan 8, 2022
1 parent 374fb9d commit 0c02ddf
Show file tree
Hide file tree
Showing 12 changed files with 264 additions and 201 deletions.
70 changes: 0 additions & 70 deletions app/build.gradle

This file was deleted.

76 changes: 76 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
id("com.android.application")
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"

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

}

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

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

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()
}
}

packagingOptions {
exclude("META-INF/AL2.0")
exclude("META-INF/LGPL2.1")
}

}


dependencies {

implementation("org.jetbrains.kotlin:kotlin-stdlib:${Dependency.KOTLIN_VERSION}")
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.4.0")
implementation("com.google.android.material:material:1.4.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.2")

// Library FrogoLog
implementation(project(":frogolog"))

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
}
58 changes: 0 additions & 58 deletions build.gradle

This file was deleted.

28 changes: 28 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Dependency.KOTLIN_VERSION}")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
mavenCentral()
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
2 changes: 2 additions & 0 deletions buildSrc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
.gradle
9 changes: 9 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import org.gradle.kotlin.dsl.`kotlin-dsl`

repositories {
mavenCentral()
}

plugins {
`kotlin-dsl`
}
20 changes: 20 additions & 0 deletions buildSrc/src/main/kotlin/Dependency.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Created by faisalamir on 19/09/21
* FrogoRecyclerView
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
* Copyright (C) 2021 FrogoBox Inc.
* All rights reserved
*
*/

object Dependency {

// dependencies version
const val KOTLIN_VERSION = "1.6.10"
const val COMPOSE_VERSION = "1.0.2"

}
39 changes: 39 additions & 0 deletions buildSrc/src/main/kotlin/ProjectSetting.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Created by faisalamir on 19/09/21
* FrogoRecyclerView
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
* Copyright (C) 2021 FrogoBox Inc.
* All rights reserved
*
*/

object ProjectSetting {

// project settings
const val NAME_APP = "Frogo Log"
val NAME_APK = NAME_APP.toLowerCase().replace(" ", "-")

const val APP_DOMAIN = "com"
const val APP_PLAY_CONSOLE = "frogobox"
const val APP_NAME = "applog"

const val LIBRARY_NAME = "frogolog"

const val VERSION_MAJOR = 2
const val VERSION_MINOR = 0
const val VERSION_PATCH = 4

const val PROJECT_COMPILE_SDK = 31
const val PROJECT_MIN_SDK = 21
const val PROJECT_TARGET_SDK = PROJECT_COMPILE_SDK

const val PROJECT_APP_ID = "$APP_DOMAIN.$APP_PLAY_CONSOLE.$APP_NAME"
const val PROJECT_LIB_ID = "$APP_DOMAIN.$APP_PLAY_CONSOLE.$LIBRARY_NAME"
const val PROJECT_VERSION_CODE = (VERSION_MAJOR * 100) + (VERSION_MINOR * 10) + (VERSION_PATCH * 1)
const val PROJECT_VERSION_NAME = "$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"

}
70 changes: 0 additions & 70 deletions frogolog/build.gradle

This file was deleted.

Loading

0 comments on commit 0c02ddf

Please sign in to comment.