using shadowJar to build a runnable version
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -87,3 +87,4 @@ local.properties
|
|||||||
#.project
|
#.project
|
||||||
|
|
||||||
/.gradle/
|
/.gradle/
|
||||||
|
/build/
|
||||||
|
18
build.gradle
18
build.gradle
@ -1,9 +1,13 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
|
id 'application'
|
||||||
|
id 'com.github.johnrengelman.shadow' version '8.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'de.jottyfan.csv2camt'
|
group 'de.jottyfan.csv2camt'
|
||||||
version '0.0.0'
|
version '0.0.1'
|
||||||
|
|
||||||
|
mainClassName = 'de.jottyfan.csv2camt.Main'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -16,4 +20,14 @@ dependencies {
|
|||||||
|
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
|
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
manifest {
|
||||||
|
attributes(
|
||||||
|
'Main-Class': mainClassName,
|
||||||
|
'Implementation-Title': project.name,
|
||||||
|
'Implementation-Version': version
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -7,6 +7,15 @@ package de.jottyfan.csv2camt;
|
|||||||
*/
|
*/
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
new Converter().readCsv(args[1]).writeCamt();
|
Package pkg = Main.class.getPackage();
|
||||||
|
String version = (pkg == null || pkg.getImplementationVersion() == null) ? "?" : pkg.getImplementationVersion();
|
||||||
|
System.out.println("--------------------------------------");
|
||||||
|
System.out.println(String.format("- csv2camt - version %s", version));
|
||||||
|
System.out.println("--------------------------------------");
|
||||||
|
if (args.length < 1) {
|
||||||
|
System.out.println(String.format("usage: java -jar csv2camt-%s-all.jar filename.csv", version));
|
||||||
|
} else {
|
||||||
|
new Converter().readCsv(args[0]).writeCamt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user