Skip to content

Commit 6199199

Browse files
authored
Merge pull request #51 from sidhant92/date_time
Gradle Upgrade
2 parents f081dfe + 77c1543 commit 6199199

File tree

2 files changed

+50
-55
lines changed

2 files changed

+50
-55
lines changed

build.gradle

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
import java.time.LocalDateTime
22

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-
}
3+
plugins {
4+
id 'java'
5+
id 'maven-publish'
6+
id 'signing'
7+
id 'com.gradleup.nmcp' version '0.0.8'
188
}
199

20-
21-
sourceCompatibility = 1.8
22-
targetCompatibility = 1.8
23-
2410
group 'com.github.sidhant92'
2511
version = "2.0.0"
2612

27-
apply plugin: "com.dipien.semantic-version"
13+
java {
14+
sourceCompatibility = JavaVersion.VERSION_21
15+
targetCompatibility = JavaVersion.VERSION_21
16+
withJavadocJar()
17+
withSourcesJar()
18+
}
2819

2920
repositories {
3021
mavenCentral()
@@ -35,9 +26,9 @@ dependencies {
3526
implementation 'org.antlr:antlr4-runtime:4.13.2'
3627
implementation 'io.vavr:vavr:0.10.4'
3728
implementation 'com.github.ben-manes.caffeine:caffeine:2.9.3'
38-
implementation 'org.projectlombok:lombok:1.18.26'
29+
implementation 'org.projectlombok:lombok:1.18.34'
3930

40-
annotationProcessor 'org.projectlombok:lombok:1.18.26'
31+
annotationProcessor 'org.projectlombok:lombok:1.18.34'
4132
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.36'
4233

4334
testImplementation 'org.openjdk.jmh:jmh-core:1.35'
@@ -55,70 +46,74 @@ test {
5546
}
5647
useJUnitPlatform()
5748
reports {
58-
junitXml.enabled = true
59-
html.enabled = false
49+
junitXml.required = true
50+
html.required = false
6051
}
6152
}
6253

63-
java {
64-
withJavadocJar()
65-
withSourcesJar()
66-
}
67-
68-
artifacts {
69-
archives javadocJar, sourcesJar
70-
}
71-
72-
/*signing {
73-
sign configurations.archives
74-
}*/
75-
76-
signing {
77-
def signingKey = findProperty("signingKey")
78-
def signingPassword = findProperty("signingPassword")
79-
useInMemoryPgpKeys(signingKey, signingPassword)
80-
sign publishing.publications
81-
}
82-
8354
publishing {
8455
publications {
85-
mavenJava(MavenPublication) {
86-
from(components.java)
56+
maven(MavenPublication) {
57+
from components.java
58+
8759
pom {
8860
name = 'bool-parser'
8961
description = 'Java parser for boolean expressions'
9062
url = 'https://github.com/sidhant92/bool-parser-java'
63+
9164
licenses {
9265
license {
9366
name = 'The Apache License, Version 2.0'
94-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
67+
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
9568
}
9669
}
70+
9771
developers {
9872
developer {
9973
id = 'sidhant92'
10074
name = 'Sidhant Aggarwal'
75+
url = 'https://github.com/sidhant92'
10176
}
10277
}
78+
10379
scm {
80+
connection = 'scm:git:git://github.com/sidhant92/bool-parser-java.git'
81+
developerConnection = 'scm:git:ssh://[email protected]/sidhant92/bool-parser-java.git'
10482
url = 'https://github.com/sidhant92/bool-parser-java'
105-
connection = 'scm:git://github.com/sidhant92/bool-parser-java.git'
106-
developerConnection = 'scm:git://github.com/sidhant92/bool-parser-java.git'
10783
}
10884
}
10985
}
11086
}
87+
88+
// Remove the old repository configuration - NMCP plugin handles this
89+
}
90+
91+
// Configure signing - only required for Maven Central, not for local publishing
92+
signing {
93+
def signingKey = System.getenv("signingInMemoryKey") ?: findProperty("signingInMemoryKey")
94+
def signingPassword = System.getenv("signingInMemoryKeyPassword") ?: findProperty("signingInMemoryKeyPassword")
95+
96+
// Only enable signing if keys are provided
97+
required { signingKey != null && signingPassword != null }
98+
99+
if (signingKey && signingPassword) {
100+
useInMemoryPgpKeys(signingKey as String, signingPassword as String)
101+
sign publishing.publications
102+
}
111103
}
112104

113-
nexusPublishing {
114-
repositories {
115-
sonatype()
105+
// Configure New Maven Central Portal publishing
106+
nmcp {
107+
publishAllPublications {
108+
username = System.getenv("MAVEN_USERNAME") ?: findProperty("mavenCentralUsername")
109+
password = System.getenv("MAVEN_PASSWORD") ?: findProperty("mavenCentralPassword")
110+
publicationType = "AUTOMATIC"
116111
}
117112
}
118113

119-
ext.genOutputDir = file("$buildDir/generated-resources")
114+
ext.genOutputDir = file("${layout.buildDirectory.get()}/generated-resources")
120115

121-
task generateVersionTxt() {
116+
tasks.register('generateVersionTxt') {
122117
ext.outputFile = file("$genOutputDir/version.txt")
123118
outputs.file(outputFile)
124119
doLast {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)