Skip to content

Commit

Permalink
Merge branch 'main' into dependent-on-snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreckYe committed Dec 4, 2024
2 parents a62f8df + 9265d9a commit 62f0178
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/demo-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: gradle/actions/setup-gradle@v4

- name: Build the distribution with Gradle Wrapper
run: ./gradlew :demo:sideBySideBrowserDistribution
run: ./gradlew :compose-multiplatform-html-unified-demo:sideBySideBrowserDistribution

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
implementation(kotlin("gradle-plugin", kotlinVersion))
implementation("org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlinVersion")
implementation("org.jetbrains.compose:compose-gradle-plugin:1.7.1")
implementation("com.huanshankeji.team:gradle-plugins:0.8.0") // don't use a snapshot version in a main branch
implementation("com.huanshankeji.team:gradle-plugins:0.9.0") // don't use a snapshot version in a main branch
implementation("com.android.tools.build:gradle:8.5.2")
implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch
implementation("com.huanshankeji:common-gradle-dependencies:0.9.0-20241203") // don't use a snapshot version in a main branch
}
16 changes: 15 additions & 1 deletion buildSrc/src/main/kotlin/common-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -38,7 +38,21 @@ kotlin {
js()



@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
common {
group("composeUi") {
withJvm()
withAndroidTarget()
group("ios")
withWasmJs()
}
}
}



compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
id("common-conventions")
id("com.huanshankeji.kotlin-multiplatform-conventional-targets")
Expand All @@ -11,20 +9,6 @@ kotlin {
publishLibraryVariants("release", "debug")
}

// move to `common-conventions` if necessary

@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
common {
group("composeUi") {
withJvm()
withAndroidTarget()
group("ios")
withWasmJs()
}
}
}

/*
sourceSets {
val composeUiMain by creating { dependsOn(commonMain.get()) }
Expand Down
20 changes: 6 additions & 14 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.huanshankeji.cpnProject
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
`common-conventions`
Expand Down Expand Up @@ -57,30 +57,22 @@ kotlin {
implementation(commonDependencies.kotlinx.coroutines.core())
}
}
composeUiMain {
dependencies {
implementation(compose.ui)
}
}
jvmMain {
dependencies {
implementation(compose.desktop.currentOs)
}
}
androidMain {
dependencies {
// TODO consider putting this in `composeUiMain`
implementation(compose.ui)

implementation(commonDependencies.androidx.activity.compose())
implementation(commonDependencies.androidx.compose.ui.module("tooling-preview"))
}
}
iosMain {
dependencies {
implementation(compose.ui)
}
}
wasmJsMain {
dependencies {
implementation(compose.ui)
}
}
jsMain {
dependencies {
implementation(compose.html.core)
Expand Down
2 changes: 1 addition & 1 deletion demo/iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/../..\"\n./gradlew :demo:embedAndSignAppleFrameworkForXcode\n";
shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/../..\"\n./gradlew :compose-multiplatform-html-unified-demo:embedAndSignAppleFrameworkForXcode\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.huanshankeji.compose.foundation.ext.outerBorder
import com.huanshankeji.compose.foundation.ext.roundedCornerBackgroundAndOuterBorder
import com.huanshankeji.compose.foundation.ext.roundedCornerOuterBorder
import com.huanshankeji.compose.foundation.layout.*
import com.huanshankeji.compose.foundation.layout.ext.outerPadding
import com.huanshankeji.compose.foundation.lazy.LazyColumn
import com.huanshankeji.compose.foundation.lazy.LazyListScope
import com.huanshankeji.compose.foundation.lazy.LazyRow
Expand All @@ -26,7 +27,7 @@ fun Common(/*modifier: Modifier = Modifier*/) {

@Composable
fun ColorBox(color: Color) =
Box(Modifier.padding(8.dp).background(color).size(40.dp))
Box(Modifier.outerPadding(8.dp).background(color).size(40.dp))

val halfGreen = Color(0, 0x80, 0x00)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.ui.unit.dp
import com.huanshankeji.compose.foundation.VerticalScrollBox
import com.huanshankeji.compose.foundation.background
import com.huanshankeji.compose.foundation.layout.*
import com.huanshankeji.compose.foundation.layout.ext.outerPadding
import com.huanshankeji.compose.foundation.text.KeyboardActions
import com.huanshankeji.compose.foundation.text.KeyboardOptions
import com.huanshankeji.compose.foundation.text.input.ImeAction
Expand Down Expand Up @@ -73,7 +74,7 @@ fun Material2(/*modifier: Modifier = Modifier*/) {
IconButton(onClick, icon = Icons.Default.Add, contentDescription = "increment count")
}

val listModifier = Modifier.padding(16.dp).height(listSize)
val listModifier = Modifier.outerPadding(16.dp).height(listSize)
List(listModifier) {
item {
Text("Ungrouped item")
Expand Down

0 comments on commit 62f0178

Please sign in to comment.