File size: 5,390 Bytes
89995d3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 5715433..be0afc1 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -5,6 +5,7 @@ import java.io.FileInputStream
plugins {
alias(libs.plugins.android)
+ alias(libs.plugins.kotlin.compose)
alias(libs.plugins.detekt)
}
@@ -37,6 +38,7 @@ android {
versionCode = project.property("VERSION_CODE").toString().toInt()
multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
@@ -62,6 +64,14 @@ android {
buildFeatures {
viewBinding = true
buildConfig = true
+ compose = true
+ }
+
+ testOptions {
+ unitTests {
+ isIncludeAndroidResources = true
+ all { it.maxHeapSize = "3g" }
+ }
}
buildTypes {
@@ -89,6 +99,8 @@ android {
sourceSets {
getByName("main").java.directories.add("src/main/kotlin")
+ getByName("test").java.directories.add("src/test/kotlin")
+ getByName("androidTest").java.directories.add("src/androidTest/kotlin")
}
compileOptions {
@@ -145,5 +157,16 @@ dependencies {
implementation(libs.gestureviews)
implementation(libs.autofittextview)
implementation(libs.zip4j)
+ implementation(libs.androidx.activity.compose)
+ implementation(libs.androidx.compose.ui)
+ implementation(libs.androidx.compose.foundation)
+ implementation(libs.androidx.compose.material3)
+ implementation(libs.kotlinx.collections.immutable)
+ testImplementation(libs.junit)
+ testImplementation(libs.robolectric)
+ testImplementation(libs.androidx.compose.ui.test.junit4)
+ androidTestImplementation(libs.androidx.test.runner)
+ androidTestImplementation(libs.androidx.test.espresso.core)
+ androidTestImplementation(libs.androidx.compose.ui.test.junit4)
detektPlugins(libs.compose.detekt)
}
diff --git a/build.gradle.kts b/build.gradle.kts
index 360f5f4..7665d2b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,5 @@
plugins {
alias(libs.plugins.android).apply(false)
+ alias(libs.plugins.kotlin.compose).apply(false)
alias(libs.plugins.detekt).apply(false)
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 6c71eb8..22f8b5f 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -5,16 +5,26 @@ kotlin = "2.3.10"
detekt = "1.23.8"
detektCompose = "0.4.28"
#AndroidX
+androidx-activity = "1.12.4"
+androidx-compose-foundation = "1.8.1"
+androidx-compose-material3 = "1.4.0"
+androidx-compose-ui = "1.9.2"
androidx-swiperefreshlayout = "1.2.0"
androidx-documentfile = "1.1.0"
#Fossify
commons = "6.1.6"
#Other
autofittextview = "0.2.1"
+kotlinx-collections-immutable = "0.4.0"
gestureviews = "2.9.0"
rootshell = "bc7e5d398e"
roottools = "965c154e20"
zip4j = "2.11.6"
+#Testing
+junit = "4.13.2"
+androidx-test-runner = "1.6.2"
+androidx-test-espresso = "3.6.1"
+robolectric = "4.16"
#Gradle
gradlePlugins-agp = "9.4.0"
#build
@@ -25,9 +35,14 @@ app-build-javaVersion = "VERSION_17"
app-build-kotlinJVMTarget = "17"
[libraries]
#AndroidX
+androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefreshlayout" }
androidx-documentfile = { module = "androidx.documentfile:documentfile", version.ref = "androidx-documentfile" }
#Compose
+androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-foundation" }
+androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "androidx-compose-material3" }
+androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidx-compose-ui" }
+androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-compose-ui" }
compose-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
#Fossify
fossify-commons = { module = "org.fossify:commons", version.ref = "commons" }
@@ -37,6 +52,13 @@ gestureviews = { module = "com.alexvasilkov:gesture-views", version.ref = "gestu
rootshell = { module = "com.github.naveensingh:RootShell", version.ref = "rootshell" }
roottools = { module = "com.github.naveensingh:RootTools", version.ref = "roottools" }
zip4j = { module = "net.lingala.zip4j:zip4j", version.ref = "zip4j" }
+kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable" }
+#Testing
+junit = { module = "junit:junit", version.ref = "junit" }
+androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" }
+androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
+robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
[plugins]
android = { id = "com.android.application", version.ref = "gradlePlugins-agp" }
+kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
|