Skip to content

Commit

Permalink
Issue checkstyle#617: Remove -PublishXdocWithPush and -PublishXdoc co…
Browse files Browse the repository at this point in the history
…mmand
  • Loading branch information
Rahulkhinchi03 authored and rnveach committed Jul 9, 2022
1 parent 9c63ffc commit 292f28c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 236 deletions.
6 changes: 0 additions & 6 deletions releasenotes-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ java -jar releasenotes-builder-1.0-all.jar -localRepoPath <arg> \
-releaseNumber <arg> [-outputLocation <args>] [-githubAuthToken <arg>] \
[-generateAll] [-generateXdoc] [-generateTwit] [-generateRss] [-generateMlist] \
[-xdocTemplate] [-twitterTemplate] [-rssTemplate] [-mlistTemplate] \
[-publishXdoc] [-publishXdocWithPush] \
[-publishAllSocial] [-publishTwit] [-twitterConsumerKey <arg>] [-twitterConsumerSecret <arg>] \
[-twiterAccessToken <arg>] [-twitterAccessTokenSecret <arg>] [-twitterProperties <arg>] \
[-publishMlist] [-mlistUsername <arg>] [-mlistPassword <arg>] [-mlistProperties <arg>] \
Expand Down Expand Up @@ -77,11 +76,6 @@ Generated files will be at specified output location.

**mlistTemplate** - (optional) path to the external mailing list freemarker template file.

**publishXdoc** - (optional) Make commit in local checkstyle repo with releasenotes.
Notes are read from ```xdoc.xml```.

**publishXdocWithPush** - (optional) Make push of a commit from ```publishXdoc```.

**publishAllSocial** - (optional) publish all possible posts. Posts are read from generated files.

**publishTwit** - (optional) publish on Twitter from ```twitter.txt```.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ public final class CliOptions {
/** Properties for connection to Twitter. */
private String twitterProperties;

/** Whether to publish xdoc. */
private boolean publishXdoc;
/** Whether to publish xdoc with push. */
private boolean publishXdocWithPush;

/** Whether to publish to mailing list. */
private boolean publishMlist;
/** Username to publish to mailing list. */
Expand Down Expand Up @@ -308,24 +303,6 @@ public String getTwitterAccessTokenSecret() {
return twitterAccessTokenSecret;
}

/**
* Returns whether to publish xdoc.
*
* @return whether to publish xdoc
*/
public boolean isPublishXdoc() {
return publishXdoc;
}

/**
* Returns whether to publish xdoc with push.
*
* @return whether to publish xdoc with push
*/
public boolean isPublishXdocWithPush() {
return publishXdocWithPush;
}

/**
* Returns whether to publish to mailing list.
*
Expand Down Expand Up @@ -665,30 +642,6 @@ public Builder setTwitterProperties(String twProperties) {
return this;
}

/**
* Specify to publish Xdoc update.
*
* @param pubXdoc flag to publish xdoc file update
* @return Builder Object
* @noinspection ReturnOfInnerClass
*/
public Builder setPublishXdoc(boolean pubXdoc) {
publishXdoc = pubXdoc;
return this;
}

/**
* Specify to publish xdoc update and do push to remote git.
*
* @param pubXdocWithPush flag to publish xdoc and push to remote repo
* @return Builder Object
* @noinspection ReturnOfInnerClass
*/
public Builder setPublishXdocWithPush(boolean pubXdocWithPush) {
publishXdocWithPush = pubXdocWithPush;
return this;
}

/**
* Specify to do publication only for mailing list.
*
Expand Down Expand Up @@ -949,8 +902,6 @@ private CliOptions getNewCliOptionsInstance() {
cliOptions.twitterAccessToken = twitterAccessToken;
cliOptions.twitterAccessTokenSecret = twitterAccessTokenSecret;
cliOptions.twitterProperties = twitterProperties;
cliOptions.publishXdoc = publishXdoc;
cliOptions.publishXdocWithPush = publishXdocWithPush;
cliOptions.publishMlist = publishMlist;
cliOptions.mlistUsername = mlistUsername;
cliOptions.mlistPassword = mlistPassword;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ public class CliProcessor {
private static final String OPTION_PUBLISH_ALL_SOCIAL = "publishAllSocial";
/** Name for the option 'publishTwit'. */
private static final String OPTION_PUBLISH_TWIT = "publishTwit";
/** Name for the option 'publishXdoc'. */
private static final String OPTION_PUBLISH_XDOC = "publishXdoc";
/** Name for the option 'publishXdocWithPush'. */
private static final String OPTION_PUBLISH_XDOC_WITH_PUSH = "publishXdocWithPush";
/** Name for the option 'publishMlist'. */
private static final String OPTION_PUBLISH_MLIST = "publishMlist";
/** Name for the option 'publishSfRss'. */
Expand Down Expand Up @@ -184,10 +180,6 @@ private List<String> validateCli() {
result.add("Release number has not been specified!");
}

if (cmdLine.hasOption(OPTION_PUBLISH_XDOC_WITH_PUSH)
&& cmdLine.getOptionValue(OPTION_AUTH_TOKEN) == null) {
result.add("Auth token should not be null for xdoc publication with push.");
}
if (cmdLine.hasOption(OPTION_XDOC_TEMPLATE)) {
final String path = cmdLine.getOptionValue(OPTION_XDOC_TEMPLATE);
if (!Files.isRegularFile(Paths.get(path))) {
Expand Down Expand Up @@ -241,8 +233,6 @@ public CliOptions getCliOptions() {
.setMlistTemplate(cmdLine.getOptionValue(OPTION_MLIST_TEMPLATE))
.setPublishAllSocial(cmdLine.hasOption(OPTION_PUBLISH_ALL_SOCIAL))
.setPublishTwit(cmdLine.hasOption(OPTION_PUBLISH_TWIT))
.setPublishXdoc(cmdLine.hasOption(OPTION_PUBLISH_XDOC))
.setPublishXdocWithPush(cmdLine.hasOption(OPTION_PUBLISH_XDOC_WITH_PUSH))
.setTwitterConsumerKey(cmdLine.getOptionValue(OPTION_TWITTER_CONSUMER_KEY))
.setTwitterConsumerSecret(cmdLine.getOptionValue(OPTION_TWITTER_CONSUMER_SECRET))
.setTwitterAccessToken(cmdLine.getOptionValue(OPTION_TWITTER_ACCESS_TOKEN))
Expand Down Expand Up @@ -293,8 +283,6 @@ private static Options buildOptions() {
"Access token secret for Twitter.");
options.addOption(OPTION_TWITTER_PROPERTIES, true,
"Properties for publication on Twitter.");
options.addOption(OPTION_PUBLISH_XDOC, "Whether to publish xdoc.");
options.addOption(OPTION_PUBLISH_XDOC_WITH_PUSH, "Whether to publish xdoc with push.");
return options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.github.checkstyle.publishers.MailingListPublisher;
import com.github.checkstyle.publishers.SourceforgeRssPublisher;
import com.github.checkstyle.publishers.TwitterPublisher;
import com.github.checkstyle.publishers.XdocPublisher;
import com.github.checkstyle.templates.TemplateProcessor;
import com.google.common.collect.Multimap;
import freemarker.template.TemplateException;
Expand Down Expand Up @@ -126,9 +125,6 @@ private static void runPostGeneration(Multimap<String, ReleaseNotesMessage> rele
*/
private static List<String> runPostPublication(CliOptions cliOptions) {
final List<String> errors = new ArrayList<>();
if (cliOptions.isPublishXdoc()) {
runXdocPublication(cliOptions, errors);
}
if (cliOptions.isPublishAllSocial() || cliOptions.isPublishTwit()) {
runTwitterPublication(cliOptions, errors);
}
Expand All @@ -141,26 +137,6 @@ private static List<String> runPostPublication(CliOptions cliOptions) {
return errors;
}

/**
* Publish on xdoc.
*
* @param cliOptions command line options.
* @param errors list of publication errors.
*/
private static void runXdocPublication(CliOptions cliOptions, List<String> errors) {
final XdocPublisher xdocPublisher = new XdocPublisher(
cliOptions.getOutputLocation() + XDOC_FILENAME, cliOptions.getLocalRepoPath(),
cliOptions.getReleaseNumber(), cliOptions.isPublishXdocWithPush(),
cliOptions.getAuthToken());
try {
xdocPublisher.publish();
}
// -@cs[IllegalCatch] We should execute all publishers, so cannot fail-fast
catch (Exception ex) {
errors.add(ex.toString());
}
}

/**
* Publish on Twitter.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ Prepare releasenotes 7.3 for commit in /home/user/opensource/checkstyle:
java -jar releasenotes-builder-1.0-all.jar \
-localRepoPath /home/user/opensource/checkstyle -startRef checkstyle-7.2 \
-releaseNumber 7.3 -githubAuthToken a0b1234567890ad1234e5678fc9e01234a56d789 \
-generateXdoc -publishXdoc
-generateXdoc
```

to make push just add `-publishXdocWithPush` option

## Twitter

```bash
Expand Down

This file was deleted.

0 comments on commit 292f28c

Please sign in to comment.