use of org.graalvm.component.installer.ComponentParam in project graal by oracle.
the class InstallCommand method printRequiredComponents.
void printRequiredComponents() throws IOException {
if (dependencies.isEmpty()) {
return;
}
feedback.output("INSTALL_RequiredDependencies");
for (ComponentParam p : dependencies) {
ComponentInfo ci = p.createMetaLoader().getComponentInfo();
feedback.output("INSTALL_RequiredDependencyLine", p.getDisplayName(), ci.getId(), ci.getVersion().displayString(), printComponentList(dependencyMap.get(ci.getId())));
}
}
use of org.graalvm.component.installer.ComponentParam in project graal by oracle.
the class InstallCommand method processComponents.
protected void processComponents(Iterable<ComponentParam> toProcess) throws IOException {
for (Iterator<ComponentParam> it = toProcess.iterator(); it.hasNext(); ) {
appendParameterText();
ComponentParam p = it.next();
feedback.output(p.isComplete() ? "INSTALL_VerboseProcessingArchive" : "INSTALL_VerboseProcessingComponent", p.getDisplayName());
current = p.getSpecification();
MetadataLoader ldr = validateDownload ? p.createFileLoader() : p.createMetaLoader();
Installer inst = createInstaller(p, ldr);
if (!verifyInstaller(inst)) {
continue;
}
if (registerComponent(inst, p)) {
addLicenseToAccept(inst, ldr);
if (p.isComplete()) {
// null realInstaller will be handled in completeInstallers() later.
realInstallers.put(p, inst);
} else {
realInstallers.put(p, null);
}
}
current = null;
URL remote = ldr.getComponentInfo().getRemoteURL();
if (remote == null || remote.getProtocol().equalsIgnoreCase("file")) {
wasFile = true;
}
}
}
use of org.graalvm.component.installer.ComponentParam in project graal by oracle.
the class InfoCommand method filePath.
protected String filePath(ComponentInfo info) {
ComponentParam p = files.get(info);
if (fullPath) {
return p.getFullPath();
} else {
String s = p.getShortName();
int idx = s.lastIndexOf('.');
return idx == -1 ? s : s.substring(0, idx);
}
}
use of org.graalvm.component.installer.ComponentParam in project graal by oracle.
the class RemoteCatalogDownloaderTest method testSingleNonMatchingCatalogIgnored.
/**
* Checks that if a single catalog does not correspond to graalvm version, other catalogs will
* be read.
*
* @throws Exception
*/
@Test
public void testSingleNonMatchingCatalogIgnored() throws Exception {
setupJoinedCatalog("catalogMultiPart1.properties");
ComponentCatalog col = openCatalog(rcd);
// need to incorporate requirements, too... they are tested in CatalogIterable
CatalogIterable catIt = new CatalogIterable(this, this);
catIt.setRemoteRegistry(col);
textParams.add("r");
textParams.add("ruby");
textParams.add("python");
Iterator<ComponentParam> iter = catIt.iterator();
ComponentParam p = iter.next();
ComponentInfo info;
assertNotNull(p);
info = p.createMetaLoader().getComponentInfo();
assertEquals("1.0.0.0", info.getVersion().toString());
p = iter.next();
assertNotNull(p);
info = p.createMetaLoader().getComponentInfo();
assertEquals("1.0.0.0", info.getVersion().toString());
// python cannot be found, an exception expected
assertTrue(iter.hasNext());
try {
p = iter.next();
fail("No python for 1.0.0");
} catch (FailedOperationException ex) {
}
}
use of org.graalvm.component.installer.ComponentParam in project graal by oracle.
the class UpgradeTest method testUpgradeWithDependencies.
/**
* Upgrade an installation with "ruby" to a newer one, where "ruby" has a dependency on an
* additional component. The other component should be auto-installed.
*/
@Test
public void testUpgradeWithDependencies() throws Exception {
initVersion("1.0.0.0", "../repo/catalog-19.3.properties");
ComponentInfo ci = new ComponentInfo("org.graalvm.r", "Installed R", "1.0.0.0");
storage.installed.add(ci);
UpgradeCommand cmd = new UpgradeCommand();
cmd.init(this, this);
textParams.add("r");
ComponentInfo graalInfo = cmd.configureProcess();
assertNotNull(graalInfo);
assertEquals(Version.fromString("19.3.0.0"), graalInfo.getVersion());
boolean installed = cmd.getProcess().installGraalCore(graalInfo);
assertTrue(installed);
factory = new CatalogFactory() {
@Override
public ComponentCatalog createComponentCatalog(CommandInput in) {
RemoteCatalogDownloader dnl = new RemoteCatalogDownloader(in, UpgradeTest.this, downloader.getOverrideCatalogSpec());
// carry over the override spec
return new CatalogContents(UpgradeTest.this, dnl.getStorage(), in.getLocalRegistry());
}
@Override
public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
return Collections.emptyList();
}
};
InstallTrampoline targetInstall = new InstallTrampoline();
cmd.getProcess().configureInstallCommand(targetInstall);
targetInstall.executionInit();
targetInstall.prepareInstallation();
assertTrue(targetInstall.getUnresolvedDependencies().isEmpty());
List<ComponentParam> deps = targetInstall.getDependencies();
assertEquals(1, deps.size());
MetadataLoader ldr = deps.iterator().next().createFileLoader();
assertEquals("org.graalvm.llvm-toolchain", ldr.getComponentInfo().getId());
}
Aggregations