use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class GraalEditionList method createComponentCatalog.
@Override
public ComponentCatalog createComponentCatalog(CommandInput in) {
ComponentRegistry targetGraalVM = in.getLocalRegistry();
if (targetGraalVM != this.targetGraal) {
GraalEditionList gl = listGraalEditions(in, targetGraalVM);
return gl.createComponentCatalog(in);
}
if (catalog != null) {
return catalog;
}
String edId = in.optValue(Commands.OPTION_USE_EDITION, "");
GraalEdition ge = getEdition(edId);
RemoteCatalogDownloader downloader = createEditionDownloader(ge);
CatalogContents col = new CatalogContents(feedback, downloader.getStorage(), targetGraalVM);
return catalog = col;
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class CatalogInstallTest method testInstallDependencyFromSameDirectory.
/**
* Checks that dependencies can be loaded from the same directory as the installed Component.
*/
@Test
public void testInstallDependencyFromSameDirectory() throws Exception {
Path ruby193Source = dataFile("../repo/19.3.0.0/r");
Path llvm193Source = dataFile("../repo/19.3.0.0/llvm-toolchain");
// they should be next to eah other
assertEquals(ruby193Source.getParent(), llvm193Source.getParent());
files.add(ruby193Source.toFile());
setupVersion("19.3.0.0");
// no external catalog
downloader = new RemoteCatalogDownloader(this, this, (URL) null);
downloader.addLocalChannelSource(new SoftwareChannelSource(ruby193Source.getParent().toFile().toURI().toString()));
catalogFactory = new CatalogFactory() {
@Override
public ComponentCatalog createComponentCatalog(CommandInput input) {
return new CatalogContents(CatalogInstallTest.this, downloader.getStorage(), input.getLocalRegistry());
}
@Override
public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
return Collections.emptyList();
}
};
FileIterable fit = new FileIterable(this, this);
fit.setCatalogFactory(catalogFactory);
paramIterable = fit;
InstallCommand cmd = new InstallCommand();
cmd.init(this, withBundle(InstallCommand.class));
cmd.executionInit();
cmd.executeStep(cmd::prepareInstallation, false);
assertFalse(cmd.getDependencies().isEmpty());
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class CatalogInstallTest method setupCatalog.
private void setupCatalog(String rel) throws Exception {
String relSpec;
if (rel == null) {
relSpec = "catalog-" + name.getMethodName() + ".properties";
if (getClass().getResource(relSpec) == null) {
if (name.getMethodName().contains("Deps")) {
relSpec = "cataloginstallDeps.properties";
} else {
relSpec = "catalogInstallTest.properties";
}
}
} else {
relSpec = rel;
}
URL u = getClass().getResource(relSpec);
if (u == null) {
u = getClass().getResource("catalogInstallTest.properties");
}
Handler.bind(TEST_CATALOG_URL, u);
downloader = new RemoteCatalogDownloader(this, this, new URL(TEST_CATALOG_URL));
this.registry = new CatalogContents(this, downloader.getStorage(), getLocalRegistry());
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class InstallLicensedCatalogTest method initCatalogIterable.
private void initCatalogIterable(URL u) {
GraalChannel channel = new GraalChannel(this, this, getLocalRegistry());
channel.setIndexURL(u);
cfactory = new CatalogFactory() {
@Override
public ComponentCatalog createComponentCatalog(CommandInput input) {
try {
return new CatalogContents(InstallLicensedCatalogTest.this, channel.getStorage(), localRegistry);
} catch (IOException ex) {
fail("Unexpected exception");
return null;
}
}
@Override
public List<GraalEdition> listEditions(ComponentRegistry targetGraalVM) {
return Collections.emptyList();
}
};
paramIterable = new CatalogIterable(this, this);
}
use of org.graalvm.component.installer.model.CatalogContents in project graal by oracle.
the class InstallVersionsTest method initVersion.
private Version initVersion(String s) throws IOException {
Version v = Version.fromString(s);
storage.graalInfo.put(BundleConstants.GRAAL_VERSION, s);
Path catalogPath = dataFile("../repo/catalog.properties");
RemoteCatalogDownloader downloader = new RemoteCatalogDownloader(this, this, catalogPath.toUri().toURL());
registry = new CatalogContents(this, downloader.getStorage(), localRegistry);
paramIterable = new CatalogIterable(this, this);
return v;
}
Aggregations