Skip to content

Commit 056555f

Browse files
committed
Refactor project structure and migrate to Version Catalog
- Migrated the single `sample` module into a multi-module structure: `:sample:shared`, `:sample:android`, `:sample:ios`, `:sample:desktop`, and `:sample:web`. - Introduced a Version Catalog (`libs.versions.toml`) to manage dependencies and plugins across the project. - Updated Gradle to 9.3.1 and Kotlin to 2.3.10. - Migrated library modules (`theme-material`, `theme-material3`, `theme-prefs`) to use the Android Kotlin Multiplatform library plugin. - Added a `PUBLICATION.md` guide and updated the publication logic using `vanniktech/gradle-maven-publish-plugin`. - Refactored `AppState` to use `TextFieldState` and updated `NoteDetailBody` in both Material 2 and 3 samples to utilize the new state and `rememberSaveable`. - Added "Source code" and "Info" items to the settings screens with `LocalUriHandler` to link to the GitHub repository. - Reorganized sample source code, moving platform-specific code into their respective new modules. - Cleaned up imports and standardized `@Preview` annotations across the theme modules. - Enabled `TYPESAFE_PROJECT_ACCESSORS` in `settings.gradle.kts`.
1 parent 54be566 commit 056555f

71 files changed

Lines changed: 785 additions & 312 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
cache-read-only: false
3737
cache-overwrite-existing: true
3838
- name: "Build WasmJS App"
39-
run: gradle :sample:wasmJsBrowserDistribution
39+
run: gradle --no-configure-on-demand :sample:web:wasmJsBrowserDistribution
4040
- name: Setup Pages
4141
uses: actions/configure-pages@v5
4242
- name: Upload artifact
4343
uses: actions/upload-pages-artifact@v3
4444
with:
45-
path: ./sample/build/dist/wasmJs/productionExecutable
45+
path: ./sample/web/build/dist/wasmJs/productionExecutable
4646

4747
deploy:
4848
environment:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fun App() = PreferableMaterialTheme {
5454
}
5555
}
5656
```
57-
Check the [sample app](sample/src/commonMain/kotlin/com/softartdev/shared/App.kt) for using with Material Design versions 2 & 3.
57+
Check the [sample app](sample/shared/src/commonMain/kotlin/com/softartdev/shared/App.kt) for using with Material Design versions 2 & 3.
5858

5959
The [NoteDelight](https://github.com/softartdev/NoteDelight/blob/master/shared-compose-ui/src/commonMain/kotlin/com/softartdev/notedelight/ui/SettingsScreen.kt#L104) app is a real example.
6060
## Installation

build.gradle.kts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
buildscript {
2-
extra["kotlin_version"] = "2.2.10"
3-
extra["android_min_sdk_version"] = 21
4-
extra["android_compile_sdk_version"] = 36
5-
extra["jdk_version"] = 17
6-
repositories {
7-
gradlePluginPortal()
8-
google()
9-
mavenCentral()
10-
}
11-
dependencies {
12-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["kotlin_version"]}")
13-
classpath("org.jetbrains.kotlin:compose-compiler-gradle-plugin:${rootProject.extra["kotlin_version"]}")
14-
classpath("com.android.tools.build:gradle:8.13.0")
15-
classpath("org.jetbrains.compose:compose-gradle-plugin:1.9.0")
16-
classpath("org.jetbrains.kotlin:kotlin-serialization:${rootProject.extra["kotlin_version"]}")
17-
}
1+
plugins {
2+
alias(libs.plugins.kotlin.multiplatform) apply false
3+
alias(libs.plugins.kotlin.compose.compiler) apply false
4+
alias(libs.plugins.kotlin.serialization) apply false
5+
alias(libs.plugins.android.application) apply false
6+
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
7+
alias(libs.plugins.compose.multiplatform) apply false
188
}
19-
allprojects {
20-
repositories {
21-
google()
22-
mavenCentral()
23-
}
24-
}

convention-plugins/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ repositories {
77
}
88

99
dependencies {
10-
implementation("com.vanniktech:gradle-maven-publish-plugin:0.34.0")
10+
implementation(libs.vanniktech.gradle.maven.publish.plugin)
1111
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
rootProject.name = "convention-plugins"
2+
3+
pluginManagement {
4+
repositories {
5+
gradlePluginPortal()
6+
google()
7+
mavenCentral()
8+
}
9+
}
10+
11+
dependencyResolutionManagement {
12+
repositories {
13+
gradlePluginPortal()
14+
google()
15+
mavenCentral()
16+
}
17+
versionCatalogs {
18+
create("libs") {
19+
from(files("../gradle/libs.versions.toml"))
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)