build: migrate to Kotlin DSL (#151)

Co-authored-by: PatrickMis <24607131+PatrickMis@users.noreply.github.com>
This commit is contained in:
Patryk Miś
2022-09-22 18:47:46 +02:00
committed by GitHub
parent b97c6005f0
commit f47cc8b375
13 changed files with 87 additions and 86 deletions

2
app/.gitignore vendored
View File

@ -1 +1 @@
/build
/build

View File

@ -1,44 +0,0 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
buildToolsVersion "32.0.0"
namespace 'app.revanced.integrations'
defaultConfig {
applicationId "app.revanced.integrations"
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0"
multiDexEnabled false
Properties properties = new Properties()
if (rootProject.file("local.properties").exists()) {
properties.load(rootProject.file("local.properties").newDataInputStream())
}
buildConfigField "String", "YT_API_KEY", "\"${properties.getProperty("youtubeAPIKey", "")}\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
}
dependencies {
compileOnly 'androidx.annotation:annotation:1.5.0'
}

47
app/build.gradle.kts Normal file
View File

@ -0,0 +1,47 @@
import java.io.FileInputStream
import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}
android {
compileSdk = 32
buildToolsVersion = "32.0.0"
namespace = "app.revanced.integrations"
defaultConfig {
applicationId = "app.revanced.integrations"
minSdk = 23
targetSdk = 32
versionCode = 1
versionName = "1.0"
multiDexEnabled = false
val properties = Properties()
if (rootProject.file("local.properties").exists()) {
properties.load(FileInputStream(rootProject.file("local.properties")))
}
buildConfigField("String", "YT_API_KEY", "\"${properties.getProperty("youtubeAPIKey", "")}\"")
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility(JavaVersion.VERSION_11)
targetCompatibility(JavaVersion.VERSION_11)
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}
dependencies {
compileOnly("androidx.annotation:annotation:1.5.0")
}

View File

@ -18,4 +18,4 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

View File

@ -2,4 +2,4 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
</manifest>
</manifest>