Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: update API to 0.25 #49

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/scripts/build-jni.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

& cmake -S ktreesitter -B ktreesitter/.cmake/build `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DCMAKE_INSTALL_PREFIX=ktreesitter/src/jvmMain/resources `
-DCMAKE_INSTALL_PREFIX=ktreesitter/src/jvmMain/resources `
-DCMAKE_INSTALL_BINDIR="$env:CMAKE_INSTALL_LIBDIR"
& cmake --build ktreesitter/.cmake/build --config Debug
& cmake --install ktreesitter/.cmake/build --config Debug
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/build-jni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cmake -S ktreesitter -B ktreesitter/.cmake/build \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' \
-DCMAKE_INSTALL_PREFIX=ktreesitter/src/jvmMain/resources \
-DCMAKE_INSTALL_LIBDIR="$CMAKE_INSTALL_LIBDIR"
cmake --build ktreesitter/.cmake/build
Expand All @@ -12,7 +12,7 @@ cmake --install ktreesitter/.cmake/build
for dir in languages/*/; do
cmake -S "${dir}build/generated" -B "${dir}.cmake/build" \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' \
-DCMAKE_INSTALL_PREFIX="${dir}build/generated/src/jvmMain/resources" \
-DCMAKE_INSTALL_LIBDIR="$CMAKE_INSTALL_LIBDIR"
cmake --build "${dir}.cmake/build"
Expand Down
49 changes: 15 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@ jobs:
cache-dependency-path: |
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
- name: Cache Kotlin/Native prebuilt
uses: actions/cache@v4
- name: Set up Kotlin/Native
uses: ObserverOfTime/setup-konan-action@v1
with:
path: ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
key: konan-${{runner.os}}-prebuilt-1.9
kotlin_version: 2.1.10
- name: Generate files
run: ./gradlew --no-daemon generateGrammarFiles
env:
KONAN_DATA_DIR: ${{runner.tool_cache}}/konan
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -113,14 +110,20 @@ jobs:
cache-dependency-path: |
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
- name: Set up Kotlin/Native
uses: ObserverOfTime/setup-konan-action@v1
with:
kotlin_version: 2.1.10
- name: Set up cross compilation
run: sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
if: matrix.platform == 'Linux'
- name: Restore Kotlin/Native prebuilt
uses: actions/cache/restore@v4
with:
path: ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
key: konan-${{runner.os}}-prebuilt-1.9
run: |-
sudo apt-get update
sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
- name: Set up Ninja
if: matrix.platform == 'Android'
run: |-
sudo apt-get update
sudo apt-get install -qy ninja-build
- name: Download generated files
uses: actions/download-artifact@v4
with:
Expand All @@ -131,30 +134,8 @@ jobs:
run: .github/scripts/build-jni.${{matrix.os == 'windows-latest' && 'ps1' || 'sh'}}
env:
CMAKE_INSTALL_LIBDIR: lib/${{matrix.lib_platform}}/${{matrix.lib_arch}}
- name: Cache Kotlin/Native dependencies
id: cache-dependencies
uses: actions/cache@v4
if: matrix.platform != 'JVM' && matrix.platform != 'Android'
with:
path: ${{runner.tool_cache}}/konan/dependencies
key: konan-${{runner.os}}-dependencies
- name: Download Kotlin/Native dependencies
if: matrix.platform == 'macOS/iOS' && steps.cache-dependencies.outputs.cache-hit != 'true'
run: |-
mkdir -p "$RUNNER_TOOL_CACHE/konan/dependencies"
curl -LSs https://download-cdn.jetbrains.com/kotlin/native/$DEP.tar.gz | \
tar -xzf - -C "$RUNNER_TOOL_CACHE/konan/dependencies"
env:
DEP: apple-llvm-20200714-macos-aarch64-essentials
- name: Set up Ninja
if: matrix.platform == 'Android'
run: |-
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Run tests
run: ./gradlew --no-daemon ${{matrix.targets}}
env:
KONAN_DATA_DIR: ${{runner.tool_cache}}/konan
- name: Report test results
uses: mikepenz/action-junit-report@v5
if: matrix.platform == 'JVM' && !cancelled()
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,22 @@ jobs:
cache-dependency-path: |
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
- name: Restore Kotlin/Native prebuilt
uses: actions/cache/restore@v4
- name: Set up Kotlin/Native
uses: ObserverOfTime/setup-konan-action@v1
with:
path: ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
key: konan-${{runner.os}}-prebuilt-1.9
- name: Restore Kotlin/Native dependencies
uses: actions/cache/restore@v4
with:
path: ${{runner.tool_cache}}/konan/dependencies
key: konan-${{runner.os}}-dependencies
kotlin_version: 2.1.10
- name: Set up cross compilation
if: matrix.platform == 'Linux'
run: |-
sudo apt-get update
sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
- name: Set up Ninja
if: matrix.platform == 'Android'
run: |-
sudo apt-get update
sudo apt-get install -y ninja-build
sudo apt-get install -qy ninja-build
- name: Build documentation
run: ./gradlew --no-daemon generateFiles :ktreesitter:dokkaHtml
env:
KONAN_DATA_DIR: ${{runner.tool_cache}}/konan
run: ./gradlew --no-daemon generateFiles :ktreesitter:dokkaGeneratePublicationHtml
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
java-version: 17
- name: Install ktlint
run: |-
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.3.1/ktlint
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.5.0/ktlint
chmod a+x ktlint && mv ktlint $RUNNER_TOOL_CACHE/ktlint
- name: Run ktlint
id: ktlint
Expand Down
40 changes: 16 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,38 +132,32 @@ jobs:
cache-dependency-path: |
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
- name: Set up cross compilation
run: sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
if: matrix.platform == 'Linux' || matrix.platform == 'common'
- name: Restore Kotlin/Native prebuilt
uses: actions/cache/restore@v4
- name: Set up Kotlin/Native
uses: ObserverOfTime/setup-konan-action@v1
with:
path: ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
key: konan-${{runner.os}}-prebuilt-1.9
- name: Restore Kotlin/Native dependencies
uses: actions/cache/restore@v4
if: matrix.platform != 'JVM' && matrix.platform != 'Android'
with:
path: ${{runner.tool_cache}}/konan/dependencies
key: konan-${{runner.os}}-dependencies
kotlin_version: 2.1.10
- name: Set up cross compilation
if: matrix.platform == 'Linux'
run: |-
sudo apt-get update
sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
- name: Set up Ninja
if: matrix.platform == 'Android'
run: |-
sudo apt-get update
sudo apt-get install -qy ninja-build
- name: Download library artifacts
uses: actions/download-artifact@v4
if: matrix.platform == 'JVM'
with:
path: ktreesitter/src/jvmMain/resources/lib
pattern: ktreesitter-lib-*
merge-multiple: true
- name: Set up Ninja
if: matrix.platform == 'Android'
run: |-
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Build packages
run: ./gradlew --no-daemon ${{matrix.targets}}
env:
SIGNING_KEY: ${{secrets.SIGNING_KEY}}
SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}}
KONAN_DATA_DIR: ${{runner.tool_cache}}/konan
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -235,14 +229,12 @@ jobs:
cache-dependency-path: |
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
- name: Restore Kotlin/Native prebuilt
uses: actions/cache/restore@v4
- name: Set up Kotlin/Native
uses: ObserverOfTime/setup-konan-action@v1
with:
path: ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
key: konan-${{runner.os}}-prebuilt-1.9
kotlin_version: 2.1.10
- name: Publish Gradle plugin
run: ./gradlew --no-daemon :ktreesitter-plugin:publishPlugins
env:
KONAN_DATA_DIR: ${{runner.tool_cache}}/konan
GRADLE_PUBLISH_KEY: ${{secrets.GRADLE_PUBLISH_KEY}}
GRADLE_PUBLISH_SECRET: ${{secrets.GRADLE_PUBLISH_SECRET}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Gradle ###
.gradle/
build/
.kotlin/
kotlin-js-store/
dependency-graph-reports/
local.properties
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "tree-sitter"]
path = tree-sitter
url = https://github.com/tree-sitter/tree-sitter
branch = release-0.24
branch = release-0.25

[submodule "tree-sitter-java"]
path = languages/java/tree-sitter-java
Expand Down
5 changes: 3 additions & 2 deletions .idea/ktlint-plugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ subprojects {
}

tasks.wrapper {
gradleVersion = "8.7"
gradleVersion = "8.11"
distributionType = Wrapper.DistributionType.BIN
}
10 changes: 8 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
project.version=0.24.1

# The Android SDK version that is used to compile the project.
sdk.version.compile=34
sdk.version.compile=35
# The minimum supported Android SDK version.
sdk.version.min=23
# The Android NDK version that is used to compile the project.
ndk.version=26.3.11579264
ndk.version=27.2.12479018
# The CMake version that is used to compile the project.
cmake.version=3.31.3

Expand All @@ -23,6 +23,8 @@ kotlin.code.style=official
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable C interop sharing
kotlin.mpp.enableCInteropCommonization=true
# Enable cross-compilation of klib artifacts
kotlin.native.enableKlibsCrossCompilation=true
# Disable default stdlib dependency
kotlin.stdlib.default.dependency=false
# Ignore disabled Kotlin/Native targets
Expand All @@ -32,3 +34,7 @@ kotlin.native.ignoreDisabledTargets=true
android.useAndroidX=true
# Disables automatically downloading the Android SDK.
android.builder.sdkDownload=false

# Enables the experimental Dokka V2 mode.
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
77 changes: 20 additions & 57 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,61 +1,24 @@
[versions]
kotlin-stdlib = "[1.9,2.0)"
#noinspection GradleDependency
android-gradle = {strictly = "8.2.0"}
kotest = "5.9.1"
dokka = "1.9.20"

[libraries.kotlin-stdlib]
module = "org.jetbrains.kotlin:kotlin-stdlib"
version.ref = "kotlin-stdlib"

[libraries.kotest-engine]
module = "io.kotest:kotest-framework-engine"
version.ref = "kotest"

[libraries.kotest-assertions]
module = "io.kotest:kotest-assertions-core"
version.ref = "kotest"

[libraries.kotest-junit-runner]
module = "io.kotest:kotest-runner-junit5"
version.ref = "kotest"

[libraries.kotest-junit-reporter]
module = "io.kotest:kotest-extensions-junitxml"
version.ref = "kotest"

[libraries.kotest-android-runner]
module = "br.com.colman:kotest-runner-android"
version = "1.1.1"

[libraries.androidx-test-runner]
module = "androidx.test:runner"
version = "1.5.2"

[libraries.dokka-base]
module = "org.jetbrains.dokka:dokka-base"
version.ref = "dokka"

[plugins.kotlin-mpp]
id = "org.jetbrains.kotlin.multiplatform"
version.ref = "kotlin-stdlib"

[plugins.android-library]
id = "com.android.library"
version.ref = "android-gradle"

[plugins.kotest]
id = "io.kotest.multiplatform"
version.ref = "kotest"

[plugins.dokka]
id = "org.jetbrains.dokka"
version.ref = "dokka"

[plugins.gradle-publish]
id = "com.gradle.plugin-publish"
version = "1.2.1"
kotlin-stdlib = "2.1.10"
android-gradle = {strictly = "8.7.3"}
kotest = "6.0.0.M1"
dokka = "2.0.0"

[libraries]
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-stdlib" }
kotest-engine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-junit-runner = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
kotest-junit-reporter = { module = "io.kotest:kotest-extensions-junitxml", version.ref = "kotest" }
kotest-android-runner = { module = "br.com.colman:kotest-runner-android", version = "1.1.1" }
androidx-test-runner = { module = "androidx.test:runner", version = "1.6.2" }
dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" }

[plugins]
kotlin-mpp = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-stdlib" }
android-library = { id = "com.android.library", version.ref = "android-gradle" }
kotest = { id = "io.kotest.multiplatform", version.ref = "kotest" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }

[bundles]
kotest-core = [
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading
Loading