예제 #1
0
 @Override
 public void initProcessAnnotations(Iterable<? extends Processor> processors) {
   java.util.List<String> aptModules = options.getMulti(Option.CEYLONAPT);
   if (aptModules != null) {
     CeyloncFileManager dfm = (CeyloncFileManager) fileManager;
     RepositoryManager repositoryManager = dfm.getRepositoryManager();
     final Set<ModuleSpec> visited = new HashSet<>();
     StatusPrinterAptProgressListener progressListener = null;
     if (sp != null) {
       progressListener =
           new StatusPrinterAptProgressListener(sp) {
             @Override
             protected long getNumberOfModulesResolved() {
               return visited.size();
             }
           };
       sp.clearLine();
       sp.log("Starting APT resolving");
     }
     for (String aptModule : aptModules) {
       ModuleSpec moduleSpec = ModuleSpec.parse(aptModule);
       addDependenciesToAptPath(repositoryManager, moduleSpec, visited, progressListener);
     }
     if (sp != null) {
       sp.clearLine();
       sp.log("Done APT resolving");
     }
     // we only run APT if asked explicitly with the --apt flag
     super.initProcessAnnotations(processors);
   }
   // else don't do anything, which will leave the "processAnnotations" field to false
 }
예제 #2
0
 public LanguageCompiler(Context context) {
   super(context);
   ceylonContext = getCeylonContextInstance(context);
   vfs = ceylonContext.getVfs();
   compilerDelegate = getCompilerDelegate(context);
   phasedUnits = getPhasedUnitsInstance(context);
   try {
     gen = CeylonTransformer.getInstance(context);
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
   modelLoader = CeylonModelLoader.instance(context);
   ceylonEnter = CeylonEnter.instance(context);
   options = Options.instance(context);
   isBootstrap = options.get(Option.BOOTSTRAPCEYLON) != null;
   timer = Timer.instance(context);
   sourceLanguage = SourceLanguage.instance(context);
   boolean isProgressPrinted =
       options.get(Option.CEYLONPROGRESS) != null && StatusPrinter.canPrint();
   if (isProgressPrinted) {
     sp = getStatusPrinterInstance(context);
     if (taskListener == null) {
       taskListener.add(new StatusPrinterTaskListener(sp));
     }
   }
 }