Skip to content

Commit 091b4ed

Browse files
nomanrgithub-actions
authored andcommitted
Fixed component dependency chain flattening.
1 parent 8c4160c commit 091b4ed

Some content is hidden

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

43 files changed

+264
-521
lines changed

.github/scripts/build-verify-android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ ComponentsDir=sample-android/ui-components/src/main/java/com/nomanr/sample/ui
1313
PackageName=com.nomanr.sample.ui
1414
EOF
1515

16-
./gradlew lumo --addAll
16+
./gradlew lumo --add-all
1717
./gradlew sample-android:catalogue:assembleDebug

.github/scripts/build-verify-multiplatform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ PackageName=com.nomanr.lumo.multiplatform.ui
1717
KotlinMultiplatform=true
1818
EOF
1919

20-
./gradlew lumo --addAll
20+
./gradlew lumo --add-all
2121
./gradlew sample-multiplatform:catalogue:android:assembleDebug
Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,59 @@
11
#!/bin/bash
22

3+
set -e
4+
35
CURRENT_VERSION="$1"
46
PROJECT_DIR="KMP-App-Template-main"
7+
COMPONENTS_DIR="composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/components"
58

6-
echo "Cleaning up previous files..."
79
rm -rf template.zip
810
rm -rf "$PROJECT_DIR"
911

10-
echo "Downloading template from GitHub..."
1112
curl -L -o template.zip https://github.com/Kotlin/KMP-App-Template/archive/refs/heads/main.zip
1213

13-
echo "Extracting template..."
1414
unzip -q template.zip
1515

16-
if [ -d "$PROJECT_DIR" ]; then
17-
echo "Directory $PROJECT_DIR exists."
18-
else
19-
echo "Directory $PROJECT_DIR does not exist after unzipping. Exiting..."
16+
if [ ! -d "$PROJECT_DIR" ]; then
2017
exit 1
2118
fi
2219

23-
echo "Changing directory to $PROJECT_DIR..."
24-
cd "$PROJECT_DIR" || { echo "Failed to cd into $PROJECT_DIR. Exiting..."; exit 1; }
25-
26-
echo "Adding mavenLocal repository to settings.gradle.kts..."
27-
awk '
28-
/mavenCentral()/ {
29-
if (!seen) {
30-
print " mavenLocal()"
31-
print "\n"
32-
seen=1
33-
}
34-
}
35-
{print}' settings.gradle.kts > temp && mv temp settings.gradle.kts
36-
37-
echo "Adding Lumo plugin to build.gradle.kts..."
20+
cd "$PROJECT_DIR" || exit 1
21+
22+
awk '/mavenCentral()/ { if (!seen) { print " mavenLocal()"; print "\n"; seen=1 } } {print}' settings.gradle.kts > temp && mv temp settings.gradle.kts
23+
3824
awk 'NR==2 {print " id(\"com.nomanr.plugin.lumo\") version \"'$CURRENT_VERSION'\""} {print}' build.gradle.kts > temp && mv temp build.gradle.kts
3925

40-
echo "Refreshing dependencies..."
4126
./gradlew --refresh-dependencies
42-
43-
echo "Checking Lumo plugin help..."
4427
./gradlew lumo --plugin-help
4528

46-
echo "Creating lumo.properties file..."
4729
echo "
4830
4931
ThemeName=AppTheme
50-
ComponentsDir=composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp
51-
PackageName=com.jetbrains.kmpapp
32+
ComponentsDir=$COMPONENTS_DIR
33+
PackageName=com.jetbrains.kmpapp.components
5234
KotlinMultiplatform=true
5335
5436
" > lumo.properties
5537

56-
echo "Setting up Lumo..."
38+
mkdir -p "$COMPONENTS_DIR"
39+
5740
./gradlew lumo --setup
5841

