use of org.ballerinalang.repository.PackageSourceEntry in project ballerina by ballerina-lang.
the class JarIntegrationTest method balInsideJar.
@Test
public void balInsideJar() throws IOException {
Patten balPatten = new Patten(path("very"), Patten.WILDCARD_SOURCE);
JarRepo repo = new JarRepo(tempJar.toUri());
Converter<Path> subject = repo.getConverterInstance();
List<PackageSourceEntry> sources = balPatten.convertToSources(subject, null).collect(Collectors.toList());
Assert.assertEquals(sources.size(), 1);
Assert.assertEquals(sources.get(0).getCode(), BAL_CONTENT);
}
use of org.ballerinalang.repository.PackageSourceEntry in project ballerina by ballerina-lang.
the class RepoHierarchy method resolve.
public Resolution resolve(PackageID pkg) {
log1(pkg);
for (int i = 0; i < repos.length; i++) {
Repo repo = repos[i];
Patten patten = repo.calculate(pkg);
if (patten != Patten.NULL) {
Converter converter = repo.getConverterInstance();
List<PackageSourceEntry> paths = patten.convertToSources(converter, pkg).collect(Collectors.toList());
log2(repo, patten, paths);
if (!paths.isEmpty()) {
return new Resolution(getChildHierarchyForRepo(i), paths);
}
} else {
log3(repo);
}
}
log4();
return Resolution.NOT_FOUND;
}
Aggregations