Now stores files in the user gradle folder, will prevent downloading assets for each project

This commit is contained in:
modmuss50
2016-08-25 12:42:23 +01:00
parent 547c242ff0
commit 3eb9b77746
8 changed files with 60 additions and 24 deletions

View File

@@ -24,6 +24,7 @@
package net.fabricmc.loom.task;
import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.loom.util.Constants;
import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.TaskAction;
@@ -35,9 +36,10 @@ import java.io.FileNotFoundException;
public class ExtractNativesTask extends DefaultTask {
@TaskAction
public void extractNatives() throws FileNotFoundException {
if (!Constants.MINECRAFT_NATIVES.exists()) {
LoomGradleExtension extension = getProject().getExtensions().getByType(LoomGradleExtension.class);
if (!Constants.MINECRAFT_NATIVES.get(extension).exists()) {
for (File source : getProject().getConfigurations().getByName(Constants.CONFIG_NATIVES)) {
ZipUtil.unpack(source, Constants.MINECRAFT_NATIVES);
ZipUtil.unpack(source, Constants.MINECRAFT_NATIVES.get(extension));
}
}
}