Skip to content

Commit ad7cb42

Browse files
committed
feat: using new build scripts
1 parent 828200d commit ad7cb42

File tree

9 files changed

+75
-70
lines changed

9 files changed

+75
-70
lines changed

build.gradle

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,20 @@
1-
apply plugin: 'java-library'
2-
3-
buildscript {
4-
repositories {
5-
mavenCentral()
6-
mavenLocal()
7-
}
8-
dependencies {
9-
classpath 'se.bjurr.gradle:gradle-scripts:2.+'
10-
}
1+
plugins {
2+
id "se.bjurr.gradle.conventional-release" version "0.+"
3+
id "se.bjurr.gradle.update-versions" version "0.+"
4+
id "se.bjurr.gradle.java-convention" version "0.+"
115
}
12-
project.ext.buildConfig = [
13-
repoType: "COMMAND",
14-
publishing: [
15-
relocate: [
16-
"org:org",
17-
"com:com"
18-
]
19-
],
20-
manifest: [
21-
mainClass: 'se.bjurr.gitchangelog.main.Main'
22-
]
23-
]
24-
apply from: project.buildscript.classLoader.getResource('main.gradle').toURI()
256

267
shadowJar {
27-
exclude 'META-INF/versions/21/**'
8+
exclude 'META-INF/versions/21/**'
289
}
2910

3011
dependencies {
31-
implementation 'se.bjurr.gitchangelog:git-changelog-lib:2.1.3'
32-
implementation 'se.softhouse:jargo:0.4.14'
33-
implementation 'org.slf4j:slf4j-simple:2.0.6'
34-
implementation 'com.google.code.gson:gson:2.10.1'
35-
implementation 'org.openjdk.nashorn:nashorn-core:15.4'
12+
implementation 'se.bjurr.gitchangelog:git-changelog-lib:2.1.3'
13+
implementation 'se.softhouse:jargo:0.4.14'
14+
implementation 'org.slf4j:slf4j-simple:2.0.6'
15+
implementation 'com.google.code.gson:gson:2.10.1'
16+
implementation 'org.openjdk.nashorn:nashorn-core:15.4'
3617

37-
testImplementation 'junit:junit:4.13.2'
18+
testImplementation 'junit:junit:4.13.2'
3819
}
3920

changelog.json

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
{
2-
"templatePath": "changelog.json",
3-
4-
"fromRepo": ".",
5-
"fromCommit": "0000000000000000000000000000000000000000",
6-
"toRef": "refs/heads/master",
7-
8-
"ignoreCommitsIfMessageMatches": "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*",
9-
"readableTagName": "/([^/]+?)$",
10-
"dateFormat": "YYYY-MM-dd HH:mm:ss",
11-
"untaggedName": "Next release",
12-
"noIssueName": "Other changes",
13-
"timeZone": "UTC",
14-
"removeIssueFromMessage": "true",
15-
16-
"jiraServer": "https://jiraserver/jira",
17-
"jiraIssuePattern": "\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b",
18-
19-
"gitHubApi": "https://api.github.com/repos/tomasbjerre/git-changelog-command-line",
20-
"gitHubIssuePattern": "#([0-9]+)",
21-
22-
"customIssues": [
23-
{ "name": "Incident", "pattern": "INC[0-9]*", "link": "http://inc/${PATTERN_GROUP}" },
24-
{ "name": "CQ", "pattern": "CQ([0-9]+)", "link": "http://cq/${PATTERN_GROUP_1}" },
25-
{ "name": "Bugs", "pattern": "#bug" }
26-
]
2+
"templatePath": "changelog.json",
3+
"fromRepo": ".",
4+
"fromCommit": "0000000000000000000000000000000000000000",
5+
"toRef": "refs/heads/master",
6+
"ignoreCommitsIfMessageMatches": "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*",
7+
"readableTagName": "/([^/]+?)$",
8+
"dateFormat": "YYYY-MM-dd HH:mm:ss",
9+
"untaggedName": "Next release",
10+
"noIssueName": "Other changes",
11+
"timeZone": "UTC",
12+
"removeIssueFromMessage": "true",
13+
"jiraServer": "https://jiraserver/jira",
14+
"jiraIssuePattern": "\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b",
15+
"gitHubApi": "https://api.github.com/repos/tomasbjerre/git-changelog-command-line",
16+
"gitHubIssuePattern": "#([0-9]+)",
17+
"customIssues": [
18+
{
19+
"name": "Incident",
20+
"pattern": "INC[0-9]*",
21+
"link": "http://inc/${PATTERN_GROUP}"
22+
},
23+
{
24+
"name": "CQ",
25+
"pattern": "CQ([0-9]+)",
26+
"link": "http://cq/${PATTERN_GROUP_1}"
27+
},
28+
{
29+
"name": "Bugs",
30+
"pattern": "#bug"
31+
}
32+
]
2733
}

gradle.properties

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
#Sun Jul 07 08:01:20 CEST 2024
1+
#
2+
#Thu Oct 03 19:53:35 CEST 2024
23
description="Command line tool that generates changelog from a GIT repository."
3-
version=2.3.0
44
group=se.bjurr.gitchangelog
5+
mainClass=se.bjurr.gitchangelog.main.Main
6+
relocate=org\:org,com\:com
7+
repoType=COMMAND
8+
version=2.3.0

gradle/wrapper/gradle-wrapper.jar

121 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

settings.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
mavenCentral()
5+
mavenLocal()
6+
}
7+
}

