From: Rob M. <ro...@us...> - 2010-01-29 11:41:05
|
Update of /cvsroot/wix/wix3.5/src/WixTasks In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18774/src/WixTasks Modified Files: CreateProjectReferenceDefineConstants.cs RefreshGeneratedFile.cs wix.targets wix2010.targets Log Message: JaredR: Added UX/Payload/PayloadGroup to Bundle language schema. Added Parsing for Payload/PayloadGroup(Ref) to Compiler. Added flattening of UX payloads to Linker. Added binding of UX payloads into output in Binder Added "just enough" of burnexe into Binder to start generation of bundle output (stub exe with attached UX container). JaredR: Created BurnWriter to replace SectionWriter and handle PE re-writing in safe code. Modified Binder to use BurnWriter for creating Bundles. Removed SectionWriter. Removed "Allow unsafe code" from Wix.csproj JaredR: Changed Bundle to require one UX element. Added simple Chain/MsiPackage/ExePackage to Bundle language schema. Updated Binder bundle code to generate chain/package information in Burn manifest and ParameterInfo to create a basic chainer. APaloma: Changed heat to use the new MSBuild API when harvesting VS 2010 projects. Fixed WiX projects being detected as non-MSBuildable in VS 2010. Fixed discrepancies between what projects were referenced in the new generated file and which ones heat actually generated authoring for. Fixed problems with missing or wrong project information being defined in project reference variables for VS 2010. Fixed build action not being changable on the property grid in VS 2010. Fixed heat generating Directory/@Name attributes containing "..". JaredR: Changed Bundle Chain to require one package element, and updated a failing unit test to include the now-required element. Refactored Binder.ChainPackageInfo.PackageType to Compiler.ChainPackageType so that hard-coded in order to remove some hard-coded strings. Changed Payload and *Package ID generation to use deterministic CompilerCore.GenerateIdentifier() method. Added end-to-end support for Variables in Bundles. CAraman: fixes for /W4 and static analysis APaloma: Added ability for heat to harvest projects to PayloadGroups. Added better error messages for when heat is unable to build targets in an MSBuild project when harvesting projects. Fixed heat generating Ids with invalid characters when project names contain characters that aren't valid for identifiers. APaloma: Added enforcing of valid identifer characters on ComponentGroup and ComponentGroupRef. MikeHo: Fix issue with DoesShareExist code, fix static analysis errors in IIS7 CAs APaloma: Added property for project references in Votive to completely disable automatic harvesting for a reference. APaloma: SFBUG:2940161 - Fixed heat generating ComponentGroups with duplicate Ids when using the -cg switch. MiCarls: Fix some issues found by static analysis MiCarls: Fix a scenario related to website locators, broken from previous fix RobMen: introduce buxutil.lib, Burn User Experience Utility library. Index: wix2010.targets =================================================================== RCS file: /cvsroot/wix/wix3.5/src/WixTasks/wix2010.targets,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wix2010.targets 22 Jan 2010 10:05:12 -0000 1.7 --- wix2010.targets 29 Jan 2010 11:40:26 -0000 1.8 *************** *** 868,871 **** --- 868,878 ---- Condition=" '@(ProjectReference)' != '' "> + <!-- Set VC project references to get both native target path and the regular target path. Only one will have a value. --> + <ItemGroup> + <ProjectReference> + <Targets Condition="'%(Extension)' == '.vcxproj'">GetNativeTargetPath;%(ProjectReference.Targets)</Targets> + </ProjectReference> + </ItemGroup> + <!-- Assign a project configuration to each project reference if we're building a solution file. --> <AssignProjectConfiguration *************** *** 878,881 **** --- 885,895 ---- <Output TaskParameter="UnassignedProjects" ItemName="_ProjectReferenceWithConfiguration"/> </AssignProjectConfiguration> + + <!-- Add in the source project path so that we can have access to it after resolving the output. --> + <ItemGroup> + <_ProjectReferenceWithConfiguration> + <MSBuildSourceProjectFileFullPath>%(FullPath)</MSBuildSourceProjectFileFullPath> + </_ProjectReferenceWithConfiguration> + </ItemGroup> </Target> *************** *** 959,963 **** <MSBuild Projects="@(_MSBuildProjectReferenceExistent)" ! Targets="GetTargetPath" Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)" Condition="'@(_ProjectReferenceWithConfiguration)'!='' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '@(_MSBuildProjectReferenceExistent)' != ''" --- 973,977 ---- <MSBuild Projects="@(_MSBuildProjectReferenceExistent)" ! Targets="%(_MSBuildProjectReferenceExistent.Targets);GetTargetPath" Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)" Condition="'@(_ProjectReferenceWithConfiguration)'!='' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '@(_MSBuildProjectReferenceExistent)' != ''" *************** *** 965,968 **** --- 979,983 ---- <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> + <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" /> </MSBuild> *************** *** 981,984 **** --- 996,1000 ---- <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> + <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" /> </MSBuild> *************** *** 1188,1201 **** Condition=" '@(_ResolvedProjectReferencePaths)' != '' "> - <CreateItem - Include="@(_ResolvedProjectReferencePaths)" - AdditionalMetadata="MSBuildSourceProjectFileFullPath=%(FullPath)"> - - <Output TaskParameter="Include" ItemName="_ResolvedProjectReferencePathsWithMetadata" /> - </CreateItem> - <CreateProjectReferenceDefineConstants ! ProjectReferenceSourcePaths="@(_MSBuildProjectReferenceExistent)" ! ProjectReferencePaths="@(_ResolvedProjectReferencePathsWithMetadata)" ProjectConfigurations="$(VSProjectConfigurations)"> --- 1204,1209 ---- Condition=" '@(_ResolvedProjectReferencePaths)' != '' "> <CreateProjectReferenceDefineConstants ! ProjectReferencePaths="@(_ResolvedProjectReferencePaths)" ProjectConfigurations="$(VSProjectConfigurations)"> *************** *** 1395,1408 **** <RefreshGeneratedFile ! ProjectReferenceSourcePaths="@(_MSBuildProjectReferenceExistent)" ! ProjectReferencePaths="@(_ResolvedProjectReferencePathsWithMetadata)" CompGrpGenFile="@(CompGrpGenFile)" /> - <!-- - <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="ProjectOutputGroups=Binaries%3BSymbols%3BSources%3BContent%3BSatellites%3BDocuments"> - <Output TaskParameter="Include" ItemName="HeatProject" /> - </CreateItem> - --> - </Target> --- 1403,1409 ---- <RefreshGeneratedFile ! ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" CompGrpGenFile="@(CompGrpGenFile)" /> </Target> *************** *** 1418,1422 **** Condition=" ('$(OutputType)' == 'Bundle')"> ! <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="ProjectOutputGroups=Binaries;GenerateType=container"> <Output TaskParameter="Include" ItemName="HeatProject" /> </CreateItem> --- 1419,1423 ---- Condition=" ('$(OutputType)' == 'Bundle')"> ! <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="ProjectOutputGroups=Binaries%3BSymbols%3BSources%3BContent%3BSatellites%3BDocuments;GenerateType=container"> <Output TaskParameter="Include" ItemName="HeatProject" /> </CreateItem> Index: CreateProjectReferenceDefineConstants.cs =================================================================== RCS file: /cvsroot/wix/wix3.5/src/WixTasks/CreateProjectReferenceDefineConstants.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CreateProjectReferenceDefineConstants.cs 22 Jan 2010 10:05:12 -0000 1.3 --- CreateProjectReferenceDefineConstants.cs 29 Jan 2010 11:40:26 -0000 1.4 *************** *** 35,39 **** private ITaskItem[] projectConfigurations; private ITaskItem[] projectReferencePaths; - private ITaskItem[] projectReferenceSourcePaths; [Output] --- 35,38 ---- *************** *** 50,59 **** } - public ITaskItem[] ProjectReferenceSourcePaths - { - get { return this.projectReferenceSourcePaths; } - set { this.projectReferenceSourcePaths = value; } - } - public ITaskItem[] ProjectConfigurations { --- 49,52 ---- *************** *** 75,79 **** string platform = item.GetMetadata("Platform"); ! string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, this.ProjectReferenceSourcePaths, i); string projectDir = Path.GetDirectoryName(projectPath) + Path.DirectorySeparatorChar; string projectExt = Path.GetExtension(projectPath); --- 68,72 ---- string platform = item.GetMetadata("Platform"); ! string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); string projectDir = Path.GetDirectoryName(projectPath) + Path.DirectorySeparatorChar; string projectExt = Path.GetExtension(projectPath); *************** *** 171,189 **** } ! public static string GetProjectPath(ITaskItem[] projectReferencePaths, ITaskItem[] projectReferenceSourcePaths, int i) { ! // If a correct ProjectReferenceSourcePaths was specified, use that ! // Otherwise, use the old MSBuildSourceProjectFileFullPath metadata method. ! string projectPath; ! if (projectReferenceSourcePaths != null && projectReferenceSourcePaths.Length == projectReferencePaths.Length) ! { ! projectPath = projectReferenceSourcePaths[i].GetMetadata("FullPath"); ! } ! else ! { ! projectPath = projectReferencePaths[i].GetMetadata("MSBuildSourceProjectFileFullPath"); ! } ! ! return projectPath; } --- 164,170 ---- } ! public static string GetProjectPath(ITaskItem[] projectReferencePaths, int i) { ! return projectReferencePaths[i].GetMetadata("MSBuildSourceProjectFileFullPath"); } Index: RefreshGeneratedFile.cs =================================================================== RCS file: /cvsroot/wix/wix3.5/src/WixTasks/RefreshGeneratedFile.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RefreshGeneratedFile.cs 22 Jan 2010 10:05:12 -0000 1.1 --- RefreshGeneratedFile.cs 29 Jan 2010 11:40:26 -0000 1.2 *************** *** 23,26 **** --- 23,27 ---- using System.Globalization; using System.IO; + using System.Text.RegularExpressions; using System.Xml; using Microsoft.Build.Framework; *************** *** 33,39 **** public class RefreshGeneratedFile : Task { private ITaskItem[] generatedFiles; private ITaskItem[] projectReferencePaths; - private ITaskItem[] projectReferenceSourcePaths; /// <summary> --- 34,42 ---- public class RefreshGeneratedFile : Task { + private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); + private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters + private ITaskItem[] generatedFiles; private ITaskItem[] projectReferencePaths; /// <summary> *************** *** 57,66 **** } - public ITaskItem[] ProjectReferenceSourcePaths - { - get { return this.projectReferenceSourcePaths; } - set { this.projectReferenceSourcePaths = value; } - } - /// <summary> /// Gets a complete list of external cabs referenced by the given installer database file. --- 60,63 ---- *************** *** 73,79 **** { ITaskItem item = this.ProjectReferencePaths[i]; ! string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, this.ProjectReferenceSourcePaths, i); string projectName = Path.GetFileNameWithoutExtension(projectPath); ! string referenceName = CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName); string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); --- 70,82 ---- { ITaskItem item = this.ProjectReferencePaths[i]; ! ! if (!String.IsNullOrEmpty(item.GetMetadata("DoNotHarvest"))) ! { ! continue; ! } ! ! string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); string projectName = Path.GetFileNameWithoutExtension(projectPath); ! string referenceName = GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); *************** *** 128,131 **** --- 131,154 ---- return true; } + + /// <summary> + /// Return an identifier based on passed file/directory name + /// </summary> + /// <param name="name">File/directory name to generate identifer from</param> + /// <returns>A version of the name that is a legal identifier.</returns> + /// <remarks>This is duplicated from WiX's Common class.</remarks> + internal static string GetIdentifierFromName(string name) + { + string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". + + // MSI identifiers must begin with an alphabetic character or an + // underscore. Prefix all other values with an underscore. + if (AddPrefix.IsMatch(name)) + { + result = String.Concat("_", result); + } + + return result; + } } } Index: wix.targets =================================================================== RCS file: /cvsroot/wix/wix3.5/src/WixTasks/wix.targets,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wix.targets 22 Jan 2010 10:05:12 -0000 1.6 --- wix.targets 29 Jan 2010 11:40:26 -0000 1.7 *************** *** 111,115 **** <UsingTask TaskName="GetCabList" AssemblyFile="$(WixTasksPath)" /> <UsingTask TaskName="GetLooseFileList" AssemblyFile="$(WixTasksPath)" /> - <UsingTask TaskName="ConvertReferences" AssemblyFile="$(WixTasksPath)"/> <UsingTask TaskName="RefreshGeneratedFile" AssemblyFile="$(WixTasksPath)"/> --- 111,114 ---- *************** *** 932,935 **** --- 931,935 ---- <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> + <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" /> </MSBuild> *************** *** 947,950 **** --- 947,951 ---- <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" /> + <Output TaskParameter="TargetOutputs" ItemName="_MSBuildResolvedProjectReferencePaths" /> </MSBuild> *************** *** 1390,1398 **** Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' )"> ! <ConvertReferences ! ProjectOutputGroups="Binaries;Symbols;Sources;Content;Satellites;Documents" ! ProjectReferences="@(_MSBuildProjectReferenceExistent)"> ! <Output TaskParameter="HarvestItems" ItemName="HeatProject" /> ! </ConvertReferences> <CreateItem Include="@(Compile)" Condition=" '%(Compile.GenerateComponentGroups)' != '' "> --- 1391,1397 ---- Condition=" ('$(OutputType)' == 'Package' or '$(OutputType)' == 'PatchCreation' or '$(OutputType)' == 'Module' )"> ! <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="DirectoryIds=%(_MSBuildProjectReferenceExistent.RefTargetDir);ProjectOutputGroups=Binaries%3BSymbols%3BSources%3BContent%3BSatellites%3BDocuments;ProjectName=%(_MSBuildProjectReferenceExistent.Name)"> ! <Output TaskParameter="Include" ItemName="HeatProject" /> ! </CreateItem> <CreateItem Include="@(Compile)" Condition=" '%(Compile.GenerateComponentGroups)' != '' "> *************** *** 1401,1406 **** <RefreshGeneratedFile ! ProjectReferenceSourcePaths="@(_MSBuildProjectReferenceExistent)" ! ProjectReferencePaths="@(_ResolvedProjectReferencePaths)" CompGrpGenFile="@(CompGrpGenFile)" /> --- 1400,1404 ---- <RefreshGeneratedFile ! ProjectReferencePaths="@(_MSBuildResolvedProjectReferencePaths)" CompGrpGenFile="@(CompGrpGenFile)" /> *************** *** 1418,1439 **** Condition=" ('$(OutputType)' == 'Bundle')"> ! <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="ProjectOutputGroups=Binaries;GenerateType=container"> ! <Output TaskParameter="Include" ItemName="HeatProject" /> ! </CreateItem> ! ! </Target> ! ! <!-- ! ================================================================================================ ! ConvertBundleReferences ! ! Converts project references in Bundle projects to HeatProject items to auto generate authoring. ! ================================================================================================ ! --> ! <Target ! Name="ConvertBundleReferences" ! Condition=" ('$(OutputType)' == 'Bundle')"> ! ! <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="ProjectOutputGroups=Binaries;GenerateContainer=true"> <Output TaskParameter="Include" ItemName="HeatProject" /> </CreateItem> --- 1416,1420 ---- Condition=" ('$(OutputType)' == 'Bundle')"> ! <CreateItem Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' " AdditionalMetadata="ProjectOutputGroups=Binaries%3BSymbols%3BSources%3BContent%3BSatellites%3BDocuments;GenerateType=container"> <Output TaskParameter="Include" ItemName="HeatProject" /> </CreateItem> |