Skip to content
Closed
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
9 changes: 8 additions & 1 deletion .github/workflows/jvm-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- bindings/java/**
- bindings/kotlin/**
- bindings/scala/**
- cmd/scip/version.txt
- scip.proto
- .github/workflows/jvm-bindings.yaml
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
sudo apt-get install -qq -y libxml2-utils
expected=$(cat cmd/scip/version.txt)
xpath='/*[local-name()="project"]/*[local-name()="version"]/text()'
for pom in bindings/java/pom.xml bindings/kotlin/pom.xml; do
for pom in bindings/java/pom.xml bindings/kotlin/pom.xml bindings/scala/pom.xml; do
actual=$(xmllint --xpath "$xpath" "$pom")
if [ "$actual" != "$expected" ]; then
echo "::error file=$pom::version is '$actual', expected '$expected'"
Expand All @@ -52,3 +53,9 @@ jobs:

- name: Build scip-kotlin-bindings (resolves scip-java-bindings from local repo)
run: mvn -B -ntp -Prelease -Dgpg.skip=true -f bindings/kotlin/pom.xml verify

- name: Build scip-scala-bindings_2.13
run: mvn -B -ntp -Pscala-2.13,release -Dgpg.skip=true -f bindings/scala/pom.xml verify

- name: Build scip-scala-bindings_3
run: mvn -B -ntp -Pscala-3,release -Dgpg.skip=true -f bindings/scala/pom.xml verify
18 changes: 14 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ jobs:
needs: publish
runs-on: ubuntu-latest
# Maven Central publication with waitUntil=published can block for
# 10-30 min per module while Sonatype mirrors propagate. Two
# sequential deploys (Java then Kotlin, which resolves Java from
# Central) means worst-case ~60 min.
timeout-minutes: 90
# 10-30 min per module while Sonatype mirrors propagate.
timeout-minutes: 150
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -131,6 +129,18 @@ jobs:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

- name: Deploy scip-scala-bindings_2.13 to Maven Central
run: mvn -B -ntp -Pscala-2.13,release -f bindings/scala/pom.xml deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

- name: Deploy scip-scala-bindings_3 to Maven Central
run: mvn -B -ntp -Pscala-3,release -f bindings/scala/pom.xml deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

build-go-binaries:
needs: publish
permissions:
Expand Down
2 changes: 2 additions & 0 deletions bindings/scala/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
.flattened-pom.xml
230 changes: 230 additions & 0 deletions bindings/scala/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.scip-code</groupId>
<!-- Scala binary version goes in the artifactId (sbt convention), not the version. -->
<artifactId>scip-scala-bindings_${scala.binary.version}</artifactId>
<version>0.8.0</version>
<packaging>jar</packaging>

<name>scip-scala-bindings_${scala.binary.version}</name>
<description>
Generated Scala bindings (via ScalaPB) for the Semantic Code
Intelligence Protocol (SCIP).
</description>
<url>https://github.com/scip-code/scip</url>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>SCIP Maintainers</name>
<organization>scip-code</organization>
<organizationUrl>https://github.com/scip-code</organizationUrl>
</developer>
</developers>

<scm>
<url>https://github.com/scip-code/scip</url>
<connection>scm:git:https://github.com/scip-code/scip.git</connection>
<developerConnection>scm:git:git@github.com:scip-code/scip.git</developerConnection>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<!-- Must match the protoc-gen-scala version pinned in flake.nix. -->
<scalapb.version>0.11.20</scalapb.version>
<scala.binary.version>2.13</scala.binary.version>
<scala.version>2.13.18</scala.version>
<project.build.outputTimestamp>${git.commit.time}</project.build.outputTimestamp>
</properties>

<dependencies>
<dependency>
<groupId>com.thesamet.scalapb</groupId>
<artifactId>scalapb-runtime_${scala.binary.version}</artifactId>
<version>${scalapb.version}</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<plugins>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>10.0.0</version>
<executions>
<execution>
<id>get-git-properties</id>
<phase>initialize</phase>
<goals><goal>revision</goal></goals>
</execution>
</executions>
<configuration>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssXXX</dateFormat>
<dateFormatTimeZone>UTC</dateFormatTimeZone>
<generateGitPropertiesFile>false</generateGitPropertiesFile>
<verbose>false</verbose>
</configuration>
</plugin>
<!-- Publishes a consumer POM with ${scala.binary.version} resolved. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.7.3</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>oss</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals><goal>flatten</goal></goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals><goal>clean</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.9.5</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
</configuration>
<executions>
<execution>
<id>scala-compile</id>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
</execution>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals><goal>doc-jar</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals><goal>jar-no-fork</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<!-- No-op; defined so `mvn -Pscala-2.13` is symmetric with `-Pscala-3`. -->
<profile>
<id>scala-2.13</id>
</profile>
<profile>
<id>scala-3</id>
<properties>
<scala.binary.version>3</scala.binary.version>
<!-- Latest 3.3.x LTS. -->
<scala.version>3.3.7</scala.version>
</properties>
<build>
<plugins>
<!--
scala-maven-plugin 4.9.5's `doc-jar` emits Scala-2-only flags
that Scala 3 scaladoc rejects, so we skip it and attach an
empty `-javadoc.jar` to satisfy Maven Central. Doc comments
remain in `-sources.jar`.
-->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<jar destfile="${project.build.directory}/${project.build.finalName}-javadoc.jar"/>
<attachartifact
file="${project.build.directory}/${project.build.finalName}-javadoc.jar"
classifier="javadoc"
type="jar"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Mirror of bindings/java/pom.xml's `release` profile; keep in sync. -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals><goal>sign</goal></goals>
<configuration>
<gpgArguments>
<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.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading