Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow same property configure to different goal. #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,24 @@
@Mojo(name = "feature-finish", aggregator = true)
public class GitFlowFeatureFinishMojo extends AbstractGitFlowMojo {

/** Whether to keep feature branch after finish. */
/**
* Whether to keep feature branch after finish.
*
* @deprecated 1.13.0 Use {@link #keepBranchFeature}
*/
@Parameter(property = "keepBranch", defaultValue = "false")
@Deprecated
private boolean keepBranch = false;


/**
* Whether to keep feature branch after finish.
*
* @since 1.13.0
*/
@Parameter(property = "keepBranchFeature", defaultValue = "false")
private boolean keepBranchFeature = false;

/**
* Whether to skip calling Maven test goal before merging the branch.
*
Expand All @@ -60,10 +74,20 @@ public class GitFlowFeatureFinishMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.3.0
* @deprecated 1.13.0 Use {@link #pushRemoteFeatureFinish}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "true")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteFeatureFinish", defaultValue = "true")
private boolean pushRemoteFeatureFinish = true;

/**
* Feature name to use in non-interactive mode.
*
Expand Down Expand Up @@ -153,15 +177,15 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteFeatureFinish) {
gitPush(gitFlowConfig.getDevelopmentBranch(), false);

if (!keepBranch) {
if (!keepBranchFeature) {
gitPushDelete(featureBranchName);
}
}

if (!keepBranch) {
if (!keepBranchFeature) {
if (featureSquash) {
// git branch -D feature/...
gitBranchDeleteForce(featureBranchName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,20 @@ public class GitFlowFeatureStartMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.6.0
* @deprecated 1.13.0 Use {@link #pushRemoteFeatureStart}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "false")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteFeatureStart", defaultValue = "false")
private boolean pushRemoteFeatureStart = false;

/**
* Feature name to use in non-interactive mode.
*
Expand Down Expand Up @@ -153,7 +163,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteFeatureStart) {
gitPush(gitFlowConfig.getFeatureBranchPrefix()
+ featureBranchName, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,24 @@ public class GitFlowHotfixFinishMojo extends AbstractGitFlowMojo {
@Parameter(property = "skipTag", defaultValue = "false")
private boolean skipTag = false;

/** Whether to keep hotfix branch after finish. */
/**
* Whether to keep hotfix branch after finish.
*
* @deprecated 1.13.0 Use {@link #keepBranchHotfix}
*
*/
@Deprecated
@Parameter(property = "keepBranch", defaultValue = "false")
private boolean keepBranch = false;

/**
* Whether to keep hotfix branch after finish.
*
* @since 1.13.0
*/
@Parameter(property = "keepBranchHotfix", defaultValue = "false")
private boolean keepBranchHotfix = false;

/**
* Whether to skip calling Maven test goal before merging the branch.
*
Expand All @@ -57,10 +71,20 @@ public class GitFlowHotfixFinishMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.3.0
* @deprecated 1.13.0 Use {@link #pushRemoteHotfixFinish}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "true")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.3.0
*/
@Parameter(property = "pushRemoteHotfixFinish", defaultValue = "true")
private boolean pushRemoteHotfixFinish = true;

/**
* Maven goals to execute in the hotfix branch before merging into the
* production or support branch.
Expand Down Expand Up @@ -315,7 +339,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteHotfixFinish) {
if (supportBranchName != null) {
gitPush(supportBranchName, !skipTag);
} else {
Expand All @@ -329,12 +353,12 @@ && notSameProdDevName()) { // if no release branch
}
}

if (!keepBranch) {
if (!keepBranchHotfix) {
gitPushDelete(hotfixBranchName);
}
}

if (!keepBranch) {
if (!keepBranchHotfix) {
if (skipMergeProdBranch){
//force delete as upstream merge is skipped
gitBranchDeleteForce(hotfixBranchName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,20 @@ public class GitFlowHotfixStartMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.6.0
* @deprecated 1.13.0 Use {@link #pushRemoteHotfixStart}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "false")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteHotfixStart", defaultValue = "false")
private boolean pushRemoteHotfixStart = false;

/**
* Branch to start hotfix in non-interactive mode. Production branch or one of
* the support branches.
Expand Down Expand Up @@ -246,7 +256,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteHotfixStart) {
gitPush(hotfixBranchName, false);
}
} catch (CommandLineException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,23 @@ public class GitFlowReleaseFinishMojo extends AbstractGitFlowMojo {
@Parameter(property = "skipTag", defaultValue = "false")
private boolean skipTag = false;

/** Whether to keep release branch after finish. */
/**
* Whether to keep release branch after finish.
*
* @deprecated 1.13.0 Use {@link #keepBranchRelease}
*/
@Parameter(property = "keepBranch", defaultValue = "false")
@Deprecated
private boolean keepBranch = false;

/**
* Whether to keep release branch after finish.
*
* @since 1.13.0
*/
@Parameter(property = "keepBranchRelease", defaultValue = "false")
private boolean keepBranchRelease = false;

/**
* Whether to skip calling Maven test goal before merging the branch.
*
Expand Down Expand Up @@ -78,10 +91,20 @@ public class GitFlowReleaseFinishMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.3.0
* @deprecated 1.13.0 Use {@link #pushRemoteReleaseFinish}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "true")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteReleaseFinish", defaultValue = "true")
private boolean pushRemoteReleaseFinish = true;

/**
* Whether to use <code>--ff-only</code> option when merging.
*
Expand Down Expand Up @@ -331,18 +354,18 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteReleaseFinish) {
gitPush(gitFlowConfig.getProductionBranch(), !skipTag);
if (notSameProdDevName()) {
gitPush(gitFlowConfig.getDevelopmentBranch(), !skipTag);
}

if (!keepBranch) {
if (!keepBranchRelease) {
gitPushDelete(releaseBranch);
}
}

if (!keepBranch) {
if (!keepBranchRelease) {
// git branch -d release/...
gitBranchDelete(releaseBranch);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,20 @@ public class GitFlowReleaseMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.3.0
* @deprecated 1.13.0 {@link #pushRemoteRelease}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "true")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteRelease", defaultValue = "true")
private boolean pushRemoteRelease = true;

/**
* Release version to use instead of the default next release version in non
* interactive mode.
Expand Down Expand Up @@ -323,7 +333,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteRelease) {
gitPush(gitFlowConfig.getProductionBranch(), !skipTag);
if (notSameProdDevName()) {
gitPush(gitFlowConfig.getDevelopmentBranch(), !skipTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,20 @@ public class GitFlowReleaseStartMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.6.0
* @deprecated 1.13.0 Use {@link #pushRemoteReleaseStart}
*/
@Parameter(property = "pushRemote", defaultValue = "false")
@Deprecated
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteReleaseStart", defaultValue = "false")
private boolean pushRemoteReleaseStart = false;

/**
* Whether to commit development version when starting the release (vs when
* finishing the release which is the default). Has effect only when there
Expand Down Expand Up @@ -232,7 +242,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteReleaseStart) {
if (commitDevelopmentVersionAtStart) {
gitPush(gitFlowConfig.getDevelopmentBranch(), false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,20 @@ public class GitFlowSupportStartMojo extends AbstractGitFlowMojo {
* Whether to push to the remote.
*
* @since 1.6.0
* @deprecated 1.13.0 Use {@link #pushRemoteSupport}
*/
@Deprecated
@Parameter(property = "pushRemote", defaultValue = "true")
private boolean pushRemote;

/**
* Whether to push to the remote.
*
* @since 1.13.0
*/
@Parameter(property = "pushRemoteSupport", defaultValue = "true")
private boolean pushRemoteSupport = true;

/**
* Tag name to use in non-interactive mode.
*
Expand Down Expand Up @@ -108,7 +118,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
mvnCleanInstall();
}

if (pushRemote) {
if (pushRemoteSupport) {
gitPush(gitFlowConfig.getSupportBranchPrefix() + tag, false);
}
} catch (CommandLineException e) {
Expand Down