File tree Expand file tree Collapse file tree
core/src/main/java/edu/wpi/grip/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,20 @@ plugins {
1515}
1616apply plugin : ' nebula-aggregate-javadocs'
1717
18+
19+ /*
20+ * Gets the version name from the latest Git tag
21+ * http://ryanharter.com/blog/2013/07/30/automatic-versioning-with-git-and-gradle/
22+ */
23+ def getVersionName = { ->
24+ def stdout = new ByteArrayOutputStream ()
25+ exec {
26+ commandLine ' git' , ' describe' , ' --tags'
27+ standardOutput = stdout
28+ }
29+ return stdout. toString(). trim()
30+ }
31+
1832allprojects {
1933 apply plugin : ' java'
2034 apply plugin : ' application'
@@ -36,7 +50,7 @@ allprojects {
3650 testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
3751 }
3852
39- version = ' 1.0.0 '
53+ version = getVersionName()
4054
4155 compileJava {
4256 options. compilerArgs << " -g"
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ public synchronized void publish(final LogRecord record) {
6868 fileHandler .setFormatter (new SimpleFormatter ());//log in text, not xml
6969
7070 globalLogger .config ("Configuration done." );//Log that we are done setting up the logger
71+ globalLogger .config ("GRIP Version: " + edu .wpi .grip .core .Main .class .getPackage ().getImplementationVersion ());
7172
7273 } catch (IOException exception ) {//Something happened setting up file IO
7374 throw new IllegalStateException ("Failed to configure the Logger" , exception );
You can’t perform that action at this time.
0 commit comments