Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Chapi (pronounced /tʃɑpi/) can also be read as “XP” in Chinese if you pron

### Language stages

| Feature | Java | Python | Go | Kotlin | TS/JS | C | C# | Scala | C++ | Rust |
|----------------|------|--------|----|--------|-------|----|----|-------|-----|------|
| HTTP API decl | ✅ | 🆕 | 🆕 | ✅ | ✅ | 🆕 | 🆕 | | ✅ | 🆕 |
| Syntax parsing | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | 🆕 | ✅ | 🆕 | ✅ |
| Function calls | ✅ | ✅ | 🆕 | ✅ | ✅ | 🆕 | | | | ✅ |
| Arch/package | ✅ | | | ✅ | ✅ | 🆕 | | ✅ | ✅ | 🆕 |
| Real-world | ✅ | | | ✅ | ✅ | | | | | |
| Feature | Java | Python | Go | Kotlin | TS/JS | C | C# | Scala | C++ | Rust | Swift |
|----------------|------|--------|----|--------|-------|----|----|-------|-----|------|-------|
| HTTP API decl | ✅ | 🆕 | | ✅ | ✅ | 🆕 | ✅ | ✅ | 🆕 | ✅ | |
| Syntax parsing | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ | | ✅ | ✅ |
| Function calls | ✅ | ✅ | | ✅ | ✅ | ✅ | ✅ | | | ✅ | ✅ |
| Arch/package | ✅ | | | ✅ | ✅ | 🆕 | | ✅ | ✅ | ✅ | ✅ |
| Real-world | ✅ | | | ✅ | ✅ | | | | | | |

### IDL stages

Expand Down Expand Up @@ -59,6 +59,7 @@ Tested language versions:
- Kotlin
- Rust: v1.60.0
- Python: 2, 3
- Swift: 5, 6 (with typed throws, async/await, actors, ownership modifiers)

Gradle modules (by tier):

Expand All @@ -69,6 +70,7 @@ Gradle modules (by tier):

// tier 1 model language
":chapi-ast-protobuf",
":chapi-ast-thrift",

// tier 2 languages
":chapi-ast-kotlin",
Expand All @@ -81,6 +83,7 @@ Gradle modules (by tier):
":chapi-ast-csharp",
":chapi-ast-c",
":chapi-ast-cpp",
":chapi-ast-swift",

// others
":chapi-parser-toml",
Expand Down Expand Up @@ -135,8 +138,8 @@ Add dependencies:

```groovy
dependencies {
implementation "com.phodal.chapi:chapi-ast-java:2.3.6"
implementation "com.phodal.chapi:chapi-domain:2.3.6"
implementation "com.phodal.chapi:chapi-ast-java:2.5.2"
implementation "com.phodal.chapi:chapi-domain:2.5.2"
Comment on lines +141 to +142
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version numbers are being updated from "2.3.6" to "2.5.2" in the usage example. This change is not related to adding Swift support and should either be documented in the PR description or handled separately. Version updates in documentation examples should be kept in sync with actual releases.

Suggested change
implementation "com.phodal.chapi:chapi-ast-java:2.5.2"
implementation "com.phodal.chapi:chapi-domain:2.5.2"
implementation "com.phodal.chapi:chapi-ast-java:2.3.6"
implementation "com.phodal.chapi:chapi-domain:2.3.6"

Copilot uses AI. Check for mistakes.
}
```

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ dependencies {
jacocoAggregation(project(":chapi-ast-scala"))
jacocoAggregation(project(":chapi-ast-cpp"))
jacocoAggregation(project(":chapi-ast-protobuf"))
jacocoAggregation(project(":chapi-ast-swift"))

jacocoAggregation(project(":chapi-parser-toml"))
jacocoAggregation(project(":chapi-parser-cmake"))
Expand Down
56 changes: 56 additions & 0 deletions chapi-ast-swift/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
id("antlr")
java
kotlin("jvm")
kotlin("plugin.serialization") version "1.9.24"

`jacoco-conventions`
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
antlr("org.antlr:antlr4:4.13.2")

// project deps
implementation(project(":chapi-domain"))

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")

implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
testImplementation(kotlin("test"))

// JUnit 5
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-console:1.10.2")

implementation("org.antlr:antlr4:4.13.2")
implementation("org.antlr:antlr4-runtime:4.13.2")
}

sourceSets.main {
java.srcDirs("${project.layout.buildDirectory.get().asFile}/generated-src")
}

tasks.generateGrammarSource {
maxHeapSize = "256m"
arguments = arguments + listOf("-package", "chapi.ast.antlr") + listOf("-visitor", "-long-messages")
outputDirectory = file("${project.layout.buildDirectory.get().asFile}/generated-src/chapi/ast/antlr")
}

tasks.named("compileKotlin") {
dependsOn(tasks.withType<AntlrTask>())
}

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}

Loading
Loading