A modern Kotlin Multiplatform SDK template for building cross-platform libraries and applications. This template provides a robust foundation for creating SDKs that work seamlessly across Android and iOS platforms. Currently in development - this template is designed to be forked and customized for your specific SDK needs.
- Kotlin Multiplatform: Write once, run on Android and iOS
- Modern Architecture: Clean, modular structure with separate modules for different concerns
- Compose Multiplatform: Shared UI components using Jetpack Compose
- Comprehensive Testing: Unit tests, integration tests, and performance benchmarks
- Code Quality: KtLint, dependency guard, and binary compatibility validation
- Documentation: Automated API documentation with Dokka
- CI/CD Ready: GitHub Actions workflows for automated builds and publishing
- Performance Monitoring: Built-in benchmarking tools
- Android: API 21+ (Android 5.0+)
- iOS: 12.0+
- Kotlin: 2.2.20+
- Gradle: 8.0+
SDKForge.Template/
βββ app-android/ # Android sample application
βββ app-ios/ # iOS sample application
βββ app-shared/ # Shared sample UI components (Compose Multiplatform)
βββ shared/ # Main SDK library with all components
βββ shared-core/ # Core shared functionality
βββ shared-template/ # Template for shared modules
βββ build-logic/ # Gradle build logic and conventions
βββ internal-benchmark/ # Performance benchmarks
βββ internal-ktlint/ # Custom ktlint rules
Note: This project is currently in development and not yet published to any repository. Installation instructions will be available once the project is published.
Once published, you'll be able to install the SDK using:
dependencies {
implementation("dev.sdkforge.template:shared:1.0.0")
implementation("dev.sdkforge.template:shared-core:1.0.0")
}dependencies {
implementation 'dev.sdkforge.template:shared:1.0.0'
implementation 'dev.sdkforge.template:shared-core:1.0.0'
}<dependency>
<groupId>dev.sdkforge.template</groupId>
<artifactId>shared</artifactId>
<version>1.0.0</version>
</dependency>- Java Development Kit (JDK): Version 21 or higher
- Android Studio: Latest stable version (for Android development)
- Xcode: Latest stable version (for iOS development, macOS only)
- Kotlin: Version 2.2.20 or higher
- Gradle: Version 8.0 or higher
-
Clone the repository:
git clone https://github.com/SDKForge/template-sdk.git SDKForgeTemplate cd SDKForgeTemplate -
Build the project:
./gradlew build
-
Run tests:
./gradlew lint ktlintCheck dependencyGuard apiCheck
-
Generate documentation:
./gradlew dokkaHtml
This project serves as a template for creating Kotlin Multiplatform SDKs. To use it:
- Fork or clone this repository
- Customize the module names, package names, and functionality
- Add your SDK logic to the
shared-*modules - Configure publishing when ready to distribute
- Update documentation to reflect your specific SDK
The template provides a modular structure with platform-specific implementations:
// Common interface (shared/src/commonMain/kotlin/dev/sdkforge/template/core/Platform.kt)
interface Platform {
val name: String
val version: String
}
expect val currentPlatform: Platform// shared-core/src/androidMain/kotlin/dev/sdkforge/template/core/Platform.android.kt
actual val currentPlatform: Platform = object : Platform {
override val name: String get() = "Android"
override val version: String get() = android.os.Build.VERSION.SDK_INT.toString()
}// shared-core/src/iosMain/kotlin/dev/sdkforge/template/core/Platform.ios.kt
import platform.UIKit.UIDevice
actual val currentPlatform: Platform = object : Platform {
override val name: String get() = UIDevice.currentDevice.systemName
override val version: String get() = UIDevice.currentDevice.systemVersion
}The template includes a shared UI component using Compose Multiplatform:
// app-shared/src/commonMain/kotlin/dev/sdkforge/template/app/App.kt
@Composable
fun App(
modifier: Modifier = Modifier,
) = ApplicationTheme {
Surface(
modifier = modifier,
color = MaterialTheme.colorScheme.background,
) {
Column(
verticalArrangement = Arrangement.spacedBy(
space = 8.dp,
alignment = Alignment.CenterVertically,
),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = "Platform name: ${currentPlatform.name}",
)
Text(
text = "Platform version: ${currentPlatform.version}",
)
}
}
}Access SDK version information through the Library object:
// shared/src/commonMain/kotlin/dev/sdkforge/template/Library.kt
data object Library {
const val VERSION = "0.0.1"
}
// Usage
val sdkVersion = Library.VERSION./gradlew test# Android tests
./gradlew app-android:test
# iOS tests
./gradlew app-ios:test./gradlew internal-benchmark:connectedAndroidTest- API Documentation: Generated with Dokka
- Contributing Guide: CONTRIBUTING.md
- Code of Conduct: CODE_OF_CONDUCT.md
- Security Policy: SECURITY.md
- Create a new module in the
shared-*directory - Apply the appropriate plugins in
build.gradle.kts - Update the main
sharedmodule to export the new module - Add tests and documentation
This project uses KtLint for code formatting. Run the following to check and fix code style:
./gradlew ktlintCheck
./gradlew ktlintFormatThe project uses dependency guard to prevent dependency drift:
./gradlew dependencyGuardWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Ensure all checks pass
- Submit a pull request
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code.
We take security seriously. Please report security vulnerabilities to volodymyr.nevmerzhytskyi@sdkforge.dev.
Do NOT create public GitHub issues for security vulnerabilities.
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check our documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: volodymyr.nevmerzhytskyi@sdkforge.dev
- Publishing Setup - Configure Maven Central or other repository publishing
- CI/CD Pipeline - Automated publishing workflows
- Web platform support - Extend to web platforms
- Desktop platform support - Add desktop (Windows, macOS, Linux) support
- Enhanced performance monitoring - Advanced benchmarking and profiling
- More UI components - Additional Compose Multiplatform components
- Advanced configuration options - Flexible SDK configuration
- Documentation site - Dedicated documentation website
- Kotlin Multiplatform team
- Jetpack Compose team
- JetBrains for excellent tooling
- All contributors and community members
Made with β€οΈ by the SDKForge Team