Skip to content

Commit

Permalink
Improve build (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
vooft authored Dec 1, 2024
1 parent 6c556d6 commit cf4672e
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 25 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ permissions:
contents: write
issues: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:

Expand All @@ -32,8 +36,11 @@ jobs:
with:
dependency-graph: generate-and-submit

- name: Build
run: ./gradlew build --parallel --no-daemon
- name: Assemble
run: ./gradlew assemble

- name: Check
run: ./gradlew check

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
Expand Down
78 changes: 76 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
This is a fork of the [bonsai](https://github.com/adrielcafe/bonsai) project by Adriel Cafe.
![Build and test](https://github.com/vooft/compose-treeview/actions/workflows/build.yml/badge.svg?branch=main)
![Releases](https://img.shields.io/github/v/release/vooft/compose-treeview)
![Maven Central](https://img.shields.io/maven-central/v/io.github.vooft/compose-treeview-core)
![License](https://img.shields.io/github/license/vooft/compose-treeview)

Still WIP, but [sample](./sample) works on Android, iOS, Desktop and Web (wasm).
![badge-platform-jvm]
![badge-platform-wasm]
![badge-platform-android]
![badge-platform-ios]

![badge-demo] https://vooft.github.io/compose-treeview/

# compose-treeview

A tree view for Compose Multiplatform. This project is a fork of [bonsai](https://github.com/adrielcafe/bonsai) by Adriel Cafe.

# Supported platforms

* Android
* iOS
* Desktop
* Web (wasm) ([demo](https://vooft.github.io/compose-treeview/))

# Quick start

Add the dependency to your project:

```kotlin
kotlin {
...

sourceSets {
commonMain.dependencies {
implementation("io.github.vooft:compose-treeview-core:<version>")
}
}
}
```

Create a tree using DSL:

```kotlin
@Composable
fun TreeViewExample() {
// build tree structure
val tree = Tree {
Branch("Mammalia") {
Branch("Carnivora") {
Branch("Canidae") {
Branch("Canis") {
Leaf("Wolf", customIcon = { EmojiIcon("🐺") })
Leaf("Dog", customIcon = { EmojiIcon("🐶") })
}
}
Branch("Felidae") {
Branch("Felis") {
Leaf("Cat", customIcon = { EmojiIcon("🐱") })
}
Branch("Panthera") {
Leaf("Lion", customIcon = { EmojiIcon("🦁") })
}
}
}
}
}

// render the tree
TreeView(tree)
}
```

<!-- TAG_PLATFORMS -->
[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat
[badge-platform-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg?style=flat
[badge-platform-ios]: http://img.shields.io/badge/-ios-CDCDCD.svg?style=flat
[badge-platform-wasm]: https://img.shields.io/badge/-wasm-624FE8.svg?style=flat
[badge-demo]: https://img.shields.io/badge/-demo-4E8EF7.svg?style=flat
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,8 @@ kotlin {
binaries.executable()
}

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "compose-treeview"
isStatic = true
}
}
iosArm64()
iosSimulatorArm64()

applyDefaultHierarchyTemplate()

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#Kotlin
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx4096M
kotlin.daemon.jvmargs=-Xmx3072M

#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx3072M -Dfile.encoding=UTF-8

#Android
android.nonTransitiveRClass=true
Expand Down
10 changes: 1 addition & 9 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ kotlin {
binaries.executable()
}

listOf(
// iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "SampleApp"
isStatic = true
}
}
iosSimulatorArm64()

sourceSets {
val desktopMain by getting
Expand Down

0 comments on commit cf4672e

Please sign in to comment.