Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Make CeylonModuleLoader implement RuntimeResolver
Browse files Browse the repository at this point in the history
Part of #5734
  • Loading branch information
tombentley committed Nov 13, 2015
1 parent e4962fc commit 0ba2b6b
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import com.redhat.ceylon.cmr.api.RepositoryManager;
import com.redhat.ceylon.common.Constants;
import com.redhat.ceylon.common.Versions;
import com.redhat.ceylon.compiler.java.runtime.model.RuntimeResolver;
import com.redhat.ceylon.model.cmr.ArtifactResult;
import com.redhat.ceylon.model.cmr.ArtifactResultType;
import com.redhat.ceylon.model.cmr.ImportType;
Expand All @@ -64,7 +65,8 @@
*
* @author <a href="mailto:[email protected]">Ales Justin</a>
*/
public class CeylonModuleLoader extends ModuleLoader {
public class CeylonModuleLoader extends ModuleLoader
implements RuntimeResolver {
private static final ModuleIdentifier LANGUAGE;
private static final ModuleIdentifier COMMON;
private static final ModuleIdentifier MODEL;
Expand Down Expand Up @@ -248,11 +250,16 @@ protected ArtifactResult findArtifact(ModuleIdentifier mi) {
return repository.getArtifactResult(context);
}

public ModuleIdentifier findOverride(ModuleIdentifier mi) {
protected ModuleIdentifier findOverride(ModuleIdentifier mi) {
final ArtifactContext context = new ArtifactContext(mi.getName(), mi.getSlot(), ArtifactContext.CAR, ArtifactContext.JAR);
ArtifactContext override = repository.getArtifactOverride(context);
return ModuleIdentifier.create(override.getName(), override.getVersion());
}

@Override
public String resolveVersion(String moduleName, String moduleVersion) {
return findOverride(ModuleIdentifier.create(moduleName, moduleVersion)).getSlot();
}

protected boolean isLogging(List<DependencySpec> deps, Builder builder, ArtifactResult result) {
for (LogChecker checker : checkers) {
Expand Down

0 comments on commit 0ba2b6b

Please sign in to comment.