use of org.curioswitch.gradle.helpers.platform.PlatformHelper in project curiostack by curioswitch.
the class PulumiSetupPlugin method apply.
@Override
public void apply(Project project) {
checkState(project.getParent() == null, "PulumiSetupPlugin can only be applied to the root project.");
var toolDownloaderPlugin = project.getPlugins().apply(ToolDownloaderPlugin.class);
toolDownloaderPlugin.registerToolIfAbsent("pulumi", tool -> {
tool.getVersion().set(ToolDependencies.getPulumiVersion(project));
tool.getBaseUrl().set("https://get.pulumi.com/releases/sdk/");
tool.getArtifactPattern().set("[artifact]-v[revision]-[classifier].[ext]");
var osClassifiers = tool.getOsClassifiers();
osClassifiers.getLinux().set("linux-x64");
osClassifiers.getMac().set("darwin-x64");
osClassifiers.getWindows().set("windows-x64");
switch(new PlatformHelper().getOs()) {
case LINUX:
case MAC_OSX:
tool.getPathSubDirs().add("pulumi");
break;
case WINDOWS:
tool.getPathSubDirs().add("Pulumi/bin");
break;
case UNKNOWN:
throw new IllegalStateException("Unsupported OS");
}
});
}
Aggregations