// Path: src/mcp/java/net/minecraftforge/gradle/mcp/util/MCPEnvironment.java
// public class MCPEnvironment {
// 
//     private final MCPRuntime runtime;
//     public final Project project;
//     public final String side;
//     public Logger logger;
//     private final MinecraftVersion mcVersion;
//     private final JavaLanguageVersion javaVersion;
// 
//     public MCPEnvironment(MCPRuntime runtime, String mcVersion, int javaVersion, String side) {
//         this.runtime = runtime;
//         this.project = runtime.project;
//         this.side = side;
//         this.mcVersion = MinecraftVersion.from(mcVersion);
//         this.javaVersion = JavaLanguageVersion.of(javaVersion);
//     }
// 
//     public Map<String, Object> getArguments() {
//         return runtime.currentStep.arguments;
//     }
// 
//     public File getWorkingDir() {
//         return runtime.currentStep.workingDirectory;
//     }
// 
//     public File getConfigZip() {
//         return runtime.zipFile;
//     }
// 
//     public File getFile(String name) {
//         File file = new File(name);
//         if (file.getAbsolutePath().equals(name)) { // If this is already an absolute path, don't mess with it
//             return file;
//         } else if (name.startsWith("/")) {
//             return new File(runtime.mcpDirectory, name);
//         } else {
//             return new File(getWorkingDir(), name);
//         }
//     }
// 
//     public File getStepOutput(String name) {
//         MCPRuntime.Step step = runtime.steps.get(name);
//         if (step == null) {
//             throw new IllegalArgumentException("Could not find a step named " + name);
//         }
//         if (step.output == null) {
//             throw new IllegalArgumentException("Attempted to get the output of an unexecuted step: " + name);
//         }
//         return step.output;
//     }
// 
//     public MinecraftVersion getMinecraftVersion() {
//         return this.mcVersion;
//     }
// 
//     /**
//      * @return The Java version used to run the MCP steps (decompilation, etc.)
//      */
//     public JavaLanguageVersion getJavaVersion() {
//         return javaVersion;
//     }
// }


import net.minecraftforge.gradle.mcp.util.MCPEnvironment;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
/*
 * ForgeGradle
 * Copyright (C) 2018 Forge Development LLC
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

package net.minecraftforge.gradle.mcp.function;



class DownloadVersionJSONFunction extends DownloadFileFunction {

    private static final String DEFAULT_OUTPUT = "version.json";

    public DownloadVersionJSONFunction() {
        super(env -> DEFAULT_OUTPUT, DownloadVersionJSONFunction::getDownloadInfo);
    }

// Path: src/mcp/java/net/minecraftforge/gradle/mcp/util/MCPEnvironment.java
// public class MCPEnvironment {
// 
//     private final MCPRuntime runtime;
//     public final Project project;
//     public final String side;
//     public Logger logger;
//     private final MinecraftVersion mcVersion;
//     private final JavaLanguageVersion javaVersion;
// 
//     public MCPEnvironment(MCPRuntime runtime, String mcVersion, int javaVersion, String side) {
//         this.runtime = runtime;
//         this.project = runtime.project;
//         this.side = side;
//         this.mcVersion = MinecraftVersion.from(mcVersion);
//         this.javaVersion = JavaLanguageVersion.of(javaVersion);
//     }
// 
//     public Map<String, Object> getArguments() {
//         return runtime.currentStep.arguments;
//     }
// 
//     public File getWorkingDir() {
//         return runtime.currentStep.workingDirectory;
//     }
// 
//     public File getConfigZip() {
//         return runtime.zipFile;
//     }
// 
//     public File getFile(String name) {
//         File file = new File(name);
//         if (file.getAbsolutePath().equals(name)) { // If this is already an absolute path, don't mess with it
//             return file;
//         } else if (name.startsWith("/")) {
//             return new File(runtime.mcpDirectory, name);
//         } else {
//             return new File(getWorkingDir(), name);
//         }
//     }
// 
//     public File getStepOutput(String name) {
//         MCPRuntime.Step step = runtime.steps.get(name);
//         if (step == null) {
//             throw new IllegalArgumentException("Could not find a step named " + name);
//         }
//         if (step.output == null) {
//             throw new IllegalArgumentException("Attempted to get the output of an unexecuted step: " + name);
//         }
//         return step.output;
//     }
// 
//     public MinecraftVersion getMinecraftVersion() {
//         return this.mcVersion;
//     }
// 
//     /**
//      * @return The Java version used to run the MCP steps (decompilation, etc.)
//      */
//     public JavaLanguageVersion getJavaVersion() {
//         return javaVersion;
//     }
// }


// Path: src/mcp/java/net/minecraftforge/gradle/mcp/function/DownloadVersionJSONFunction.java
import net.minecraftforge.gradle.mcp.util.MCPEnvironment;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

/*
 * ForgeGradle
 * Copyright (C) 2018 Forge Development LLC
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

package net.minecraftforge.gradle.mcp.function;



class DownloadVersionJSONFunction extends DownloadFileFunction {

    private static final String DEFAULT_OUTPUT = "version.json";

    public DownloadVersionJSONFunction() {
        super(env -> DEFAULT_OUTPUT, DownloadVersionJSONFunction::getDownloadInfo);
    }

    private static DownloadInfo getDownloadInfo(MCPEnvironment environment) {