2020-10-13 14:55:07 +02:00
|
|
|
#!/usr/bin/env python3
|
2019-11-10 04:58:04 +01:00
|
|
|
|
2019-11-13 21:09:19 +01:00
|
|
|
import sys
|
|
|
|
|
2019-11-10 04:58:04 +01:00
|
|
|
from os.path import join as path_join
|
|
|
|
from options import *
|
|
|
|
from os_utils import *
|
|
|
|
|
|
|
|
|
|
|
|
def build(opts: BaseOpts):
|
|
|
|
build_dir = '%s/mcs/class/reference-assemblies' % opts.mono_source_root
|
|
|
|
install_dir = path_join(opts.install_dir, 'reference-assemblies')
|
|
|
|
|
|
|
|
mkdir_p(install_dir)
|
|
|
|
|
2020-04-06 11:01:36 +02:00
|
|
|
make_args = make_default_args(opts)
|
|
|
|
make_args += ['-C', build_dir, 'build-reference-assemblies']
|
|
|
|
|
2019-11-10 04:58:04 +01:00
|
|
|
run_command('make', args=make_args, name='make build-reference-assemblies')
|
|
|
|
|
|
|
|
|
|
|
|
def install(opts: BaseOpts):
|
|
|
|
build_dir = '%s/mcs/class/reference-assemblies' % opts.mono_source_root
|
|
|
|
install_dir = path_join(opts.install_dir, 'reference-assemblies')
|
|
|
|
|
|
|
|
mkdir_p(install_dir)
|
|
|
|
|
2020-04-06 11:01:36 +02:00
|
|
|
make_args = make_default_args(opts)
|
|
|
|
make_args += ['-C', build_dir, 'install-local', 'DESTDIR=%s' % install_dir, 'prefix=/']
|
|
|
|
|
2019-11-10 04:58:04 +01:00
|
|
|
run_command('make', args=make_args, name='make install-local')
|
|
|
|
|
|
|
|
|
|
|
|
def clean(opts: BaseOpts):
|
|
|
|
install_dir = path_join(opts.install_dir, 'reference-assemblies')
|
|
|
|
rm_rf(install_dir)
|
|
|
|
|
|
|
|
|
|
|
|
def main(raw_args):
|
|
|
|
import cmd_utils
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
'build': build,
|
|
|
|
'install': install,
|
|
|
|
'clean': clean
|
|
|
|
}
|
|
|
|
|
|
|
|
parser = cmd_utils.build_arg_parser(description='Copy the reference assemblies')
|
|
|
|
|
|
|
|
default_help = 'default: %(default)s'
|
|
|
|
|
|
|
|
parser.add_argument('action', choices=actions.keys())
|
|
|
|
|
|
|
|
cmd_utils.add_base_arguments(parser, default_help)
|
|
|
|
|
|
|
|
args = parser.parse_args(raw_args)
|
|
|
|
|
|
|
|
opts = base_opts_from_args(args)
|
|
|
|
|
2019-11-13 21:09:19 +01:00
|
|
|
try:
|
|
|
|
action = actions[args.action]
|
|
|
|
action(opts)
|
|
|
|
except BuildError as e:
|
|
|
|
sys.exit(e.message)
|
2019-11-10 04:58:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
from sys import argv
|
|
|
|
main(argv[1:])
|