Tuning gws script
Work correctly with modules
This commit is contained in:
33
bin/gws
33
bin/gws
@@ -16,43 +16,44 @@ StrIter = Iterable[str]
|
|||||||
GwCommand = 'gw'
|
GwCommand = 'gw'
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
|
actions = (
|
||||||
|
'clean',
|
||||||
|
'build',
|
||||||
|
'compileTestKotlin',
|
||||||
|
# todo only if there no -x prefix
|
||||||
|
'test',
|
||||||
|
'componentTest',
|
||||||
|
'shadowJar'
|
||||||
|
)
|
||||||
|
|
||||||
shortcuts = {
|
shortcuts = {
|
||||||
'c': ['clean'],
|
'c': ['clean'],
|
||||||
'b': ['build'],
|
'b': ['build'],
|
||||||
't': ['test'],
|
't': ['test'],
|
||||||
'bt': ['compileTestKotlin'],
|
'bt': ['compileTestKotlin'],
|
||||||
'ct': ['componentTest'],
|
'ct': ['componentTest'],
|
||||||
|
'tct': ['test', 'componentTest'],
|
||||||
'cb': ['clean', 'build'],
|
'cb': ['clean', 'build'],
|
||||||
'cbx': ['clean', 'build', '-x', 'test'],
|
'cbx': ['clean', 'build', '-x', 'test'],
|
||||||
'cbt': ['clean', 'build', 'compileTestKotlin', '-x', 'test'],
|
'cbt': ['clean', 'build', 'compileTestKotlin', '-x', 'test'],
|
||||||
'ctt': ['cleanComponentTest'],
|
|
||||||
'cct': ['cleanComponentTest'],
|
'cct': ['cleanComponentTest'],
|
||||||
'rt': ['cleanTest', 'test'],
|
'rt': ['cleanTest', 'test'],
|
||||||
'rct': ['cleanComponentTest', 'componentTest'],
|
'rct': ['cleanComponentTest', 'componentTest'],
|
||||||
'nd': ['-x', 'detekt'],
|
'nd': ['-x', 'detekt'],
|
||||||
'-nd': ['-x', 'detekt'],
|
'-nd': ['-x', 'detekt'],
|
||||||
'xt': ['-x', 'test'],
|
'xt': ['-x', 'test'],
|
||||||
|
'-nt': ['-x', 'test'],
|
||||||
'br': ['bootRun'],
|
'br': ['bootRun'],
|
||||||
'rb': ['bootRun'],
|
'rb': ['bootRun'],
|
||||||
'jar': ['shadowJar'],
|
'jar': ['shadowJar'],
|
||||||
'-nt': ['-x', 'test'],
|
|
||||||
'-nc': ['--no-build-cache'],
|
'-nc': ['--no-build-cache'],
|
||||||
'-rr': ['--rerun-tasks'],
|
'-rr': ['--rerun-tasks'],
|
||||||
'-wl': ['--write-locks'],
|
|
||||||
'-rt': ['--rerun-tasks'],
|
'-rt': ['--rerun-tasks'],
|
||||||
|
'-wl': ['--write-locks'],
|
||||||
'-ef': ['-Penvironment=free'],
|
'-ef': ['-Penvironment=free'],
|
||||||
'-el': ['-Penvironment=licensed'],
|
'-el': ['-Penvironment=licensed'],
|
||||||
'-lic': ['-Penvironment=licensed']
|
'-lic': ['-Penvironment=licensed']
|
||||||
}
|
}
|
||||||
actions = [
|
|
||||||
'clean',
|
|
||||||
'build',
|
|
||||||
'compileTestKotlin',
|
|
||||||
'test',
|
|
||||||
'componentTest',
|
|
||||||
'shadowJar'
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
help_text = """\
|
help_text = """\
|
||||||
Support functionality for gw application
|
Support functionality for gw application
|
||||||
@@ -111,12 +112,12 @@ def split_on_condition(lst: Sequence, condtion):
|
|||||||
|
|
||||||
|
|
||||||
def pair_module_with_action(args: Args) -> List[str]:
|
def pair_module_with_action(args: Args) -> List[str]:
|
||||||
modules, no_module = split_on_condition(args, is_module)
|
modules, rest_args = split_on_condition(args, is_module)
|
||||||
log("modules", modules)
|
log("modules", modules)
|
||||||
log("args", no_module)
|
log("args", rest_args)
|
||||||
if modules:
|
if modules:
|
||||||
_args = []
|
_args = []
|
||||||
for arg in no_module:
|
for arg in rest_args:
|
||||||
if arg in actions:
|
if arg in actions:
|
||||||
for module in modules:
|
for module in modules:
|
||||||
_args.append(module + ':' + arg)
|
_args.append(module + ':' + arg)
|
||||||
|
|||||||
Reference in New Issue
Block a user