Package com.gtnewhorizons.gtnhgradle
Interface GTNHModule
- All Known Implementing Classes:
AccessTransformerModule
,CodeStyleModule
,GitVersionModule
,IdeIntegrationModule
,MixinModule
,ModernJavaModule
,OldGradleEmulationModule
,PublishingModule
,ScalaModule
,ShadowModule
,StandardScriptsModules.AddonScriptModule
,StandardScriptsModules.DependenciesScriptModule
,StandardScriptsModules.LateAddonScriptModule
,StandardScriptsModules.RepositoriesScriptModule
,StructureCheckModule
,ToolchainModule
,UpdaterModule
,UtilityModule
,WellKnownRepositoriesModule
public interface GTNHModule
A toggleable module of the GTNH buildscript plugin.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(GTNHGradlePlugin.GTNHExtension gtnh, @NotNull Project project) Activates this module on the given project.static void
applyIfEnabled
(@NotNull Class<? extends GTNHModule> moduleClass, GTNHGradlePlugin.GTNHExtension gtnh, @NotNull Project project) Checks if the module should be enabled, and if it is - activates it.boolean
isEnabled
(@NotNull PropertiesConfiguration configuration)
-
Method Details
-
isEnabled
- Parameters:
configuration
- The project configuration- Returns:
- If this module should be enabled for the input project settings
-
apply
void apply(@NotNull GTNHGradlePlugin.GTNHExtension gtnh, @NotNull @NotNull Project project) throws Throwable Activates this module on the given project.- Parameters:
gtnh
- The GTNH extension providing access to various gradle services and configurationproject
- The project to activate the module on- Throws:
Throwable
- Any exception to allow easier module writing
-
applyIfEnabled
static void applyIfEnabled(@NotNull @NotNull Class<? extends GTNHModule> moduleClass, @NotNull GTNHGradlePlugin.GTNHExtension gtnh, @NotNull @NotNull Project project) Checks if the module should be enabled, and if it is - activates it. Registers a gradle project ext property "activatedModuleClassName" set to true or false depending if the module was enabled. Also registers another ext property "gtnhModuleClassName" set to the instance of the constructed module (regardless of enabled status).- Parameters:
moduleClass
- The module class to enable.gtnh
- The GTNH extension providing access to various gradle services and configurationproject
- The project to activate the module on
-