From 6190a4fccf43a872e19230bf96d4702cf30e151e Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Thu, 23 Nov 2023 01:46:55 +0800 Subject: [PATCH] refactor: move resources to flexiui-resources --- .idea/artifacts/flexiui_resources_desktop.xml | 8 +++ flexiui-core/build.gradle.kts | 1 + flexiui-resources/.gitignore | 1 + flexiui-resources/build.gradle.kts | 64 +++++++++++++++++++ .../src/androidMain/AndroidManifest.xml | 2 + .../highcapable/flexiui/resources/Icons.kt | 0 .../flexiui/resources/builder/ImageVector.kt | 0 .../flexiui/resources/icon/Backspace.kt | 0 .../flexiui/resources/icon/CheckMark.kt | 0 .../flexiui/resources/icon/Dropdown.kt | 0 .../flexiui/resources/icon/ViewerClose.kt | 0 .../flexiui/resources/icon/ViewerOpen.kt | 0 settings.gradle.kts | 2 +- 13 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .idea/artifacts/flexiui_resources_desktop.xml create mode 100644 flexiui-resources/.gitignore create mode 100644 flexiui-resources/build.gradle.kts create mode 100644 flexiui-resources/src/androidMain/AndroidManifest.xml rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/Icons.kt (100%) rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/builder/ImageVector.kt (100%) rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Backspace.kt (100%) rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/CheckMark.kt (100%) rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Dropdown.kt (100%) rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerClose.kt (100%) rename {flexiui-core => flexiui-resources}/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerOpen.kt (100%) diff --git a/.idea/artifacts/flexiui_resources_desktop.xml b/.idea/artifacts/flexiui_resources_desktop.xml new file mode 100644 index 0000000..94102d8 --- /dev/null +++ b/.idea/artifacts/flexiui_resources_desktop.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/flexiui-resources/build/libs + + + + + \ No newline at end of file diff --git a/flexiui-core/build.gradle.kts b/flexiui-core/build.gradle.kts index 1b41bb4..66ddde1 100644 --- a/flexiui-core/build.gradle.kts +++ b/flexiui-core/build.gradle.kts @@ -32,6 +32,7 @@ kotlin { implementation(compose.foundation) // TODO: We need to remove this and replace with "material-ripple" implementation(compose.material) + implementation(projects.flexiuiResources) } } val androidMain by getting { diff --git a/flexiui-resources/.gitignore b/flexiui-resources/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/flexiui-resources/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/flexiui-resources/build.gradle.kts b/flexiui-resources/build.gradle.kts new file mode 100644 index 0000000..0df2d65 --- /dev/null +++ b/flexiui-resources/build.gradle.kts @@ -0,0 +1,64 @@ +plugins { + autowire(libs.plugins.kotlin.multiplatform) + autowire(libs.plugins.android.library) + autowire(libs.plugins.jetbrains.compose) +} + +group = property.project.groupName + +kotlin { + androidTarget() + jvm("desktop") + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64(), + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = projects.flexiuiResources.name + isStatic = true + } + } + jvmToolchain(17) + sourceSets { + val commonMain by getting { + dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + } + } + val androidMain by getting + val desktopMain by getting + val iosX64Main by getting + val iosArm64Main by getting + val iosSimulatorArm64Main by getting + val iosMain by creating { + dependsOn(commonMain) + iosX64Main.dependsOn(this) + iosArm64Main.dependsOn(this) + iosSimulatorArm64Main.dependsOn(this) + } + } +} + +android { + namespace = property.project.groupName + compileSdk = property.project.android.compileSdk + + sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + sourceSets["main"].res.srcDirs("src/androidMain/res") + sourceSets["main"].resources.srcDirs("src/commonMain/resources") + + defaultConfig { + minSdk = property.project.android.minSdk + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} \ No newline at end of file diff --git a/flexiui-resources/src/androidMain/AndroidManifest.xml b/flexiui-resources/src/androidMain/AndroidManifest.xml new file mode 100644 index 0000000..568741e --- /dev/null +++ b/flexiui-resources/src/androidMain/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/Icons.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/Icons.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/Icons.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/Icons.kt diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/builder/ImageVector.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/builder/ImageVector.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/builder/ImageVector.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/builder/ImageVector.kt diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Backspace.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Backspace.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Backspace.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Backspace.kt diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/CheckMark.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/CheckMark.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/CheckMark.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/CheckMark.kt diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Dropdown.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Dropdown.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Dropdown.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/Dropdown.kt diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerClose.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerClose.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerClose.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerClose.kt diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerOpen.kt b/flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerOpen.kt similarity index 100% rename from flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerOpen.kt rename to flexiui-resources/src/commonMain/kotlin/com/highcapable/flexiui/resources/icon/ViewerOpen.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index 93f2dde..32c21ac 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,4 +20,4 @@ sweetProperty { } rootProject.name = "FlexiUI" include(":samples:androidApp", ":samples:desktopApp", ":samples:shared") -include(":flexiui-core") \ No newline at end of file +include(":flexiui-core", "flexiui-resources") \ No newline at end of file