Skip to content

Commit

Permalink
Add description to README, remove google repo
Browse files Browse the repository at this point in the history
  • Loading branch information
tresat committed Jan 23, 2024
1 parent ccc80f1 commit 6eb8631
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions early-prototypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

## [Android](android/README.md)
## [Java projects](single-target/README.md)
## [Kotlin Multiplatform projects](kotlin-multiplatform/README.md)
## [Settings](workspace-settings/README.md)
25 changes: 25 additions & 0 deletions early-prototypes/kotlin-multiplatform/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Declarative Kotlin Multiplatform projects

This explores how to use a simpler, more static DSL to configure applications and libraries written for KMP.

All configuration is moved under a new `androidApplication` block.
This example only demonstrates an application, but the same ideas apply to libraries.

## [Example](testbed/build.gradle.kts)

The `testbed` subproject uses the new DSL.

The new DSL demonstrates several ideas:
- `platforms` is a list property in the `kmpApplication` block that specifies the multiplatform targets built by this project.
- Common top-level properties that apply to all targets (like the `languageVersion` of Kotlin used, and the whether or not to `publishSources` for the project) are backed by `Property` instances and available directly in the `kmpApplication` block.
There is code in the `Greeter.kt` file in `commonMain` that requires Kotlin 1.9 to compile.
- `dependencies {}` in the `kmpApplication` block allows for declaring common dependencies usable by all targets, in the same way the `commonMain` KMP sourceSet would.
- `targets {}` allows for configuring specific KMP platform variants.
Static extension methods are provided for each platform (only `jvm` and `js` implemented so far) to allow for configuring platform-specific dependencies with IDE type assistance.
- Publishing the project is configured to use a local Maven repo under `build/repo` using the `publishing` block provided by the `maven-publish` plugin, to demonstrate the results of publishing the project with and without sources.

### Running the project

All tasks below should be executed from the `testbed` directory.
Running the project requires running Gradle with Java 17.

To run (on the JVM):
```shell
./gradlew jvmRun -DmainClass=GreeterKt --quiet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {

repositories {
mavenCentral()
google()
}

kmpApplication {
Expand Down

0 comments on commit 6eb8631

Please sign in to comment.