-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
128 lines (107 loc) · 4.08 KB
/
build.gradle
File metadata and controls
128 lines (107 loc) · 4.08 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import java.time.LocalDateTime
plugins {
id 'java'
id 'maven-publish'
id 'signing'
id 'com.gradleup.nmcp' version '0.0.8'
}
group 'com.github.sidhant92'
version = "2.0.0"
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.apache.maven:maven-artifact:3.5.2'
implementation 'org.antlr:antlr4-runtime:4.13.2'
implementation 'io.vavr:vavr:0.10.4'
implementation 'com.github.ben-manes.caffeine:caffeine:2.9.3'
implementation 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.36'
testImplementation 'org.openjdk.jmh:jmh-core:1.35'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.35'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.4.2'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3'
testImplementation group: 'org.mock-server', name: 'mockserver-junit-jupiter', version: '5.10.0'
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
test {
testLogging {
events "passed", "skipped", "failed"
}
useJUnitPlatform()
reports {
junitXml.required = true
html.required = false
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = 'bool-parser'
description = 'Java parser for boolean expressions'
url = 'https://github.com/sidhant92/bool-parser-java'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'sidhant92'
name = 'Sidhant Aggarwal'
url = 'https://github.com/sidhant92'
}
}
scm {
connection = 'scm:git:git://github.com/sidhant92/bool-parser-java.git'
developerConnection = 'scm:git:ssh://git@github.com/sidhant92/bool-parser-java.git'
url = 'https://github.com/sidhant92/bool-parser-java'
}
}
}
}
// Remove the old repository configuration - NMCP plugin handles this
}
// Configure signing - only required for Maven Central, not for local publishing
signing {
def signingKey = System.getenv("signingInMemoryKey") ?: findProperty("signingInMemoryKey")
def signingPassword = System.getenv("signingInMemoryKeyPassword") ?: findProperty("signingInMemoryKeyPassword")
// Only enable signing if keys are provided
required { signingKey != null && signingPassword != null }
if (signingKey && signingPassword) {
useInMemoryPgpKeys(signingKey as String, signingPassword as String)
sign publishing.publications
}
}
// Configure New Maven Central Portal publishing
nmcp {
publishAllPublications {
username = System.getenv("MAVEN_USERNAME") ?: findProperty("mavenCentralUsername")
password = System.getenv("MAVEN_PASSWORD") ?: findProperty("mavenCentralPassword")
publicationType = "AUTOMATIC"
}
}
ext.genOutputDir = file("${layout.buildDirectory.get()}/generated-resources")
tasks.register('generateVersionTxt') {
ext.outputFile = file("$genOutputDir/version.txt")
outputs.file(outputFile)
doLast {
outputFile.text = """GroupId: ${project.group}
Name: ${project.name}
Version: $version
Build-time: ${LocalDateTime.now()}
"""
}
}
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt