Esempio n. 1
0
    private ModelDependencies updateUnchanged(
        GenerationStatus genStatus, StreamHandler streamHandler) {
      final ModelDependencies newDeps = genStatus.getBLDependencies();
      if (newDeps == null) {
        return null;
      }
      // update modelDependencies and generationDependencies
      ModelDependencies modelDep = null;

      // process unchanged files
      SModel originalInputModel = genStatus.getOriginalInputModel();
      for (GenerationRootDependencies rdep : genStatus.getUnchangedDependencies()) {
        for (String filename : rdep.getFiles()) {
          if (!streamHandler.touch(filename)) {
            continue;
          }
          // re-register baseLanguage dependencies
          if (modelDep == null) {
            modelDep = BLDependenciesCache.getInstance().get(originalInputModel);
          }
          if (modelDep != null) {
            RootDependencies root = modelDep.getDependency(filename);
            if (root != null) {
              newDeps.replaceRoot(root);
            }
          }
        }
      }
      return newDeps;
    }
Esempio n. 2
0
    @Override
    public void generateCache(GenerationStatus status, StreamHandler handler) {
      final ModelDependencies deps = updateUnchanged(status, handler);
      if (deps == null) {
        return;
      }
      update(status.getOriginalInputModel(), deps);

      handler.saveStream(getCacheFileName(), deps.toXml());
    }