Package org.codehaus.plexus.util.cli

Examples of org.codehaus.plexus.util.cli.Commandline$Argument


                                                 ScmVersion startRev, ScmVersion endRev )
    {
        String start = startRev != null && StringUtils.isNotEmpty( startRev.getName() ) ? "@" + startRev.getName() : "";
        String end = endRev != null && StringUtils.isNotEmpty( endRev.getName() ) ? endRev.getName() : "now";

        Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory );

        command.createArg().setValue( "diff2" );
        command.createArg().setValue( "-u" );
        // I'm assuming the "revs" are actually labels
        command.createArg().setValue( "..." + start );
        command.createArg().setValue( "...@" + end );
        return command;
    }
View Full Code Here


    }

    public static Commandline getBaseVssCommandLine( File workingDirectory, String cmd,
                                                     VssScmProviderRepository repository )
    {
        Commandline cl = new Commandline();

        cl.setExecutable( VssConstants.SS_EXE );

        cl.setWorkingDirectory( workingDirectory.getAbsolutePath() );

        if ( !StringUtils.isEmpty( repository.getUser() ) )
        {
            cl.createArg().setValue( "-Y" );

            StringBuilder sb = new StringBuilder( repository.getUser() );
            if ( !StringUtils.isEmpty( repository.getPassword() ) )
            {
                sb.append( "," ).append( repository.getPassword() );
            }
            cl.createArg().setValue( sb.toString() );
        }

        return cl;
    }
View Full Code Here

                                                        ScmVersion endVersion, String datePattern )
        throws ScmException
    {
        CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;

        Commandline cl = CvsCommandUtils.getBaseCommand( "log", repository, fileSet );

        if ( startDate != null )
        {
            SimpleDateFormat outputDate = new SimpleDateFormat( getDateFormat() );

            String dateRange;

            if ( endDate == null )
            {
                dateRange = ">" + outputDate.format( startDate );
            }
            else
            {
                dateRange = outputDate.format( startDate ) + "<" + outputDate.format( endDate );
            }

            cl.createArg().setValue( "-d" );

            addDateRangeParameter( cl, dateRange );
        }

        if ( branch != null && StringUtils.isNotEmpty( branch.getName() ) )
        {
            cl.createArg().setValue( "-r" + branch.getName() );
        }

        if ( startVersion != null  || endVersion != null )
        {
            StringBuilder sb = new StringBuilder();
            sb.append( "-r" );
            if ( startVersion != null && StringUtils.isNotEmpty( startVersion.getName() ) )
            {
                sb.append( startVersion.getName() );
            }
            sb.append( "::" );
            if ( endVersion != null && StringUtils.isNotEmpty( endVersion.getName() ) )
            {
                sb.append( endVersion.getName() );
            }

            cl.createArg().setValue( sb.toString() );
        }

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Executing: " + cl );
            getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );
        }

        return executeCvsCommand( cl, startDate, endDate, startVersion, endVersion, datePattern );
    }
View Full Code Here

     */
    public static Commandline showTaskObjects( int taskNumber, String format, String ccmAddr )
        throws ScmException
    {
        // Construct the CM Synergy command
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );

        cl.createArg().setValue( TASK );
        cl.createArg().setValue( "-show" );
        cl.createArg().setValue( "objects" );

        // Set up the output format
        if ( format != null && !format.equals( "" ) )
        {
            cl.createArg().setValue( "-f" );
            cl.createArg().setValue( format );
        }

        cl.createArg().setValue( Integer.toString( taskNumber ) );

        return cl;
    }
View Full Code Here

    public static Commandline query( String query, String format, String ccmAddr )
        throws ScmException
    {

        // Construct the CM Synergy command
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( QUERY );

        cl.createArg().setValue( "-u" );

        // Set up the output format
        if ( format != null && !format.equals( "" ) )
        {
            cl.createArg().setValue( "-f" );
            cl.createArg().setValue( format );
        }

        cl.createArg().setValue( query );

        return cl;
    }
View Full Code Here

     */
    public static Commandline createBaseline( String projectSpec, String name, String release, String purpose,
                                              String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( BASELINE );

        cl.createArg().setValue( "-create" );
        cl.createArg().setValue( name );

        cl.createArg().setValue( "-p" );
        cl.createArg().setValue( projectSpec );

        cl.createArg().setValue( "-release" );
        cl.createArg().setValue( release );

        cl.createArg().setValue( "-purpose" );
        cl.createArg().setValue( purpose );

        return cl;

    }
View Full Code Here

     * @throws ScmException
     */
    public static Commandline create( List<File> files, String message, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( CREATE );

        if ( message != null && !message.equals( "" ) )
        {

            cl.createArg().setValue( "-c" );

            cl.createArg().setValue( message );

        }

        for ( File f : files )
        {
            try
            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
View Full Code Here

     * @throws ScmException
     */
    public static Commandline createTask( String synopsis, String release, boolean defaultTask, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( TASK );

        cl.createArg().setValue( "-create" );

        cl.createArg().setValue( "-synopsis" );
        cl.createArg().setValue( synopsis );

        if ( release != null && !release.equals( "" ) )
        {
            cl.createArg().setValue( "-release" );
            cl.createArg().setValue( release );
        }

        if ( defaultTask )
        {
            cl.createArg().setValue( "-default" );
        }

        cl.createArg().setValue( "-description" );
        cl.createArg().setValue(
            "This task was created by Maven SCM Synergy provider on " + Calendar.getInstance().getTime() );

        return cl;

    }
View Full Code Here

     * @throws ScmException
     */
    public static Commandline checkinTask( String taskSpecs, String comment, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( TASK );

        cl.createArg().setValue( "-checkin" );

        cl.createArg().setValue( taskSpecs );

        cl.createArg().setValue( "-comment" );
        cl.createArg().setValue( comment );

        return cl;

    }
View Full Code Here

     * @throws ScmException
     */
    public static Commandline delete( List<File> files, String ccmAddr, boolean replace )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( DELETE );

        if ( replace )
        {
            cl.createArg().setValue( "-replace" );
        }

        for ( File f : files )
        {
            try
            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.cli.Commandline$Argument

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.