Browse Source

upgrade build.gradle in lib module to build.gradle.kts

dev-kts
andywu91 3 years ago
parent
commit
b1d30eccbe
  1. 9
      build.gradle.kts
  2. 7
      buildSrc/build.gradle.kts
  3. 6
      buildSrc/src/main/kotlin/Versions.kt
  4. 35
      lib/build.gradle.kts
  5. 2
      lib/proguard-rules.pro

9
build.gradle.kts

@ -2,7 +2,6 @@
buildscript {
val kotlin_version = "1.5.20"
repositories {
google()
maven("https://mirrors.tencent.com/nexus/repository/maven-public/")
@ -11,7 +10,7 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@ -26,6 +25,6 @@ allprojects {
}
}
//task(clean(type: Delete) {
// delete = rootProject.buildDir
//})
tasks.register<Delete>("clean"){
delete(rootProject.buildDir)
}

7
buildSrc/build.gradle.kts

@ -0,0 +1,7 @@
plugins{
`kotlin-dsl`
}
repositories {
maven("https://mirrors.tencent.com/nexus/repository/maven-public/")
}

6
buildSrc/src/main/kotlin/Versions.kt

@ -0,0 +1,6 @@
/**
* created by Andy
* on 2023/9/21
*/
const val kotlinVersion = "1.5.20"
const val appCompatVersion = "1.1.0"

35
lib/build.gradle → lib/build.gradle.kts

@ -5,14 +5,14 @@ plugins{
}
group = "com.wuliang.lib"
version = "1.0.0"
version = "1.0.1"
android {
compileSdkVersion = 28
compileSdkVersion(28)
defaultConfig {
minSdkVersion = 14
targetSdkVersion = 28
minSdkVersion(14)
targetSdkVersion(28)
versionCode = 1
versionName = "1.0"
@ -21,46 +21,41 @@ android {
}
buildTypes {
release {
minifyEnabled = false
val release by getting {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildToolsVersion = "28.0.3"
}
def appcompat_version = "1.1.0"
def kotlin_version = "1.5.20"
dependencies {
implementation (fileTree(dir: "libs", include: ["*.jar"]))
// implementation (fileTree(dir to "libs", include to ["*.jar"]))
implementation( "androidx.appcompat:appcompat:$appcompat_version")
implementation( "androidx.appcompat:appcompat:$appCompatVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion")
testImplementation( "junit:junit:4.12")
implementation("org.zeroturnaround:zt-zip:1.13")
}
// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
create<MavenPublication>("release"){
// Applies the component for the release build variant.
from(components.release)
from(components["release"])
// You can then customize attributes of the publication as shown below.
artifactId = "xapkinstaller"
}
}
}
}
}

2
lib/proguard-rules.pro

@ -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

Loading…
Cancel
Save