Package org.jetbrains.jps.incremental.storage

Examples of org.jetbrains.jps.incremental.storage.TimestampStorage


    return "Java Builder";
  }

  public ExitCode build(final CompileContext context, final ModuleChunk chunk) throws ProjectBuildException {
    try {
      final TimestampStorage tsStorage = context.getBuildDataManager().getTimestampStorage(BUILDER_NAME);
      final Set<File> filesToCompile = new HashSet<File>();
      final List<File> formsToCompile = new ArrayList<File>();
      final Set<String> srcRoots = new HashSet<String>();

      context.processFiles(chunk, new FileProcessor() {
View Full Code Here


    final Collection<File> classpath = paths.getCompilationClasspath(chunk, context.isCompilingTests(), !context.isMake());
    final Collection<File> platformCp = paths.getPlatformCompilationClasspath(chunk, context.isCompilingTests(), !context.isMake());
    final Map<File, Set<File>> outs = buildOutputDirectoriesMap(context, chunk);
    final List<String> options = getCompilationOptions(context, chunk);

    final TimestampStorage tsStorage = context.getBuildDataManager().getTimestampStorage(BUILDER_NAME);

    // setup loader for instrumentation
    final List<URL> urls = new ArrayList<URL>();
    for (Collection<File> cp : Arrays.asList(platformCp, classpath)) {
      for (File file : cp) {
        urls.add(file.toURI().toURL());
      }
    }
    final PseudoClassLoader pseudoLoader = new PseudoClassLoader(urls.toArray(new URL[urls.size()]));
    PSEUDO_CLASSLOADER_KEY.set(context, pseudoLoader);

    final DiagnosticSink diagnosticSink = new DiagnosticSink(context);
    final OutputFilesSink outputSink = new OutputFilesSink(context);

    try {
      final boolean compilationOk = myJavacCompiler.compile(options, files, classpath, platformCp, outs, context, diagnosticSink, outputSink);
      if (!compilationOk || diagnosticSink.getErrorCount() > 0) {
        throw new ProjectBuildException("Compilation failed: errors: " + diagnosticSink.getErrorCount() + "; warnings: " + diagnosticSink.getWarningCount());
      }

      instrumentForms(context, pseudoLoader, forms, outs);

      // todo: add notNull

      return ExitCode.OK;
    }
    finally {
      outputSink.writePendingData();

      PSEUDO_CLASSLOADER_KEY.set(context, null);
      for (File file : outputSink.getSuccessfullyCompiled()) {
        tsStorage.saveStamp(file);
      }
    }
  }
View Full Code Here

    ResourcePatterns patterns = ResourcePatterns.KEY.get(context);
    if (patterns == null) {
      ResourcePatterns.KEY.set(context, patterns = new ResourcePatterns(context.getProject()));
    }
    try {
      final TimestampStorage tsStorage = context.getBuildDataManager().getTimestampStorage(BUILDER_NAME);
      final ResourcePatterns finalPatterns = patterns;
      context.processFiles(chunk, new FileProcessor() {
        public boolean apply(final Module module, final File file, final String sourceRoot) throws Exception {
          if (finalPatterns.isResourceFile(file, sourceRoot)) {
            if (isFileDirty(file, context, tsStorage)) {
              try {
                context.processMessage(new ProgressMessage("Copying " + file.getPath()));
                copyResource(context, module, file, sourceRoot);
              }
              catch (IOException e) {
                context.processMessage(new CompilerMessage("Resource Compiler", BuildMessage.Kind.ERROR, e.getMessage(), FileUtil.toSystemIndependentName(file.getPath())));
                return false;
              }
              tsStorage.saveStamp(file);
            }
          }
          return true;
        }
      });
View Full Code Here

TOP

Related Classes of org.jetbrains.jps.incremental.storage.TimestampStorage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.