Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed May 30, 2024
1 parent 75be957 commit 226f964
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public interface ServerBuildInfo {
*
* @return the {@code ServerBuildInfo}
*/
// TODO: This works but, I have no clue if this is correct codewise
static <T extends ServerBuildInfo> @NotNull T buildInfo() {
//<editor-fold defaultstate="collapsed" desc="Holder">
/**
Expand Down
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/velocity-init-manifest.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tasks.withType<Jar> {
val gitHash = indraGit.commit()?.name?.substring(0, 8) ?: "unknown"
val gitBranch = indraGit.branchName() ?: "unknown"
val velocityVersion = project.version.toString()
val velocityVersionButWithoutTheDashSnapshot = velocityVersion.replace("-SNAPSHOT", "")
val implementationVersion = "$velocityVersion-${buildNumber ?: "DEV"}-$gitHash"
val velocityHumanVersion: String =
if (project.version.toString().endsWith("-SNAPSHOT")) {
Expand All @@ -29,13 +30,12 @@ tasks.withType<Jar> {
attributes["Implementation-Vendor"] = "Velocity Contributors"
attributes["Multi-Release"] = "true"
attributes["Specification-Version"] = velocityHumanVersion
attributes["Implementation-Version"] = velocityVersion
attributes["Implementation-Version"] = velocityVersionButWithoutTheDashSnapshot
attributes["Brand-Id"] = "papermc:velocity"
attributes["Brand-Name"] = "Velocity"
attributes["Build-Number"] = (buildNumber ?: "")
attributes["Build-Time"] = Instant.now().toString()
attributes["Git-Branch"] = gitBranch
attributes["Git-Commit"] = gitHash
attributes["Full-Version"] = implementationVersion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import com.velocitypowered.api.util.GameProfile;
import com.velocitypowered.api.util.ProxyVersion;
import com.velocitypowered.api.util.buildinfo.ServerBuildInfo;
import com.velocitypowered.api.util.buildinfo.VelocityServerBuildInfo;
import com.velocitypowered.proxy.command.VelocityCommandManager;
import com.velocitypowered.proxy.command.builtin.CallbackCommand;
import com.velocitypowered.proxy.command.builtin.GlistCommand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public boolean isBrandCompatible(final @NotNull Key brandId) {
public @NotNull String asString(final @NotNull StringRepresentation representation) {
final StringBuilder sb = new StringBuilder();
sb.append(this.velocityVersionName);
if (this.buildNumber.isPresent()) {
sb.append('-'); // eh
sb.append(this.buildNumber.getAsInt());
} else if (!this.velocityVersionName.contains("-SNAPSHOT")) {
sb.append('-'); // eh
sb.append('-');
final OptionalInt buildNumber = this.buildNumber;
if (buildNumber.isPresent()) {
sb.append(buildNumber.getAsInt());
} else {
sb.append(BUILD_DEV);
}
final boolean hasGitBranch = this.gitBranch.isPresent();
Expand Down

0 comments on commit 226f964

Please sign in to comment.