summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-06-07 17:11:26 +0200
committerJose <jose@zeroc.com>2017-06-07 17:11:26 +0200
commitac7cc3a146e1add06c1e419f122f17fd64b6a804 (patch)
treeb29288b9c8895b8d316ff922b19423d5dc27de36 /scripts/Util.py
parentFixed (ICE-7973) - C++ allTests.py broken for V140 release (diff)
downloadice-ac7cc3a146e1add06c1e419f122f17fd64b6a804.tar.bz2
ice-ac7cc3a146e1add06c1e419f122f17fd64b6a804.tar.xz
ice-ac7cc3a146e1add06c1e419f122f17fd64b6a804.zip
Fix (ICE-7984) - C++ dist testing script error
Diffstat (limited to 'scripts/Util.py')
-rw-r--r--scripts/Util.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/Util.py b/scripts/Util.py
index 017a298af3c..4caa4a3d0fa 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -228,6 +228,7 @@ class Windows(Platform):
def __init__(self):
Platform.__init__(self)
self.compiler = ""
+ self.nugetPackageVersion = None
def getFilters(self, config):
if config.uwp:
@@ -280,6 +281,12 @@ class Windows(Platform):
pass
return self.compiler
+ def getNugetPackageVersion(self):
+ if not self.nugetPackageVersion:
+ with open(os.path.join(toplevel, "config", "icebuilder.props"), "r") as configFile:
+ self.nugetPackageVersion = re.search("<IceJSONVersion>(.*)</IceJSONVersion>", configFile.read()).group(1)
+ return self.nugetPackageVersion
+
def getPlatformToolset(self):
return self.getCompiler().replace("VC", "v")
@@ -292,18 +299,16 @@ class Windows(Platform):
config = "Debug" if buildConfig.find("Debug") >= 0 else "Release"
if current.driver.useIceBinDist(mapping):
-
- with open(os.path.join(toplevel, "config", "icebuilder.props"), "r") as configFile:
- version = re.search("<IceJSONVersion>(.*)</IceJSONVersion>", configFile.read()).group(1)
+ version = self.getNugetPackageVersion()
packageSuffix = self.getPlatformToolset() if isinstance(mapping, CppMapping) else "net"
package = os.path.join(mapping.path, "msbuild", "packages", "{0}".format(
mapping.getNugetPackage(packageSuffix, version))) if hasattr(mapping, "getNugetPackage") else None
nuget = package and os.path.exists(package)
- if (not nuget):
+ if not nuget:
return "bin"
- elif csharp or isinstance(process, SliceTranslator):
+ elif isinstance(mapping, CSharpMapping) or isinstance(process, SliceTranslator):
return os.path.join("tools")
else:
@@ -340,10 +345,7 @@ class Windows(Platform):
platform = current.config.buildPlatform
config = "Debug" if current.config.buildConfig.find("Debug") >= 0 else "Release"
-
- with open(os.path.join(toplevel, "config", "icebuilder.props"), "r") as configFile:
- version = re.search("<IceJSONVersion>(.*)</IceJSONVersion>", configFile.read()).group(1)
-
+ version = self.getNugetPackageVersion()
packageSuffix = self.getPlatformToolset() if isinstance(mapping, CppMapping) else "net"
package = os.path.join(mapping.path, "msbuild", "packages", "{0}".format(
mapping.getNugetPackage(packageSuffix, version))) if hasattr(mapping, "getNugetPackage") else None