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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 87 additions and 86 deletions

View File

@ -5,4 +5,4 @@ contact_links:
about: Don't know how or where to start? Check out our documentation!
- name: 🗨 Discussions
url: https://github.com/revanced/revanced-suggestions/discussions
about: Got something you think should change or be added? Search for or start a new discussion!
about: Got something you think should change or be added? Search for or start a new discussion!

View File

@ -43,4 +43,4 @@ body:
label: Additional context
description: Add additional context here.
validations:
required: false
required: false

View File

@ -37,4 +37,4 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
run: npx semantic-release

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>

View File

@ -1,33 +0,0 @@
// 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.3.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url 'https://jitpack.io' }
mavenCentral()
}
}
// Tracking issue https://github.com/semantic-release/semantic-release/issues/963
task publish(type: DefaultTask) {
group = 'publish'
description = 'Dummy publish to pass the verification phase of the gradle-semantic-release-plugin'
}
task clean(type: Delete) {
delete rootProject.buildDir
}

24
build.gradle.kts Normal file
View File

@ -0,0 +1,24 @@
// 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.3.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
// Tracking issue https://github.com/semantic-release/semantic-release/issues/963
tasks.register("publish", DefaultTask::class) {
group = "publish"
description = "Dummy publish to pass the verification phase of the gradle-semantic-release-plugin"
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}

View File

@ -1,4 +1,3 @@
org.gradle.jvmargs = -Xmx2048m
android.useAndroidX = true
android.enableJetifier = true
version = 0.41.1

View File

@ -1,2 +0,0 @@
include ':app'
rootProject.name = "integrations"

10
settings.gradle.kts Normal file
View File

@ -0,0 +1,10 @@
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
maven { url = uri("https://jitpack.io") }
mavenCentral()
}
}
include(":app")
rootProject.name = "integrations"