diff --git a/src/main/groovy/org/spongepowered/gradle/meta/GenerateMeta.groovy b/src/main/groovy/org/spongepowered/gradle/meta/GenerateMeta.groovy index d6a7e39..e817a2f 100644 --- a/src/main/groovy/org/spongepowered/gradle/meta/GenerateMeta.groovy +++ b/src/main/groovy/org/spongepowered/gradle/meta/GenerateMeta.groovy @@ -35,15 +35,19 @@ import java.util.function.Supplier class GenerateMeta extends DefaultTask { Supplier> provider = {[]} - Path target = temporaryDir.toPath().resolve(McModInfo.STANDARD_FILENAME) + Path target List getMetadata() { return this.provider.get() } + Path getTarget() { + return this.target ?: temporaryDir.toPath().resolve(McModInfo.STANDARD_FILENAME) + } + @TaskAction void generateMetadata() { - McModInfo.DEFAULT.write(target, metadata) + McModInfo.DEFAULT.write(getTarget(), metadata) } } diff --git a/src/main/groovy/org/spongepowered/gradle/meta/MetadataBasePlugin.groovy b/src/main/groovy/org/spongepowered/gradle/meta/MetadataBasePlugin.groovy index 9a67bcb..2ec8626 100644 --- a/src/main/groovy/org/spongepowered/gradle/meta/MetadataBasePlugin.groovy +++ b/src/main/groovy/org/spongepowered/gradle/meta/MetadataBasePlugin.groovy @@ -24,7 +24,7 @@ */ package org.spongepowered.gradle.meta -import static org.spongepowered.gradle.meta.MetadataBaseExtension.getEXTENSION_NAME +import static org.spongepowered.gradle.meta.MetadataBaseExtension.EXTENSION_NAME import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/src/main/groovy/org/spongepowered/gradle/meta/MetadataPlugin.groovy b/src/main/groovy/org/spongepowered/gradle/meta/MetadataPlugin.groovy index 6feb6b9..e3a9b95 100644 --- a/src/main/groovy/org/spongepowered/gradle/meta/MetadataPlugin.groovy +++ b/src/main/groovy/org/spongepowered/gradle/meta/MetadataPlugin.groovy @@ -24,7 +24,7 @@ */ package org.spongepowered.gradle.meta -import static org.spongepowered.gradle.meta.MetadataBaseExtension.getEXTENSION_NAME +import static org.spongepowered.gradle.meta.MetadataBaseExtension.EXTENSION_NAME import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/src/main/groovy/org/spongepowered/gradle/plugin/SpongePluginPlugin.groovy b/src/main/groovy/org/spongepowered/gradle/plugin/SpongePluginPlugin.groovy index 1d8331c..804ddbb 100644 --- a/src/main/groovy/org/spongepowered/gradle/plugin/SpongePluginPlugin.groovy +++ b/src/main/groovy/org/spongepowered/gradle/plugin/SpongePluginPlugin.groovy @@ -29,7 +29,7 @@ import static org.gradle.api.JavaVersion.VERSION_1_8 import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.plugins.JavaPluginConvention -import org.spongepowered.gradle.meta.MetadataBasePlugin +import org.spongepowered.gradle.meta.MetadataPlugin class SpongePluginPlugin implements Plugin { @@ -56,7 +56,7 @@ class SpongePluginPlugin implements Plugin { // IntelliJ IDEA resource fix idea.module.inheritOutputDirs = true - plugins.apply(MetadataBasePlugin) + plugins.apply(MetadataPlugin) plugins.apply(SpongePluginBasePlugin) } }