Skip to content

Commit

Permalink
update: .gradle->.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 19, 2021
1 parent 7ee6497 commit a39f877
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 98 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
基于无障碍和自定义匹配规则的广告关闭app

记录递归调用的次数, 根据统计次数考虑是否添加规则长度, 可减少匹配时间

# Fix Bug

## Android Studio kts lint error

replace default "Embedded JDK" with download jdk by `File->Project Structrue...->SDK Location->Gradle Settings->Gradle JDK`
88 changes: 0 additions & 88 deletions app/build.gradle

This file was deleted.

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

val composeVersion = "1.0.5"
android {
compileSdk =31
buildToolsVersion ="31.0.0"

defaultConfig {
applicationId = "li.songe.ad_closer"
minSdk =26
targetSdk =31
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
// signingConfigs{
// release{
// storeFile = file("./android.jks")
// storePassword = "KdMQ6pqiNSJ6Sype"
// keyAlias = "key0"
// keyPassword = "KdMQ6pqiNSJ6Sype"
// }
// }

buildTypes {
getByName("release") {
// isMinifyEnabled = false
// setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
// signingConfig = signingConfigs.getByName("release")
}
// debug{
// signingConfig = signingConfigs.getByName("release")
// }
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose =true
}
composeOptions {
kotlinCompilerExtensionVersion = composeVersion
}
packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {

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.compose.ui:ui:$composeVersion")
implementation("androidx.compose.material:material:$composeVersion")
implementation("androidx.compose.ui:ui-tooling-preview:$composeVersion")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0")
implementation("androidx.activity:activity-compose:1.4.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$composeVersion")
debugImplementation("androidx.compose.ui:ui-tooling:$composeVersion")

// https://github.com/RikkaApps/Shizuku-API
val shizuku_version = "12.1.0"
implementation("dev.rikka.shizuku:api:$shizuku_version")
// Add this line if you want to support Shizuku
implementation("dev.rikka.shizuku:provider:$shizuku_version")

// 工具集合类
// https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/README-CN.md
implementation("com.blankj:utilcodex:1.30.6")

}
19 changes: 10 additions & 9 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
compose_version = "1.0.5"
kotlin_version = "1.5.31"
}
// ext {
// compose_version = "1.0.5"
// kotlin_version = "1.5.31"
// }
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
val kotlinVersion= "1.5.31"
classpath("com.android.tools.build:gradle:7.0.3")
classpath(kotlin("gradle-plugin", version = kotlinVersion))

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

task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.register<Delete>("clean").configure {
delete(rootProject.buildDir)
}
2 changes: 1 addition & 1 deletion settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencyResolutionManagement {
}
}
rootProject.name = "AdCloser"
include ':app'
include(":app")

0 comments on commit a39f877

Please sign in to comment.