Use this guide to align contributions with PlatformTools’ Kotlin Multiplatform setup before opening a pull request.
platformtools/core,appmanager,releasefetcher,darkmodedetector, andrtlwindowsfollow the KMP layout withsrc/commonMain, platform-specificsrc/<target>Main, and optionalsrc/commonTest. Keep shared logic incommonMainand addexpect/actualpairs only when necessary.sample/composeApphosts the Compose multiplatform demo (Android + Desktop), whilesample/terminalAppbuilds native CLIs that showcase the core APIs.kotlin-js-store/wasmstores generated JS/WASM artifacts required by the sample apps; do not hand-edit its contents.- Treat
build/directories as disposable Gradle outputs.
./gradlew buildcompiles all modules and runs the default verification suite../gradlew checkexecutes platform-specific tests (e.g.,:platformtools:releasefetcher:allTests) and Dokka validation../gradlew :sample:composeApp:runlaunches the desktop demo; useinstallDebugfor Android when a device/emulator is present../gradlew dokkaHtmlMultiModuleregenerates API docs for Maven publishing previews../gradlew publishToMavenLocalpublishes every library module with the version inferred fromGITHUB_REF.
- Kotlin 2.1 defaults: 4-space indentation, trailing commas where idiomatic, and explicit visibility (
internalwithin modules). - Namespaces mirror directory structure (
io.github.kdroidfilter.platformtools.<module>); files with multiple expect/actual declarations should group related APIs. - Use UpperCamelCase for classes/object singletons, lowerCamelCase for functions and properties, and
snake_caseonly for native interop identifiers.
- Place new tests under the matching
src/commonTest/kotlinpackage; add target-specific suites (e.g.,jvmTest) when behaviour diverges. - Use
kotlin.testassertions and descriptive method names such asfun isSystemInDarkMode_returnsTrue_onWindowsInDarkTheme(). - When adding public APIs, cover at least the happy path and one failure path per supported platform. Update demos to exercise new primitives if UI confirmation is required.
- Follow the existing history: short, imperative commit subjects (
Add Windows title bar helper,Fix release fetcher cache). Reference affected module(s) when helpful. - Each PR should include: a concise summary, linked issue (if any), testing notes (
./gradlew checkoutput or emulator/device evidence), and screenshots when UI changes affect the samples. - Keep PRs atomic—version bumps, feature work, and doc updates should land separately to simplify Maven publishing.