diff options
author | Adam Mitz <mitza-oci@users.noreply.github.com> | 2010-08-20 21:50:36 +0000 |
---|---|---|
committer | Adam Mitz <mitza-oci@users.noreply.github.com> | 2010-08-20 21:50:36 +0000 |
commit | 9f263d81339b3506ef4c2a4d7626b3ac3b3da5da (patch) | |
tree | 0ea163239035d3ff5c881231acb7d9b25e79ee60 | |
parent | 142910a2780c26926b52fdf2b44b5f0ab84a5589 (diff) | |
download | MPC-9f263d81339b3506ef4c2a4d7626b3ac3b3da5da.tar.gz |
ChangeLogTag: Fri Aug 20 21:40:40 UTC 2010 Adam Mitz <mitza@ociweb.com>
-rw-r--r-- | ChangeLog | 38 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 12 | ||||
-rw-r--r-- | modules/TemplateParser.pm | 4 | ||||
-rw-r--r-- | modules/VC7ProjectCreator.pm | 4 | ||||
-rw-r--r-- | modules/VC8WorkspaceCreator.pm | 2 | ||||
-rw-r--r-- | templates/vc10.mpd | 38 | ||||
-rw-r--r-- | templates/vc8csharp.mpd | 20 |
7 files changed, 112 insertions, 6 deletions
@@ -1,3 +1,41 @@ +Fri Aug 20 21:40:40 UTC 2010 Adam Mitz <mitza@ociweb.com> + + * modules/ProjectCreator.pm: + + Allow template variables to use an "extended attributes" notation, + which borrows syntax from what "after" already supports: + variables += value:attrname1=attrval1[,attrname2=attrval2]... + The "value" part is referenced in the template as + <%variable->_default%> and the "attrval" parts are referenced as + <%variable->attrname1%>. + + * modules/TemplateParser.pm: + * modules/VC7ProjectCreator.pm: + + Changed the GUID generation algorithm for <%guid%> and <%new_guid%> + to not use the absoulte path to the workspace. This allows stable + GUID generation among different developers and/or moving the + workspace to a different filesystem location. + + * modules/VC8WorkspaceCreator.pm: + + Use Windows slashes for relative paths in project references. + + * templates/vc10.mpd: + + Support TargetExt when setting a non-standard {lib,dll,exe}_ext. + OutputFile should not add a \ after $(OutDir) since it already ends + in a \. The double-\ confuses .NET project references. + Added comreferences as a template variable to generate the + <COMReference> XML element in the vcxproj. This uses the extended + attributes support in ProjectCreator. + + * templates/vc8csharp.mpd: + + RootNamespace is set to the project name. + TargetFrameworkProfile supported as a template variable. + Added comreference support (similar to vc10.mpd). + Thu Aug 19 21:51:35 UTC 2010 Adam Mitz <mitza@ociweb.com> * modules/VC10WorkspaceCreator.pm: diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index 02048b76..f4220228 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -3861,6 +3861,18 @@ sub get_special_value { elsif (index($type, $grouped_key) == 0) { return $self->get_grouped_value($type, $cmd, $based); } + elsif (defined $self->get_addtemp()->{$type . 's'}) { + if ($cmd eq '_default') { + $based =~ /^([^:]+):/; + return defined $1 ? $1 : $based; + } + else { + $based =~ /:(.*)/; + my $attribs = $1; + my %attr = map {split '='} split(',', $attribs); + return $attr{$cmd}; + } + } else { my $language = $self->get_language(); diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index 9c1eb56f..61da8e88 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -1881,7 +1881,9 @@ sub handle_new_guid { my $val = $self->get_value_with_default($name); my $prjc = $self->{'prjc'}; my $guid = GUID::generate($val ? $val : $name, - $prjc->{'current_input'}, $prjc->getcwd()); + $prjc->{'current_input'}, + File::Spec->abs2rel($prjc->getcwd(), + $prjc->getstartdir())); $self->append_current($guid); } diff --git a/modules/VC7ProjectCreator.pm b/modules/VC7ProjectCreator.pm index 8182c23f..4f24ea6f 100644 --- a/modules/VC7ProjectCreator.pm +++ b/modules/VC7ProjectCreator.pm @@ -87,7 +87,9 @@ sub fill_value { ## provided will be hashed and returned in a format expected by ## Visual Studio. return GUID::generate($self->project_file_name(), - $self->{'current_input'}, $self->getcwd()); + $self->{'current_input'}, + File::Spec->abs2rel($self->getcwd(), + $self->getstartdir())); } elsif ($name eq 'language') { ## If this project is a Web Application, the language is website. diff --git a/modules/VC8WorkspaceCreator.pm b/modules/VC8WorkspaceCreator.pm index c24f3942..329c91d2 100644 --- a/modules/VC8WorkspaceCreator.pm +++ b/modules/VC8WorkspaceCreator.pm @@ -94,6 +94,8 @@ sub post_workspace { $dep); if (defined $relative) { + $relative =~ s!/!\\!g; + ## Temporary hack for vc10, this probably needs to change. $relative =~ s/\.filters$//; diff --git a/templates/vc10.mpd b/templates/vc10.mpd index af77da30..4bea5a78 100644 --- a/templates/vc10.mpd +++ b/templates/vc10.mpd @@ -44,7 +44,7 @@ <%if(WholeProgramOptimization)%> <WholeProgramOptimization>true</WholeProgramOptimization> <%endif%> -</PropertyGroup> + </PropertyGroup> <%endfor%> <%endfor%> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> @@ -89,6 +89,21 @@ <IntDir Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'"><%intermediate_dir%>\<%noextension(project_file)%>\<%if(output_subdir)%><%output_subdir%>\<%endif%></IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'"><%if(debug_prj)%>true<%else%>false<%endif%></LinkIncremental> <TargetName Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'"><%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%endif%></TargetName> +<%if(type_is_static && staticname && !compares(lib_ext, .lib))%> + <TargetExt Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'"><%lib_ext%></TargetExt> +<%else%> +<%if(!type_is_static)%> +<%if(exename || sharedname || staticname)%> +<%if(type_is_dynamic && !compares(dll_ext, .dll))%> + <TargetExt Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'"><%dll_ext%></TargetExt> +<%else%> +<%if(!type_is_dynamic && !compares(exe_ext, .exe))%> + <TargetExt Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'"><%exe_ext%></TargetExt> +<%endif%> +<%endif%> +<%endif%> +<%endif%> +<%endif%> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'">AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='<%configuration%>|<%platform%>'" /> @@ -390,7 +405,7 @@ <%endif%> <AdditionalDependencies><%foreach(reverse(libs))%><%libname_prefix%><%lib%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%lib_ext%>;<%endfor%><%foreach(reverse(lit_libs))%><%lit_lib%>.lib;<%endfor%><%foreach(reverse(pure_libs))%> <%pure_lib%>;<%endfor%>%(AdditionalDependencies)</AdditionalDependencies> <%if(exename || sharedname || staticname)%> - <OutputFile>$(OutDir)\<%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%></OutputFile> + <OutputFile>$(OutDir)<%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%></OutputFile> <%endif%> <%if(ShowProgress)%> <ShowProgress><%ShowProgress%></ShowProgress> @@ -688,6 +703,25 @@ <%foreach(AssemblyReferences)%> <Reference Include="<%AssemblyReference%>" /> <%endfor%> +<%foreach(comreferences)%> + <COMReference Include="<%comreference->_default%>"> + <Guid><%lc(comreference->guid)%></Guid> + <VersionMajor><%comreference->majorver("1")%></VersionMajor> + <VersionMinor><%comreference->minorver("0")%></VersionMinor> + <Lcid><%comreference->lcid("0")%></Lcid> + <WrapperTool><%comreference->wrapper("tlbimp")%></WrapperTool> + <Isolated><%comreference->isolated("false")%></Isolated> +<%if(comreference->copylocal)%> + <Private><%comreference->copylocal%></Private> +<%endif%> +<%if(comreference->refout)%> + <ReferenceOutputAssembly><%comreference->refout%></ReferenceOutputAssembly> +<%endif%> +<%if(comreference->clsa)%> + <CopyLocalSatelliteAssemblies><%comreference->clsa%></CopyLocalSatelliteAssemblies> +<%endif%> + </COMReference> +<%endfor%> </ItemGroup> <%if(exename || sharedname || staticname)%> <%if(source_files)%> diff --git a/templates/vc8csharp.mpd b/templates/vc8csharp.mpd index 206c4036..da29da9e 100644 --- a/templates/vc8csharp.mpd +++ b/templates/vc8csharp.mpd @@ -38,8 +38,7 @@ <%if(exename || sharedname || staticname)%> <OutputType><%if(exename)%><%if(winapp)%>Win<%endif%>Exe<%else%>Library<%endif%></OutputType> <%endif%> - <RootNamespace> - </RootNamespace> + <RootNamespace><%project_name%></RootNamespace> <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> <StartupObject><%startupobject%></StartupObject> <ReferencePath><%foreach(libpaths)%><%libpath%><%fornotlast(";")%><%endfor%></ReferencePath> @@ -50,6 +49,9 @@ <%if(TargetFrameworkVersion)%> <TargetFrameworkVersion>v<%TargetFrameworkVersion%></TargetFrameworkVersion> <%endif%> +<%if(TargetFrameworkProfile)%> + <TargetFrameworkProfile><%TargetFrameworkProfile%></TargetFrameworkProfile> +<%endif%> </PropertyGroup> <%foreach(platforms)%> <%foreach(configurations)%> @@ -99,6 +101,20 @@ <Name><%lib%></Name> </Reference> <%endfor%> +<%foreach(comreferences)%> + <COMReference Include="<%comreference->_default%>"> + <Guid>{<%uc(comreference->guid)%>}</Guid> + <VersionMajor><%comreference->majorver("1")%></VersionMajor> + <VersionMinor><%comreference->minorver("0")%></VersionMinor> + <Lcid><%comreference->lcid("0")%></Lcid> + <WrapperTool><%comreference->wrapper("tlbimp")%></WrapperTool> + <Isolated><%comreference->isolated("False")%></Isolated> + <Private><%comreference->copylocal("False")%></Private> +<%if(comreference->embed)%> + <EmbedInteropTypes><%comreference->embed%></EmbedInteropTypes> +<%endif%> + </COMReference> +<%endfor%> </ItemGroup> <ItemGroup> <%foreach(source_files)%> |