Fix fabricApi.module does not respecting offline mode. Closes #412
parent
69caaccb07
commit
a73696a83f
|
@ -107,6 +107,14 @@ public class FabricApiExtension {
|
||||||
|
|
||||||
File mavenPom = new File(extension.getFiles().getUserCache(), "fabric-api/" + fabricApiVersion + ".pom");
|
File mavenPom = new File(extension.getFiles().getUserCache(), "fabric-api/" + fabricApiVersion + ".pom");
|
||||||
|
|
||||||
|
if (project.getGradle().getStartParameter().isOffline()) {
|
||||||
|
if (!mavenPom.exists()) {
|
||||||
|
throw new RuntimeException("Cannot retrieve fabric-api pom due to being offline");
|
||||||
|
}
|
||||||
|
|
||||||
|
return mavenPom;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
URL url = new URL(String.format("https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/%1$s/fabric-api-%1$s.pom", fabricApiVersion));
|
URL url = new URL(String.format("https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/%1$s/fabric-api-%1$s.pom", fabricApiVersion));
|
||||||
DownloadUtil.downloadIfChanged(url, mavenPom, project.getLogger());
|
DownloadUtil.downloadIfChanged(url, mavenPom, project.getLogger());
|
||||||
|
|
Loading…
Reference in New Issue