Examples of FileCollection


Examples of com.google.opengse.io.FileCollection

  /**
   * Get all of the non-jdk packages in the current classpath.
   */
  public static Set<String> getAllPackages() throws IOException {
    FileCollection fileCollection = getClasspathAsFileCollection();
    FileCollection jdkFileCollection = JDKFileCollection.getFileCollection();
    Set<String> packages = new TreeSet<String>();
    for (String filename : fileCollection.getFileNames()) {
      if (filename.endsWith(CLASS_SUFFIX)) {
        if (!jdkFileCollection.containsFile(filename)) {
          filename = filename
              .substring(0, filename.length() - CLASS_SUFFIX.length());
          String classname = filename.replace(File.separatorChar, '.');
          String pkg = getPackage(classname);
          packages.add(pkg);
View Full Code Here

Examples of com.google.opengse.io.FileCollection

    Set<String> classes = new TreeSet<String>();
    int pkglength = pkg.length();
    if (pkglength > 0) {
      ++pkglength;
    }
    FileCollection fileCollection = getClasspathAsFileCollection();
    for (String filename : fileCollection.getFileNames()) {
      if (filename.endsWith(CLASS_SUFFIX)) {
        filename = filename.substring(0, filename.length() - 6);
        String classname = filename.replace('/', '.');
        if (classname.startsWith(pkg)
            && classname.substring(pkglength).indexOf('.') == -1) {
View Full Code Here

Examples of org.buildndeploy.server.model.FileCollection

 
  public void doPost(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
    List<String> uploadedKeys = BlobstoreUtil.processRequest(req);
    if (uploadedKeys.size() > 0) {
      FileCollection fc = FileCollection.get();
      for (String b : uploadedKeys) {
        log.info("Uploaded " + b);
        fc.add(b);
      }
      fc.save();
    } else {
      log.warning("empty upload");
    }
   
    List<BlobInfo> blobInfos = BlobstoreUtil.loadBlobInfos(uploadedKeys);
View Full Code Here

Examples of org.gradle.api.file.FileCollection

                }
            } else if (value instanceof Closure) {
                Closure closure = (Closure) value;
                value = closure.call();
            } else if (value instanceof FileCollection) {
                FileCollection fileCollection = (FileCollection) value;
                return fileCollection.getFiles();
            } else {
                return value;
            }
        }
    }
View Full Code Here

Examples of org.gradle.api.file.FileCollection

    @Override
    protected void addSourceCollections(Collection<FileCollection> sources) {
        for (Object element : resolveToFilesAndFileCollections()) {
            if (element instanceof FileCollection) {
                FileCollection collection = (FileCollection) element;
                sources.add(collection);
            } else {
                File file = (File) element;
                sources.add(new SingletonFileCollection(file, buildDependency));
            }
View Full Code Here

Examples of org.gradle.api.file.FileCollection

            }
        }
        if (maxHeapSize != null) {
            args.add(String.format("-Xmx%s", maxHeapSize));
        }
        FileCollection bootstrapClasspath = getBootstrapClasspath();
        if (!bootstrapClasspath.isEmpty()) {
            args.add(String.format("-Xbootclasspath:%s", bootstrapClasspath.getAsPath()));
        }
        if (assertionsEnabled) {
            args.add("-ea");
        }
        if (debug) {
View Full Code Here

Examples of org.gradle.api.file.FileCollection

    @Test
    public void fileTreeIsLive() {
        final FileTree tree1 = context.mock(FileTree.class, "tree1");
        final FileTree tree2 = context.mock(FileTree.class, "tree2");
        final FileCollection source3 = context.mock(FileCollection.class);
        final FileTree tree3 = context.mock(FileTree.class);

        context.checking(new Expectations() {{
            one(source1).getAsFileTree();
            will(returnValue(tree1));
View Full Code Here

Examples of org.gradle.api.file.FileCollection

        assertThat(((CompositeFileTree) fileTree).getSourceCollections(), equalTo((Iterable) toList(tree1, tree2, tree3)));
    }

    @Test
    public void filterDelegatesToEachSet() {
        final FileCollection filtered1 = context.mock(FileCollection.class, "filtered1");
        final FileCollection filtered2 = context.mock(FileCollection.class, "filtered2");
        final Spec spec = context.mock(Spec.class);

        context.checking(new Expectations() {{
            one(source1).filter(spec);
            will(returnValue(filtered1));
            one(source2).filter(spec);
            will(returnValue(filtered2));
        }});

        FileCollection filtered = collection.filter(spec);
        assertThat(filtered, instanceOf(CompositeFileCollection.class));
        assertThat(((CompositeFileCollection) filtered).getSourceCollections(), equalTo((Iterable) toList(filtered1, filtered2)));
    }
View Full Code Here

Examples of org.gradle.api.file.FileCollection

    public void dependsOnLiveUnionOfAllDependencies() {
        final Task target = context.mock(Task.class, "target");
        final Task task1 = context.mock(Task.class, "task1");
        final Task task2 = context.mock(Task.class, "task2");
        final Task task3 = context.mock(Task.class, "task3");
        final FileCollection source3 = context.mock(FileCollection.class, "source3");

        context.checking(new Expectations(){{
            TaskDependency dependency1 = context.mock(TaskDependency.class, "dep1");
            TaskDependency dependency2 = context.mock(TaskDependency.class, "dep2");
            TaskDependency dependency3 = context.mock(TaskDependency.class, "dep3");
View Full Code Here

Examples of org.gradle.api.file.FileCollection

    }

    void setUpMocksAndAttributes(GroovyCompile compile, final List groovyClasspath) {
        super.setUpMocksAndAttributes(compile);

        final FileCollection groovyClasspathCollection = context.mock(FileCollection.class);
        context.checking(new Expectations(){{
            allowing(groovyClasspathCollection).getFiles();
            will(returnValue(new LinkedHashSet<File>(groovyClasspath)));
        }});
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.