-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
113 lines (97 loc) · 3.14 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
plugins {
id 'java-library'
id 'antlr'
id 'signing'
id 'maven-publish'
id('io.github.gradle-nexus.publish-plugin') version '1.1.0'
}
group = "com.sesamecare"
version = "0.0.1-SNAPSHOT"
repositories() {
mavenCentral()
}
dependencies {
antlr 'org.antlr:antlr4:4.10.1'
implementation 'org.antlr:antlr4-runtime:4.10.1'
implementation 'org.apache.commons:commons-configuration2:2.9.0'
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.hamcrest:java-hamcrest:2.0.0.0")
testImplementation("com.google.code.gson:gson:2.10.1")
}
ext.genOutputDir = file("$buildDir/generated-resources")
task generateVersionTxt() {
ext.outputFile = file("$genOutputDir/version.txt")
outputs.file(outputFile)
doLast {
outputFile.text = """GroupId: ${project.group}
Name: ${project.name}
Version: $version
Build-time: ${java.time.LocalDateTime.now()}
"""
}
}
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt
generateGrammarSource {
arguments += ["-visitor", "-package", "com.sesamecare.asyncRuleEvaluator"]
}
compileJava {
dependsOn generateGrammarSource
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
exclude("com/sesamecare/asyncRuleEvaluator/FiltrexLexer.java")
exclude("com/sesamecare/asyncRuleEvaluator/FiltrexParser.java")
exclude("com/sesamecare/asyncRuleEvaluator/FiltrexBaseListener.java")
exclude("com/sesamecare/asyncRuleEvaluator/FiltrexBaseVisitor.java")
}
sourcesJar.dependsOn ':generateGrammarSource'
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'async-rule-evaluator'
description = 'A simple DSL based on https://github.com/joewalnes/filtrex and its forks'
url = 'https://github.com/sesamecare/async-rule-evaluator'
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/license/mit/'
}
}
developers {
developer {
id = 'djmax'
name = 'Max Metral'
}
}
scm {
url = 'https://github.com/sesamecare/async-rule-evaluator'
connection = 'scm:git://github.com/sesamecare/async-rule-evaluator.git'
developerConnection = 'scm:git://github.com/sesamecare/async-rule-evaluator.git'
}
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}