From 2e1409f042ccd1e2fae7c2e6505281c631ea81cf Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 6 Jul 2016 10:50:21 +0200 Subject: [PATCH] Add support to create TLog files for C++ projects --- AddinRemoval/Properties/AssemblyInfo.cs | 2 +- CHANGELOG.md | 6 ++ IceBuilder.debug.bat | 2 +- IceBuilder/Properties/AssemblyInfo.cs | 2 +- IceBuilder/Resources/IceBuilder.CSharp.props | 7 +- .../Resources/IceBuilder.CSharp.targets | 2 +- IceBuilder/Resources/IceBuilder.Common.props | 54 +++++++++---- IceBuilder/Resources/IceBuilder.Cpp.props | 8 +- IceBuilder/Resources/IceBuilder.Cpp.targets | 23 +++++- IceBuilder/source.extension.vsixmanifest | 2 +- IceBuilderTasks/Properties/AssemblyInfo.cs | 2 +- IceBuilderTasks/Tasks.cs | 80 +++++++++++++++---- .../Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- IceBuilder_Common/Properties/AssemblyInfo.cs | 2 +- IceBuilder_VS2012/Properties/AssemblyInfo.cs | 2 +- IceBuilder_VS2013/Properties/AssemblyInfo.cs | 2 +- IceBuilder_VS2015/Properties/AssemblyInfo.cs | 2 +- 18 files changed, 148 insertions(+), 54 deletions(-) diff --git a/AddinRemoval/Properties/AssemblyInfo.cs b/AddinRemoval/Properties/AssemblyInfo.cs index 8a5fa84..64a15d6 100644 --- a/AddinRemoval/Properties/AssemblyInfo.cs +++ b/AddinRemoval/Properties/AssemblyInfo.cs @@ -13,5 +13,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Visual Studio Extension")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: AssemblyDelaySign(false)] diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e4ad3..711ca30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Changes in Ice Builder for Visual Studio 4.3.3 + +- Add support to generate TLog files with C++ builds, this ensure + that Visual Studio correctly rebuild projects when out of project + dependencies change. + ## Changes in Ice Builder for Visual Studio 4.3.2 - Fixed a bug that cause Slice files not being compiled after a project was diff --git a/IceBuilder.debug.bat b/IceBuilder.debug.bat index 23b9624..e9c913d 100644 --- a/IceBuilder.debug.bat +++ b/IceBuilder.debug.bat @@ -1,5 +1,5 @@ -set ICEBUILDERINSTALLDIR=%LOCALAPPDATA%\Microsoft\VisualStudio\14.0Exp\Extensions\ZeroC\Ice Builder\4.3.2 +set ICEBUILDERINSTALLDIR=%LOCALAPPDATA%\Microsoft\VisualStudio\14.0Exp\Extensions\ZeroC\Ice Builder\4.3.3 set IceBuilderCppProps=%ICEBUILDERINSTALLDIR%\Resources\IceBuilder.Cpp.props set IceBuilderCppTargets=%ICEBUILDERINSTALLDIR%\Resources\IceBuilder.Cpp.targets diff --git a/IceBuilder/Properties/AssemblyInfo.cs b/IceBuilder/Properties/AssemblyInfo.cs index 68ddbb3..a7225e6 100644 --- a/IceBuilder/Properties/AssemblyInfo.cs +++ b/IceBuilder/Properties/AssemblyInfo.cs @@ -15,5 +15,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Builder")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: ComVisibleAttribute(false)] diff --git a/IceBuilder/Resources/IceBuilder.CSharp.props b/IceBuilder/Resources/IceBuilder.CSharp.props index 2d71637..1fbdbed 100644 --- a/IceBuilder/Resources/IceBuilder.CSharp.props +++ b/IceBuilder/Resources/IceBuilder.CSharp.props @@ -18,8 +18,9 @@ - + + $(MSBuildProjectDirectory)\generated - + $(IceHome)\cpp\bin $(IceHome)\bin $(IceToolsPath) diff --git a/IceBuilder/Resources/IceBuilder.CSharp.targets b/IceBuilder/Resources/IceBuilder.CSharp.targets index 67b6780..495104c 100644 --- a/IceBuilder/Resources/IceBuilder.CSharp.targets +++ b/IceBuilder/Resources/IceBuilder.CSharp.targets @@ -4,7 +4,7 @@ + Condition="'$(IceHome)' == '' Or '$(IceVersion)' == '' Or '$(IceIntVersion)' == ''" /> diff --git a/IceBuilder/Resources/IceBuilder.Common.props b/IceBuilder/Resources/IceBuilder.Common.props index ad0761a..e580adf 100644 --- a/IceBuilder/Resources/IceBuilder.Common.props +++ b/IceBuilder/Resources/IceBuilder.Common.props @@ -1,25 +1,47 @@ - - - $(ICE_HOME) - + + + $(ICE_HOME) + + + + - - $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceHome) - $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceVersion) - $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceIntVersion) - $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceVersionMM) - + + + - - - $(IceHome) - + + + $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceHome) + $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceVersion) + $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceIntVersion) + $(Registry:HKEY_CURRENT_USER\Software\ZeroC\IceBuilder@IceVersionMM) + + + + + $(IceHome) + diff --git a/IceBuilder/Resources/IceBuilder.Cpp.props b/IceBuilder/Resources/IceBuilder.Cpp.props index ceee988..e0695a2 100644 --- a/IceBuilder/Resources/IceBuilder.Cpp.props +++ b/IceBuilder/Resources/IceBuilder.Cpp.props @@ -24,9 +24,9 @@ - - + + PATH=$(Path);$(LocalDebuggerEnvironment) - + $(IceHome)\cpp\bin $(IceHome)\bin $(IceToolsPath) diff --git a/IceBuilder/Resources/IceBuilder.Cpp.targets b/IceBuilder/Resources/IceBuilder.Cpp.targets index 9c11b9a..4205abe 100644 --- a/IceBuilder/Resources/IceBuilder.Cpp.targets +++ b/IceBuilder/Resources/IceBuilder.Cpp.targets @@ -10,7 +10,7 @@ + Condition="'$(IceHome)' == '' Or '$(IceVersion)' == '' Or '$(IceIntVersion)' == ''" /> @@ -97,7 +97,8 @@ SourceExt = "$(IceBuilderSourceExt)" DependFile = "$(IceBuilderDependFile)" Sources = "@(_IceBuilder)" - Condition = "'%(_IceBuilder.BuildRequired)' == 'True'"/> + Condition = "'%(_IceBuilder.BuildRequired)' == 'True'"> + + Condition = "'$(_IceBuilderUdateDepends)' == 'True'"> + + + + + + + + diff --git a/IceBuilder/source.extension.vsixmanifest b/IceBuilder/source.extension.vsixmanifest index 55960c6..5f2cfa9 100644 --- a/IceBuilder/source.extension.vsixmanifest +++ b/IceBuilder/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Ice Builder Ice Builder manages the compilation of Slice (.ice) files to C++ and C#. It compiles your Slice files with slice2cpp and slice2cs, and allows you to specify the parameters provided to these compilers. https://github.com/zeroc-ice/ice-builder-visualstudio diff --git a/IceBuilderTasks/Properties/AssemblyInfo.cs b/IceBuilderTasks/Properties/AssemblyInfo.cs index 0d4b105..c325106 100644 --- a/IceBuilderTasks/Properties/AssemblyInfo.cs +++ b/IceBuilderTasks/Properties/AssemblyInfo.cs @@ -15,6 +15,6 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Builder")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: AssemblyDelaySign(false)] [assembly: ComVisibleAttribute(false)] diff --git a/IceBuilderTasks/Tasks.cs b/IceBuilderTasks/Tasks.cs index 98951fc..58a13bb 100644 --- a/IceBuilderTasks/Tasks.cs +++ b/IceBuilderTasks/Tasks.cs @@ -414,6 +414,22 @@ protected override String GeneratedExtensions } } + [Output] + public ITaskItem[] ComputedSources + { + get; + private set; + } + + protected ITaskItem[] GeneratedItems(ITaskItem source) + { + return new ITaskItem[] + { + new TaskItem(GetGeneratedPath(source, OutputDir, SourceExt)), + new TaskItem(GetGeneratedPath(source, String.IsNullOrEmpty(HeaderOutputDir) ? OutputDir : HeaderOutputDir, HeaderExt)), + }; + } + protected override String GenerateCommandLineCommands() { CommandLineBuilder builder = new CommandLineBuilder(false); @@ -465,28 +481,60 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand try { int status = base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); - if (!String.IsNullOrEmpty(HeaderOutputDir) && !Depend && status == 0) + if(status == 0) { - if (!Directory.Exists(HeaderOutputDir)) + if(Depend) { - Directory.CreateDirectory(HeaderOutputDir); + List computed = new List(); + XmlDocument dependsDoc = new XmlDocument(); + dependsDoc.Load(DependFile); + + foreach(ITaskItem source in Sources) + { + List dependPaths = new List(); + XmlNodeList depends = dependsDoc.DocumentElement.SelectNodes( + String.Format("/dependencies/source[@name='{0}']/dependsOn", source.GetMetadata("Identity"))); + if(depends != null) + { + foreach(XmlNode depend in depends) + { + dependPaths.Add(Path.GetFullPath(depend.Attributes["name"].Value).ToUpper()); + } + } + dependPaths.Add(Path.GetFullPath(pathToTool).ToUpper()); + + ITaskItem computedSource = new TaskItem(source.ItemSpec); + source.CopyMetadataTo(computedSource); + computedSource.SetMetadata("Outputs", String.Join(";", + Array.ConvertAll(GeneratedItems(source), (item) => item.GetMetadata("FullPath").ToUpper()))); + computedSource.SetMetadata("Inputs", String.Join(";", dependPaths.ToArray())); + computed.Add(computedSource); + } + ComputedSources = computed.ToArray(); } - foreach (ITaskItem source in Sources) + else if(!String.IsNullOrEmpty(HeaderOutputDir)) { - String sourceH = GetGeneratedPath(source, OutputDir, HeaderExt); - String targetH = GetGeneratedPath(source, HeaderOutputDir, HeaderExt); - if (!File.Exists(targetH) || new FileInfo(targetH).LastWriteTime < new FileInfo(sourceH).LastWriteTime) + if(!Directory.Exists(HeaderOutputDir)) + { + Directory.CreateDirectory(HeaderOutputDir); + } + foreach(ITaskItem source in Sources) { - if (File.Exists(targetH)) + String sourceH = GetGeneratedPath(source, OutputDir, HeaderExt); + String targetH = GetGeneratedPath(source, HeaderOutputDir, HeaderExt); + if(!File.Exists(targetH) || new FileInfo(targetH).LastWriteTime < new FileInfo(sourceH).LastWriteTime) { - File.Delete(targetH); + if(File.Exists(targetH)) + { + File.Delete(targetH); + } + File.Move(sourceH, targetH); } - File.Move(sourceH, targetH); - } - if (File.Exists(sourceH)) - { - File.Delete(sourceH); + if(File.Exists(sourceH)) + { + File.Delete(sourceH); + } } } } @@ -815,10 +863,10 @@ public override bool Execute() if (skip) { XmlNodeList depends = dependsDoc.DocumentElement.SelectNodes( - String.Format("/dependencies/source[@name='{0}']/dependsOn", source.GetMetadata("Identity"))); + String.Format("/dependencies/source[@name='{0}']/dependsOn", source.GetMetadata("Identity"))); + if (depends != null) { - List dependPaths = new List(); foreach (XmlNode depend in depends) { String path = depend.Attributes["name"].Value; diff --git a/IceBuilderTemplates/CSharpSliceItemTemplate/Properties/AssemblyInfo.cs b/IceBuilderTemplates/CSharpSliceItemTemplate/Properties/AssemblyInfo.cs index bc8cbe4..7e61b45 100644 --- a/IceBuilderTemplates/CSharpSliceItemTemplate/Properties/AssemblyInfo.cs +++ b/IceBuilderTemplates/CSharpSliceItemTemplate/Properties/AssemblyInfo.cs @@ -13,5 +13,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Visual Studio Extension")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: AssemblyDelaySign(false)] diff --git a/IceBuilderTemplates/VCSliceItemTemplate/Properties/AssemblyInfo.cs b/IceBuilderTemplates/VCSliceItemTemplate/Properties/AssemblyInfo.cs index 041c935..24c218f 100644 --- a/IceBuilderTemplates/VCSliceItemTemplate/Properties/AssemblyInfo.cs +++ b/IceBuilderTemplates/VCSliceItemTemplate/Properties/AssemblyInfo.cs @@ -13,5 +13,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Visual Studio Extension")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: AssemblyDelaySign(false)] \ No newline at end of file diff --git a/IceBuilder_Common/Properties/AssemblyInfo.cs b/IceBuilder_Common/Properties/AssemblyInfo.cs index c5cf775..6aebc40 100644 --- a/IceBuilder_Common/Properties/AssemblyInfo.cs +++ b/IceBuilder_Common/Properties/AssemblyInfo.cs @@ -15,5 +15,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Builder")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: ComVisibleAttribute(false)] diff --git a/IceBuilder_VS2012/Properties/AssemblyInfo.cs b/IceBuilder_VS2012/Properties/AssemblyInfo.cs index 9fc1278..3ef7bfe 100644 --- a/IceBuilder_VS2012/Properties/AssemblyInfo.cs +++ b/IceBuilder_VS2012/Properties/AssemblyInfo.cs @@ -15,5 +15,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Builder")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: ComVisibleAttribute(false)] diff --git a/IceBuilder_VS2013/Properties/AssemblyInfo.cs b/IceBuilder_VS2013/Properties/AssemblyInfo.cs index 89bde9e..3d6471d 100644 --- a/IceBuilder_VS2013/Properties/AssemblyInfo.cs +++ b/IceBuilder_VS2013/Properties/AssemblyInfo.cs @@ -15,5 +15,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Builder")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: ComVisibleAttribute(false)] diff --git a/IceBuilder_VS2015/Properties/AssemblyInfo.cs b/IceBuilder_VS2015/Properties/AssemblyInfo.cs index ac52904..21fc1c7 100644 --- a/IceBuilder_VS2015/Properties/AssemblyInfo.cs +++ b/IceBuilder_VS2015/Properties/AssemblyInfo.cs @@ -15,5 +15,5 @@ [assembly: AssemblyCompany("ZeroC, Inc.")] [assembly: AssemblyProduct("Ice Builder")] [assembly: AssemblyCopyright("Copyright (c) 2009-2016 ZeroC, Inc.")] -[assembly: AssemblyVersion("4.3.2")] +[assembly: AssemblyVersion("4.3.3")] [assembly: ComVisibleAttribute(false)]