generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 479
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
182 lines (161 loc) · 5.34 KB
/
build.gradle.kts
File metadata and controls
182 lines (161 loc) · 5.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.serialization)
// Note: npm publish plugin disabled temporarily due to wasmJs incompatibility
// id("dev.petuska.npm.publish") version "3.5.3"
}
repositories {
google()
mavenCentral()
}
version = "0.1.0"
kotlin {
jvm {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
js(IR) {
useCommonJs()
browser()
nodejs()
binaries.library()
generateTypeScriptDefinitions()
compilerOptions {
moduleKind.set(org.jetbrains.kotlin.gradle.dsl.JsModuleKind.MODULE_ES)
sourceMap.set(true)
sourceMapEmbedSources.set(org.jetbrains.kotlin.gradle.dsl.JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_ALWAYS)
}
}
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
browser()
nodejs()
binaries.library()
// Use d8 optimizer instead of binaryen to avoid wasm-validator errors
d8 {
}
}
// iOS targets
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "CodeGraph"
isStatic = true
}
}
sourceSets {
commonMain {
dependencies {
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.coroutines.core)
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
implementation(libs.kotlinx.coroutines.test)
}
}
jvmMain {
dependencies {
// TreeSitter JVM bindings - matching SASK versions
// see in https://github.com/bonede/tree-sitter-ng
implementation(libs.treesitter)
implementation(libs.treesitter.java)
implementation(libs.treesitter.kotlin)
implementation(libs.treesitter.csharp)
implementation(libs.treesitter.javascript)
implementation(libs.treesitter.python)
implementation(libs.treesitter.rust)
implementation(libs.treesitter.go)
}
}
jvmTest {
dependencies {
implementation(kotlin("test-junit"))
}
}
jsMain {
dependencies {
// web-tree-sitter for JS platform
implementation(npm("web-tree-sitter", "0.22.2"))
// TreeSitter WASM artifacts - matching autodev-workbench versions
implementation(npm("@unit-mesh/treesitter-artifacts", "1.7.7"))
}
}
jsTest {
dependencies {
implementation(kotlin("test-js"))
}
}
wasmJsMain {
dependencies {
// web-tree-sitter for WASM-JS platform (uses same npm packages as JS)
implementation(npm("web-tree-sitter", "0.22.2"))
// TreeSitter WASM artifacts
implementation(npm("@unit-mesh/treesitter-artifacts", "1.7.7"))
implementation(devNpm("copy-webpack-plugin", "12.0.2"))
}
}
wasmJsTest {
dependencies {
implementation(kotlin("test"))
}
}
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
iosMain {
dependencies {
// iOS uses a simplified implementation without TreeSitter
// TreeSitter native bindings are not available for iOS
}
}
val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting
iosTest {
dependencies {
implementation(kotlin("test"))
}
}
}
}
// npmPublish configuration disabled temporarily due to wasmJs incompatibility
// To publish JS package, manually configure npm package.json and use npm publish
//
// Disable wasmJs D8 tests due to missing npm dependencies (web-tree-sitter)
// The wasmJs library will still be built, but D8 tests are skipped
tasks.named("wasmJsD8Test") {
enabled = false
}
// npmPublish {
// organization.set("autodev")
// packages {
// named("js") {
// packageJson {
// name = "@autodev/codegraph"
// version = project.version.toString()
// main = "autodev-codegraph.js"
// types = "autodev-codegraph.d.ts"
// description.set("AutoDev Code Graph - TreeSitter-based code analysis for Kotlin Multiplatform")
// author {
// name.set("Unit Mesh")
// email.set("h@phodal.com")
// }
// license.set("MIT")
// private.set(false)
// repository {
// type.set("git")
// url.set("https://github.com/unit-mesh/auto-dev.git")
// }
// keywords.set(listOf("kotlin", "multiplatform", "treesitter", "code-analysis", "ast"))
// }
// }
// }
// }