use of org.eclipse.ceylon.cmr.api.RepositoryBuilder in project ceylon by eclipse.
the class SmokeTestCase method testPropertiesGet.
@Test
public void testPropertiesGet() throws Exception {
RepositoryManagerBuilder builder = getRepositoryManagerBuilder(false, 60000, java.net.Proxy.NO_PROXY);
RepositoryBuilder rb = builder.repositoryBuilder();
CmrRepository[] repositories = rb.buildRepository(Constants.REPO_URL_CEYLON);
for (CmrRepository repo : repositories) {
builder.addRepository(repo);
}
RepositoryManager manager = builder.buildRepository();
ArtifactContext context = new ArtifactContext(null, "io.undertow.core", "1.0.0.Alpha1-9fdfd5f766", ArtifactContext.JAR);
try {
File artifact = manager.getArtifact(context);
Assert.assertNotNull(artifact);
File mp = new File(artifact.getParent(), ArtifactContext.MODULE_PROPERTIES);
Assert.assertNotNull(mp.exists());
} finally {
manager.removeArtifact(context);
}
}
use of org.eclipse.ceylon.cmr.api.RepositoryBuilder in project ceylon by eclipse.
the class RepositoryBuilderImpl method buildRepository.
public CmrRepository[] buildRepository(String token, RepositoryBuilderConfig config) throws Exception {
if (token == null)
throw new IllegalArgumentException("Null repository");
final String key = (token.startsWith("${") ? token.substring(2, token.length() - 1) : token);
final String temp = SecurityActions.getProperty(key);
if (temp != null)
token = temp;
for (RepositoryBuilder builder : builders) {
CmrRepository[] repos = builder.buildRepository(token, config);
if (repos != null) {
return repos;
}
}
return localBuilder.buildRepository(token, config);
}
Aggregations