Rengenerate and download all files with --refresh-dependencies (#227)

* Re generate all files with --refresh-dependencies

* Always re-process jar processors

* Update mixin compile extensions
This commit is contained in:
modmuss50
2020-06-23 19:22:36 +01:00
committed by GitHub
parent 2f6071991c
commit 2d7421d4ed
10 changed files with 84 additions and 36 deletions

View File

@@ -36,6 +36,8 @@ import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
public class DownloadUtil {
public static boolean refreshDeps = false;
/**
* Download from the given {@link URL} to the given {@link File} so long as there are differences between them.
*
@@ -60,6 +62,11 @@ public class DownloadUtil {
public static void downloadIfChanged(URL from, File to, Logger logger, boolean quiet) throws IOException {
HttpURLConnection connection = (HttpURLConnection) from.openConnection();
if (refreshDeps) {
getETagFile(to).delete();
to.delete();
}
//If the output already exists we'll use it's last modified time
if (to.exists()) {
connection.setIfModifiedSince(to.lastModified());