diff --git a/.gitignore b/.gitignore index 762cd42..f3d6a29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /*/target/ +core/src/main/java/com/threerings/getdown/data/Build.java diff --git a/core/pom.xml b/core/pom.xml index 97e2d7c..085db37 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -56,6 +56,51 @@ + + maven-antrun-plugin + 1.8 + + + gen-build + generate-sources + + + + + + + + + + + + + + + run + + + + + + + maven-clean-plugin + 3.1.0 + + + + ${project.build.sourceDirectory}/ + + com/threerings/getdown/data/Build.java + + false + + + + + org.apache.maven.plugins maven-failsafe-plugin diff --git a/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl b/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl new file mode 100644 index 0000000..d3fdccf --- /dev/null +++ b/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl @@ -0,0 +1,22 @@ +// +// Getdown - application installer, patcher and launcher +// Copyright (C) 2004-2016 Getdown authors +// https://github.com/threerings/getdown/blob/master/LICENSE + +package com.threerings.getdown.data; + +/** + * Contains static data provided during the build process. + */ +public class Build { + + /** The date and time at which the code was built: in {@code yyyy-MM-dd HH:mm} format. */ + public static String time () { + return "@build_time@"; + } + + /** The Maven version of the Getdown project. */ + public static String version () { + return "@build_version@"; + } +} diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java b/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java index 37ea675..ef494e1 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -47,6 +47,7 @@ import com.samskivert.util.StringUtil; import com.threerings.getdown.data.Application.UpdateInterface.Step; import com.threerings.getdown.data.Application; +import com.threerings.getdown.data.Build; import com.threerings.getdown.data.Resource; import com.threerings.getdown.data.SysProps; import com.threerings.getdown.net.Downloader; @@ -150,6 +151,8 @@ public abstract class Getdown extends Thread return; } + log.info("Getdown starting", "version", Build.version(), "built", Build.time()); + // determine whether or not we can write to our install directory File instdir = _app.getLocalPath(""); if (!instdir.canWrite()) {