Skip to content

Commit e2a8cb1

Browse files
committed
Fixed some regressions and updated the generation of documentation.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
1 parent ba944c4 commit e2a8cb1

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

QtSharp.CLI/Program.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static bool QueryQt(QtVersion qt, bool debug)
148148

149149
string emptyFile = Platform.IsWindows ? "NUL" : "/dev/null";
150150
string output;
151-
ProcessHelper.Run("gcc", string.Format("-v -E -x c++ {0}", emptyFile), out output);
151+
ProcessHelper.Run("gcc", string.Format("-v -E -x c++ {0}", emptyFile), out output, waitForExit: !Platform.IsWindows);
152152
qt.Target = Regex.Match(output, @"Target:\s*(?<target>[^\r\n]+)").Groups["target"].Value;
153153

154154
const string includeDirsRegex = @"#include <\.\.\.> search starts here:(?<includes>.+)End of search list";
@@ -200,7 +200,7 @@ static Dictionary<string, IList<string>> GetDependencies(QtVersion qt)
200200
var dependencies = new Dictionary<string, IList<string>>();
201201

202202
var parserOptions = new ParserOptions();
203-
parserOptions.addLibraryDirs(qt.Libs);
203+
parserOptions.addLibraryDirs(Platform.IsWindows ? qt.Bins : qt.Libs);
204204

205205
foreach (var libFile in qt.LibFiles)
206206
{
@@ -216,7 +216,7 @@ static Dictionary<string, IList<string>> GetDependencies(QtVersion qt)
216216
}
217217
else
218218
{
219-
var path = Path.Combine(qt.Libs, libFile);
219+
var path = Path.Combine(Platform.IsWindows ? qt.Bins : qt.Libs, libFile);
220220
dependencies[libFile] = ParseDependenciesFromLibtool(path).ToList();
221221
}
222222
}
@@ -318,8 +318,8 @@ public static int Main(string[] args)
318318
logredirect.Start();
319319
}
320320

321-
var qtSharp = new QtSharp(new QtModuleInfo(qt.QMake, qt.Make, qt.Headers, qt.Libs, libFile,
322-
qt.Target, qt.SystemIncludeDirs, qt.FrameworkDirs, qt.Docs));
321+
var qtSharp = new QtSharp(new QtModuleInfo(qt.QMake, qt.Make, qt.Headers, Platform.IsWindows ? qt.Bins : qt.Libs,
322+
libFile, qt.Target, qt.SystemIncludeDirs, qt.FrameworkDirs, qt.Docs));
323323
ConsoleDriver.Run(qtSharp);
324324

325325
if (File.Exists(qtSharp.LibraryName) && File.Exists(Path.Combine("release", qtSharp.InlinesLibraryName)))

QtSharp/Documentation.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,12 @@ public void DocumentType(Class type)
397397
Text = text,
398398
FullComment = new FullComment()
399399
};
400-
var paragraphComment = new ParagraphComment();
401-
paragraphComment.Content.Add(new TextComment { Text = briefText });
402-
paragraphComment.Content.AddRange(text.Split('\n').Select(t => new TextComment { Text = t }));
403-
type.Comment.FullComment.Blocks.Add(paragraphComment);
400+
var summary = new ParagraphComment();
401+
summary.Content.Add(new TextComment { Text = briefText });
402+
type.Comment.FullComment.Blocks.Add(summary);
403+
var remarks = new ParagraphComment();
404+
remarks.Content.AddRange(text.Split('\n').Select(t => new TextComment { Text = t }));
405+
type.Comment.FullComment.Blocks.Add(remarks);
404406
}
405407
}
406408
}

QtSharp/ProcessHelper.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace QtSharp
55
{
66
public class ProcessHelper
77
{
8-
public static string Run(string path, string args, out string error, bool readOutputByLines = false)
8+
public static string Run(string path, string args, out string error, bool readOutputByLines = false, bool waitForExit = true)
99
{
1010
try
1111
{
@@ -17,7 +17,10 @@ public static string Run(string path, string args, out string error, bool readOu
1717
process.StartInfo.RedirectStandardOutput = true;
1818
process.StartInfo.RedirectStandardError = true;
1919
process.Start();
20-
process.WaitForExit();
20+
if (waitForExit)
21+
{
22+
process.WaitForExit();
23+
}
2124
while (readOutputByLines && !process.StandardOutput.EndOfStream)
2225
{
2326
Console.WriteLine(process.StandardOutput.ReadLine());

0 commit comments

Comments
 (0)