From 994672608db65a68b3ba3db8fa37bb613de89c20 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 10 Sep 2024 23:46:21 +0200 Subject: Add libs:documents Reads the abomination that is SAF, or Androids best effort to make files and directories completely and utterly unusable on Android. The androidTest was (and is) a pain, only known to work on a Pixel3 API 34 emulator but it showed a lot of things that the fake content provider in the unit tests failed to show. --- libs/documents/build.gradle.kts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libs/documents/build.gradle.kts (limited to 'libs/documents/build.gradle.kts') diff --git a/libs/documents/build.gradle.kts b/libs/documents/build.gradle.kts new file mode 100644 index 0000000..8d03de9 --- /dev/null +++ b/libs/documents/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + alias(libs.plugins.android.library) +} + +android { + namespace = "org.the_jk.cleversync.documents" + + testOptions { + unitTests { + all { test -> + // Needed to get robolectric FileDescriptorInterceptor to work + test.jvmArgs("--add-opens=java.base/java.io=ALL-UNNAMED") + } + } + } +} + +dependencies { + implementation(project(":libs:io")) + implementation(libs.androidx.core) + implementation(libs.androidx.fragment.ktx) + implementation(libs.androidx.uiautomator) + testImplementation(project(":libs:test-utils")) + androidTestImplementation(project(":libs:test-utils")) +} + +val removeTestDirs = tasks.register("removeTestDirs") { + executable = android.adbExecutable.toString() + args("shell", "rm", "-vrf", "/sdcard/Download/DocumentTreeTest-*") +} + +tasks.all { + if (name == "connectedDebugAndroidTest") { + finalizedBy(removeTestDirs) + } +} -- cgit v1.2.3-70-g09d2