diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 88d7d7246..aaeed1dea 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -2391,7 +2391,50 @@ class DotNetExampleComponent(ExampleComponent): out.write('\n') out.write('_ex_%s: %s\n\n' % (self.name, exefile)) if is_dotnet_core_enabled(): - print("TBD: build script for dotnet_example on core") + proj_name = 'dotnet_example.csproj' + out.write('_ex_%s:' % self.name) + for csfile in get_cs_files(self.ex_dir): + out.write(' ') + out.write(os.path.join(self.to_ex_dir, csfile)) + + def mk_echo(msg, first = False): + echo_ex_qu = '' if IS_WINDOWS else '"' + echo_in_qu = '"' if IS_WINDOWS else '\\"' + echo_esc = '^' if IS_WINDOWS else '' + echo_dir = '>' if first else '>>' + + msg = msg.replace('"', echo_in_qu).replace('<', echo_esc + '<').replace('>', echo_esc + '>') + out.write('\t@echo %s%s%s %s %s\n' % (echo_ex_qu, msg, echo_ex_qu, echo_dir, proj_name)) + + out.write('\n') + mk_echo('', True) + mk_echo(' ') + mk_echo(' Exe') + mk_echo(' netcoreapp2.0') + if VS_X64: + platform = 'x64' + elif VS_ARM: + platform = 'ARM' + else: + platform = 'x86' + mk_echo(' %s' % platform) + mk_echo(' ') + mk_echo(' ') + mk_echo(' ' % self.to_ex_dir) + mk_echo(' ') + mk_echo(' Microsoft.Z3.dll') + mk_echo(' ') + mk_echo(' ') + mk_echo('') + + dotnetCmdLine = [DOTNET, "build", proj_name] + dotnetCmdLine.extend(['-c']) + if DEBUG_MODE: + dotnetCmdLine.extend(['Debug']) + else: + dotnetCmdLine.extend(['Release']) + MakeRuleCmd.write_cmd(out, ' '.join(dotnetCmdLine)) + out.write('\n') class JavaExampleComponent(ExampleComponent): def __init__(self, name, path):