3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 09:34:08 +00:00

update script to generate file directly instead of from makefile

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-11-14 13:44:40 -08:00
parent c49d71ba66
commit 2501a875ef

View file

@ -2399,36 +2399,32 @@ class DotNetExampleComponent(ExampleComponent):
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('<Project Sdk="Microsoft.NET.Sdk">', True)
mk_echo(' <PropertyGroup>')
mk_echo(' <OutputType>Exe</OutputType>')
mk_echo(' <TargetFramework>netcoreapp2.0</TargetFramework>')
proj_path = os.path.join(BUILD_DIR, proj_name)
if VS_X64:
platform = 'x64'
elif VS_ARM:
platform = 'ARM'
else:
platform = 'x86'
mk_echo(' <PlatformTarget>%s</PlatformTarget>' % platform)
mk_echo(' </PropertyGroup>')
mk_echo(' <ItemGroup>')
mk_echo(' <Compile Include="%s/*.cs" />' % self.to_ex_dir)
mk_echo(' <Reference Include="Microsoft.Z3">')
mk_echo(' <HintPath>Microsoft.Z3.dll</HintPath>')
mk_echo(' </Reference>')
mk_echo(' </ItemGroup>')
mk_echo('</Project>')
dotnet_proj_str = """xemacs<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PlatformTarget>%s</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile Include="%s/*.cs" />
<Reference Include="Microsoft.Z3">
<HintPath>Microsoft.Z3.dll</HintPath>
</Reference>
</ItemGroup>
</Project>""" % (platform, self.to_ex_dir)
with open(proj_path, 'w') as ous:
ous.write(dotnet_proj_str)
out.write('\n')
dotnetCmdLine = [DOTNET, "build", proj_name]
dotnetCmdLine.extend(['-c'])
if DEBUG_MODE: