Skip to content

Commit 1188611

Browse files
authored
Merge pull request #1 from sidhant92/antlr
ANTLR implementation
2 parents 31da181 + b352f00 commit 1188611

51 files changed

Lines changed: 3712 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build Job
2+
3+
on:
4+
pull_request:
5+
branches: ['master', 'develop']
6+
7+
jobs:
8+
build:
9+
name: Compile and Test code
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: '8'
18+
distribution: 'temurin'
19+
cache: 'gradle'
20+
21+
- name: Validate Gradle wrapper
22+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
23+
- name: Build with Gradle
24+
run: ./gradlew build --no-daemon

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Snapshot Release
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
7+
jobs:
8+
build:
9+
name: Compile and Test code
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: '8'
18+
distribution: 'temurin'
19+
cache: 'gradle'
20+
21+
- name: Validate Gradle wrapper
22+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
23+
- name: Build with Gradle
24+
run: ./gradlew build --no-daemon
25+
26+
publish:
27+
name: Publish Artifacts
28+
needs: [build]
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set up JDK 8
34+
uses: actions/setup-java@v3
35+
with:
36+
java-version: '8'
37+
distribution: 'temurin'
38+
cache: 'gradle'
39+
40+
- name: Validate Gradle wrapper
41+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
42+
43+
- name: Publish with Gradle
44+
env:
45+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
46+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
47+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
48+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
49+
run: ./gradlew -Psnapshot=false publishToSonatype --no-daemon
50+
51+
increment:
52+
name: Increment Version
53+
needs: [publish]
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v3
57+
- name: Increment Version
58+
run: ./gradlew incrementVersion --versionIncrementType=PATCH --versionIncrementBranch=master

.github/workflows/snapshot.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Java CI
2+
3+
on:
4+
push:
5+
branches: ['develop', 'master']
6+
7+
jobs:
8+
build:
9+
name: Compile and Test code
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 8
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: '8'
18+
distribution: 'temurin'
19+
cache: 'gradle'
20+
21+
- name: Validate Gradle wrapper
22+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
23+
- name: Build with Gradle
24+
run: ./gradlew build --no-daemon
25+
26+
publish:
27+
name: Publish Artifacts
28+
needs: [build]
29+
if: github.event_name != 'pull_request'
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Set up JDK 8
35+
uses: actions/setup-java@v3
36+
with:
37+
java-version: '8'
38+
distribution: 'temurin'
39+
cache: 'gradle'
40+
41+
- name: Validate Gradle wrapper
42+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
43+
44+
- name: Publish with Gradle
45+
env:
46+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
47+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
48+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
49+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
50+
run: ./gradlew publishToSonatype --no-daemon

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
5+
### STS ###
6+
.apt_generated
7+
.classpath
8+
.factorypath
9+
.project
10+
.settings
11+
.springBeans
12+
.sts4-cache
13+
14+
### IntelliJ IDEA ###
15+
.idea
16+
*.iws
17+
*.iml
18+
*.ipr
19+
out/
20+
21+
### NetBeans ###
22+
/nbproject/private/
23+
/nbbuild/
24+
/dist/
25+
/nbdist/
26+
/.nb-gradle/
27+
28+
### VS Code ###
29+
.vscode/
30+
`
31+
32+
gradle.properties

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# bool-parser-java
2+
Boolean Expression Parser in Java

build.gradle

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import java.time.LocalDateTime
2+
3+
apply plugin: 'java'
4+
apply plugin: 'maven-publish'
5+
apply plugin: 'signing'
6+
apply plugin: "io.github.gradle-nexus.publish-plugin"
7+
8+
buildscript {
9+
repositories {
10+
maven {
11+
url "https://plugins.gradle.org/m2/"
12+
}
13+
}
14+
dependencies {
15+
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
16+
classpath "com.dipien:semantic-version-gradle-plugin:1.4.1"
17+
}
18+
}
19+
20+
21+
sourceCompatibility = 1.8
22+
targetCompatibility = 1.8
23+
24+
group 'com.github.sidhant92'
25+
version = "1.0.0"
26+
27+
apply plugin: "com.dipien.semantic-version"
28+
29+
repositories {
30+
mavenCentral()
31+
}
32+
33+
dependencies {
34+
testImplementation group: 'junit', name: 'junit', version: '4.12'
35+
36+
implementation 'ch.qos.logback:logback-classic:1.2.3'
37+
implementation 'ch.qos.logback.contrib:logback-json-classic:0.1.5'
38+
implementation 'ch.qos.logback.contrib:logback-jackson:0.1.5'
39+
implementation 'net.logstash.logback:logstash-logback-encoder:5.2'
40+
implementation 'org.apache.maven:maven-artifact:3.5.2'
41+
implementation 'org.antlr:antlr4-runtime:4.11.1'
42+
implementation 'io.vavr:vavr:0.10.4'
43+
44+
compileOnly 'org.projectlombok:lombok:1.18.26'
45+
annotationProcessor 'org.projectlombok:lombok:1.18.26'
46+
47+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.2'
48+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.4.2'
49+
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3'
50+
testImplementation group: 'org.mock-server', name: 'mockserver-junit-jupiter', version: '5.10.0'
51+
}
52+
53+
test {
54+
testLogging {
55+
events "passed", "skipped", "failed"
56+
}
57+
useJUnitPlatform()
58+
reports {
59+
junitXml.enabled = true
60+
html.enabled = false
61+
}
62+
}
63+
64+
java {
65+
withJavadocJar()
66+
withSourcesJar()
67+
}
68+
69+
artifacts {
70+
archives javadocJar, sourcesJar
71+
}
72+
73+
/*signing {
74+
sign configurations.archives
75+
}*/
76+
77+
signing {
78+
def signingKey = findProperty("signingKey")
79+
def signingPassword = findProperty("signingPassword")
80+
useInMemoryPgpKeys(signingKey, signingPassword)
81+
sign publishing.publications
82+
}
83+
84+
publishing {
85+
publications {
86+
mavenJava(MavenPublication) {
87+
from(components.java)
88+
pom {
89+
name = 'bool-parser'
90+
description = 'Java parser for boolean expressions'
91+
url = 'https://github.com/sidhant92/bool-parser'
92+
licenses {
93+
license {
94+
name = 'The Apache License, Version 2.0'
95+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
96+
}
97+
}
98+
developers {
99+
developer {
100+
id = 'sidhant92'
101+
name = 'Sidhant Aggarwal'
102+
}
103+
}
104+
scm {
105+
url = 'https://github.com/sidhant92/bool-parser'
106+
connection = 'scm:git://github.com/sidhant92/bool-parser.git'
107+
developerConnection = 'scm:git://github.com/sidhant92/bool-parser.git'
108+
}
109+
}
110+
}
111+
}
112+
}
113+
114+
nexusPublishing {
115+
repositories {
116+
sonatype()
117+
}
118+
}
119+
120+
ext.genOutputDir = file("$buildDir/generated-resources")
121+
122+
task generateVersionTxt() {
123+
ext.outputFile = file("$genOutputDir/version.txt")
124+
outputs.file(outputFile)
125+
doLast {
126+
outputFile.text = """GroupId: ${project.group}
127+
Name: ${project.name}
128+
Version: $version
129+
Build-time: ${LocalDateTime.now()}
130+
"""
131+
}
132+
}
133+
134+
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt

gradle/wrapper/gradle-wrapper.jar

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

0 commit comments

Comments
 (0)