59-
echo "Adding all components..."
60-
./gradlew lumo --addAll
42+
OUTPUT=$(./gradlew lumo --available-components)
43+
44+
RAW_COMPONENTS=$(echo "$OUTPUT" | awk '/Available components:/ {flag=1; next} flag && NF {gsub(/^-/, "", $0); print $0} flag && !NF {exit}')
45+
46+
COMPONENTS=()
47+
while IFS= read -r line; do
48+
[[ -n "$line" ]] && COMPONENTS+=("$line")
49+
done <<< "$RAW_COMPONENTS"
50+
51+
if [ ${#COMPONENTS[@]} -eq 0 ]; then
52+
exit 1
53+
fi
6154

62-
echo "Building project..."
63-
./gradlew build
55+
for COMPONENT in "${COMPONENTS[@]}"; do
56+
rm -rf "$COMPONENTS_DIR/components"
57+
./gradlew lumo --add "$COMPONENT"
58+
./gradlew assembleDebug
59+
done

.github/workflows/build-verify.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
- name: Checkout Repository
1515
uses: actions/checkout@v4
1616

17+
- name: Regenerate templates
18+
run: |
19+
chmod +x lumo-ui/scripts/generate_templates.sh
20+
lumo-ui/scripts/generate_templates.sh
21+
1722
- name: Publish test version to local maven
1823
run: |
1924
GRADLE_FILE="lumo-ui/plugin/build.gradle.kts"
@@ -42,6 +47,11 @@ jobs:
4247
- name: Checkout Repository
4348
uses: actions/checkout@v4
4449

50+
- name: Regenerate templates
51+
run: |
52+
chmod +x lumo-ui/scripts/generate_templates.sh
53+
lumo-ui/scripts/generate_templates.sh
54+
4555
- name: Build And Verify - Multiplatform Sample
4656
run: |
4757
chmod +x .github/scripts/build-verify-multiplatform.sh
@@ -54,6 +64,11 @@ jobs:
5464
- name: Checkout Repository
5565
uses: actions/checkout@v4
5666

67+
- name: Regenerate templates
68+
run: |
69+
chmod +x lumo-ui/scripts/generate_templates.sh
70+
lumo-ui/scripts/generate_templates.sh
71+
5772
- name: Build And Verify - Android Sample
5873
run: |
5974
chmod +x .github/scripts/build-verify-android.sh

lumo-ui/components-lab/src/androidMain/kotlin/com/nomanr/lumo/ui/components/native/Tooltip.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import androidx.compose.foundation.layout.padding
2222
import androidx.compose.foundation.layout.size
2323
import androidx.compose.foundation.layout.sizeIn
2424
import androidx.compose.foundation.shape.RoundedCornerShape
25+
import androidx.compose.foundation.text.BasicText
2526
import androidx.compose.runtime.Composable
2627
import androidx.compose.runtime.MutableState
2728
import androidx.compose.runtime.Stable
@@ -45,7 +46,6 @@ import androidx.compose.ui.layout.onGloballyPositioned
4546
import androidx.compose.ui.platform.LocalConfiguration
4647
import androidx.compose.ui.platform.LocalDensity
4748
import androidx.compose.ui.platform.debugInspectorInfo
48-
import androidx.compose.ui.text.style.TextAlign
4949
import androidx.compose.ui.tooling.preview.Preview
5050
import androidx.compose.ui.unit.Density
5151
import androidx.compose.ui.unit.Dp
@@ -59,7 +59,6 @@ import androidx.compose.ui.unit.isSpecified
5959
import androidx.compose.ui.window.PopupPositionProvider
6060
import com.nomanr.lumo.ui.AppTheme
6161
import com.nomanr.lumo.ui.components.Surface
62-
import com.nomanr.lumo.ui.components.Text
6362
import kotlinx.coroutines.CancellableContinuation
6463
import kotlinx.coroutines.suspendCancellableCoroutine
6564
import kotlinx.coroutines.withTimeout
@@ -375,9 +374,8 @@ fun PlainTooltipWithCaret() {
375374
TooltipBox(
376375
tooltip = {
377376
Tooltip {
378-
Text(
377+
BasicText(
379378
text = "This is a tooltip",
380-
textAlign = TextAlign.Center,
381379
)
382380
}
383381
},

lumo-ui/components-lab/src/commonMain/kotlin/com/nomanr/lumo/ui/components/Checkbox.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.padding
1919
import androidx.compose.foundation.layout.requiredSize
2020
import androidx.compose.foundation.layout.wrapContentSize
2121
import androidx.compose.foundation.selection.triStateToggleable
22+
import androidx.compose.foundation.text.BasicText
2223
import androidx.compose.runtime.Composable
2324
import androidx.compose.runtime.Immutable
2425
import androidx.compose.runtime.State
@@ -388,7 +389,7 @@ fun CheckboxPreview() {
388389
checked = isChecked,
389390
onCheckedChange = { isChecked = it },
390391
)
391-
Text("Basic Checkbox")
392+
BasicText("Basic Checkbox")
392393
}
393394

394395
Row(
@@ -402,7 +403,7 @@ fun CheckboxPreview() {
402403
enabled = false,
403404
)
404405
Spacer(modifier = Modifier.height(4.dp))
405-
Text("Disabled Checked")
406+
BasicText("Disabled Checked")
406407
}
407408

408409
Column {
@@ -412,7 +413,7 @@ fun CheckboxPreview() {
412413
enabled = false,
413414
)
414415
Spacer(modifier = Modifier.height(4.dp))
415-
Text("Disabled Unchecked")
416+
BasicText("Disabled Unchecked")
416417
}
417418
}
418419

@@ -432,7 +433,7 @@ fun CheckboxPreview() {
432433
}
433434
},
434435
)
435-
Text("Tri-State Checkbox")
436+
BasicText("Tri-State Checkbox")
436437
}
437438

