From 4dc685f89516981e0283412d8b33ea300c0f59d6 Mon Sep 17 00:00:00 2001 From: Christopher Schnick Date: Sat, 18 Jun 2022 01:17:08 +0200 Subject: [PATCH] Release fixes --- api/build.gradle | 6 +++- beacon/build.gradle | 2 +- build.gradle | 6 ++++ core/build.gradle | 2 +- deps | 2 +- extension/build.gradle | 2 +- gradlew | 0 jreleaser.gradle | 52 +++++++++++------------------ misc/canonical_version | 1 + misc/changelogs/0.1.txt | 1 + misc/discord_full.tpl | 11 ++++++ misc/discord_pre.tpl | 12 +++++++ misc/github_full.tpl | 1 + misc/github_pre.tpl | 1 + version => misc/version | 0 samples/sample_program/build.gradle | 2 +- 16 files changed, 62 insertions(+), 39 deletions(-) create mode 100644 build.gradle mode change 100644 => 100755 gradlew create mode 100644 misc/canonical_version create mode 100644 misc/changelogs/0.1.txt create mode 100644 misc/discord_full.tpl create mode 100644 misc/discord_pre.tpl create mode 100644 misc/github_full.tpl create mode 100644 misc/github_pre.tpl rename version => misc/version (100%) diff --git a/api/build.gradle b/api/build.gradle index aec245a1..73c97d0c 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -10,7 +10,7 @@ apply from: "$rootDir/deps/junit.gradle" apply from: 'publish.gradle' apply from: "$rootDir/deps/publish-base.gradle" -version = file('../version').text +version = file('../misc/version').text group = 'io.xpipe' archivesBaseName = 'api' @@ -18,6 +18,10 @@ repositories { mavenCentral() } +test { + enabled = false +} + dependencies { // Fix warnings about missing annotations compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "2.13.0" diff --git a/beacon/build.gradle b/beacon/build.gradle index eea5327d..0cca5ece 100644 --- a/beacon/build.gradle +++ b/beacon/build.gradle @@ -15,7 +15,7 @@ configurations { compileOnly.extendsFrom(dep) } -version = file('../version').text +version = file('../misc/version').text group = 'io.xpipe' archivesBaseName = 'beacon' diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..b11c945e --- /dev/null +++ b/build.gradle @@ -0,0 +1,6 @@ +plugins { + id 'org.jreleaser' version '1.0.0' +} + +version file('misc/version').text +apply from: 'jreleaser.gradle' \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index 3a88d39f..00b2e1f3 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -17,7 +17,7 @@ configurations { testImplementation.extendsFrom(dep) } -version = file('../version').text +version = file('../misc/version').text group = 'io.xpipe' archivesBaseName = 'core' diff --git a/deps b/deps index 49a1ad06..cbac51bc 160000 --- a/deps +++ b/deps @@ -1 +1 @@ -Subproject commit 49a1ad06bc6872f72c1d20ea864d24f3df59b7c5 +Subproject commit cbac51bc63e727c0ff5038cace4e91daa168a556 diff --git a/extension/build.gradle b/extension/build.gradle index 0b3f8daa..14842902 100644 --- a/extension/build.gradle +++ b/extension/build.gradle @@ -21,7 +21,7 @@ configurations { compileOnly.extendsFrom(dep) } -version = file('../version').text +version = file('../misc/version').text group = 'io.xpipe' archivesBaseName = 'extension' diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/jreleaser.gradle b/jreleaser.gradle index c19cc619..5fcd8167 100644 --- a/jreleaser.gradle +++ b/jreleaser.gradle @@ -1,28 +1,25 @@ def isPreRelease = project.version.endsWith('-pre') def isFullRelease = !isPreRelease && !project.version.endsWith('-SNAPSHOT') def proj = project -def canonicalVersion = file('canonical_version').text +def canonicalVersion = file('misc/canonical_version').text jreleaser { environment { - properties.put('rawChangelog', file("changelogs/${canonicalVersion}.txt").exists() ? - file("changelogs/${canonicalVersion}.txt").text.replace('\r\n', '\n') : "") + properties.put('rawChangelog', file("misc/changelogs/${canonicalVersion}.txt").exists() ? + file("misc/changelogs/${canonicalVersion}.txt").text.replace('\r\n', '\n') : "") } project { - name = 'Pdx-Unlimiter' - description = 'A smart savegame manager, editor, and toolbox for all current major Paradox Grand Strategy games.' - longDescription = 'The Pdx-Unlimiter is a tool for all major Paradox Grand Strategy games that provides a ' + - 'powerful and smart savegame manager to quickly organize and play all of your savegames with ease. ' + - 'Furthermore, it also comes with an Ironman converter, a powerful savegame editor, some savescumming ' + - 'tools, integrations for various other great community-made tools for all major Paradox games.' - website = 'https://github.com/crschnick/pdx_unlimiter' + name = 'X-Pipe Java' + description = '' + longDescription = '' + website = 'https://github.com/xpipe-io/xpipe_java' authors = ['Christopher Schnick'] - license = 'GPL3' - copyright = ' ' + license = 'MIT' + copyright = '2022, Christopher Schnick' java { - groupId = 'com.crschnick.pdxu' + groupId = 'io.xpipe' version = '17' multiProject = true } @@ -38,11 +35,11 @@ jreleaser { github { skipRelease = !isFullRelease && !isPreRelease skipTag = !isFullRelease && !isPreRelease - owner = 'crschnick' + owner = 'xpipe-io' overwrite = false tagName = '{{projectVersion}}' releaseName = '{{tagName}}' - token = proj.hasProperty("PDXU_GITHUB_TOKEN") ? proj.property("PDXU_GITHUB_TOKEN") : System.getenv("JRELEASER_GITHUB_TOKEN") + token = proj.hasProperty("XPIPE_GITHUB_TOKEN") ? proj.property("XPIPE_GITHUB_TOKEN") : System.getenv("XPIPE_GITHUB_TOKEN") files = true artifacts = true @@ -70,30 +67,19 @@ jreleaser { } } distributions { - app { - if (org.gradle.internal.os.OperatingSystem.current().isWindows()) { - artifact { - distributionType = 'BINARY' - path = 'build/pdx_unlimiter-windows.zip' - platform = 'windows' - } - } else { - artifact { - distributionType = 'BINARY' - path = 'build/pdx_unlimiter-linux.zip' - platform = 'linux' - } + api { + artifact { + distributionType = 'SINGLE_JAR' + path = 'api/build/libs/api-{{version}}.jar' + transform = 'build/xpipe-api-{{version}}.jar' } } } announce { - enabled = isFullRelease || isPreRelease discord { - active = 'ALWAYS' - - webhook = proj.hasProperty("PDXU_DISCORD_WEBHOOK") ? proj.property("PDXU_DISCORD_WEBHOOK") : System.getenv("JRELEASER_DISCORD_WEBHOOK") - + active = 'RELEASE' + webhook = proj.hasProperty("XPIPE_DISCORD_WEBHOOK") ? proj.property("XPIPE_DISCORD_WEBHOOK") : System.getenv("XPIPE_DISCORD_WEBHOOK") messageTemplate = isFullRelease ? 'misc/discord_full.tpl' : 'misc/discord_pre.tpl' } } diff --git a/misc/canonical_version b/misc/canonical_version new file mode 100644 index 00000000..ceab6e11 --- /dev/null +++ b/misc/canonical_version @@ -0,0 +1 @@ +0.1 \ No newline at end of file diff --git a/misc/changelogs/0.1.txt b/misc/changelogs/0.1.txt new file mode 100644 index 00000000..6d6fa499 --- /dev/null +++ b/misc/changelogs/0.1.txt @@ -0,0 +1 @@ +Initial Release! \ No newline at end of file diff --git a/misc/discord_full.tpl b/misc/discord_full.tpl new file mode 100644 index 00000000..1038d4c3 --- /dev/null +++ b/misc/discord_full.tpl @@ -0,0 +1,11 @@ +@everyone + +🚀 {{projectName}} {{projectVersion}} has been released: {{releaseNotesUrl}} + +If you have already installed {{projectName}} and have updates enabled, +this update will be automatically installed when launching it the next time. + +You can get the standalone version here: {{releaseNotesUrl}} + +Changes in {{projectVersion}}: +{{{rawChangelog}}} \ No newline at end of file diff --git a/misc/discord_pre.tpl b/misc/discord_pre.tpl new file mode 100644 index 00000000..2d4ee937 --- /dev/null +++ b/misc/discord_pre.tpl @@ -0,0 +1,12 @@ +@everyone + +🚀 {{projectName}} {{projectVersion}} has been released: {{releaseNotesUrl}} + +Note that as this is not a final release, there might still be some small issues with it. +Please report them if you stumble upon one. + +Also note that pre-releases are not downloaded by the automatic updater +until they are ready for a full release or you have opted in to receiving pre-releases. + +Changes in {{projectVersion}}: +{{{rawChangelog}}} \ No newline at end of file diff --git a/misc/github_full.tpl b/misc/github_full.tpl new file mode 100644 index 00000000..e18b2bb5 --- /dev/null +++ b/misc/github_full.tpl @@ -0,0 +1 @@ +{{{rawChangelog}}} diff --git a/misc/github_pre.tpl b/misc/github_pre.tpl new file mode 100644 index 00000000..e18b2bb5 --- /dev/null +++ b/misc/github_pre.tpl @@ -0,0 +1 @@ +{{{rawChangelog}}} diff --git a/version b/misc/version similarity index 100% rename from version rename to misc/version diff --git a/samples/sample_program/build.gradle b/samples/sample_program/build.gradle index 37d3166f..c9a55753 100644 --- a/samples/sample_program/build.gradle +++ b/samples/sample_program/build.gradle @@ -15,7 +15,7 @@ repositories { // The used X-Pipe API version. // In your case, you have to fix this value to the target API version, // which you can find at https://search.maven.org/artifact/io.xpipe/api/ -def apiVersion = file('../../version').text +def apiVersion = file('../../misc/version').text dependencies { implementation project(':core')