public async Task E2ETestWindowsAsync( string runtime, string packageName, string packageVersion, bool shouldSkipTesting) { Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; var outputDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, packageName, packageVersion); string outputFileName; string outputFrameworkFileName; const string pythonVersion = "cp36"; IDictionary <string, string> filesToExtract = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); switch (Environment.OSVersion.Platform) { case PlatformID.Unix: if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { runtime = "osx"; outputFileName = filesToExtract["_pywrap_tensorflow_internal.so"] = "libtensorflow.dylib"; outputFrameworkFileName = filesToExtract["libtensorflow_framework.so"] = "libtensorflow_framework.dylib"; } else { outputFileName = filesToExtract["_pywrap_tensorflow_internal.so"] = "libtensorflow.so"; outputFrameworkFileName = filesToExtract["libtensorflow_framework.so"] = "libtensorflow_framework.so"; runtime = "linux"; } break; default: outputFileName = filesToExtract["_pywrap_tensorflow_internal.pyd"] = "libtensorflow.dll"; outputFrameworkFileName = null; break; } var libFullPath = Path.Combine(outputDir, outputFileName); await TensowflowBinariesBuildTaskUtils.BuildFromWheelAsync( runtime : runtime, pythonVersion : pythonVersion, pypiPackageName : packageName, pypiPackageVersion : packageVersion, outputDir : outputDir, filesToExtract : filesToExtract); FileAssert.Exists(libFullPath); if (!shouldSkipTesting) { ValidateNativeBinaryVersion(outputDir, packageVersion); } }
private Task <bool> ExecuteAsync() { if (!(FilesToExtract?.Length > 0)) { throw new ArgumentException($"{nameof(FilesToExtract)} property cannot be empty"); } var filesToExtract = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); foreach (var item in FilesToExtract) { filesToExtract[item.GetMetadata("OriginalFileName")] = item.GetMetadata("TargetFileName"); } return(TensowflowBinariesBuildTaskUtils.BuildFromWheelAsync( runtime: Runtime, pythonVersion: PythonVersion, pypiPackageName: PypiPackageName, pypiPackageVersion: PypiPackageVersion, outputDir: OutputDir, filesToExtract: filesToExtract)); }