From b633b4744135ec0e2e533b82e4aa718f12334183 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 13 Dec 2017 21:47:41 +0100 Subject: Rework C# project structure - .NET 4.5 projects go to msbuild\net45 - .NET Standard 2.0 projects go to msbuild\netstandard2.0 - .NET Standard projects can be build for different target frameworks the default is .NET Core 2.0 but this can be override setting IceTestsFramworks MSBuild property --- scripts/IceBoxUtil.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'scripts/IceBoxUtil.py') diff --git a/scripts/IceBoxUtil.py b/scripts/IceBoxUtil.py index c58fa3ae525..d53ebfc9e1a 100644 --- a/scripts/IceBoxUtil.py +++ b/scripts/IceBoxUtil.py @@ -14,6 +14,35 @@ class IceBox(ProcessFromBinDir, Server): processType = "icebox" + def __init__(self, *args, **kargs): + Server.__init__(self, *args, **kargs) + + # Find config file + if 'args' in kargs: + for v in kargs['args']: + if "--Ice.Config=" in v: + self.config = v.replace("--Ice.Config=", "") + break + + def setup(self, current): + mapping = self.mapping or current.testcase.getMapping() + # + # If running IceBox tests with .NET Core we need to generate a config + # file that use the service for the .NET Framework used to build the + # tests + # + if isinstance(mapping, CSharpMapping) and current.config.netframework: + + targetConfig = os.path.abspath( + self.config.strip('"').format(testdir=current.testsuite.getPath(), + iceboxconfigext=".{0}".format(current.config.netframework))) + baseConfig = targetConfig.rstrip(".{0}".format(current.config.netframework)) + with open(baseConfig, 'r') as config: + with open(targetConfig, 'w') as target: + for line in config.readlines(): + target.write(line.replace("\\net45\\", "\\netstandard2.0\\{0}\\".format(current.config.netframework))) + current.files.append(targetConfig) + class IceBoxAdmin(ProcessFromBinDir, Client): processType = "iceboxadmin" -- cgit v1.2.3