net.minecraftforge.gradle.user.IReobfuscator Maven / Gradle / Ivy
/*
* A Gradle plugin for the creation of Minecraft mods and MinecraftForge plugins.
* Copyright (C) 2013-2019 Minecraft Forge
* Copyright (C) 2020-2021 anatawa12 and other contributors
*
* 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.user;
import java.io.File;
import java.util.List;
import org.gradle.api.file.FileCollection;
/**
* Used to create a base interface for the reobf task and config classes so that
* things can be copy-pasted between the two.
*/
public interface IReobfuscator
{
/**
* Gets the mappings file used to reobfuscate. It should be either a
* {@link File} or a String path for a DelayedFile.
*
* @return The srg file or path to it
*/
Object getMappings();
/**
* Sets the mappings file used to reobfuscate. It should be either a String
* or {@link File}.
*
* @param srg The srg file or path to it
*/
void setMappings(Object srg);
/**
* Gets the mappings type.
*
* @return The mapping type
*/
ReobfMappingType getMappingType();
/**
* Sets the mapping type for easy access to searge or notch names. For
* custom mappings, use {@link #setMappings(Object)}.
*
*
* // for notch names (vanilla)
* mappingType = "NOTCH"
*
* // or searge names (forge)
* mappingType = "SEARGE"
*
*
* @param type The mapping
* @throws NullPointerException when type is null
* @throws IllegalArgumentException when type is {@link ReobfMappingType#CUSTOM}
*/
void setMappingType(ReobfMappingType type);
/**
* Sets the classpath used to reobfuscate. This is used by groovy for
* simplicity. Use classpath += otherClasspath
to add to it.
*
* @param classpath The new classpath
*/
void setClasspath(FileCollection classpath);
/**
* Gets the classpath used to reobfuscate. Use
* classpath += otherClasspath
to add to it.
*
* @return The classpath
*/
FileCollection getClasspath();
/**
* Gets the extra srg lines and files. Modders should prefer to use
* {@link #extraLines(Object...)} or {@code extra += []} instead of setting
* the list manually.
*
* @return The extra srg lines
*/
List