Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / office / build.gradle.kts
build.gradle.kts123 lines · 6.1 KiBRaw
| 1 | plugins { |
| 2 | id("common-conventions-app") |
| 3 | // Listing screenshots come from Compose previews (src/screenshotTest), not from an |
| 4 | // instrumented test on a device. Same `:<module>:metadata` task name either way. |
| 5 | id("common-conventions-preview-metadata") |
| 6 | } |
| 7 | |
| 8 | launcherIcon { |
| 9 | symbol = "description" |
| 10 | } |
| 11 | |
| 12 | android { |
| 13 | defaultConfig { |
| 14 | applicationId = "com.vayunmathur.office" |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | androidComponents { |
| 19 | onVariants { variant -> |
| 20 | variant.sources.jniLibs?.addStaticSourceDirectory( |
| 21 | layout.buildDirectory.dir("rustJniLibs").get().asFile.absolutePath |
| 22 | ) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Native ODF formula engine + document CRDT (Rust). See office/src/main/rust/. |
| 27 | rustNativeLib("office_engine", "office") |
| 28 | |
| 29 | // Only the classes below actually load a native library: they touch |
| 30 | // OfficeNative (liboffice_engine: workbook/CRDT handles, or the XLSX |
| 31 | // importer's native number formatter via OoxmlXlsx.formatDisplayValue), |
| 32 | // DocumentTreeCrdt over it, or the PQC stack in :library:e2ee-p2p |
| 33 | // (libe2ee_pqc via Pqc / PqcIdentity, reached through OfficeSync's |
| 34 | // seal/sign helpers). Quarantine them into testDevUnitTestNative |
| 35 | // (forkEvery = 1); the remaining classes batch 20-per-JVM in |
| 36 | // testDevUnitTest, which depends on the quarantine task so the usual |
| 37 | // invocation still runs everything. |
| 38 | rustNativeTests { |
| 39 | nativeClasses.addAll( |
| 40 | listOf( |
| 41 | "com.vayunmathur.office.data.odf.OoxmlDirectSliceTest", |
| 42 | "com.vayunmathur.office.data.odf.OoxmlImporterTest", |
| 43 | "com.vayunmathur.office.data.odf.OoxmlRoundTripTest", |
| 44 | "com.vayunmathur.office.data.odf.OoxmlXlsxSliceTest", |
| 45 | "com.vayunmathur.office.data.odf.W4FinalParserTest", |
| 46 | "com.vayunmathur.office.data.odf.W4OdfPackageFormatsTest", |
| 47 | "com.vayunmathur.office.data.odf.W5XlsxKotlinFormatTest", |
| 48 | "com.vayunmathur.office.platform.OfficeDocTombstoneTest", |
| 49 | "com.vayunmathur.office.platform.OfficeSharingE2ETest", |
| 50 | "com.vayunmathur.office.platform.OfficeViewModelLiveSlice3Test", |
| 51 | "com.vayunmathur.office.platform.OfficeViewModelSyncSlice3Test", |
| 52 | "com.vayunmathur.office.platform.Slice4SyncLogicTest", |
| 53 | "com.vayunmathur.office.platform.W4ShareOpenOnlineTest", |
| 54 | "com.vayunmathur.office.platform.W4SyncDocMergeTest", |
| 55 | "com.vayunmathur.office.platform.W4SyncRelayTest", |
| 56 | "com.vayunmathur.office.ui.Slice4SheetsTest", |
| 57 | ) |
| 58 | ) |
| 59 | // Shared-JVM polluters keep forkEvery = 1 in the same companion task: |
| 60 | // every OfficeViewModel start touches the process-wide DataStoreUtils |
| 61 | // singleton in init (hasOnlineIdentity) and starts Eagerly viewModelScope |
| 62 | // collectors that are never cleared when the test never calls |
| 63 | // onCleared; loadSettings/saveSettings with the default-on auto-save |
| 64 | // additionally start an infinite delay loop on viewModelScope (the |
| 65 | // known hang shape when batched). Audit rule: any test instantiating |
| 66 | // OfficeViewModel (harness newVm/idleVm/loadedVm or a real |
| 67 | // ApplicationProvider construction), launching MainActivity (which |
| 68 | // builds one), or mocking/replacing the DataStoreUtils singleton |
| 69 | // belongs here. All other classes batch. |
| 70 | isolatedClasses.addAll( |
| 71 | listOf( |
| 72 | "com.vayunmathur.office.Slice4BottomBarPaneTest", |
| 73 | "com.vayunmathur.office.Slice4DocOverlaysTest", |
| 74 | "com.vayunmathur.office.Slice4FindBarsTest", |
| 75 | "com.vayunmathur.office.Slice4MenuBarOnlineTest", |
| 76 | "com.vayunmathur.office.Slice4MenusOverlaysTest", |
| 77 | "com.vayunmathur.office.Slice4OverlaysTest", |
| 78 | "com.vayunmathur.office.Slice4Pass2CropOverlaysTest", |
| 79 | "com.vayunmathur.office.Slice4Pass2MainActivityTest", |
| 80 | "com.vayunmathur.office.Slice4Pass2MenusOverlaysTest", |
| 81 | "com.vayunmathur.office.Slice4Pass2OnlineHomeTest", |
| 82 | "com.vayunmathur.office.Slice4Pass2PaneExportTest", |
| 83 | "com.vayunmathur.office.Slice4ScreenTest", |
| 84 | "com.vayunmathur.office.Slice4ShellTest", |
| 85 | "com.vayunmathur.office.W4DocumentScreenRichTest", |
| 86 | "com.vayunmathur.office.W4FindBarsInteractTest", |
| 87 | "com.vayunmathur.office.W4MainActivityTest", |
| 88 | "com.vayunmathur.office.W5DocumentScreenMenusTest", |
| 89 | "com.vayunmathur.office.platform.OfficeViewModelBranchesSlice3Test", |
| 90 | "com.vayunmathur.office.platform.OfficeViewModelCoreSlice3Test", |
| 91 | "com.vayunmathur.office.platform.OfficeViewModelDocsSlice3Test", |
| 92 | "com.vayunmathur.office.platform.OfficeViewModelExportBranchesSlice3Test", |
| 93 | "com.vayunmathur.office.platform.OfficeViewModelSaveSlice3Test", |
| 94 | "com.vayunmathur.office.platform.OfficeViewModelSheetSlice3Test", |
| 95 | "com.vayunmathur.office.platform.OfficeViewModelSlidesSlice3Test", |
| 96 | "com.vayunmathur.office.platform.OfficeViewModelTextSlice3Test", |
| 97 | "com.vayunmathur.office.platform.OfficeViewModelTracked2Slice3Test", |
| 98 | "com.vayunmathur.office.platform.Slice4TrackedChangesTest", |
| 99 | "com.vayunmathur.office.platform.W4SaveTest", |
| 100 | "com.vayunmathur.office.platform.W4SlidesElementTextTest", |
| 101 | "com.vayunmathur.office.ui.Slice4FormatControlsTest", |
| 102 | "com.vayunmathur.office.ui.Slice4FormatterWiringTest", |
| 103 | "com.vayunmathur.office.ui.Slice4FormattersTest", |
| 104 | "com.vayunmathur.office.ui.Slice4Pass2CellElementFormatTest", |
| 105 | "com.vayunmathur.office.ui.Slice4Pass2FloatingDocTest", |
| 106 | "com.vayunmathur.office.ui.Slice4Pass2FormatMenusTest", |
| 107 | "com.vayunmathur.office.ui.Slice4PresentationTest", |
| 108 | "com.vayunmathur.office.ui.W4BottomBarTest", |
| 109 | ) |
| 110 | ) |
| 111 | } |
| 112 | |
| 113 | dependencies { |
| 114 | implementation(project(":library:network")) |
| 115 | implementation(project(":library:e2ee-p2p")) |
| 116 | |
| 117 | // Provides a real XmlPullParser implementation for JVM unit tests (Android's is a stub). |
| 118 | testImplementation(libs.kxml2) |
| 119 | // Android framework statics (Uri.parse/fromFile) for slice 3/4 ViewModel tests. |
| 120 | testImplementation(libs.robolectric) |
| 121 | // Plain-JVM mocks for Android framework classes (slice 3/4 ViewModel tests). |
| 122 | testImplementation(libs.mockito.core) |
| 123 | } |