Skip to content

Commit

Permalink
Specify "embulkHome" instead of "into" in InstallEmbulkRunSet
Browse files Browse the repository at this point in the history
  • Loading branch information
dmikurube committed Dec 1, 2023
1 parent a816c4f commit a287291
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/main/java/org/embulk/gradle/runset/InstallEmbulkRunSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<? super CopySpec> 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();
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/simple/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit a287291

Please sign in to comment.