Пример #1
0
  private void writeJarOptions(
      String inputEntryOptionName, String outputEntryOptionName, ClassPath classPath) {
    if (classPath != null) {
      for (int index = 0; index < classPath.size(); index++) {
        ClassPathEntry entry = classPath.get(index);
        String optionName = entry.isOutput() ? outputEntryOptionName : inputEntryOptionName;

        writer.print(optionName);
        writer.print(' ');
        writer.print(relativeFileName(entry.getFile()));

        // Append the filters, if any.
        boolean filtered = false;

        // For backward compatibility, the aar and apk filters come
        // first.
        filtered = writeFilter(filtered, entry.getAarFilter());
        filtered = writeFilter(filtered, entry.getApkFilter());
        filtered = writeFilter(filtered, entry.getZipFilter());
        filtered = writeFilter(filtered, entry.getEarFilter());
        filtered = writeFilter(filtered, entry.getWarFilter());
        filtered = writeFilter(filtered, entry.getJarFilter());
        filtered = writeFilter(filtered, entry.getFilter());

        if (filtered) {
          writer.print(ConfigurationConstants.CLOSE_ARGUMENTS_KEYWORD);
        }

        writer.println();
      }
    }
  }
Пример #2
0
  @SuppressWarnings("UseOfSystemOutOrSystemErr")
  private static void logTiming(ClassPath path, long started, String msg) {
    if (!ourLogTiming) return;

    long time = System.nanoTime() - started;
    ourTotalTime += time;
    ++ourTotalRequests;
    if (time > 10000000L) {
      System.out.println((time / 1000000) + " ms for " + msg);
    }
    if (ourTotalRequests % 1000 == 0) {
      System.out.println(
          path.toString()
              + ", requests:"
              + ourTotalRequests
              + ", time:"
              + (ourTotalTime / 1000000)
              + "ms");
    }
  }
Пример #3
0
 public ClassPath getClassPath() {
   return ClassPath.valueOf(getPackage(), getName());
 }