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
25 changes: 25 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17', '21' ]
name: Java ${{ matrix.Java }} Check

steps:
- uses: actions/checkout@v1
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Test
env:
STRUMENTA_PACKAGES_USER: ${{ secrets.STRUMENTA_PACKAGES_USER }}
STRUMENTA_PACKAGES_TOKEN: ${{ secrets.STRUMENTA_PACKAGES_TOKEN }}
run: ./gradlew check --stacktrace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea
build
.gradle
123 changes: 123 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
plugins {
`java-library`
alias(libs.plugins.vanniktech.publish)
signing
id("antlr")
id("com.diffplug.spotless") version "5.1.0"
id("net.researchgate.release") version "3.0.2"
}

group = "com.strumenta.antlr4-c3"
description = "A code completion core implementation for ANTLR4 based parsers"

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}

repositories {
mavenCentral()
}

val junitVersion = "5.14.0"
val antlrVersion = "4.13.2"

dependencies {
implementation("org.antlr:antlr4-runtime:$antlrVersion")
antlr("org.antlr:antlr4:$antlrVersion")
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.test {
useJUnitPlatform()
}

sourceSets {
named("test") {
java.srcDir("$buildDir/generated-test-sources/antlr4")
}
}

tasks.named<AntlrTask>("generateTestGrammarSource") {
arguments = arguments + listOf("-visitor", "-listener", "-package", "com.strumenta.antlr4c3")
outputDirectory = file("$buildDir/generated-test-sources/antlr4")
}
tasks.named("compileTestJava").configure {
dependsOn(tasks.named("generateTestGrammarSource"))
}

mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
name.set("antlr4-c3")
description.set(project.description)
url.set("https://github.com/Strumenta/antlr4-c3-java")

licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
distribution.set("repo")
}
}

scm {
connection.set("scm:git:strumenta/antlr4-c3-java.git")
developerConnection.set("scm:git:git@github.com:strumenta/antlr4-c3-java.git")
url.set("https://github.com/strumenta/antlr4-c3-java.git")
tag.set("HEAD")
}

developers {
developer {
id.set("nicks")
name.set("Nick Stephen")
email.set("nicks _at_ vmware.com")
organization.set("VMware")
timezone.set("Europe/Paris")
}
developer {
id.set("tiagobstr")
name.set("Tiago Baptista")
email.set("tiago _at_ strumenta.com")
organization.set("Strumenta")
timezone.set("Europe/Lisbon")
}
developer {
id.set("ftomassetti")
name.set("Federico Tomassetti")
email.set("federico _at_ strumenta.com")
organization.set("Strumenta")
timezone.set("Europe/Rome")
}
}
}
}

signing {
val pub = publishing.publications.findByName("mavenJava")
if (pub != null && (findProperty("signing.keyId") != null || System.getenv("SIGNING_KEY_ID") != null)) {
sign(pub)
}
}

release {
buildTasks = listOf("publish")
versionPropertyFile = "./gradle.properties"
git {
requireBranch.set("main")
pushToRemote.set("origin")
}
}

tasks.named("sourcesJar").configure {
dependsOn(tasks.named("generateGrammarSource"))
}
//tasks.named("generateMetadataFileForMavenPublication").configure {
// dependsOn(tasks.named("plainJavadocJar"))
//}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=1.2.0-SNAPSHOT
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[plugins]
vanniktech-publish = { id = "com.vanniktech.maven.publish", version = "0.34.0" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading