1+ plugins {
2+ `java- library`
3+ alias(libs.plugins.vanniktech.publish)
4+ signing
5+ id(" antlr" )
6+ id(" com.diffplug.spotless" ) version " 5.1.0"
7+ id(" net.researchgate.release" ) version " 3.0.2"
8+ }
9+
10+ group = " com.strumenta.antlr4-c3"
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+ }
18+
19+ repositories {
20+ mavenCentral()
21+ }
22+
23+ val junitVersion = " 5.14.0"
24+ val antlrVersion = " 4.13.2"
25+
26+ dependencies {
27+ implementation(" org.antlr:antlr4-runtime:$antlrVersion " )
28+ antlr(" org.antlr:antlr4:$antlrVersion " )
29+ testImplementation(platform(" org.junit:junit-bom:$junitVersion " ))
30+ testImplementation(" org.junit.jupiter:junit-jupiter" )
31+ testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
32+ }
33+
34+ tasks.test {
35+ useJUnitPlatform()
36+ }
37+
38+ sourceSets {
39+ named(" test" ) {
40+ java.srcDir(" $buildDir /generated-test-sources/antlr4" )
41+ }
42+ }
43+
44+ tasks.named<AntlrTask >(" generateTestGrammarSource" ) {
45+ arguments = arguments + listOf (" -visitor" , " -listener" , " -package" , " com.strumenta.antlr4c3" )
46+ outputDirectory = file(" $buildDir /generated-test-sources/antlr4" )
47+ }
48+ tasks.named(" compileTestJava" ).configure {
49+ dependsOn(tasks.named(" generateTestGrammarSource" ))
50+ }
51+
52+ mavenPublishing {
53+ publishToMavenCentral()
54+ signAllPublications()
55+
56+ pom {
57+ name.set(" antlr4-c3" )
58+ description.set(project.description)
59+ url.set(" https://github.com/Strumenta/antlr4-c3-java" )
60+
61+ licenses {
62+ license {
63+ name.set(" MIT License" )
64+ url.set(" https://opensource.org/licenses/MIT" )
65+ distribution.set(" repo" )
66+ }
67+ }
68+
69+ scm {
70+ connection.set(" scm:git:strumenta/antlr4-c3-java.git" )
71+ developerConnection.set(" scm:git:git@github.com:strumenta/antlr4-c3-java.git" )
72+ url.set(" https://github.com/strumenta/antlr4-c3-java.git" )
73+ tag.set(" HEAD" )
74+ }
75+
76+ developers {
77+ developer {
78+ id.set(" nicks" )
79+ name.set(" Nick Stephen" )
80+ email.set(" nicks _at_ vmware.com" )
81+ organization.set(" VMware" )
82+ timezone.set(" Europe/Paris" )
83+ }
84+ developer {
85+ id.set(" tiagobstr" )
86+ name.set(" Tiago Baptista" )
87+ email.set(" tiago _at_ strumenta.com" )
88+ organization.set(" Strumenta" )
89+ timezone.set(" Europe/Lisbon" )
90+ }
91+ developer {
92+ id.set(" ftomassetti" )
93+ name.set(" Federico Tomassetti" )
94+ email.set(" federico _at_ strumenta.com" )
95+ organization.set(" Strumenta" )
96+ timezone.set(" Europe/Rome" )
97+ }
98+ }
99+ }
100+ }
101+
102+ signing {
103+ val pub = publishing.publications.findByName(" mavenJava" )
104+ if (pub != null && (findProperty(" signing.keyId" ) != null || System .getenv(" SIGNING_KEY_ID" ) != null )) {
105+ sign(pub)
106+ }
107+ }
108+
109+ release {
110+ buildTasks = listOf (" publish" )
111+ versionPropertyFile = " ./gradle.properties"
112+ git {
113+ requireBranch.set(" main" )
114+ pushToRemote.set(" origin" )
115+ }
116+ }
117+
118+ tasks.named(" sourcesJar" ).configure {
119+ dependsOn(tasks.named(" generateGrammarSource" ))
120+ }
121+ // tasks.named("generateMetadataFileForMavenPublication").configure {
122+ // dependsOn(tasks.named("plainJavadocJar"))
123+ // }
0 commit comments