use of com.typelead.gradle.eta.internal.EtlasResolver in project gradle-eta by typelead.
the class EtaSetupEnvironment method resolveEtlas.
private ResolvedExecutable resolveEtlas() {
EtlasResolver resolver = new EtlasResolver(getCacheDir());
ExecutableSpec spec = etlasSpec.get();
ResolvedExecutable resolvedEtlas = null;
if (spec instanceof NoSpec) {
throw new GradleException("Etlas not configured, please supply a value for the 'etlasVersion'" + " property in an eta { .. } block.");
} else if (spec instanceof SystemSpec) {
resolvedEtlas = resolver.resolveInSystemPath();
getProject().getLogger().info("Using etlas from system PATH: " + resolvedEtlas.getPath());
} else if (spec instanceof PathSpec) {
resolvedEtlas = resolver.resolveLocalPath(((PathSpec) spec).getPath());
} else if (spec instanceof VersionSpec) {
String etlasRepo = getEtlasRepository();
if (etlasRepo == null) {
throw new GradleException("etlasVersion provided, but etlasRepo was unexpectedly null!");
}
resolvedEtlas = resolver.resolveRemote(etlasRepo, ((VersionSpec) spec).getVersion());
}
return resolvedEtlas;
}
Aggregations