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

Updating JCommander to 1.78 #615

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.48</version>
<version>1.78</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void usage() {
*/
public void usage(String commandName) {
StringBuilder stringBuilder = new StringBuilder();
jCommander.usage(commandName, stringBuilder, "");
jCommander.getUsageFormatter().usage(commandName, stringBuilder, "");
consoleWriter.a(stringBuilder).println();
}

Expand All @@ -206,7 +206,8 @@ public void createJCommanderForRun() {
logger.debug("Create JCommander instance");
jCommander = new JCommander();

jCommander.setAcceptUnknownOptions(true);
// TODO: Cant enable this until https://github.com/cbeust/jcommander/issues/377 is fixed
// jCommander.setAcceptUnknownOptions(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that was used to pass extra configuration to spring ... not sure if it is actually used today

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeeyi Is this used on your side?


logger.debug("Initialize the JCommander instance");
jCommander.setProgramName(PROGRAM_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public Long answer(InvocationOnMock invocation) throws Throwable {

localizeDropFiles(dropRepository.findById(dropId).orElse(null));

l10nJCommander.run(new String[]{"drop-import", "-r", repository.getName(), "--number-drop-fetched", "1000"});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😨

l10nJCommander.run(new String[]{"drop-import", "-r", repository.getName(), "--number-drops-fetched", "1000"});

int numberOfFrenchTranslationsAfter = getNumberOfFrenchTranslations(repository);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ public void importXcodeXliff() throws Exception {

getL10nJCommander().run("push", "-r", repository.getName(),
"-s", getInputResourcesTestDir("source").getAbsolutePath(),
"-t", getInputResourcesTestDir("translations").getAbsolutePath(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Push command doesn't have any -t parameter

"-ft", "XCODE_XLIFF");

getL10nJCommander().run("import", "-r", repository.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ public void execute() throws Exception {
Repository repository = repositoryService.createRepository(repoName, repoName + " description", null, false);
String projectId = testIdWatcher.getEntityName("projectId");

// TODO: For a plural separator like " _" this test will fail. The current version we have for
// JCommander trims the argument values, even when quoted.
// https://github.com/cbeust/jcommander/issues/417
// https://github.com/cbeust/jcommander/commit/4aec38b4a0ea63a8dc6f41636fa81c2ebafddc18
String pluralSeparator = "_";
String pluralSeparator = " _";
String skipTextUnitPattern = "%skip_text_pattern";
String skipAssetPattern = "%skip_asset_pattern%";
List<String> options = Arrays.asList(
Expand Down