Skip to content

Commit

Permalink
build: Convert Gradle buildscripts to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
kdrag0n committed Jun 29, 2021
1 parent c660c5c commit b970637
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 119 deletions.
83 changes: 0 additions & 83 deletions app/build.gradle

This file was deleted.

83 changes: 83 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
plugins {
id("com.android.application")
kotlin("android")
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("com.mikepenz.aboutlibraries.plugin")
}

android {
compileSdkVersion = "android-S"
buildToolsVersion = "30.0.3"

defaultConfig {
applicationId = "dev.kdrag0n.android12ext"
minSdkVersion(30)
targetSdkVersion(30)
versionCode = 50100
versionName = "5.1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
packagingOptions {
exclude("META-INF/library_release.kotlin_module")
}
}

kapt {
correctErrorTypes = true

javacOptions {
// These options are normally set automatically via the Hilt Gradle plugin, but we
// set them manually to workaround a bug in the Kotlin 1.5.20
option("-Adagger.fastInit=ENABLED")
option("-Adagger.hilt.android.internal.disableAndroidSuperclassValidation=true")
}
}

dependencies {
compileOnly("de.robv.android.xposed:api:82")

implementation("org.jetbrains.kotlin:kotlin-stdlib:${rootProject.extra.get("kotlinVersion")}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")

implementation("androidx.core:core-ktx:1.5.0")
// AppCompat 1.3.0 makes https://github.com/material-components/material-components-android/issues/1984 worse
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("com.google.android.material:material:1.4.0-rc01")
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
implementation("androidx.navigation:navigation-fragment-ktx:2.3.5")
implementation("androidx.navigation:navigation-ui-ktx:2.3.5")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
implementation("com.google.dagger:hilt-android:2.37")
kapt("com.google.dagger:hilt-compiler:2.37")

implementation("de.maxr1998:modernandroidpreferences:2.0")
implementation("com.microsoft.design:fluent-system-icons:1.1.115")
implementation("dev.chrisbanes.insetter:insetter:0.5.0")
implementation("com.crossbowffs.remotepreferences:remotepreferences:0.8")
implementation("com.mikepenz:aboutlibraries:8.8.4")
implementation("com.jakewharton.timber:timber:4.7.1")
implementation("io.coil-kt:coil:1.2.1")
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:2.0")
implementation("com.jaredrummler:colorpicker:1.1.0")
implementation("com.github.topjohnwu.libsu:core:3.1.2")
}
4 changes: 2 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand All @@ -23,4 +23,4 @@
# Alter access modifiers for more optimization
-allowaccessmodification

-keep class dev.kdrag0n.android12ext.core.xposed.XposedEntryPoint
-keep class dev.kdrag0n.android12ext.core.xposed.XposedEntryPoint
32 changes: 0 additions & 32 deletions build.gradle

This file was deleted.

32 changes: 32 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlinVersion by rootProject.extra { "1.5.20" }

repositories {
google()
jcenter()
maven("https://plugins.gradle.org/m2/")
}

dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:8.8.4")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.37")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
}
}

allprojects {
repositories {
google()
jcenter()
maven("https://jitpack.io")
}
}

tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}
2 changes: 0 additions & 2 deletions settings.gradle

This file was deleted.

2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include(":app")
rootProject.name = "Android 12 Extensions"

0 comments on commit b970637

Please sign in to comment.