Package com.atlassian.clover.ant.tasks

Examples of com.atlassian.clover.ant.tasks.CloverSnapshotTask


        if (!new File(resolveCloverDatabase()).exists()) {
            getLog().info(resolveCloverDatabase() + " does not exist. Skipping snapshot creation.");
            return;
        }

        final CloverSnapshotTask task = createSnapshotTask();
        task.setInitString(resolveCloverDatabase());
        task.setDebug(debug);

        if (span != null) {
            task.setSpan(span);
        } else if (CloverSetupMojo.START_DATE != null) {
            final long timeSinceStart = new Date().getTime() - CloverSetupMojo.START_DATE.getTime();
            final String interval = ((timeSinceStart + 1000)/ 1000) + "s";
            getLog().info("No span specified, using span of: " + interval);
            task.setSpan(interval);
        }

        snapshot = new ConfigUtil(this).resolveSnapshotFile(snapshot);

        snapshot.getParentFile().mkdirs();
        getLog().info("Saving snapshot to: " + snapshot);
        task.setFile(snapshot);

        execTask(task);

        if (getLog().isDebugEnabled() || debug) {
            final String cpLocation = snapshot != null ? snapshot.getPath() : task.getInitString() + CloverNames.SNAPSHOT_SUFFIX;
            SnapshotPrinter.textPrint(Snapshot.loadFrom(cpLocation), new MvnLogger(getLog()), Logger.LOG_VERBOSE);
        }

    }
View Full Code Here


    protected void execTask(CloverSnapshotTask task) {
        task.execute();
    }

    CloverSnapshotTask createSnapshotTask() {
        CloverSnapshotTask task = new CloverSnapshotTask();
        final Project antProj = new Project();
        antProj.init();
        antProj.addBuildListener(new MvnLogBuildListener(getLog()));
        task.setProject(antProj);
        task.init();
        return task;
    }
View Full Code Here

TOP

Related Classes of com.atlassian.clover.ant.tasks.CloverSnapshotTask

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.