From 107f06962222b2e3b7aec79ea3248a73e9e697f0 Mon Sep 17 00:00:00 2001 From: Gabor Bata Date: Tue, 3 Oct 2023 10:34:33 +0200 Subject: [PATCH] Fix EOL in startup scripts --- build.gradle | 30 +++++++++++++++--- src/main/{dist => distribution}/install.sh | 0 src/main/{dist => distribution}/jpass.bat | 0 src/main/{dist => distribution}/jpass.command | 0 src/main/{dist => distribution}/jpass.desktop | 0 src/main/{dist => distribution}/jpass.ico | Bin src/main/{dist => distribution}/jpass.png | Bin src/main/{dist => distribution}/jpass.sh | 0 src/main/{dist => distribution}/jpass.svg | 0 src/main/{dist => distribution}/readme.txt | 0 10 files changed, 25 insertions(+), 5 deletions(-) rename src/main/{dist => distribution}/install.sh (100%) rename src/main/{dist => distribution}/jpass.bat (100%) rename src/main/{dist => distribution}/jpass.command (100%) rename src/main/{dist => distribution}/jpass.desktop (100%) rename src/main/{dist => distribution}/jpass.ico (100%) rename src/main/{dist => distribution}/jpass.png (100%) rename src/main/{dist => distribution}/jpass.sh (100%) rename src/main/{dist => distribution}/jpass.svg (100%) rename src/main/{dist => distribution}/readme.txt (100%) diff --git a/build.gradle b/build.gradle index 4ea8f894..12216ad9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.apache.tools.ant.filters.FixCrLfFilter + plugins { id 'java' id 'distribution' @@ -36,8 +38,8 @@ jar { } task copyConfig(type: Copy) { - from 'src/main/config' - into 'build/libs' + from "$projectDir/src/main/config" + into "$buildDir/libs" } distributions { @@ -45,15 +47,32 @@ distributions { distributionBaseName = 'jpass' contents { from jar - from { 'src/main/config' } + from "$projectDir/src/main/config" + from("$projectDir/src/main/distribution") { + include 'jpass.sh' + include 'jpass.desktop' + include 'jpass.command' + include 'install.sh' + filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('unix')) + } + from("$projectDir/src/main/distribution") { + include 'jpass.bat' + filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('dos')) + } + from("$projectDir/src/main/distribution") { + include 'jpass.ico' + include 'jpass.png' + include 'jpass.svg' + include 'readme.txt' + } into '/' } } } task createChecksum(type: org.gradle.crypto.checksum.Checksum, dependsOn: distZip) { - files = fileTree(dir: "${buildDir}/distributions").matching { include "*.zip" } - outputDir = new File("${buildDir}/distributions") + files = fileTree(dir: "$buildDir/distributions").matching { include "*.zip" } + outputDir = new File("$buildDir/distributions") algorithm = org.gradle.crypto.checksum.Checksum.Algorithm.SHA256 appendFileNameToChecksum.set(true) } @@ -127,3 +146,4 @@ jacocoTestCoverageVerification.dependsOn jacocoTestReport check.dependsOn jacocoTestCoverageVerification createChecksum.finalizedBy updateScoopManifest + diff --git a/src/main/dist/install.sh b/src/main/distribution/install.sh similarity index 100% rename from src/main/dist/install.sh rename to src/main/distribution/install.sh diff --git a/src/main/dist/jpass.bat b/src/main/distribution/jpass.bat similarity index 100% rename from src/main/dist/jpass.bat rename to src/main/distribution/jpass.bat diff --git a/src/main/dist/jpass.command b/src/main/distribution/jpass.command similarity index 100% rename from src/main/dist/jpass.command rename to src/main/distribution/jpass.command diff --git a/src/main/dist/jpass.desktop b/src/main/distribution/jpass.desktop similarity index 100% rename from src/main/dist/jpass.desktop rename to src/main/distribution/jpass.desktop diff --git a/src/main/dist/jpass.ico b/src/main/distribution/jpass.ico similarity index 100% rename from src/main/dist/jpass.ico rename to src/main/distribution/jpass.ico diff --git a/src/main/dist/jpass.png b/src/main/distribution/jpass.png similarity index 100% rename from src/main/dist/jpass.png rename to src/main/distribution/jpass.png diff --git a/src/main/dist/jpass.sh b/src/main/distribution/jpass.sh similarity index 100% rename from src/main/dist/jpass.sh rename to src/main/distribution/jpass.sh diff --git a/src/main/dist/jpass.svg b/src/main/distribution/jpass.svg similarity index 100% rename from src/main/dist/jpass.svg rename to src/main/distribution/jpass.svg diff --git a/src/main/dist/readme.txt b/src/main/distribution/readme.txt similarity index 100% rename from src/main/dist/readme.txt rename to src/main/distribution/readme.txt