Commit b6749eab authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

Moved "Version.java" from "VadereSimulator" to "VadereUtil", "pom.xml" files...

Moved "Version.java" from "VadereSimulator" to "VadereUtil", "pom.xml" files and added "--version" to "VadereConsole.java
parent a4a8e223
Pipeline #225785 passed with stages
in 134 minutes and 41 seconds
......@@ -26,7 +26,6 @@ VadereGui/*.svg
VadereGui/*.mov
VadereGui/testResources/**/*.legacy
VadereUtils/testreports/*.txt
VadereSimulator/resources/current_commit_hash.txt
VadereSimulator/testResources/**/*.legacy
# Python (byte-compiled, optimized, DLL files etc.)
......
......@@ -6,6 +6,7 @@
### Added
- Added "--version" to "vadere-console.jar".
- Added a Vadere logo (a simple "V") as window and task bar icon to get rid of the lame default Java icon.
- Added "Psychology" tab in GUI which shows all psychology-related attributes of a scenario (which are stored in JSON node "attributesPsychology").
- Add `PedestrianPotentialProcessor` which writes out different potentials (TARGET (target potential), OBSTACLE (obstacle potential), PEDESTRIAN (agent potential), ALL (sum of all)) configureable via its `Attributes`. It only writes those potentials if the used main model for the simulation is a `PotentialFieldModel`.
......
......@@ -68,8 +68,9 @@ ProjectView.JSONDisplay.label=Nothing selected
ProjectView.btnAbout.tooltip=About
ProjectView.about.title=About
ProjectView.title=Vadere
ProjectView.version= Version {0}
ProjectView.license.text=This software is licensed under the {0}
ProjectView.version.release=Version
ProjectView.version.commit=Commit hash
ProjectView.license.text=License
ProjectView.aboutDialog.label=About Vadere
ProjectView.startDialog.label=Vadere GUI
ProjectView.startDialog.text=Create a new Project or load an existing project
......
......@@ -68,8 +68,9 @@ ProjectView.warning.lwjgl.title=Warnung
ProjectView.warning.opencl.title=Warnung
ProjectView.warning.opencl.text=OpenCL-Beschleunigung deaktiviert.\nEs konnte keine OpenCL Unterst\u00FCtzung gefunden werden.\nTreiber-Aktualisierung kann das Problem beheben.
ProjectView.title=Vadere
ProjectView.version= Version {0}
ProjectView.license.text=Dieses Software ist unter der {0} lizenziert
ProjectView.version.release=Version
ProjectView.version.commit=Commit-Hash
ProjectView.license.text=Lizenz
ProjectView.aboutDialog.label=\u00DCber Vadere
ProjectView.startDialog.label=Vadere GUI
ProjectView.startDialog.text=Erstellen oder laden Sie ein existierendes Projekt
......
......@@ -20,7 +20,7 @@ public class PostVisualisation {
ArgumentParser argumentParser = vadereArgumentParser.getArgumentParser();
try {
vadereArgumentParser.parseArgsAndProcessOptions(args);
vadereArgumentParser.parseArgsAndProcessInitialOptions(args);
} catch (UnsatisfiedLinkError linkError) {
System.err.println("[LWJGL]: " + linkError.getMessage());
} catch (ArgumentParserException e) {
......
......@@ -35,7 +35,7 @@ public class VadereApplication {
Namespace ns;
try {
ns = vadereArgumentParser.parseArgsAndProcessOptions(args);
ns = vadereArgumentParser.parseArgsAndProcessInitialOptions(args);
Messages.loadLanguageFromPreferences(VadereApplication.class);
ProjectView.start(ns.getString("project-path"));
} catch (UnsatisfiedLinkError linkError) {
......
......@@ -4,7 +4,7 @@ import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.gui.projectview.view.VDialogManager;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.VadereProject;
import org.vadere.simulator.projects.io.IOVadere;
import org.vadere.simulator.projects.migration.MigrationOptions;
......
......@@ -4,7 +4,7 @@ import javax.swing.*;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.components.utils.Resources;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import java.awt.event.ActionEvent;
import java.text.MessageFormat;
......@@ -20,12 +20,17 @@ public class ActionShowAboutDialog extends AbstractAction {
@Override
public void actionPerformed(final ActionEvent event) {
String releaseVersion = String.format("%s: %s", Messages.getString("ProjectView.version.release"), Version.releaseNumber());
String versionControlInfo = String.format("%s: %s", Messages.getString("ProjectView.version.commit"), Version.getVersionControlCommitHash());
String license = String.format("%s: %s", Messages.getString("ProjectView.license.text"), "GNU Lesser General Public License (LGPL)");
String text = "";
text += "<html>";
text += "<font size =\"3\"><em>" + MessageFormat.format(Messages.getString("ProjectView.version"), Version.releaseNumber()) + "</em></font><br>";
text += "<font size =\"3\"><em>" + releaseVersion + "</em></font><br>";
text += "<font size =\"3\"><em>" + versionControlInfo + "</em></font><br>";
text += "<font size =\"3\"><em>" + license + "</em></font><br>";
text += "<br>";
text += "<font size =\"3\">www.vadere.org</font><br>";
text += "<font size =\"3\">" + MessageFormat.format(Messages.getString("ProjectView.license.text"), "GNU Lesser General Public License (<em>LGPL</em>).") + "</font>";
text += "<font size =\"3\">www.vadere.org</font>";
text += "</html>";
JOptionPane.showMessageDialog(null,
......
......@@ -48,29 +48,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>write-version-control-info-to-file</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<!-- Write a file with current version of Vadere to get reproducible simulations. -->
<configuration>
<executable>git</executable>
<arguments>
<argument>rev-parse</argument>
<argument>HEAD</argument>
</arguments>
<outputFile>resources/current_commit_hash.txt</outputFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
......
......@@ -7,7 +7,7 @@ import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import net.sourceforge.argparse4j.inf.Subparsers;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.entrypoints.cmd.commands.MigrationSubCommand;
import org.vadere.simulator.entrypoints.cmd.commands.ProjectRunSubCommand;
import org.vadere.simulator.entrypoints.cmd.commands.ScenarioRunSubCommand;
......@@ -34,7 +34,7 @@ public class VadereConsole {
addSubCommandsToParser(argumentParser);
try {
Namespace ns = vadereArgumentParser.parseArgsAndProcessOptions(args);
Namespace ns = vadereArgumentParser.parseArgsAndProcessInitialOptions(args);
SubCommandRunner sRunner = ns.get("func");
StdOutErrLog.addStdOutErrToLog();
sRunner.run(ns, argumentParser);
......
......@@ -3,7 +3,7 @@ package org.vadere.simulator.entrypoints.cmd.commands;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.Namespace;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.entrypoints.cmd.SubCommandRunner;
import org.vadere.simulator.projects.migration.jsontranformation.JsonMigrationAssistant;
import org.vadere.simulator.projects.migration.MigrationAssistant;
......
......@@ -5,7 +5,7 @@ import net.sourceforge.argparse4j.inf.Namespace;
import org.apache.commons.lang3.tuple.Pair;
import org.vadere.simulator.entrypoints.ScenarioFactory;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.entrypoints.cmd.SubCommandRunner;
import org.vadere.simulator.models.potential.fields.IPotentialField;
import org.vadere.simulator.models.potential.fields.PotentialFieldDistancesBruteForce;
......@@ -38,8 +38,6 @@ public class UtilsSubCommand implements SubCommandRunner {
methods.put("getHash", Pair.of("[-i: file, -o: ignored]", this::getHash));
methods.put("binCache", Pair.of("[-i: file, -o: directory]",this::calculateBinCache));
methods.put("txtCache", Pair.of("[-i: file, -o: directory]",this::calculateTextCache));
methods.put("getVersion", Pair.of("returns version",this::getVersion));
methods.put("getCommitHash", Pair.of("returns commit hash",this::getCommitHash));
}
public String[] methodsString(){
......@@ -90,20 +88,6 @@ public class UtilsSubCommand implements SubCommandRunner {
calculateCache(ns, parser, CacheType.TXT_CACHE);
}
/**
* Returns the current version
*/
private void getVersion(Namespace ns, ArgumentParser parser) throws Exception{
System.out.println(Version.releaseNumber());
}
private void getCommitHash(Namespace ns, ArgumentParser parser) throws Exception{
System.out.println(Version.commitHash());
/* String filename = Resources.class.getResource("/current_commit_hash.txt").getFile();
String commit_hash = (new BufferedReader(new FileReader(filename))).readLine();
System.out.println(commit_hash); */
}
private void calculateBinCache(Namespace ns, ArgumentParser parser) throws Exception{
calculateCache(ns, parser, CacheType.BIN_CACHE);
}
......
......@@ -3,7 +3,7 @@ package org.vadere.simulator.projects.io;
import java.io.IOException;
import java.util.List;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.models.MainModel;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.ScenarioStore;
......@@ -101,7 +101,7 @@ public class JsonConverter {
node.put("description", scenarioStore.getDescription());
node.put("release", Version.releaseNumber());
if (commitHashIncluded)
node.put("commithash", Version.commitHash());
node.put("commithash", Version.getVersionControlCommitHash());
}
private static ObjectNode serializeVadereNode(ScenarioStore scenarioStore) {
......
package org.vadere.simulator.projects.migration;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.migration.incident.IncidentMigrationAssistant;
import org.vadere.simulator.projects.migration.jsontranformation.JsonMigrationAssistant;
import org.vadere.util.io.IOUtils;
......
package org.vadere.simulator.projects.migration;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import java.util.Objects;
......
......@@ -7,7 +7,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.migration.incident.incidents.AddTextNodeIncident;
import org.vadere.simulator.projects.migration.incident.incidents.DeletionIncident;
import org.vadere.simulator.projects.migration.incident.incidents.Incident;
......@@ -20,7 +20,7 @@ import org.vadere.simulator.projects.migration.incident.incidents.specialized.Mo
import org.vadere.state.attributes.AttributesSimulation;
import org.vadere.state.util.StateJsonConverter;
import static org.vadere.simulator.entrypoints.Version.*;
import static org.vadere.util.version.Version.*;
public class IncidentDatabase {
......
......@@ -2,7 +2,7 @@ package org.vadere.simulator.projects.migration.incident;
import com.fasterxml.jackson.databind.JsonNode;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.migration.MigrationAssistant;
import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.MigrationOptions;
......
package org.vadere.simulator.projects.migration.incident.helper;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.migration.MigrationAssistant;
import org.vadere.simulator.projects.migration.MigrationException;
import org.vadere.simulator.projects.migration.MigrationOptions;
......
package org.vadere.simulator.projects.migration.incident.incidents;
import org.vadere.simulator.projects.migration.incident.Tree;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.migration.MigrationException;
import com.fasterxml.jackson.databind.JsonNode;
......
......@@ -3,7 +3,7 @@ package org.vadere.simulator.projects.migration.jsontranformation;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.vadere.simulator.entrypoints.Version;
import org.vadere.util.version.Version;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.io.JsonConverter;
import org.vadere.simulator.projects.migration.MigrationException;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment