Package org.gradle.api.tasks

Examples of org.gradle.api.tasks.Copy


                    }
                });
                sourceSet.getJava().srcDir(String.format("src/%s/java", sourceSet.getName()));
                sourceSet.getResources().srcDir(String.format("src/%s/resources", sourceSet.getName()));

                Copy processResources = project.getTasks().add(sourceSet.getProcessResourcesTaskName(), ProcessResources.class);
                processResources.setDescription(String.format("Processes the %s.", sourceSet.getResources()));
                conventionMapping = processResources.getConventionMapping();
                conventionMapping.map("defaultSource", new ConventionValue() {
                    public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
                        return sourceSet.getResources();
                    }
                });
View Full Code Here


            task.from(delayedFile(DevConstants.REMAPPED_CLEAN));
            task.into(delayedFile(DevConstants.ECLIPSE_CLEAN_RES));
            task.dependsOn("extractWorkspace", "remapCleanJar");
        }

        Copy copy = makeTask("copyStart", Copy.class);
        {
            copy.from(delayedFile("{MAPPINGS_DIR}/patches"));
            copy.include("Start.java");
            copy.into(delayedFile(DevConstants.ECLIPSE_CLEAN_SRC));
            copy.dependsOn("extractMcResources");
        }

        task = makeTask("extractMcSource", ExtractTask.class);
        {
            task.include(JAVA_FILES);
            task.setIncludeEmptyDirs(false);
            task.from(delayedFile(DevConstants.REMAPPED_CLEAN));
            task.into(delayedFile(DevConstants.ECLIPSE_CLEAN_SRC));
            task.dependsOn("copyStart");
        }
       
        // COPY FML STUFF
        task = makeTask("extractFmlResources", ExtractTask.class);
        {
            task.exclude(JAVA_FILES);
            task.from(delayedFile(DevConstants.REMAPPED_DIRTY));
            task.into(delayedFile(DevConstants.ECLIPSE_FML_RES));
            task.dependsOn("remapDirtyJar", "extractWorkspace");
        }

        copy = makeTask("copyDeobfData", Copy.class);
        {
            copy.from(delayedFile(DevConstants.DEOBF_DATA));
            copy.from(delayedFile(DevConstants.FML_VERSIONF));
            copy.into(delayedFile(DevConstants.ECLIPSE_FML_RES));
            copy.dependsOn("extractFmlResources", "compressDeobfData");
        }

        task = makeTask("extractFmlSources", ExtractTask.class);
        {
            task.include(JAVA_FILES);
View Full Code Here

            obf.configureProject(getExtension().getDirtyProject());
        }

        try
        {
            Copy copyTask = makeTask("extractNatives", Copy.class);
            {
                copyTask.exclude("META-INF", "META-INF/**", "META-INF/*");
                copyTask.into(delayedString(DevConstants.ECLIPSE_NATIVES).call());
                copyTask.dependsOn("extractWorkspace");
            }

            DelayedFile devJson = getDevJson();
            if (devJson == null)
            {
                project.getLogger().info("Dev json not set, could not create native downloads tasks");
                return;
            }

            if (version == null)
            {
                File jsonFile = devJson.call().getAbsoluteFile();
                try
                {
                    version = JsonFactory.loadVersion(jsonFile);
                }
                catch (Exception e)
                {
                    project.getLogger().error("" + jsonFile + " could not be parsed");
                    Throwables.propagate(e);
                }
            }

            for (Library lib : version.getLibraries())
            {
                if (lib.natives != null)
                {
                    String path = lib.getPathNatives();
                    String taskName = "downloadNatives-" + lib.getArtifactName().split(":")[1];

                    DownloadTask task = makeTask(taskName, DownloadTask.class);
                    {
                        task.setOutput(delayedFile("{CACHE_DIR}/minecraft/" + path));
                        task.setUrl(delayedString(lib.getUrl() + path));
                    }

                    copyTask.from(delayedZipTree("{CACHE_DIR}/minecraft/" + path));
                    copyTask.dependsOn(taskName);
                }
            }

        }
        catch (Exception e)
View Full Code Here

    private void createProcessResourcesTaskForBinary(final ClassDirectoryBinarySpecInternal binary, final Project target) {
        final BinaryNamingScheme namingScheme = binary.getNamingScheme();
        binary.getSource().withType(JvmResourceSet.class).all(new Action<JvmResourceSet>() {
            public void execute(JvmResourceSet resourceSet) {
                Copy resourcesTask = target.getTasks().create(namingScheme.getTaskName("process", "resources"), ProcessResources.class);
                resourcesTask.setDescription(String.format("Processes %s.", resourceSet));
                new DslObject(resourcesTask).getConventionMapping().map("destinationDir", new Callable<File>() {
                    public File call() throws Exception {
                        return binary.getResourcesDir();
                    }
                });
                binary.getTasks().add(resourcesTask);
                binary.builtBy(resourcesTask);
                resourcesTask.from(resourceSet.getSource());
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.tasks.Copy

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.