mirror of
https://github.com/Matte23/circolapp.git
synced 2025-12-05 23:19:10 +00:00
Migrate from Groovy to Kotlin DSL
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.2"
|
||||
defaultConfig {
|
||||
applicationId "net.underdesk.circolapp"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 5
|
||||
versionName "0.3.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
androidExtensions {
|
||||
experimental = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.core:core-ktx:1.3.2'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha03'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
|
||||
implementation "androidx.work:work-runtime-ktx:2.4.0"
|
||||
implementation "androidx.room:room-runtime:2.2.5"
|
||||
kapt "androidx.room:room-compiler:2.2.5"
|
||||
implementation "androidx.room:room-ktx:2.2.5"
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
testImplementation 'junit:junit:4.13'
|
||||
androidTestImplementation 'androidx.test:runner:1.3.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.8.1'
|
||||
implementation 'com.squareup.moshi:moshi:1.9.3'
|
||||
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.3'
|
||||
implementation 'org.jsoup:jsoup:1.13.1'
|
||||
implementation 'com.github.AppIntro:AppIntro:6.0.0'
|
||||
implementation 'com.github.tiper:MaterialSpinner:1.4.2'
|
||||
implementation "com.mikepenz:aboutlibraries-core:$about_libs_version"
|
||||
implementation "com.mikepenz:aboutlibraries:$about_libs_version"
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:26.0.0')
|
||||
implementation 'com.google.firebase:firebase-messaging-ktx'
|
||||
}
|
||||
91
app/build.gradle.kts
Normal file
91
app/build.gradle.kts
Normal file
@@ -0,0 +1,91 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
id("kotlin-android-extensions")
|
||||
id("kotlin-kapt")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.mikepenz.aboutlibraries.plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(Config.Android.compileSdk)
|
||||
buildToolsVersion = Config.Android.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "net.underdesk.circolapp"
|
||||
|
||||
minSdkVersion(Config.Android.minSdk)
|
||||
targetSdkVersion(Config.Android.targetSdk)
|
||||
|
||||
versionCode = System.getenv("VERSION_CODE")?.toIntOrNull() ?: 1
|
||||
versionName = System.getenv("VERSION_NAME") ?: "LOCAL"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
named("release") {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
androidExtensions {
|
||||
isExperimental = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
|
||||
|
||||
// Kotlin
|
||||
implementation(Dependencies.Kotlin.core)
|
||||
|
||||
// AndroidX
|
||||
implementation(Dependencies.AndroidX.appcompat)
|
||||
implementation(Dependencies.AndroidX.core)
|
||||
implementation(Dependencies.AndroidX.constraintLayout)
|
||||
implementation(Dependencies.AndroidX.swipeRefreshLayout)
|
||||
implementation(Dependencies.AndroidX.lifecycleExtensions)
|
||||
implementation(Dependencies.AndroidX.preference)
|
||||
implementation(Dependencies.AndroidX.navigationFragment)
|
||||
implementation(Dependencies.AndroidX.navigationUi)
|
||||
implementation(Dependencies.AndroidX.workManager)
|
||||
implementation(Dependencies.AndroidX.Room.roomRuntime)
|
||||
implementation(Dependencies.AndroidX.Room.roomKtx)
|
||||
kapt(Dependencies.AndroidX.Room.roomCompiler)
|
||||
|
||||
// Google
|
||||
implementation(Dependencies.Google.material)
|
||||
|
||||
//Firebase
|
||||
implementation(platform(Dependencies.Firebase.bom))
|
||||
implementation(Dependencies.Firebase.messaging)
|
||||
|
||||
// Square
|
||||
implementation(Dependencies.Square.okhttp)
|
||||
implementation(Dependencies.Square.moshi)
|
||||
kapt(Dependencies.Square.moshiCodegen)
|
||||
|
||||
// AboutLibraries
|
||||
implementation(Dependencies.AboutLibraries.aboutLibrariesCore)
|
||||
implementation(Dependencies.AboutLibraries.aboutLibraries)
|
||||
|
||||
// Misc
|
||||
implementation(Dependencies.Misc.jsoup)
|
||||
implementation(Dependencies.Misc.appIntro)
|
||||
implementation(Dependencies.Misc.materialSpinner)
|
||||
|
||||
// Testing
|
||||
testImplementation(Dependencies.Testing.junit)
|
||||
androidTestImplementation(Dependencies.Testing.espresso)
|
||||
androidTestImplementation(Dependencies.Testing.testRunner)
|
||||
}
|
||||
36
build.gradle
36
build.gradle
@@ -1,36 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.4.10'
|
||||
ext.about_libs_version = '8.3.0'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$about_libs_version"
|
||||
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.4.0"
|
||||
classpath 'com.google.gms:google-services:4.3.4'
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
36
build.gradle.kts
Normal file
36
build.gradle.kts
Normal file
@@ -0,0 +1,36 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url = uri("https://plugins.gradle.org/m2/")
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath(Config.Plugin.android)
|
||||
classpath(Config.Plugin.kotlin)
|
||||
classpath(Config.Plugin.google)
|
||||
classpath(Config.Plugin.ktlint)
|
||||
classpath(Config.Plugin.aboutLibraries)
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url = uri("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
apply(plugin = "org.jlleitschuh.gradle.ktlint")
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete::class) {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
||||
7
buildSrc/build.gradle.kts
Normal file
7
buildSrc/build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
19
buildSrc/src/main/kotlin/Config.kt
Normal file
19
buildSrc/src/main/kotlin/Config.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
object Config {
|
||||
object Plugin {
|
||||
const val android = "com.android.tools.build:gradle:4.1.0"
|
||||
const val kotlin =
|
||||
"org.jetbrains.kotlin:kotlin-gradle-plugin:${Dependencies.Kotlin.version}"
|
||||
const val google = "com.google.gms:google-services:4.3.4"
|
||||
const val ktlint = "org.jlleitschuh.gradle:ktlint-gradle:9.4.0"
|
||||
const val aboutLibraries =
|
||||
"com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${Dependencies.AboutLibraries.version}"
|
||||
}
|
||||
|
||||
object Android {
|
||||
const val compileSdk = 30
|
||||
const val buildToolsVersion = "30.0.2"
|
||||
|
||||
const val minSdk = 21
|
||||
const val targetSdk = 30
|
||||
}
|
||||
}
|
||||
64
buildSrc/src/main/kotlin/Dependencies.kt
Normal file
64
buildSrc/src/main/kotlin/Dependencies.kt
Normal file
@@ -0,0 +1,64 @@
|
||||
object Dependencies {
|
||||
object Kotlin {
|
||||
const val version = "1.4.10"
|
||||
const val core = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${version}"
|
||||
}
|
||||
|
||||
object AndroidX {
|
||||
const val appcompat = "androidx.appcompat:appcompat:1.2.0"
|
||||
const val core = "androidx.core:core-ktx:1.3.2"
|
||||
const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.0.3"
|
||||
const val swipeRefreshLayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||
const val lifecycleExtensions = "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
||||
const val preference = "androidx.preference:preference-ktx:1.1.1"
|
||||
|
||||
private const val navigationVersion = "2.3.1"
|
||||
const val navigationFragment =
|
||||
"androidx.navigation:navigation-fragment-ktx:${navigationVersion}"
|
||||
const val navigationUi = "androidx.navigation:navigation-ui-ktx:${navigationVersion}"
|
||||
|
||||
const val workManager = "androidx.work:work-runtime-ktx:2.4.0"
|
||||
|
||||
object Room {
|
||||
private const val version = "2.2.5"
|
||||
const val roomRuntime = "androidx.room:room-runtime:${version}"
|
||||
const val roomKtx = "androidx.room:room-ktx:${version}"
|
||||
const val roomCompiler = "androidx.room:room-compiler:${version}"
|
||||
}
|
||||
}
|
||||
|
||||
object Google {
|
||||
const val material = "com.google.android.material:material:1.2.1"
|
||||
}
|
||||
|
||||
object Firebase {
|
||||
const val bom = "com.google.firebase:firebase-bom:26.0.0"
|
||||
const val messaging = "com.google.firebase:firebase-messaging-ktx"
|
||||
}
|
||||
|
||||
object Square {
|
||||
const val okhttp = "com.squareup.okhttp3:okhttp:4.8.1"
|
||||
|
||||
private const val moshiVersion = "1.9.3"
|
||||
const val moshi = "com.squareup.moshi:moshi:${moshiVersion}"
|
||||
const val moshiCodegen = "com.squareup.moshi:moshi-kotlin-codegen:${moshiVersion}"
|
||||
}
|
||||
|
||||
object AboutLibraries {
|
||||
const val version = "8.3.0"
|
||||
const val aboutLibrariesCore = "com.mikepenz:aboutlibraries-core:$version"
|
||||
const val aboutLibraries = "com.mikepenz:aboutlibraries:$version"
|
||||
}
|
||||
|
||||
object Misc {
|
||||
const val jsoup = "org.jsoup:jsoup:1.13.1"
|
||||
const val appIntro = "com.github.AppIntro:AppIntro:6.0.0"
|
||||
const val materialSpinner = "com.github.tiper:MaterialSpinner:1.4.2"
|
||||
}
|
||||
|
||||
object Testing {
|
||||
const val junit = "junit:junit:4.13"
|
||||
const val testRunner = "androidx.test:runner:1.3.0"
|
||||
const val espresso = "androidx.test.espresso:espresso-core:3.3.0"
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
include ':app'
|
||||
rootProject.name='Circolapp'
|
||||
2
settings.gradle.kts
Normal file
2
settings.gradle.kts
Normal file
@@ -0,0 +1,2 @@
|
||||
include(":app")
|
||||
rootProject.name = "Circolapp"
|
||||
Reference in New Issue
Block a user