Include project group in ForgeVersion and determine path to patched jar.
While testing we install to net.minecraftforge.test. So don't hardcode it.
This commit is contained in:
parent
a3c8e04ee6
commit
76d912c0ba
16
build.gradle
16
build.gradle
|
@ -87,6 +87,7 @@ project(':forge') {
|
||||||
apply plugin: 'de.undercouch.download'
|
apply plugin: 'de.undercouch.download'
|
||||||
|
|
||||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||||
|
group = 'net.minecraftforge.test' //TODO: remove test when we finish patches and want users to find it
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
|
@ -129,7 +130,8 @@ project(':forge') {
|
||||||
'mc.version': MC_VERSION,
|
'mc.version': MC_VERSION,
|
||||||
'mcp.version': MCP_VERSION,
|
'mcp.version': MCP_VERSION,
|
||||||
'forge.version': "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
|
'forge.version': "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
|
||||||
'forge.spec': SPEC_VERSION
|
'forge.spec': SPEC_VERSION,
|
||||||
|
'forge.group': project.group
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
serverRun {
|
serverRun {
|
||||||
|
@ -141,7 +143,8 @@ project(':forge') {
|
||||||
'mc.version': MC_VERSION,
|
'mc.version': MC_VERSION,
|
||||||
'mcp.version': MCP_VERSION,
|
'mcp.version': MCP_VERSION,
|
||||||
'forge.version': "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
|
'forge.version': "${project.version.substring(MC_VERSION.length() + 1)}".toString(),
|
||||||
'forge.spec': SPEC_VERSION
|
'forge.spec': SPEC_VERSION,
|
||||||
|
'forge.group': project.group
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +165,6 @@ project(':forge') {
|
||||||
return "${MC_VERSION}-${tag}.${offset}${t -> if (branch != null) t << '-' + branch}".toString() //Bake the response instead of making it dynamic
|
return "${MC_VERSION}-${tag}.${offset}${t -> if (branch != null) t << '-' + branch}".toString() //Bake the response instead of making it dynamic
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'net.minecraftforge.test' //TODO: remove when we jenkins is working
|
|
||||||
version = getVersion()
|
version = getVersion()
|
||||||
applyPatches {
|
applyPatches {
|
||||||
canonicalizeAccess true
|
canonicalizeAccess true
|
||||||
|
@ -215,7 +217,8 @@ project(':forge') {
|
||||||
"mc.version": "${MC_VERSION}",
|
"mc.version": "${MC_VERSION}",
|
||||||
"mcp.version": "${MCP_VERSION}",
|
"mcp.version": "${MCP_VERSION}",
|
||||||
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
||||||
"forge.spec":"${SPEC_VERSION}"
|
"forge.spec":"${SPEC_VERSION}",
|
||||||
|
"forge.group": project.group
|
||||||
]
|
]
|
||||||
environment += [
|
environment += [
|
||||||
target:'fmldevclient',
|
target:'fmldevclient',
|
||||||
|
@ -242,7 +245,8 @@ project(':forge') {
|
||||||
"mc.version": "${MC_VERSION}",
|
"mc.version": "${MC_VERSION}",
|
||||||
"mcp.version": "${MCP_VERSION}",
|
"mcp.version": "${MCP_VERSION}",
|
||||||
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
||||||
"forge.spec":"${SPEC_VERSION}"
|
"forge.spec":"${SPEC_VERSION}",
|
||||||
|
"forge.group": project.group
|
||||||
]
|
]
|
||||||
environment target:'fmldevserver'
|
environment target:'fmldevserver'
|
||||||
workingDir 'runserver'
|
workingDir 'runserver'
|
||||||
|
@ -613,7 +617,7 @@ project(':forge') {
|
||||||
'Specification-Title': 'Forge',
|
'Specification-Title': 'Forge',
|
||||||
'Specification-Vendor': 'Forge Development LLC',
|
'Specification-Vendor': 'Forge Development LLC',
|
||||||
'Specification-Version': SPEC_VERSION,
|
'Specification-Version': SPEC_VERSION,
|
||||||
'Implementation-Title': 'Forge',
|
'Implementation-Title': project.group,
|
||||||
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
|
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
|
||||||
'Implementation-Vendor': 'Forge Development LLC'
|
'Implementation-Vendor': 'Forge Development LLC'
|
||||||
] as LinkedHashMap, 'net/minecraftforge/versions/forge/')
|
] as LinkedHashMap, 'net/minecraftforge/versions/forge/')
|
||||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraftforge.versions.mcp.MCPVersion;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
@ -49,7 +50,7 @@ public class FMLClientLaunchProvider extends FMLCommonLaunchHandler implements I
|
||||||
public Path[] identifyTransformationTargets()
|
public Path[] identifyTransformationTargets()
|
||||||
{
|
{
|
||||||
Path libsPath = findLibsPath();
|
Path libsPath = findLibsPath();
|
||||||
Path patchedBinariesPath = libsPath.resolve(Paths.get("net","minecraftforge","forge",MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion(),"forge-"+MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion()+"-client.jar"));
|
Path patchedBinariesPath = libsPath.resolve(Paths.get(ForgeVersion.getGroup().replace('.', File.separatorChar), "forge", MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion(), "forge-" + MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion() + "-client.jar"));
|
||||||
Path srgMcPath = libsPath.resolve(Paths.get("net","minecraft", "client", MCPVersion.getMCPandMCVersion(), "client-"+MCPVersion.getMCPandMCVersion()+"-srg.jar"));
|
Path srgMcPath = libsPath.resolve(Paths.get("net","minecraft", "client", MCPVersion.getMCPandMCVersion(), "client-"+MCPVersion.getMCPandMCVersion()+"-srg.jar"));
|
||||||
LOGGER.info("SRG MC at {} is {}", srgMcPath.toString(), Files.exists(srgMcPath) ? "present" : "missing");
|
LOGGER.info("SRG MC at {} is {}", srgMcPath.toString(), Files.exists(srgMcPath) ? "present" : "missing");
|
||||||
LOGGER.info("Forge patches at {} is {}", patchedBinariesPath.toString(), Files.exists(patchedBinariesPath) ? "present" : "missing");
|
LOGGER.info("Forge patches at {} is {}", patchedBinariesPath.toString(), Files.exists(patchedBinariesPath) ? "present" : "missing");
|
||||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraftforge.versions.mcp.MCPVersion;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
@ -47,7 +48,7 @@ public class FMLServerLaunchProvider extends FMLCommonLaunchHandler implements I
|
||||||
public Path[] identifyTransformationTargets()
|
public Path[] identifyTransformationTargets()
|
||||||
{
|
{
|
||||||
Path libsPath = findLibsPath();
|
Path libsPath = findLibsPath();
|
||||||
Path patchedBinariesPath = libsPath.resolve(Paths.get("net","minecraftforge","forge",MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion(),"forge-"+MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion()+"-server.jar"));
|
Path patchedBinariesPath = libsPath.resolve(Paths.get(ForgeVersion.getGroup().replace('.', File.separatorChar), "forge", MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion(), "forge-" + MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion() + "-server.jar"));
|
||||||
Path srgMcPath = libsPath.resolve(Paths.get("net","minecraft", "server", MCPVersion.getMCPandMCVersion(), "server-"+MCPVersion.getMCPandMCVersion()+"-srg.jar"));
|
Path srgMcPath = libsPath.resolve(Paths.get("net","minecraft", "server", MCPVersion.getMCPandMCVersion(), "server-"+MCPVersion.getMCPandMCVersion()+"-srg.jar"));
|
||||||
LOGGER.info("SRG MC at {} is {}", srgMcPath.toString(), Files.exists(srgMcPath) ? "present" : "missing");
|
LOGGER.info("SRG MC at {} is {}", srgMcPath.toString(), Files.exists(srgMcPath) ? "present" : "missing");
|
||||||
LOGGER.info("Forge patches at {} is {}", patchedBinariesPath.toString(), Files.exists(patchedBinariesPath) ? "present" : "missing");
|
LOGGER.info("Forge patches at {} is {}", patchedBinariesPath.toString(), Files.exists(patchedBinariesPath) ? "present" : "missing");
|
||||||
|
|
|
@ -38,8 +38,8 @@ public class ForgeVersion
|
||||||
public static final String mcpVersion = "9.42";
|
public static final String mcpVersion = "9.42";
|
||||||
|
|
||||||
private static final String forgeVersion;
|
private static final String forgeVersion;
|
||||||
|
|
||||||
private static final String forgeSpec;
|
private static final String forgeSpec;
|
||||||
|
private static final String forgeGroup;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
String vers = ForgeVersion.class.getPackage().getImplementationVersion();
|
String vers = ForgeVersion.class.getPackage().getImplementationVersion();
|
||||||
|
@ -52,10 +52,19 @@ public class ForgeVersion
|
||||||
spec = System.getProperty("forge.spec");
|
spec = System.getProperty("forge.spec");
|
||||||
}
|
}
|
||||||
if (spec == null) throw new RuntimeException("Missing forge spec, cannot continue");
|
if (spec == null) throw new RuntimeException("Missing forge spec, cannot continue");
|
||||||
|
String group = ForgeVersion.class.getPackage().getImplementationTitle();
|
||||||
|
if (group == null) {
|
||||||
|
group = System.getProperty("forge.group");
|
||||||
|
}
|
||||||
|
if (group == null) {
|
||||||
|
group = "net.minecraftforge"; // If all else fails, Our normal group
|
||||||
|
}
|
||||||
forgeVersion = vers;
|
forgeVersion = vers;
|
||||||
forgeSpec = spec;
|
forgeSpec = spec;
|
||||||
|
forgeGroup = group;
|
||||||
LOGGER.info(CORE, "Found Forge version {}", forgeVersion);
|
LOGGER.info(CORE, "Found Forge version {}", forgeVersion);
|
||||||
LOGGER.info(CORE, "Found Forge spec {}", forgeSpec);
|
LOGGER.info(CORE, "Found Forge spec {}", forgeSpec);
|
||||||
|
LOGGER.info(CORE, "Found Forge group {}", forgeGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getVersion()
|
public static String getVersion()
|
||||||
|
@ -77,5 +86,9 @@ public class ForgeVersion
|
||||||
public static String getSpec() {
|
public static String getSpec() {
|
||||||
return forgeSpec;
|
return forgeSpec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getGroup() {
|
||||||
|
return forgeGroup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue