private static string GetAmdPath(string testHarnessDirectory, string filePath, string relativeAmdRootPath) { string amdModulePath = FileProbe.GetRelativePath(testHarnessDirectory, filePath); amdModulePath = Path.Combine(relativeAmdRootPath, amdModulePath) .Replace(Path.GetExtension(filePath), "") .Replace("\\", "/") .Trim('/', '\\'); return(amdModulePath); }
private static string GetAmdPath(string filePath, string amdAppRoot) { string amdModulePath = FileProbe.GetRelativePath(amdAppRoot, filePath); amdModulePath = amdModulePath .Replace(Path.GetExtension(filePath), "") .Replace("\\", "/") .Trim('/', '\\'); return(amdModulePath); }
/// <summary> /// Add the AMD file paths for the Path and GeneratePath fields /// </summary> /// <param name="referencedFiles"></param> /// <param name="testHarnessDirectory"></param> /// <param name="testSettings"></param> public void SetupAmdFilePaths(List <ReferencedFile> referencedFiles, string testHarnessDirectory, ChutzpahTestSettingsFile testSettings) { // If the user set a AMD base path then we must relativize the amd path's using the path from the base path to the test harness directory string relativeAmdRootPath = ""; if (!string.IsNullOrEmpty(testSettings.AMDBasePath)) { relativeAmdRootPath = FileProbe.GetRelativePath(testSettings.AMDBasePath, testHarnessDirectory); } foreach (var referencedFile in referencedFiles) { referencedFile.AmdFilePath = GetAmdPath(testHarnessDirectory, referencedFile.Path, relativeAmdRootPath); if (!string.IsNullOrEmpty(referencedFile.GeneratedFilePath)) { referencedFile.AmdGeneratedFilePath = GetAmdPath(testHarnessDirectory, referencedFile.GeneratedFilePath, relativeAmdRootPath); } } }