diff options
author | modmuss50 <modmuss50@gmail.com> | 2021-07-14 00:03:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 00:03:21 +0100 |
commit | e439a1b35493fe771e34b1698270bfa5fc41a97c (patch) | |
tree | eab48d602697085a59e83569660a5c75b92e9a0c /src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java | |
parent | 2259a4efc8f4dad35880b41cb8be59bc5b857f9b (diff) | |
download | architectury-loom-e439a1b35493fe771e34b1698270bfa5fc41a97c.tar.gz architectury-loom-e439a1b35493fe771e34b1698270bfa5fc41a97c.tar.bz2 architectury-loom-e439a1b35493fe771e34b1698270bfa5fc41a97c.zip |
Refactor LoomGradleExtension (#431)
* First pass at refactoring the extension
* Fix inital issues.
* Combine some interfaces
* Checkstyle
* Fix years
* Add isShareCaches to api
Diffstat (limited to 'src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java')
-rw-r--r-- | src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java b/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java new file mode 100644 index 00000000..4650d4ec --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java @@ -0,0 +1,83 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2021 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package net.fabricmc.loom.api; + +import java.io.File; +import java.util.List; + +import org.gradle.api.Action; +import org.gradle.api.NamedDomainObjectContainer; +import org.gradle.api.artifacts.Dependency; +import org.gradle.api.file.ConfigurableFileCollection; + +import net.fabricmc.loom.api.decompilers.LoomDecompiler; +import net.fabricmc.loom.configuration.ide.RunConfigSettings; +import net.fabricmc.loom.configuration.processors.JarProcessor; +import net.fabricmc.loom.configuration.providers.mappings.LayeredMappingSpecBuilder; + +/** + * This is the public api available exposed to build scripts. + */ +public interface LoomGradleExtensionAPI { + File getAccessWidener(); + + void setAccessWidener(Object file); + + void setShareCaches(boolean shareCaches); + + boolean isShareCaches(); + + default void shareCaches() { + setShareCaches(true); + } + + List<LoomDecompiler> getDecompilers(); + + void addDecompiler(LoomDecompiler decompiler); + + List<JarProcessor> getJarProcessors(); + + void addJarProcessor(JarProcessor processor); + + ConfigurableFileCollection getLog4jConfigs(); + + default Dependency officialMojangMappings() { + return layered(LayeredMappingSpecBuilder::officialMojangMappings); + } + + Dependency layered(Action<LayeredMappingSpecBuilder> action); + + String getRefmapName(); + + void setRefmapName(String refmapName); + + boolean isRemapMod(); + + void setRemapMod(boolean remapMod); + + void runs(Action<NamedDomainObjectContainer<RunConfigSettings>> action); + + NamedDomainObjectContainer<RunConfigSettings> getRunConfigs(); +} |