mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-26 20:16:02 +01:00
Merge pull request #1733 from KennyTV/abstraction
Add git commit hash to dumps
This commit is contained in:
commit
e3821e1741
@ -3,6 +3,7 @@ package us.myles.ViaVersion.commands.defaultsubs;
|
||||
import com.google.common.io.CharStreams;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import us.myles.ViaVersion.ViaManager;
|
||||
import us.myles.ViaVersion.api.Via;
|
||||
import us.myles.ViaVersion.api.command.ViaCommandSender;
|
||||
import us.myles.ViaVersion.api.command.ViaSubCommand;
|
||||
@ -43,7 +44,8 @@ public class DumpSubCmd extends ViaSubCommand {
|
||||
ProtocolRegistry.getSupportedVersions(),
|
||||
Via.getPlatform().getPlatformName(),
|
||||
Via.getPlatform().getPlatformVersion(),
|
||||
Via.getPlatform().getPluginVersion()
|
||||
Via.getPlatform().getPluginVersion(),
|
||||
ViaManager.class.getPackage().getImplementationVersion()
|
||||
);
|
||||
|
||||
Map<String, Object> configuration = Via.getPlatform().getConfigurationProvider().getValues();
|
||||
|
@ -10,8 +10,10 @@ public class VersionInfo {
|
||||
private final String platformName;
|
||||
private final String platformVersion;
|
||||
private final String pluginVersion;
|
||||
private final String implementationVersion;
|
||||
|
||||
public VersionInfo(String javaVersion, String operatingSystem, int serverProtocol, Set<Integer> enabledProtocols, String platformName, String platformVersion, String pluginVersion) {
|
||||
public VersionInfo(String javaVersion, String operatingSystem, int serverProtocol, Set<Integer> enabledProtocols,
|
||||
String platformName, String platformVersion, String pluginVersion, String implementationVersion) {
|
||||
this.javaVersion = javaVersion;
|
||||
this.operatingSystem = operatingSystem;
|
||||
this.serverProtocol = serverProtocol;
|
||||
@ -19,6 +21,7 @@ public class VersionInfo {
|
||||
this.platformName = platformName;
|
||||
this.platformVersion = platformVersion;
|
||||
this.pluginVersion = pluginVersion;
|
||||
this.implementationVersion = implementationVersion;
|
||||
}
|
||||
|
||||
public String getJavaVersion() {
|
||||
@ -48,5 +51,9 @@ public class VersionInfo {
|
||||
public String getPluginVersion() {
|
||||
return pluginVersion;
|
||||
}
|
||||
|
||||
public String getImplementationVersion() {
|
||||
return implementationVersion;
|
||||
}
|
||||
}
|
||||
|
||||
|
33
jar/pom.xml
33
jar/pom.xml
@ -34,13 +34,42 @@
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<!-- Libs Shading and Relocation -->
|
||||
<!-- Write git commit hash into build properties -->
|
||||
<plugin>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>scriptus</artifactId>
|
||||
<version>0.3.2</version>
|
||||
<configuration>
|
||||
<format>git-ViaVersion-${project.parent.version}:%s</format>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>describe</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<!--suppress MavenModelInspection -->
|
||||
<Implementation-Version>${describe}</Implementation-Version>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--Relocate all lib we use in order to fix class loading errors if we use different versions
|
||||
than already loaded libs (i.e. by Mojang -> gson)-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<version>3.2.2</version>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<minimizeJar>false</minimizeJar>
|
||||
|
Loading…
Reference in New Issue
Block a user