The slight convenience afforded by this opt doesn't seem worth the additional complexity. This script produces a self-contained application folder. Decisions on what to do with that folder (whether or not to zip it, etc.) are best left upstream.
50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
import argparse
|
|
from pathlib import Path
|
|
|
|
from build_spark import build
|
|
from build_spark import SparkPaths
|
|
|
|
|
|
def _get_arg_parser():
|
|
parser = argparse.ArgumentParser(
|
|
description='Publish a self-contined spark client application')
|
|
|
|
parser.add_argument(
|
|
'-o',
|
|
'--output-dir',
|
|
metavar='path',
|
|
type=str,
|
|
nargs='?',
|
|
help='The directory in which to build')
|
|
|
|
parser.add_argument(
|
|
'--verbosity',
|
|
metavar='[q(uiet)|m(inimal)|n(ormal)|d(etailed)|diag(nostic)]',
|
|
choices=[
|
|
'q', 'quiet', 'm', 'minimal', 'n', 'normal', 'd', 'detailed',
|
|
'diag', 'diagnostic'
|
|
],
|
|
type=str,
|
|
help='The output verbosity level')
|
|
|
|
parser.set_defaults(
|
|
restore=True, cpp=True, csharp=True, verbosity='minimal')
|
|
return parser
|
|
|
|
|
|
def _main():
|
|
parser = _get_arg_parser()
|
|
args = parser.parse_args()
|
|
output_dir = args.output_dir or SparkPaths.default_build()
|
|
output_dir = Path(output_dir)
|
|
build(
|
|
configuration='release',
|
|
restore=True,
|
|
build_dir=output_dir,
|
|
targets=['publish'],
|
|
verbosity=args.verbosity)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
_main()
|