Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.Echo


        echo.addText(checksumValue);
        echo.execute();
    }

    private void writePom(String pomText, File pomFile) {
        Echo echo = new Echo();
        echo.setProject(getProject());
        echo.setFile(pomFile);
        echo.addText(pomText);
        echo.execute();

        getProject().log(this, "Written pom " + pomFile, Project.MSG_INFO);
    }
View Full Code Here


       
        Copy copy = new Copy();
        copy.setProject(getProject());
        copy.setPreserveLastModified(true);
       
        Echo echo = new Echo();
        echo.setProject(getProject());
       
        final File organisationDirectory = getOrganisationDirectory();
        for (ArtifactOutput artifactOutput : ads) {

            File targetFile = artifactOutput.getOutputLocation(organisationDirectory, false);
            copy.setFile(artifactOutput.getSrcFile());
            copy.setTofile(targetFile);
            copy.execute();
            copy.init();
           
            if (artifactOutput.getSourceSrcFile() != null) {
                File targetSourceFile = artifactOutput.getOutputLocation(organisationDirectory, true);
                copy.setFile(artifactOutput.getSourceSrcFile());
                copy.setTofile(targetSourceFile);
                copy.execute();
                copy.init();
            }
           
            String pomText = "<project xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" +
              "<modelVersion>4.0.0</modelVersion>\n" +
              "<groupId>" + artifactOutput.getOrganisation() +
              "</groupId>\n" +
              "<artifactId>" + artifactOutput.getArtifact() +
              "</artifactId>\n" +
              "<version>" + artifactOutput.getVersion() +
              "</version>\n" +
              "</project>";

            File pomFile = artifactOutput.getOutputLocation(organisationDirectory, ".pom");
           
            echo.setFile(pomFile);
            echo.addText(pomText);
           
            echo.execute();
        }
       
    }
View Full Code Here

        checksum.setFile(srcFile);
        String property = MavenPublishTask.class.getName()+".checksum.property."+srcFile.getAbsolutePath();
        checksum.setProperty(property);
        checksum.execute();
       
        Echo echo = new Echo();
        echo.setProject(getProject());
       
        File checksumFile = new File(targetFile.getParentFile(), targetFile.getName()+".sha1");
       
        echo.setFile(checksumFile);
        String checksumValue = getProject().getProperty(property);
        System.out.println("Value for file " + srcFile + ": " + checksumValue);
        echo.addText(checksumValue);
        echo.execute();
    }
View Full Code Here

        echo.addText(checksumValue);
        echo.execute();
    }

    private void writePom(String pomText, File pomFile) {
        Echo echo = new Echo();
        echo.setProject(getProject());
        echo.setFile(pomFile);
        echo.addText(pomText);
        echo.execute();
    }
View Full Code Here

        checksum.setFile(srcFile);
        String property = MavenPublishTask.class.getName()+".checksum.property."+srcFile.getAbsolutePath();
        checksum.setProperty(property);
        checksum.execute();
       
        Echo echo = new Echo();
        echo.setProject(getProject());
       
        File checksumFile = new File(targetFile.getParentFile(), targetFile.getName()+".sha1");
       
        echo.setFile(checksumFile);
        String checksumValue = getProject().getProperty(property);
        echo.addText(checksumValue);
        echo.execute();
    }
View Full Code Here

        echo.addText(checksumValue);
        echo.execute();
    }

    private void writePom(String pomText, File pomFile) {
        Echo echo = new Echo();
        echo.setProject(getProject());
        echo.setFile(pomFile);
        echo.addText(pomText);
        echo.execute();

        getProject().log(this, "Written pom " + pomFile, Project.MSG_INFO);
    }
View Full Code Here

        publish.setPubrevision("1.2");
        publish.setResolver("1");
        File art = new File("build/test/publish/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), art, null);

        Echo echo = new Echo();
        echo.setProject(project);
        echo.setMessage("new version");
        echo.setFile(art);
        echo.execute();

        File dest = new File(
                "test/repositories/1/apache/resolve-simple/jars/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), dest, null);

        echo = new Echo();
        echo.setProject(project);
        echo.setMessage("old version");
        echo.setFile(dest);
        echo.execute();

        dest.setReadOnly();

        try {
            publish.execute();
View Full Code Here

        publish.setPubrevision("1.2");
        publish.setResolver("1");
        File art = new File("build/test/publish/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), art, null);

        Echo echo = new Echo();
        echo.setProject(project);
        echo.setMessage("new version");
        echo.setFile(art);
        echo.execute();

        File dest = new File(
                "test/repositories/1/apache/resolve-simple/jars/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), dest, null);

        echo = new Echo();
        echo.setProject(project);
        echo.setMessage("old version");
        echo.setFile(dest);
        echo.execute();

        publish.setOverwrite(true);
        publish.execute();
        assertTrue(dest.exists());
        BufferedReader reader = new BufferedReader(new FileReader(dest));
View Full Code Here

        publish.setPubrevision("1.2");
        publish.setResolver("1");
        File art = new File("build/test/publish/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), art, null);

        Echo echo = new Echo();
        echo.setProject(project);
        echo.setMessage("new version");
        echo.setFile(art);
        echo.execute();

        File dest = new File(
                "test/repositories/1/apache/resolve-simple/jars/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), dest, null);

        echo = new Echo();
        echo.setProject(project);
        echo.setMessage("old version");
        echo.setFile(dest);
        echo.execute();

        dest.setReadOnly();

        publish.setOverwrite(true);
        publish.execute();
View Full Code Here

        _publish.setPubrevision("1.2");
        _publish.setResolver("1");
        File art = new File("build/test/publish/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), art, null);
       
        Echo echo = new Echo();
        echo.setProject(_project);
        echo.setMessage("new version");
        echo.setFile(art);
        echo.execute();

        File dest = new File("test/repositories/1/apache/resolve-simple/jars/resolve-simple-1.2.jar");
        FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"),
                dest, null);

        echo = new Echo();
        echo.setProject(_project);
        echo.setMessage("old version");
        echo.setFile(dest);
        echo.execute();

        dest.setReadOnly();
       
        try {
            _publish.execute();
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Echo

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.