添加 gradle 版本号代码内动态替换,添加欢迎语开关参数

This commit is contained in:
A.C.Sukazyo Eyre 2021-11-26 22:26:02 +08:00
parent c715287fb7
commit cef31aa1fe
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
3 changed files with 12 additions and 12 deletions

View File

@ -6,7 +6,7 @@ plugins {
}
group 'cc.sukazyo'
version '0.3.0'
version '0.3.1'
project.ext.archiveBaseName = 'Coeur_Morny_Cono'
project.ext.artifactId = 'morny-coeur'
mainClassName = 'cc.sukazyo.cono.morny.MornyCoeur'
@ -24,6 +24,12 @@ dependencies {
}
compileJava.doFirst {
ant.replaceregexp(match:'VERSION = ["a-zA-Z0-9.\\-_+@]+;', replace:"VERSION = \"$project.version\";", flags:'g', byline:true) {
fileset(dir: 'src/main/java/cc/sukazyo/cono/morny', includes: 'MornySystem.java')
}
}
test {
useJUnitPlatform()
}
@ -46,15 +52,6 @@ tasks.test {
useJUnitPlatform()
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'application'
shadowJar {
archiveBaseName.set("${project.ext.archiveBaseName}")
archiveVersion.set("${project.version}")
archiveClassifier.set("fat")
}
shadowJar {
archiveBaseName.set("${project.ext.archiveBaseName}")
archiveVersion.set("${project.version}")

View File

@ -15,7 +15,10 @@ public class MornyCoeur {
public static void main (String[] args) {
if (!(args.length > 1 && "--no-hello".equals(args[1])))
logger.info(MornyHello.MORNY_PREVIEW_IMAGE_ASCII);
if (args.length > 1 && "--only-hello".equals(args[1]))
return;
logger.info("System Starting");
configureSafeExit();

View File

@ -6,7 +6,7 @@ import java.net.URISyntaxException;
public class MornySystem {
public static final String VERSION = "0.3.0";
public static final String VERSION = "@G_DEV_VERSION@";
public static String getJarMd5() {
try {