438439
var customColorChecked by remember { mutableStateOf(false) }
@@ -461,14 +462,14 @@ fun CheckboxPreview() {
461462
onCheckedChange = { customColorChecked = it },
462463
colors = customColors,
463464
)
464-
Text("Custom Colors")
465+
BasicText("Custom Colors")
465466
}
466467

467468
var selectedItems by remember { mutableStateOf(setOf<String>()) }
468469
val items = listOf("Option 1", "Option 2", "Option 3")
469470

470471
Column {
471-
Text("Checkbox Group")
472+
BasicText("Checkbox Group")
472473
Spacer(modifier = Modifier.height(8.dp))
473474
items.forEach { item ->
474475
Row(
@@ -490,7 +491,7 @@ fun CheckboxPreview() {
490491
}
491492
},
492493
)
493-
Text(item)
494+
BasicText(item)
494495
}
495496
}
496497
}

lumo-ui/components-lab/src/commonMain/kotlin/com/nomanr/lumo/ui/components/Chip.kt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.padding
1212
import androidx.compose.foundation.layout.requiredSize
1313
import androidx.compose.foundation.layout.size
1414
import androidx.compose.foundation.shape.RoundedCornerShape
15+
import androidx.compose.foundation.text.BasicText
1516
import androidx.compose.runtime.Composable
1617
import androidx.compose.runtime.Immutable
1718
import androidx.compose.runtime.remember
@@ -346,7 +347,7 @@ fun PrimaryChipPreview() {
346347
verticalAlignment = Alignment.CenterVertically,
347348
) {
348349
DummyIconForChipPreview()
349-
Text("Chip", style = AppTheme.typography.label3)
350+
BasicText("Chip", style = AppTheme.typography.label3)
350351
}
351352
}
352353