src/main/java/se/bjurr/gitchangelog/main/Main.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@ public static void main(final String args[]) throws Exception {
649649
}
650650
if (arg.wasGiven(ignoreCommitsOlderThanArgument)) {
651651
final Date date =
652-
new SimpleDateFormat(DEFAULT_DATEFORMAT).parse(arg.get(ignoreCommitsOlderThanArgument));
652+
new SimpleDateFormat(DEFAULT_DATEFORMAT) // NOPMD
653+
.parse(arg.get(ignoreCommitsOlderThanArgument));
653654
changelogApiBuilder.withIgnoreCommitsOlderThan(date);
654655
}
655656
if (arg.wasGiven(ignoreTagsIfNameMatchesArgument)) {
@@ -826,49 +827,50 @@ public static void main(final String args[]) throws Exception {
826827
}
827828

828829
if (arg.wasGiven(showDebugInfo)) {
829-
System.out.println(
830+
System.out.println( // NOPMD
830831
"Settings:\n"
831832
+ new GsonBuilder()
832833
.setPrettyPrinting()
833834
.create()
834835
.toJson(changelogApiBuilder.getSettings()));
835-
System.out.println("Template:\n\n" + changelogApiBuilder.getTemplateString() + "\n\n");
836+
System.out.println( // NOPMD
837+
"Template:\n\n" + changelogApiBuilder.getTemplateString() + "\n\n"); // NOPMD
836838
final byte[] template =
837839
changelogApiBuilder.getTemplateString().getBytes(StandardCharsets.UTF_8);
838840
for (final byte element : template) {
839841
System.out.format("%02X ", element);
840842
}
841-
System.out.println();
843+
System.out.println(); // NOPMD
842844
}
843845

844846
if (arg.wasGiven(printHighestVersion)) {
845847
final String version = changelogApiBuilder.getHighestSemanticVersion().toString();
846-
System.out.println(version);
848+
System.out.println(version); // NOPMD
847849
System.exit(0);
848850
}
849851

850852
if (arg.wasGiven(printHighestVersionTag)) {
851853
final SemanticVersion highestSemanticVersion =
852854
changelogApiBuilder.getHighestSemanticVersion();
853855
final String tag = highestSemanticVersion.findTag().orElse("");
854-
System.out.println(tag);
856+
System.out.println(tag); // NOPMD
855857
System.exit(0);
856858
}
857859

858860
if (arg.wasGiven(printNextVersion)) {
859861
final String version = changelogApiBuilder.getNextSemanticVersion().toString();
860-
System.out.println(version);
862+
System.out.println(version); // NOPMD
861863
System.exit(0);
862864
}
863865

864866
if (arg.wasGiven(printCurrentVersion)) {
865867
final String version = changelogApiBuilder.getCurrentSemanticVersion().toString();
866-
System.out.println(version);
868+
System.out.println(version); // NOPMD
867869
System.exit(0);
868870
}
869871

870872
} catch (final ArgumentException exception) {
871-
System.out.println(exception.getMessageAndUsage());
873+
System.out.println(exception.getMessageAndUsage()); // NOPMD
872874
System.exit(1);
873875
}
874876
}
@@ -891,7 +893,7 @@ private static void systemOutPrintln(final String systemOutPrintln) {
891893
if (Main.recordSystemOutPrintln) {
892894
Main.systemOutPrintln = systemOutPrintln;
893895
} else {
894-
System.out.println(systemOutPrintln);
896+
System.out.println(systemOutPrintln); // NOPMD
895897
}
896898
}
897899
}

0 commit comments

Comments
 (0)