| | |
| | | **
|
| | | ****************************************************************************/
|
| | |
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Linq;
|
| | | using System.Text;
|
| | | using System;
|
| | | using System.IO;
|
| | |
|
| | | using CommandLineParser = QtVsTools.Core.CommandLine.Parser;
|
| | | using CommandLineOption = QtVsTools.Core.CommandLine.Option;
|
| | |
|
| | | namespace QtVsTools.Core.QtMsBuild
|
| | | {
|
| | | using CommandLineParser = CommandLine.Parser;
|
| | | using CommandLineOption = CommandLine.Option;
|
| | |
|
| | | public interface IVSMacroExpander
|
| | | {
|
| | | string ExpandString(string stringToExpand);
|
| | |
| | |
|
| | | public class QtMsBuildContainer
|
| | | {
|
| | |
|
| | | IPropertyStorageProvider provider;
|
| | | readonly IPropertyStorageProvider provider;
|
| | | public QtMsBuildContainer(IPropertyStorageProvider provider)
|
| | | {
|
| | | this.provider = provider;
|
| | |
| | | return provider.GetProjectConfiguration(GetProject(), configName);
|
| | | }
|
| | |
|
| | | Dictionary<string, ItemPropertyChange> itemPropertyChanges
|
| | | readonly Dictionary<string, ItemPropertyChange> itemPropertyChanges
|
| | | = new Dictionary<string, ItemPropertyChange>();
|
| | | Dictionary<string, List<ItemPropertyChange>> itemPropertyChangesGrouped
|
| | | readonly Dictionary<string, List<ItemPropertyChange>> itemPropertyChangesGrouped
|
| | | = new Dictionary<string, List<ItemPropertyChange>>();
|
| | | bool pendingChanges = false;
|
| | |
|
| | | void AddChange(ItemPropertyChange newChange)
|
| | | {
|
| | | ItemPropertyChange oldChange;
|
| | | if (itemPropertyChanges.TryGetValue(newChange.Key, out oldChange)) {
|
| | | if (itemPropertyChanges.TryGetValue(newChange.Key, out ItemPropertyChange oldChange)) {
|
| | | if (oldChange.GroupKey == newChange.GroupKey) {
|
| | | oldChange.CopyFrom(newChange);
|
| | | return;
|
| | |
| | |
|
| | | #region QtRcc
|
| | | static QtRcc qtRccInstance;
|
| | | public static QtRcc QtRccInstance
|
| | |
|
| | | private static QtRcc QtRccInstance
|
| | | {
|
| | | get
|
| | | {
|
| | |
| | |
|
| | | #region QtRepc
|
| | | static QtRepc qtRepcInstance;
|
| | | public static QtRepc QtRepcInstance
|
| | |
|
| | | private static QtRepc QtRepcInstance
|
| | | {
|
| | | get
|
| | | {
|
| | |
| | |
|
| | | #region QtUic
|
| | | static QtUic qtUicInstance;
|
| | | public static QtUic QtUicInstance
|
| | |
|
| | | private static QtUic QtUicInstance
|
| | | {
|
| | | get
|
| | | {
|
| | |
| | |
|
| | | public abstract class QtTool
|
| | | {
|
| | | protected CommandLineParser parser;
|
| | | protected CommandLineOption outputOption;
|
| | | protected CommandLineOption helpOption;
|
| | | protected CommandLineOption versionOption;
|
| | | protected readonly CommandLineParser parser;
|
| | | private readonly CommandLineOption outputOption;
|
| | | private CommandLineOption helpOption;
|
| | | private CommandLineOption versionOption;
|
| | |
|
| | | protected QtTool(bool defaultInputOutput = true)
|
| | | {
|
| | |
| | | AdditionalDependencies,
|
| | | }
|
| | |
|
| | | Dictionary<Property, CommandLineOption> options
|
| | | readonly Dictionary<Property, CommandLineOption> options
|
| | | = new Dictionary<Property, CommandLineOption>();
|
| | |
|
| | | public QtMoc() : base()
|
| | |
| | | {
|
| | | properties = new Dictionary<Property, string>();
|
| | |
|
| | | string qtDir, inputPath, outputPath;
|
| | | if (!ParseCommandLine(
|
| | | commandLine,
|
| | | macros,
|
| | | ToolExecName,
|
| | | out qtDir,
|
| | | out inputPath,
|
| | | out outputPath)) {
|
| | | out string qtDir,
|
| | | out string inputPath,
|
| | | out string outputPath)) {
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | AdditionalDependencies,
|
| | | }
|
| | |
|
| | | Dictionary<Property, CommandLineOption> options
|
| | | readonly Dictionary<Property, CommandLineOption> options
|
| | | = new Dictionary<Property, CommandLineOption>();
|
| | |
|
| | | public QtRcc() : base()
|
| | |
| | | {
|
| | | properties = new Dictionary<Property, string>();
|
| | |
|
| | | string qtDir, inputPath, outputPath;
|
| | | if (!ParseCommandLine(
|
| | | commandLine,
|
| | | macros,
|
| | | ToolExecName,
|
| | | out qtDir,
|
| | | out inputPath,
|
| | | out outputPath)) {
|
| | | out string qtDir,
|
| | | out string inputPath,
|
| | | out string outputPath)) {
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | properties[Property.Root] = parser.Value(options[Property.Root]);
|
| | |
|
| | | if (parser.IsSet(options[Property.Compression])) {
|
| | | int level;
|
| | | if (!int.TryParse(parser.Value(options[Property.Compression]), out level))
|
| | | if (!int.TryParse(parser.Value(options[Property.Compression]), out int level))
|
| | | return false;
|
| | | if (level < 1 || 9 < level)
|
| | | return false;
|
| | |
| | | PrintDebug,
|
| | | }
|
| | |
|
| | | Dictionary<Property, CommandLineOption> options
|
| | | readonly Dictionary<Property, CommandLineOption> options
|
| | | = new Dictionary<Property, CommandLineOption>();
|
| | |
|
| | | public QtRepc() : base(defaultInputOutput: false)
|
| | |
| | | {
|
| | | properties = new Dictionary<Property, string>();
|
| | |
|
| | | string qtDir, inputPath, outputPath;
|
| | | if (!ParseCommandLine(
|
| | | commandLine,
|
| | | macros,
|
| | | ToolExecName,
|
| | | out qtDir,
|
| | | out inputPath,
|
| | | out outputPath)) {
|
| | | out string qtDir,
|
| | | out string inputPath,
|
| | | out string outputPath)) {
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | GenerateCommandLineOption(cmd, options[Property.InputFileType], inputType);
|
| | |
|
| | | var outputType = container.GetPropertyValue(propertyStorage, Property.OutputFileType);
|
| | | if (!string.IsNullOrEmpty(inputType))
|
| | | GenerateCommandLineOption(cmd, options[Property.InputFileType], inputType);
|
| | | if (!string.IsNullOrEmpty(outputType))
|
| | | GenerateCommandLineOption(cmd, options[Property.OutputFileType], outputType);
|
| | |
|
| | | string value = container.GetPropertyValue(propertyStorage, Property.IncludePath);
|
| | | if (!string.IsNullOrEmpty(value))
|
| | |
| | | AdditionalDependencies,
|
| | | }
|
| | |
|
| | | Dictionary<Property, CommandLineOption> options
|
| | | readonly Dictionary<Property, CommandLineOption> options
|
| | | = new Dictionary<Property, CommandLineOption>();
|
| | |
|
| | | public QtUic() : base()
|
| | |
| | | {
|
| | | properties = new Dictionary<Property, string>();
|
| | |
|
| | | string qtDir, inputPath, outputPath;
|
| | | if (!ParseCommandLine(
|
| | | commandLine,
|
| | | macros,
|
| | | ToolExecName,
|
| | | out qtDir,
|
| | | out inputPath,
|
| | | out outputPath)) {
|
| | | out string qtDir,
|
| | | out string inputPath,
|
| | | out string outputPath)) {
|
| | | return false;
|
| | | }
|
| | |
|