16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

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

Replaced Git hooks by Git command in "VadereSimulator/pom.xml" to create...

Replaced Git hooks by Git command in "VadereSimulator/pom.xml" to create "VadereSimulator/resources/current_commit_hash.txt".
parent 29e5ea14
Pipeline #84352 failed with stages
in 3 seconds
......@@ -27,6 +27,13 @@
sub-command. This will will turn the ScenarioChecker on or off for the command
line. If the Checker detects an error the simulation will not be executed.
### Changed
- Removed directory `Documentation/version-control` which contained the Git hooks. The Git hooks are not required anymore. Instead, added `git rev-parse HEAD` to file `VadereSimulator/pom.xml` to create `VadereSimulator/resources/current_commit_hash.txt` during each build via `mvn compile`.
**Note:** The file `current_commit_hash.txt` is created during Maven's validation phase, i.e., before the actual build.
`
## v0.6 (2018-09-07)
### Added
......
Copy files "post-checkout", "post-merge", "post-applypatch" and "post-commit" to .git/hooks/
The file "current_commit_hash.txt" will be created after a change to the current commit status. To create this file without changes to the current commit, you can choose "Switch/Checkout..." on the Repository folder.
\ No newline at end of file
#!/bin/sh
exec git log -1 --format=format:"%H" > VadereSimulator/resources/current_commit_hash.txt
\ No newline at end of file
#!/bin/sh
exec Documentation/version-control/git-hook-vadere-software
\ No newline at end of file
#!/bin/sh
exec Documentation/version-control/git-hook-vadere-software
\ No newline at end of file
#!/bin/sh
exec Documentation/version-control/git-hook-vadere-software
\ No newline at end of file
#!/bin/sh
exec Documentation/version-control/git-hook-vadere-software
\ No newline at end of file
......@@ -36,6 +36,28 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>write_version_control_info_to_file</id>
<phase>validate</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>com.nativelibs4java</groupId>
<artifactId>maven-javacl-plugin</artifactId>
......@@ -262,4 +284,4 @@
</dependency>
</dependencies>
</project>
\ No newline at end of file
</project>
......@@ -13,10 +13,6 @@ public class HashGenerator {
private static final String CURRENT_COMMIT_HASH_RESOURCE = "/current_commit_hash.txt";
public static boolean isCommitHashAvailable() {
return getFirstStringTokenFromResource(CURRENT_COMMIT_HASH_RESOURCE) != null;
}
public static String commitHash() {
String commitHash = getFirstStringTokenFromResource(CURRENT_COMMIT_HASH_RESOURCE);
......
package org.vadere.simulator.io;
import org.junit.Test;
import org.vadere.simulator.projects.io.HashGenerator;
import static org.junit.Assert.assertTrue;
public class TestHashGenerator {
@Test
public void testIsCommitHashFileInstalled() {
assertTrue("missing commit hash file", HashGenerator.isCommitHashAvailable());
}
}
......@@ -119,4 +119,5 @@
<version>3.4</version>
</dependency>
</dependencies>
</project>
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