From b3f05fd925a7b62a0bd02e132dd8b423b538d37e Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 27 May 2022 00:44:20 -0700 Subject: [PATCH] Update setup --- app/build.gradle.kts | 4 ---- app/shared/build.gradle.kts | 3 --- app/shared/proguard-rules.pro | 21 --------------------- buildSrc/src/main/java/Setup.kt | 10 ++++++++++ 4 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 app/shared/proguard-rules.pro diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4266bb597..10fea8f0c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -56,10 +56,6 @@ android { keepDebugSymbols += "**/*.so" } } - - kotlinOptions { - jvmTarget = "11" - } } setupApp() diff --git a/app/shared/build.gradle.kts b/app/shared/build.gradle.kts index 2e15e8d58..9ac491b18 100644 --- a/app/shared/build.gradle.kts +++ b/app/shared/build.gradle.kts @@ -6,9 +6,6 @@ setupCommon() android { namespace = "com.topjohnwu.shared" - defaultConfig { - consumerProguardFiles("proguard-rules.pro") - } } dependencies { diff --git a/app/shared/proguard-rules.pro b/app/shared/proguard-rules.pro deleted file mode 100644 index f1b424510..000000000 --- a/app/shared/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/buildSrc/src/main/java/Setup.kt b/buildSrc/src/main/java/Setup.kt index ad6cda03c..294a0c840 100644 --- a/buildSrc/src/main/java/Setup.kt +++ b/buildSrc/src/main/java/Setup.kt @@ -1,3 +1,4 @@ + import com.android.build.gradle.BaseExtension import com.android.build.gradle.internal.dsl.BaseAppModuleExtension import org.apache.tools.ant.filters.FixCrLfFilter @@ -9,6 +10,7 @@ import org.gradle.api.tasks.StopExecutionException import org.gradle.api.tasks.Sync import org.gradle.kotlin.dsl.filter import org.gradle.kotlin.dsl.named +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions import java.io.* import java.util.* import java.util.zip.Deflater @@ -22,6 +24,11 @@ private fun Project.androidBase(configure: Action) = private fun Project.android(configure: Action) = extensions.configure("android", configure) +private fun Project.kotlinOptions(configure: Action) = + extensions.findByName("kotlinOptions")?.let { + configure.execute(it as KotlinJvmOptions) + } + private val Project.android: BaseAppModuleExtension get() = extensions.getByName("android") as BaseAppModuleExtension @@ -41,6 +48,9 @@ fun Project.setupCommon() { targetCompatibility = JavaVersion.VERSION_11 } } + kotlinOptions { + jvmTarget = "11" + } } private fun Project.setupAppCommon() {