Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose Multiplatform #89

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
487261f
refactor core module to multiplatform
DatL4g Mar 29, 2024
58908fb
multiplatform core module
DatL4g Mar 29, 2024
1d38e02
fix old android targets
DatL4g Mar 29, 2024
2f65c32
prepare calendar multiplatform
DatL4g Mar 29, 2024
392641f
calendar multiplatform compatible
DatL4g Mar 29, 2024
afa6178
rating multiplatform compatible
DatL4g Mar 30, 2024
5393ed2
option multiplatform compatible
DatL4g Mar 30, 2024
50dcb48
list multiplatform compatible
DatL4g Mar 30, 2024
83dde05
multiplatform landscape check
DatL4g Mar 30, 2024
8e11b75
prepare snapshot release
DatL4g Mar 30, 2024
75d6893
fix snapshot release
DatL4g Mar 30, 2024
0cd7fa2
added release workflow
DatL4g Mar 30, 2024
da08075
api core library
DatL4g Mar 30, 2024
8ecc373
make states fully serializable
DatL4g Mar 30, 2024
14e7852
added missing java serialization
DatL4g Mar 30, 2024
981caa0
skip workflows
DatL4g Mar 30, 2024
3da43ed
fix calendar module
DatL4g Mar 30, 2024
4efdbde
fix calendar module
DatL4g Mar 30, 2024
879f669
fix calendar resources
DatL4g Mar 30, 2024
87bb4a0
fix calendar arrow size
DatL4g Mar 30, 2024
ba08232
added default selection for rating
DatL4g Apr 3, 2024
a8ba838
fix resources
DatL4g Apr 3, 2024
b795aa9
added possibility to deselect rating and rating of 0 is valid
DatL4g Apr 4, 2024
47a5cca
migrate state module
DatL4g Apr 4, 2024
8d3262e
migrate input module
DatL4g Apr 4, 2024
adeb1c0
migrate info module
DatL4g Apr 4, 2024
6f30cb1
migrate color module
DatL4g Apr 4, 2024
446bdd0
migrate emoji module
DatL4g Apr 11, 2024
37bc03c
migrate emoji module
DatL4g Apr 11, 2024
2a6a658
migrate date_time module
DatL4g Apr 11, 2024
dcc5d95
migrate date_time module
DatL4g Apr 11, 2024
7b2940a
migrate date_time module
DatL4g Apr 11, 2024
0d1f94e
migrate duration module
DatL4g Apr 12, 2024
38d3372
migrate clock module
DatL4g Apr 12, 2024
1d5bfa7
added missing configuration
DatL4g Apr 12, 2024
b29bc84
changed readme as core module is not required to add manually anymore
DatL4g Apr 12, 2024
02dbb78
added wasm target
DatL4g Apr 12, 2024
a6a90ff
added missing wasm implementations
DatL4g Apr 12, 2024
5f185b5
chore(deps): ⬆️ Upgraded Compose versions
maicol07 Apr 15, 2024
fb7d802
refactor: Moved dependency management from buildSrc to Version Catalog
maicol07 Apr 16, 2024
1c81161
Merge pull request #1 from maicol07/main
DatL4g Apr 16, 2024
da9f1f1
updated compose
DatL4g Apr 17, 2024
3886da0
ignore some fields from java serialization
DatL4g Apr 18, 2024
8c34770
roll back compose version
DatL4g Apr 18, 2024
e53bb5f
update to latest compose version
DatL4g Apr 29, 2024
cee7dbe
update to latest compose version
DatL4g Apr 30, 2024
90b23af
option invoke click listener
DatL4g Apr 30, 2024
01e57b0
option icon size
DatL4g May 12, 2024
b022d95
rating body max width
DatL4g May 12, 2024
dd2451a
revert sizing
DatL4g May 12, 2024
f16d2d3
revert LocalDate calculations and fix visual error
DatL4g May 13, 2024
dce4cd0
removed unused file
DatL4g May 13, 2024
f21cd3d
apply system locale on jvm
DatL4g May 14, 2024
24de041
added missing localization
DatL4g May 14, 2024
27692e6
added body for option
DatL4g May 14, 2024
ed2ba8c
added missing body dependency injection
DatL4g May 14, 2024
d2848f5
updated compose
DatL4g May 17, 2024
01f3361
updated dependencies
DatL4g May 22, 2024
3518cc7
fix crash on android
DatL4g May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: false
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout add-docs
uses: actions/checkout@v2
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Release

on:
workflow_dispatch:

jobs:
publish:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Publish release
run: ./gradlew publishAllPublicationsToMavenCentralRepository -x lint -x lintVitalRelease
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ bin/
gen/
out/
release/
.kotlin/

# Gradle files
.gradle/
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ In your app `build.gradle` file:
```gradle
dependencies {
...
// Implementing the `core` module is mandatory for using other use cases.
implementation 'com.maxkeppeler.sheets-compose-dialogs:core:<version>'
implementation 'com.maxkeppeler.sheets-compose-dialogs:<module>:<version>'
}
```
Expand Down
72 changes: 28 additions & 44 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@
* limitations under the License.
*/
plugins {
id(Plugins.APPLICATION.id)
id(Plugins.KOTLIN.id)
alias(libs.plugins.android.application)
alias(libs.plugins.multiplatform)
}

kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "${JavaVersion.VERSION_11}"
freeCompilerArgs += "-Xjdk-release=${JavaVersion.VERSION_11}"
}
}
}
}

android {
Expand Down Expand Up @@ -46,14 +57,11 @@ android {
// Flag to enable support for the new language APIs
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
packagingOptions {
resources {
Expand All @@ -67,7 +75,7 @@ dependencies {
// Modules

Modules.values().forEach { module ->
apis(project(module.path))
api(project(module.path))
}

// Dependencies of sheets-compose-dialogs
Expand All @@ -88,49 +96,25 @@ dependencies {
// implementation("com.maxkeppeler.sheets-compose-dialogs:emoji:$sheetsVersion")


coreLibraryDesugaring(Dependencies.DESUGAR)

// Kotlin libs

implementations(Dependencies.Kotlin.KOTLIN_STD)
coreLibraryDesugaring(libs.desugar)


// AndroidX libs

implementations(
Dependencies.AndroidX.CORE_KTX,
Dependencies.AndroidX.LIFECYCLE_KTX,
Dependencies.AndroidX.ACTIVITY_COMPOSE,
Dependencies.AndroidX.NAVIGATION_COMPOSE,
)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.navigation.compose)


// Compose libs

implementations(
platform(Dependencies.Compose.BOM),
Dependencies.Compose.UI,
Dependencies.Compose.UI_TOOLING,
Dependencies.Compose.ANIMATION,
Dependencies.Compose.RUNTIME,
Dependencies.Compose.MATERIAL_2,
Dependencies.Compose.MATERIAL_3,
Dependencies.Compose.ICONS_EXTENDED,
)

// Test libs

androidTestImplementations(
Dependencies.AndroidX.Test.TEST_CORE,
Dependencies.AndroidX.Test.TEST_RUNNER,
Dependencies.AndroidX.Test.JUNIT,
Dependencies.AndroidX.Test.ESPRESSO_CORE,
Dependencies.Compose.Test.JUNIT,
project(":test")
)
debugImplementations(
Dependencies.Compose.Test.TOOLING,
Dependencies.Compose.Test.MANIFEST
)
testImplementation(Dependencies.Test.JUNIT)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.runner)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(project(":test"))
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
testImplementation(libs.junit)
}
123 changes: 18 additions & 105 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,128 +13,41 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.android.build.gradle.LibraryExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id(Plugins.SPOTLESS.id) version (Plugins.SPOTLESS.version)
id(Plugins.DOKKA.id) version (Plugins.DOKKA.version)
alias(libs.plugins.android) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.publish) apply false
}

buildscript {

repositories {
google()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}

dependencies {
classpath(Dependencies.Kotlin.GRADLE_PLUGIN)
classpath(Dependencies.Gradle.BUILD)
classpath(Dependencies.MAVEN_PUBLISH)
classpath(Dependencies.DOKKA)
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
}
}

allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
}
}

tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(projectDir.resolve("docs/api"))
}

subprojects {
plugins.apply(Plugins.SPOTLESS.id)
project.plugins.applyBaseConfig(project)
spotless {
kotlin {
target("**/*.kt")
// ktlint(Versions.KT_LINT)
}
kotlin {
target("**/*.kt")
targetExclude("**/core/icons/**/*.*")
licenseHeaderFile(rootProject.file("copyright.kt"))
}
kotlinGradle {
target("*.gradle.kts", "gradle/*.gradle.kts", "buildSrc/*.gradle.kts")
licenseHeaderFile(
rootProject.file("copyright.kt"),
"import|tasks|apply|plugins|rootProject"
)
}
}
}


/**
* Apply base configurations to the subjects that include specific custom plugins.
*/
fun PluginContainer.applyBaseConfig(project: Project) {
whenPluginAdded {
when (this) {
is LibraryModulePlugin -> {
project.extensions
.getByType<LibraryExtension>()
.apply {
baseLibraryConfig()
}
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
}

/**
* Apply base library configurations to the subprojects that include the plugin [LibraryModulePlugin].
*/
fun com.android.build.gradle.BaseExtension.baseLibraryConfig() {

compileSdkVersion(App.COMPILE_SDK)

defaultConfig {
minSdk = App.MIN_SDK
targetSdk = App.TARGET_SDK
testInstrumentationRunner = App.TEST_INSTRUMENTATION_RUNNER

javaCompileOptions {
annotationProcessorOptions {
arguments += mapOf("module" to "${App.ID}-$name")
}
}
}

compileOptions.apply {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
}

buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER

packagingOptions.resources.excludes += listOf(
"META-INF/DEPENDENCIES.txt",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/NOTICE",
"META-INF/NOTICE.txt",
"META-INF/AL2.0",
"META-INF/LGPL2.1"
)

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = freeCompilerArgs + listOf(
"-Xopt-in=androidx.compose.material.ExperimentalMaterial3Api",
"-Xopt-in=androidx.compose.animation.ExperimentalAnimationApi",
"-Xopt-in=androidx.compose.ui.test.ExperimentalTestApi",
"-Xopt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-Xopt-in=androidx.compose.ui.ExperimentalComposeUiApi",
)
}
}
}
66 changes: 0 additions & 66 deletions buildSrc/src/main/java/Dependencies.kt

This file was deleted.