Skip to content

Commit

Permalink
Rename build.gradle -> build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
rakuishi committed Nov 8, 2023
1 parent b77f783 commit 1a0fc13
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 34 deletions.
66 changes: 35 additions & 31 deletions app/build.gradle → app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id 'kotlin-kapt'
id("kotlin-kapt")
}

android {
namespace 'com.rakuishi.nreader'
compileSdk 33
namespace = "com.rakuishi.nreader"
compileSdk = 33

defaultConfig {
applicationId "com.rakuishi.nreader"
minSdk 30
targetSdk 33
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
applicationId = "com.rakuishi.nreader"
minSdk = 30
targetSdk = 33
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

buildTypes {
debug {
debuggable true
minifyEnabled false
applicationIdSuffix ".debug"
isDebuggable = true
isMinifyEnabled = false
applicationIdSuffix = ".debug"
}
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
isDebuggable = false
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "17"
}

buildFeatures {
compose true
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.3.0"
}

packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
packaging {
resources.excludes += listOf(
"/META-INF/{AL2.0,LGPL2.1}",
)
}

@Suppress("UnstableApiUsage")
testOptions {
unitTests.includeAndroidResources = true
unitTests {
isIncludeAndroidResources = true
}
}
}

dependencies {
implementation(libs.androidx.core.ktx)

// Compose
implementation platform(libs.androidx.compose.bom)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material3)
Expand Down Expand Up @@ -104,6 +106,8 @@ dependencies {
* This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
* To remove the warnings, we add the compiler argument -Xopt-in=kotlin.RequiresOptIn.
*/
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs += listOf("-Xopt-in=kotlin.RequiresOptIn")
}
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
}

task clean(type: Delete) {
delete rootProject.buildDir
task("clean", Delete::class) {
delete = setOf(rootProject.buildDir)
}

0 comments on commit 1a0fc13

Please sign in to comment.