@@ -356,7 +357,7 @@ fun PrimaryChipPreview() {
356357
verticalAlignment = Alignment.CenterVertically,
357358
) {
358359
DummyIconForChipPreview()
359-
Text("Chip", style = AppTheme.typography.label3)
360+
BasicText("Chip", style = AppTheme.typography.label3)
360361
}
361362
}
362363

@@ -366,7 +367,7 @@ fun PrimaryChipPreview() {
366367
verticalAlignment = Alignment.CenterVertically,
367368
) {
368369
DummyIconForChipPreview()
369-
Text("Chip", style = AppTheme.typography.label3)
370+
BasicText("Chip", style = AppTheme.typography.label3)
370371
}
371372
}
372373

@@ -376,7 +377,7 @@ fun PrimaryChipPreview() {
376377
verticalAlignment = Alignment.CenterVertically,
377378
) {
378379
DummyIconForChipPreview()
379-
Text("Chip", style = AppTheme.typography.label3)
380+
BasicText("Chip", style = AppTheme.typography.label3)
380381
}
381382
}
382383
}
@@ -387,7 +388,7 @@ fun PrimaryChipPreview() {
387388
verticalAlignment = Alignment.CenterVertically,
388389
) {
389390
DummyIconForChipPreview()
390-
Text("Chip", style = AppTheme.typography.label3)
391+
BasicText("Chip", style = AppTheme.typography.label3)
391392
}
392393
}
393394

@@ -397,7 +398,7 @@ fun PrimaryChipPreview() {
397398
verticalAlignment = Alignment.CenterVertically,
398399
) {
399400
DummyIconForChipPreview()
400-
Text("Chip", style = AppTheme.typography.label3)
401+
BasicText("Chip", style = AppTheme.typography.label3)
401402
}
402403
}
403404

@@ -407,7 +408,7 @@ fun PrimaryChipPreview() {
407408
verticalAlignment = Alignment.CenterVertically,
408409
) {
409410
DummyIconForChipPreview()
410-
Text("Chip", style = AppTheme.typography.label3)
411+
BasicText("Chip", style = AppTheme.typography.label3)
411412
}
412413
}
413414
ElevatedChip(enabled = false) {
@@ -416,7 +417,7 @@ fun PrimaryChipPreview() {
416417
verticalAlignment = Alignment.CenterVertically,
417418
) {
418419
DummyIconForChipPreview()
419-
Text("Chip", style = AppTheme.typography.label3)
420+
BasicText("Chip", style = AppTheme.typography.label3)
420421
}
421422
}
422423
}
@@ -427,7 +428,7 @@ fun PrimaryChipPreview() {
427428
verticalAlignment = Alignment.CenterVertically,
428429
) {
429430
DummyIconForChipPreview()
430-
Text("Chip", style = AppTheme.typography.label3)
431+
BasicText("Chip", style = AppTheme.typography.label3)
431432
}
432433
}
433434

@@ -437,7 +438,7 @@ fun PrimaryChipPreview() {
437438
verticalAlignment = Alignment.CenterVertically,
438439
) {
439440
DummyIconForChipPreview()
440-
Text("Chip", style = AppTheme.typography.label3)
441+
BasicText("Chip", style = AppTheme.typography.label3)
441442
}
442443
}
443444

@@ -447,7 +448,7 @@ fun PrimaryChipPreview() {
447448
verticalAlignment = Alignment.CenterVertically,
448449
) {
449450
DummyIconForChipPreview()
450-
Text("Chip", style = AppTheme.typography.label3)
451+
BasicText("Chip", style = AppTheme.typography.label3)
451452
}
452453
}
453454

@@ -457,7 +458,7 @@ fun PrimaryChipPreview() {
457458
verticalAlignment = Alignment.CenterVertically,
458459
) {
459460
DummyIconForChipPreview()
460-
Text("Chip", style = AppTheme.typography.label3)
461+
BasicText("Chip", style = AppTheme.typography.label3)
461462
}
462463
}
463464
}

0 commit comments

Comments
 (0)