Skip to content

Commit e7d0311

Browse files
Refactor project
1 parent aed3eb5 commit e7d0311

File tree

139 files changed

+7217
-6436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+7217
-6436
lines changed

.editorconfig

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
root = true
22

3-
[*.{kt,kts}]
43
# noinspection EditorConfigKeyCorrectness
5-
ktlint_standard_package-name = disabled
6-
ij_kotlin_allow_trailing_comma_on_call_site = false
7-
ij_kotlin_allow_trailing_comma = false
8-
trim_trailing_whitespace = true
9-
insert_final_newline = true
4+
[*.{kt,kts}]
5+
ktlint_code_style = android_studio
6+
ktlint_function_naming_ignore_when_annotated_with=Composable

app/build.gradle

-111
This file was deleted.

app/build.gradle.kts

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2+
import io.gitlab.arturbosch.detekt.Detekt
3+
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
4+
5+
plugins {
6+
alias(libs.plugins.android.application)
7+
alias(libs.plugins.compose.compiler.report.generator)
8+
alias(libs.plugins.dagger.hilt.android)
9+
alias(libs.plugins.detekt)
10+
alias(libs.plugins.kotlin.android)
11+
alias(libs.plugins.kotlin.parcelize)
12+
alias(libs.plugins.kotlinter)
13+
alias(libs.plugins.ksp)
14+
alias(libs.plugins.room)
15+
alias(libs.plugins.spotless)
16+
alias(libs.plugins.versions)
17+
}
18+
19+
android {
20+
namespace = "io.github.tommygeenexus.usbdonglecontrol"
21+
compileSdk = 34
22+
23+
defaultConfig {
24+
applicationId = "io.github.tommygeenexus.usbdonglecontrol"
25+
minSdk = 31
26+
targetSdk = 34
27+
versionCode = 5
28+
versionName = "2.1.0"
29+
}
30+
31+
buildTypes {
32+
release {
33+
isMinifyEnabled = true
34+
isShrinkResources = true
35+
proguardFiles(
36+
getDefaultProguardFile("proguard-android-optimize.txt"),
37+
"proguard-rules.pro"
38+
)
39+
}
40+
}
41+
42+
buildFeatures {
43+
compose = true
44+
buildConfig = true
45+
}
46+
47+
composeOptions {
48+
kotlinCompilerExtensionVersion = "1.5.8"
49+
}
50+
51+
compileOptions {
52+
sourceCompatibility = JavaVersion.VERSION_17
53+
targetCompatibility = JavaVersion.VERSION_17
54+
}
55+
56+
kotlinOptions {
57+
jvmTarget = "17"
58+
}
59+
}
60+
61+
tasks.withType<DependencyUpdatesTask>().configureEach {
62+
fun isNonStable(version: String): Boolean {
63+
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
64+
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
65+
val isStable = stableKeyword || regex.matches(version)
66+
return isStable.not()
67+
}
68+
rejectVersionIf {
69+
isNonStable(candidate.version) && !isNonStable(currentVersion)
70+
}
71+
}
72+
73+
tasks.withType<Detekt>().configureEach {
74+
jvmTarget = "1.8"
75+
}
76+
77+
tasks.withType<DetektCreateBaselineTask>().configureEach {
78+
jvmTarget = "1.8"
79+
}
80+
81+
detekt {
82+
baseline = file("$projectDir/config/detekt/baseline.xml")
83+
config.setFrom("$projectDir/config/detekt/detekt.yml")
84+
buildUponDefaultConfig = true
85+
}
86+
87+
kotlin {
88+
compilerOptions {
89+
freeCompilerArgs.addAll(
90+
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
91+
"-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi",
92+
"-opt-in=androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi",
93+
)
94+
}
95+
}
96+
97+
room {
98+
schemaDirectory("$projectDir/schemas/")
99+
}
100+
101+
spotless {
102+
kotlin {
103+
ratchetFrom("origin/main")
104+
target("**/*.kt")
105+
licenseHeaderFile(rootProject.file("spotless/copyright.txt"))
106+
}
107+
}
108+
109+
dependencies {
110+
debugImplementation(libs.leakcanary)
111+
implementation(platform(libs.compose.bom))
112+
implementation(libs.bundles.implementation)
113+
ksp(libs.bundles.ksp)
114+
lintChecks(libs.bundles.lint.checks)
115+
}

0 commit comments

Comments
 (0)