jtreesitter

Used in: 0 components

Overview

Description

Java bindings to the tree-sitter parsing library

Snippets

<dependency>
    <groupId>io.github.tree-sitter</groupId>
    <artifactId>jtreesitter</artifactId>
    <version>0.25.0</version>
</dependency>

Maven POM File

<?xml version="1.0" encoding="UTF-8"?>
<project
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.tree-sitter</groupId>
  <artifactId>jtreesitter</artifactId>
  <name>JTreeSitter</name>
  <version>0.25.0</version>
  <description>Java bindings to the tree-sitter parsing library</description>
  <url>https://tree-sitter.github.io/java-tree-sitter/</url>
  <inceptionYear>2024</inceptionYear>
  <organization>
    <name>tree-sitter</name>
    <url>https://github.com/tree-sitter</url>
  </organization>
  <licenses>
    <license>
      <name>MIT</name>
      <url>https://spdx.org/licenses/MIT.html</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>ObserverOfTime</id>
      <name>ObserverOfTime</name>
      <email>chronobserver@disroot.org</email>
      <url>https://github.com/ObserverOfTime</url>
    </developer>
  </developers>
  <scm>
    <url>https://github.com/tree-sitter/java-tree-sitter</url>
    <connection>scm:git:git://github.com/tree-sitter/java-tree-sitter.git</connection>
    <developerConnection>scm:git:ssh://github.com/tree-sitter/java-tree-sitter.git</developerConnection>
  </scm>
  <ciManagement>
    <system>Github Actions</system>
    <url>https://github.com/tree-sitter/java-tree-sitter/actions</url>
  </ciManagement>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/tree-sitter/java-tree-sitter/issues</url>
  </issueManagement>
  <properties>
    <maven.compiler.source>22</maven.compiler.source>
    <maven.compiler.target>22</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.deploy.skip>true</maven.deploy.skip>
    <gpg.skip>true</gpg.skip>
    <jextract.skip>false</jextract.skip>
    <publish.auto>false</publish.auto>
    <publish.skip>true</publish.skip>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.jspecify</groupId>
      <artifactId>jspecify</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>jextract</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <skip>${jextract.skip}</skip>
              <target name="jextract">
                <echo level="info">Generating sources using jextract</echo>
                <exec osfamily="windows" executable="powershell" failonerror="true">
                  <arg value="-NoProfile"/>
                  <arg value="-ExecutionPolicy"/>
                  <arg value="bypass"/>
                  <arg value="-File"/>
                  <arg value="${project.basedir}/scripts/jextract.ps1"/>
                  <arg value="${project.basedir}"/>
                  <arg value="${project.build.directory}"/>
                </exec>
                <exec osfamily="unix" executable="bash" failonerror="true">
                  <arg value="-eu"/>
                  <arg value="${project.basedir}/scripts/jextract.sh"/>
                  <arg value="${project.basedir}"/>
                  <arg value="${project.build.directory}"/>
                </exec>
                <exec executable="git" dir="${project.build.directory}" failonerror="true">
                  <arg value="apply"/>
                  <arg value="--no-index"/>
                  <arg value="${project.basedir}/scripts/TreeSitter_java.patch"/>
                </exec>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>fix-javadoc</id>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target name="fix-javadoc">
                <echo level="info">Adding favicon &amp; prism.js to javadoc</echo>
                <exec executable="${project.basedir}/scripts/fix-javadoc.sh" failonerror="true">
                  <arg value="${project.build.directory}"/>
                </exec>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>patch-sarif</id>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target name="patch-sarif">
                <echo level="info">Patching SpotBugs sarif report</echo>
                <replace file="${project.build.directory}/reports/spotbugsSarif.json">
                  <replacetoken>"uri":"</replacetoken>
                  <replacevalue>"uri":"src/main/java/</replacevalue>
                </replace>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/jextract</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>2.43.0</version>
        <executions>
          <execution>
            <id>format-sources</id>
            <phase>process-sources</phase>
            <goals>
              <goal>apply</goal>
            </goals>
          </execution>
          <execution>
            <id>format-test-sources</id>
            <phase>process-test-sources</phase>
            <goals>
              <goal>apply</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <java>
            <palantirJavaFormat>
              <version>2.50.0</version>
              <style>PALANTIR</style>
              <formatJavadoc>false</formatJavadoc>
            </palantirJavaFormat>
          </java>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>4.9.1.0</version>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sarifOutput>true</sarifOutput>
          <failOnError>false</failOnError>
          <xmlOutputDirectory>${project.build.directory}/reports</xmlOutputDirectory>
          <sarifOutputDirectory>${project.build.directory}/reports</sarifOutputDirectory>
          <excludeFilterFile>${project.basedir}/spotbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.2</version>
        <configuration>
          <reportsDirectory>
            ${project.build.directory}/reports/surefire
          </reportsDirectory>
          <argLine>--enable-native-access=ALL-UNNAMED</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.11.2</version>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <show>public</show>
          <nohelp>true</nohelp>
          <noqualifier>true</noqualifier>
          <doclint>all,-missing</doclint>
          <tags>
            <tag>
              <name>apiNote</name>
              <placement>a</placement>
              <head>API Note:</head>
            </tag>
            <tag>
              <name>implNote</name>
              <placement>a</placement>
              <head>Implementation Note:</head>
            </tag>
          </tags>
          <links>
            <link>https://jspecify.dev/docs/api/</link>
          </links>
          <excludePackageNames>io.github.treesitter.jtreesitter.internal</excludePackageNames>
          <header><![CDATA[
          <img src="/tree-sitter/assets/images/tree-sitter-small.png" style="height:100%;width:auto;padding:0.4em" alt="logo"/>
          ]]></header>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.2.7</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
            <configuration>
              <bestPractices>true</bestPractices>
              <gpgArguments>
                <arg>--no-tty</arg>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.5.0</version>
        <executions>
          <execution>
            <phase>deploy</phase>
            <goals>
              <goal>publish</goal>
            </goals>
            <configuration>
              <waitUntil>validated</waitUntil>
              <autoPublish>${publish.auto}</autoPublish>
              <skipPublishing>${publish.skip}</skipPublishing>
              <outputFilename>${project.artifactId}-${project.version}.zip</outputFilename>
              <deploymentName>${project.artifactId}-${project.version}.zip</deploymentName>
            </configuration>
          </execution>
        </executions>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>ci</id>
      <activation>
        <property>
          <name>env.CI</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <gpg.skip>false</gpg.skip>
        <publish.auto>true</publish.auto>
        <publish.skip>false</publish.skip>
      </properties>
    </profile>
  </profiles>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>5.11.2</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>