This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make CeylonModuleLoader implement RuntimeResolver
Part of #5734
- Loading branch information
1 parent
e4962fc
commit 0ba2b6b
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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; | ||
|
@@ -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) { | ||
|