Examples of TagScmResult


Examples of org.apache.maven.scm.command.tag.TagScmResult

        {
            FileUtils.fileWrite( messageFile.getAbsolutePath(), scmTagParameters.getMessage() );
        }
        catch ( IOException ex )
        {
            return new TagScmResult( null, "Error while making a temporary file for the commit message: "
                + ex.getMessage(), null, false );
        }

        try
        {
            CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

            int exitCode;

            Commandline clTag = createCommandLine( repository, fileSet.getBasedir(), tag, messageFile );

            exitCode = GitCommandLineUtils.execute( clTag, stdout, stderr, getLogger() );
            if ( exitCode != 0 )
            {
                return new TagScmResult( clTag.toString(), "The git-tag command failed.", stderr.getOutput(), false );
            }

            if( repo.isPushChanges() )
            {
                // and now push the tag to the configured upstream repository
                Commandline clPush = createPushCommandLine( repository, fileSet, tag );
   
                exitCode = GitCommandLineUtils.execute( clPush, stdout, stderr, getLogger() );
                if ( exitCode != 0 )
                {
                    return new TagScmResult( clPush.toString(), "The git-push command failed.", stderr.getOutput(), false );
                }
            }
           
            // plus search for the tagged files
            GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.TAGGED );

            Commandline clList = GitListCommand.createCommandLine( repository, fileSet.getBasedir() );

            exitCode = GitCommandLineUtils.execute( clList, listConsumer, stderr, getLogger() );
            if ( exitCode != 0 )
            {
                return new CheckOutScmResult( clList.toString(), "The git-ls-files command failed.",
                                              stderr.getOutput(), false );
            }

            return new TagScmResult( clTag.toString(), listConsumer.getListedFiles() );
        }
        finally
        {
            try
            {
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.