public static void DownloadRuntimeToDirectory( string qtVersion, RuntimeTarget runtimeTarget, string destinationDirectory) { var extractTarGZStreamDel = ExtractTarGZStream; if (extractTarGZStreamDel == null) { throw new Exception("You must set RuntimeManager.ExtractTarGZStream to properly extract a tar file."); } if (!Directory.Exists(destinationDirectory)) { throw new Exception($"The directory \"{destinationDirectory}\" doesn't exist."); } if (Directory.GetFiles(destinationDirectory).Length > 0) { throw new Exception("The directory is not empty"); } if (Directory.GetDirectories(destinationDirectory).Length > 0) { throw new Exception("The directory is not empty"); } var url = BuildRuntimeUrl(qtVersion, runtimeTarget); GetUrlStream(url, stream => { extractTarGZStreamDel(stream, destinationDirectory); }); }
static int Main(string[] args) { File.WriteAllText("dotnetversion.txt", System.Environment.Version.ToString()); RuntimeTarget target = RuntimeTarget.Windows64; MethodInfo runtimeTargetToString = typeof(RuntimeManager).GetMethod("RuntimeTargetToString", BindingFlags.Static | BindingFlags.NonPublic); string targetString = (string)runtimeTargetToString.Invoke(null, new object[] { target }); string qtVersion = QmlNetConfig.QtBuildVersion; string qtVersionString = $"{qtVersion}-{targetString}"; File.WriteAllText("qtversion.txt", qtVersionString); return(0); }
private static string RuntimeTargetToString(RuntimeTarget target) { switch (target) { case RuntimeTarget.Windows64: return("win-x64"); case RuntimeTarget.LinuxX64: return("linux-x64"); case RuntimeTarget.OSX64: return("osx-x64"); case RuntimeTarget.Unsupported: throw new Exception("Unsupported target"); default: throw new Exception($"Unknown target {target}"); } }
public static string FindQtRuntime(string[] runtimeDirectories, string qtVersion, RuntimeTarget target) { if (runtimeDirectories.Length == 0) { return(null); } var expectedVersion = $"{qtVersion}-{RuntimeTargetToString(target)}"; foreach (var potentialRuntimeDirectory in runtimeDirectories) { if (!Directory.Exists(potentialRuntimeDirectory)) { // Obviously nothing here... continue; } // Maybe this directory contains a Qt runtime? var versionPath = Path.Combine(potentialRuntimeDirectory, "version.txt"); if (File.Exists(versionPath)) { var version = File.ReadAllText(versionPath).Trim(Environment.NewLine.ToCharArray()); if (version == expectedVersion) { // Found it! return(potentialRuntimeDirectory); } } // Maybe there are nested directories of runtimes? var nestedDirectory = Path.Combine(potentialRuntimeDirectory, expectedVersion); if (Directory.Exists(nestedDirectory)) { versionPath = Path.Combine(nestedDirectory, "version.txt"); if (File.Exists(versionPath)) { var version = File.ReadAllText(versionPath).Trim(Environment.NewLine.ToCharArray()); if (version == expectedVersion) { // Found it! return(nestedDirectory); } } } } return(null); }
public VirtualDomTarget(RuntimeTarget defaultTarget, IDictionary <string, string> tagNamesToSourceFiles) { _defaultTarget = defaultTarget; _tagNamesToSourceFiles = tagNamesToSourceFiles; }
public Visitor(RuntimeTarget target, CSharpRenderingContext context, IDictionary <string, string> tagNamesToSourceFiles) { _target = target; _context = context; _tagNamesToSourceFiles = tagNamesToSourceFiles; }
public VirtualDomDocumentWriter(RuntimeTarget target, CSharpRenderingContext context, IDictionary <string, string> tagNamesToSourceFiles) { _target = target; _context = context; _tagNamesToSourceFiles = tagNamesToSourceFiles; }