From a2872912f4d59808b9fc310c95ea152dfd334e07 Mon Sep 17 00:00:00 2001 From: Dai MIKURUBE Date: Fri, 1 Dec 2023 18:03:21 +0900 Subject: [PATCH] Specify "embulkHome" instead of "into" in InstallEmbulkRunSet --- .../gradle/runset/InstallEmbulkRunSet.java | 23 +++++++++++++++++++ src/test/resources/simple/build.gradle | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/embulk/gradle/runset/InstallEmbulkRunSet.java b/src/main/java/org/embulk/gradle/runset/InstallEmbulkRunSet.java index f233250..da5191c 100644 --- a/src/main/java/org/embulk/gradle/runset/InstallEmbulkRunSet.java +++ b/src/main/java/org/embulk/gradle/runset/InstallEmbulkRunSet.java @@ -25,8 +25,11 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.gradle.api.Action; import org.gradle.api.IllegalDependencyNotation; +import org.gradle.api.InvalidUserDataException; import org.gradle.api.Project; +import org.gradle.api.file.CopySpec; import org.gradle.api.artifacts.ArtifactCollection; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.Dependency; @@ -104,6 +107,26 @@ public void artifact(final Object dependencyNotation) { } } + public InstallEmbulkRunSet embulkHome(final Object destEmbulkHome) { + super.into(destEmbulkHome); + return this; + } + + @Override + public final Copy into​(final Object destDir) { + throw new InvalidUserDataException("Do not use 'into' directly in an InstallEmbulkRunSet task. Use 'embulkHome' instead."); + } + + @Override + public final Copy into​(final Object destDir, final groovy.lang.Closure configureClosure) { + throw new InvalidUserDataException("Do not use 'into' directly in an InstallEmbulkRunSet task. Use 'embulkHome' instead."); + } + + @Override + public final Copy into(final Object destPath, final Action copySpec) { + throw new InvalidUserDataException("Do not use 'into' directly in an InstallEmbulkRunSet task. Use 'embulkHome' instead."); + } + private void fromArtifact(final ResolvedArtifactResult resolvedArtifactResult, final String artifactType) { final ComponentIdentifier id = resolvedArtifactResult.getId().getComponentIdentifier(); final File file = resolvedArtifactResult.getFile(); diff --git a/src/test/resources/simple/build.gradle b/src/test/resources/simple/build.gradle index b4fca2d..877d3fe 100644 --- a/src/test/resources/simple/build.gradle +++ b/src/test/resources/simple/build.gradle @@ -7,7 +7,7 @@ repositories { } installEmbulkRunSet { - into "${project.buildDir}/simple" + embulkHome "${project.buildDir}/simple" artifact "org.embulk:embulk-input-postgresql:0.13.2" artifact group: "org.embulk", name: "embulk-input-s3", version: "0.6.0" }