Skip to content

Commit

Permalink
feat: using new build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Oct 3, 2024
1 parent 828200d commit ad7cb42
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 70 deletions.
41 changes: 11 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
apply plugin: 'java-library'

buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'se.bjurr.gradle:gradle-scripts:2.+'
}
plugins {
id "se.bjurr.gradle.conventional-release" version "0.+"
id "se.bjurr.gradle.update-versions" version "0.+"
id "se.bjurr.gradle.java-convention" version "0.+"
}
project.ext.buildConfig = [
repoType: "COMMAND",
publishing: [
relocate: [
"org:org",
"com:com"
]
],
manifest: [
mainClass: 'se.bjurr.gitchangelog.main.Main'
]
]
apply from: project.buildscript.classLoader.getResource('main.gradle').toURI()

shadowJar {
exclude 'META-INF/versions/21/**'
exclude 'META-INF/versions/21/**'
}

dependencies {
implementation 'se.bjurr.gitchangelog:git-changelog-lib:2.1.3'
implementation 'se.softhouse:jargo:0.4.14'
implementation 'org.slf4j:slf4j-simple:2.0.6'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.openjdk.nashorn:nashorn-core:15.4'
implementation 'se.bjurr.gitchangelog:git-changelog-lib:2.1.3'
implementation 'se.softhouse:jargo:0.4.14'
implementation 'org.slf4j:slf4j-simple:2.0.6'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.openjdk.nashorn:nashorn-core:15.4'

testImplementation 'junit:junit:4.13.2'
testImplementation 'junit:junit:4.13.2'
}

56 changes: 31 additions & 25 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
{
"templatePath": "changelog.json",

"fromRepo": ".",
"fromCommit": "0000000000000000000000000000000000000000",
"toRef": "refs/heads/master",

"ignoreCommitsIfMessageMatches": "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*",
"readableTagName": "/([^/]+?)$",
"dateFormat": "YYYY-MM-dd HH:mm:ss",
"untaggedName": "Next release",
"noIssueName": "Other changes",
"timeZone": "UTC",
"removeIssueFromMessage": "true",

"jiraServer": "https://jiraserver/jira",
"jiraIssuePattern": "\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b",

"gitHubApi": "https://api.github.com/repos/tomasbjerre/git-changelog-command-line",
"gitHubIssuePattern": "#([0-9]+)",

"customIssues": [
{ "name": "Incident", "pattern": "INC[0-9]*", "link": "http://inc/${PATTERN_GROUP}" },
{ "name": "CQ", "pattern": "CQ([0-9]+)", "link": "http://cq/${PATTERN_GROUP_1}" },
{ "name": "Bugs", "pattern": "#bug" }
]
"templatePath": "changelog.json",
"fromRepo": ".",
"fromCommit": "0000000000000000000000000000000000000000",
"toRef": "refs/heads/master",
"ignoreCommitsIfMessageMatches": "^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*",
"readableTagName": "/([^/]+?)$",
"dateFormat": "YYYY-MM-dd HH:mm:ss",
"untaggedName": "Next release",
"noIssueName": "Other changes",
"timeZone": "UTC",
"removeIssueFromMessage": "true",
"jiraServer": "https://jiraserver/jira",
"jiraIssuePattern": "\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b",
"gitHubApi": "https://api.github.com/repos/tomasbjerre/git-changelog-command-line",
"gitHubIssuePattern": "#([0-9]+)",
"customIssues": [
{
"name": "Incident",
"pattern": "INC[0-9]*",
"link": "http://inc/${PATTERN_GROUP}"
},
{
"name": "CQ",
"pattern": "CQ([0-9]+)",
"link": "http://cq/${PATTERN_GROUP_1}"
},
{
"name": "Bugs",
"pattern": "#bug"
}
]
}
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#Sun Jul 07 08:01:20 CEST 2024
#
#Thu Oct 03 19:53:35 CEST 2024
description="Command line tool that generates changelog from a GIT repository."
version=2.3.0
group=se.bjurr.gitchangelog
mainClass=se.bjurr.gitchangelog.main.Main
relocate=org\:org,com\:com
repoType=COMMAND
version=2.3.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
}
22 changes: 12 additions & 10 deletions src/main/java/se/bjurr/gitchangelog/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ public static void main(final String args[]) throws Exception {
}
if (arg.wasGiven(ignoreCommitsOlderThanArgument)) {
final Date date =
new SimpleDateFormat(DEFAULT_DATEFORMAT).parse(arg.get(ignoreCommitsOlderThanArgument));
new SimpleDateFormat(DEFAULT_DATEFORMAT) // NOPMD
.parse(arg.get(ignoreCommitsOlderThanArgument));
changelogApiBuilder.withIgnoreCommitsOlderThan(date);
}
if (arg.wasGiven(ignoreTagsIfNameMatchesArgument)) {
Expand Down Expand Up @@ -826,49 +827,50 @@ public static void main(final String args[]) throws Exception {
}

if (arg.wasGiven(showDebugInfo)) {
System.out.println(
System.out.println( // NOPMD
"Settings:\n"
+ new GsonBuilder()
.setPrettyPrinting()
.create()
.toJson(changelogApiBuilder.getSettings()));
System.out.println("Template:\n\n" + changelogApiBuilder.getTemplateString() + "\n\n");
System.out.println( // NOPMD
"Template:\n\n" + changelogApiBuilder.getTemplateString() + "\n\n"); // NOPMD
final byte[] template =
changelogApiBuilder.getTemplateString().getBytes(StandardCharsets.UTF_8);
for (final byte element : template) {
System.out.format("%02X ", element);
}
System.out.println();
System.out.println(); // NOPMD
}

if (arg.wasGiven(printHighestVersion)) {
final String version = changelogApiBuilder.getHighestSemanticVersion().toString();
System.out.println(version);
System.out.println(version); // NOPMD
System.exit(0);
}

if (arg.wasGiven(printHighestVersionTag)) {
final SemanticVersion highestSemanticVersion =
changelogApiBuilder.getHighestSemanticVersion();
final String tag = highestSemanticVersion.findTag().orElse("");
System.out.println(tag);
System.out.println(tag); // NOPMD
System.exit(0);
}

if (arg.wasGiven(printNextVersion)) {
final String version = changelogApiBuilder.getNextSemanticVersion().toString();
System.out.println(version);
System.out.println(version); // NOPMD
System.exit(0);
}

if (arg.wasGiven(printCurrentVersion)) {
final String version = changelogApiBuilder.getCurrentSemanticVersion().toString();
System.out.println(version);
System.out.println(version); // NOPMD
System.exit(0);
}

} catch (final ArgumentException exception) {
System.out.println(exception.getMessageAndUsage());
System.out.println(exception.getMessageAndUsage()); // NOPMD
System.exit(1);
}
}
Expand All @@ -891,7 +893,7 @@ private static void systemOutPrintln(final String systemOutPrintln) {
if (Main.recordSystemOutPrintln) {
Main.systemOutPrintln = systemOutPrintln;
} else {
System.out.println(systemOutPrintln);
System.out.println(systemOutPrintln); // NOPMD
}
}
}

0 comments on commit ad7cb42

Please sign in to comment.