-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Minor cleanup, plus bring back the module file Git thought was…
… being deleted rather than replaced
- Loading branch information
Showing
6 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ import picocli.CommandLine.Command | |
commandListHeading = "%n@|green Commands:|@%n%n") | ||
class BaseCommand { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2020 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import picocli.CommandLine.Command | ||
import picocli.CommandLine.HelpCommand | ||
|
||
// If using local groovy files the subcommands section may highlight as bad syntax in IntelliJ - that's OK | ||
@Command(name = "module", | ||
synopsisSubcommandLabel = "COMMAND", // Default is [COMMAND] indicating optional, but sub command here is required | ||
subcommands = [ | ||
HelpCommand.class, // Adds standard help options (help as a subcommand, -h, and --help) | ||
Recurse.class, | ||
Update.class, | ||
Get.class], // Note that these Groovy classes *must* start with a capital letter for some reason | ||
description = "Sub command for interacting with modules") | ||
class Module extends ItemCommand { | ||
@Override | ||
ManagedItem getManager(String optionGitOrigin) { | ||
return new ManagedModule(optionGitOrigin) | ||
} | ||
|
||
// This is an example of a subcommand via method - used here so we can directly hit ManagedModule for something module-specific | ||
// If in an external Refresh.groovy it _could_ specify ManagedModule, but it then could be added later to a non-module and break | ||
@Command(name = "refresh", description = "Refreshes all build.gradle files in module directories") | ||
void refresh() { | ||
new ManagedModule().refreshGradle() | ||
} | ||
} |