Skip to content

Commit 19509eb

Browse files
committed
Set up Gradle build system and configured project for publishing.
1 parent d5a8f16 commit 19509eb

File tree

6 files changed

+464
-0
lines changed

6 files changed

+464
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.idea
2+
build
3+
.gradle

build.gradle.kts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
plugins {
2+
`java-library`
3+
`maven-publish`
4+
signing
5+
id("antlr")
6+
id("com.diffplug.spotless") version "5.1.0"
7+
}
8+
9+
group = "com.strumenta.antlr4-c3"
10+
version = "1.2.0-SNAPSHOT"
11+
description = "A code completion core implementation for ANTLR4 based parsers"
12+
13+
java {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
16+
withSourcesJar()
17+
withJavadocJar()
18+
}
19+
20+
repositories {
21+
mavenCentral()
22+
}
23+
24+
val junitVersion = "5.14.0"
25+
val antlrVersion = "4.13.2"
26+
27+
dependencies {
28+
implementation("org.antlr:antlr4-runtime:$antlrVersion")
29+
antlr("org.antlr:antlr4:$antlrVersion")
30+
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
31+
testImplementation("org.junit.jupiter:junit-jupiter")
32+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
33+
}
34+
35+
tasks.test {
36+
useJUnitPlatform()
37+
}
38+
39+
sourceSets {
40+
named("test") {
41+
java.srcDir("$buildDir/generated-test-sources/antlr4")
42+
}
43+
}
44+
45+
tasks.named<AntlrTask>("generateTestGrammarSource") {
46+
arguments = arguments + listOf("-visitor", "-listener", "-package", "com.strumenta.antlr4c3")
47+
outputDirectory = file("$buildDir/generated-test-sources/antlr4")
48+
}
49+
tasks.named("compileTestJava").configure {
50+
dependsOn(tasks.named("generateTestGrammarSource"))
51+
}
52+
publishing {
53+
publications {
54+
create<MavenPublication>("mavenJava") {
55+
from(components["java"])
56+
57+
pom {
58+
name.set("antlr4-c3")
59+
description.set(project.description)
60+
url.set("https://github.com/Strumenta/antlr4-c3-java")
61+
62+
licenses {
63+
license {
64+
name.set("MIT License")
65+
url.set("https://opensource.org/licenses/MIT")
66+
distribution.set("repo")
67+
}
68+
}
69+
70+
scm {
71+
connection.set("scm:git:strumenta/antlr4-c3-java.git")
72+
developerConnection.set("scm:git:git@github.com:strumenta/antlr4-c3-java.git")
73+
url.set("https://github.com/strumenta/antlr4-c3-java.git")
74+
tag.set("HEAD")
75+
}
76+
77+
developers {
78+
developer {
79+
id.set("nicks")
80+
name.set("Nick Stephen")
81+
email.set("nicks _at_ vmware.com")
82+
organization.set("VMware")
83+
timezone.set("Europe/Paris")
84+
}
85+
developer {
86+
id.set("tiagobstr")
87+
name.set("Tiago Baptista")
88+
email.set("tiago _at_ strumenta.com")
89+
organization.set("Strumenta")
90+
timezone.set("Europe/Lisbon")
91+
}
92+
developer {
93+
id.set("ftomassetti")
94+
name.set("Federico Tomassetti")
95+
email.set("federico _at_ strumenta.com")
96+
organization.set("Strumenta")
97+
timezone.set("Europe/Rome")
98+
}
99+
}
100+
}
101+
}
102+
}
103+
}
104+
105+
signing {
106+
val pub = publishing.publications.findByName("mavenJava")
107+
if (pub != null && (findProperty("signing.keyId") != null || System.getenv("SIGNING_KEY_ID") != null)) {
108+
sign(pub)
109+
}
110+
}

gradle/wrapper/gradle-wrapper.jar

42.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

gradlew

Lines changed: 251 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)