我正在从一个带有 run.ceylon 的锡兰项目运行锡兰类型检查器,它正是 typechecker/src/main/Main.java 的锡兰版本。
这个项目应该自己进行类型检查。
它编译没有错误,但在运行时无法加载依赖项以进行类型检查。
文件:source/com/example/withmodule/module.ceylon
native("jvm")
module com.example.withmodule "1.0" {
import com.redhat.ceylon.typechecker "1.3.0" ;
//import com.redhat.ceylon.module-resolver "1.3.0";
}
文件:source/com/example/withmodule/run.ceylon
import java.io{File}
import com.redhat.ceylon.cmr.api{RepositoryManager}
import com.redhat.ceylon.cmr.ceylon{CeylonUtils}
import com.redhat.ceylon.compiler.typechecker{TypeCheckerBuilder}
import com.redhat.ceylon.compiler.typechecker.io.cmr.impl{LeakingLogger}
shared void run(){
value args = ["/absolutepath/ceylon-1.3.0/source/"];
RepositoryManager repositoryManager =
CeylonUtils.repoManager()
.systemRepo("/absolutepath/ceylon-1.3.0/repo")
.logger( LeakingLogger())
.buildManager();
TypeCheckerBuilder tcb =
TypeCheckerBuilder()
.setRepositoryManager(repositoryManager)
.verbose(true)
.statistics(true);
for (String path in args) {
tcb.addSrcDirectory( File(path));
}
tcb.typeChecker.process();
}
它编译没有错误。
但是在运行时会产生错误:
error [package not found in imported modules: 'com.redhat.ceylon.cmr.api' (add module import to module descriptor of 'com.example.withmodule')] at 2:7-2:31 of com/example/withmodule/withmodule.ceylon
error [package not found in imported modules: 'com.redhat.ceylon.cmr.ceylon' (add module import to module descriptor of 'com.example.withmodule')] at 3:7-3:34 of com/example/withmodule/withmodule.ceylon
error [package not found in imported modules: 'com.redhat.ceylon.compiler.typechecker' (add module import to module descriptor of 'com.example.withmodule')] at 4:7-4:44 of com/example/withmodule/withmodule.ceylon
error [package not found in imported modules: 'com.redhat.ceylon.compiler.typechecker.io.cmr.impl' (add module import to module descriptor of 'com.example.withmodule')] at 5:7-5:56 of com/example/withmodule/withmodule.ceylon
这对我来说毫无意义,因为编译和类型检查之前已经成功。
这是一个全新的 ceylon 1.3.0 下载,未安装,只需从解压缩的 .tar.gz 运行即可。
类型检查器需要哪些它没有的额外信息?