-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reading version into Java from pom properties
Small improvements of the web page layout Version 2.2.1
- Loading branch information
Showing
31 changed files
with
409 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
package info.teksol.mindcode; | ||
|
||
public class Version { | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
private static final String VERSION = "2.2.0"; | ||
public class Version { | ||
|
||
public static String getVersion() { | ||
return VERSION; | ||
try (InputStream in = Version.class.getResourceAsStream("mindcode.properties")) { | ||
final Properties properties = new Properties(); | ||
properties.load(in); | ||
return properties.getProperty("mindcode.version"); | ||
} | ||
catch (IOException e) { | ||
throw new RuntimeException("Error obtaining version information", e); | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
mindcode/src/main/resources-filtered/info/teksol/mindcode/mindcode.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Version | ||
mindcode.version = ${revision} |
13 changes: 13 additions & 0 deletions
13
mindcode/src/test/java/info/teksol/mindcode/VersionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package info.teksol.mindcode; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
|
||
class VersionTest { | ||
|
||
@Test | ||
void readsVersion() { | ||
assertDoesNotThrow(Version::getVersion); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
webapp/src/main/resources/samples/mindcode/2-thorium-reactor-stopper.mnd
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
webapp/src/main/resources/samples/mindcode/3-multi-thorium-reactor.mnd
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
webapp/src/main/resources/samples/mindcode/7-bind-one-unit.mnd
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
webapp/src/main/resources/samples/mindcode/8-heal-damaged-building.mnd
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
webapp/src/main/resources/samples/mindcode/9-function-decl.mnd
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
...dcode/1-control-units-using-variables.mnd → ...es/samples/mindcode/control-two-units.mnd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.