Skip to content

Commit 932b6e1

Browse files
Extract binding policy compilation code to separate targets file.
1 parent 6f1a766 commit 932b6e1

File tree

4 files changed

+35
-53
lines changed

4 files changed

+35
-53
lines changed
File renamed without changes.

Common/NitraBuild.targets

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MSBuildCommunityTasksPath Condition=" '$(MSBuildCommunityTasksPath)' == '' ">$(MSBuildThisFileDirectory)\..\ExternalTools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
5+
</PropertyGroup>
6+
7+
<UsingTask AssemblyFile="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll" TaskName="MSBuild.Community.Tasks.TemplateFile" />
38

49
<UsingTask TaskName="Nemerle.Tools.MSBuildTask.GetGitTagRevision" AssemblyFile="$(Nemerle)\Nemerle.MSBuild.Tasks.dll"/>
510

@@ -24,5 +29,30 @@
2429
</PropertyGroup>
2530
<Message Text="Nemerle build version: $(NemerleBuildVersion) " Importance="High" />
2631
</Target>
27-
32+
33+
<Target Name="BuildPolicy01Assembly">
34+
<GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).dll">
35+
<Output TaskParameter="Assemblies" ItemName="OutputAssemblyIdentity" />
36+
</GetAssemblyIdentity>
37+
<ItemGroup>
38+
<Token Include="newVersion">
39+
<ReplacementValue>%(OutputAssemblyIdentity.Version)</ReplacementValue>
40+
</Token>
41+
<Token Include="oldVersion">
42+
<ReplacementValue>0.1.0.0</ReplacementValue>
43+
</Token>
44+
<Token Include="name">
45+
<ReplacementValue>$(AssemblyName)</ReplacementValue>
46+
</Token>
47+
<Token Include="publicKeyToken">
48+
<ReplacementValue>%(OutputAssemblyIdentity.PublicKeyToken)</ReplacementValue>
49+
</Token>
50+
<Token Include="culture">
51+
<ReplacementValue>%(OutputAssemblyIdentity.Culture)</ReplacementValue>
52+
</Token>
53+
</ItemGroup>
54+
<TemplateFile Template="$(MSBuildThisFileDirectory)\AssemblyBindingPolicy.template" OutputFilename="$(MSBuildProjectDirectory)\$(OutputPath)\policy.0.1.$(AssemblyName).config" Tokens="@(Token)" />
55+
<AL LinkResources="$(OutputPath)\policy.0.1.$(AssemblyName).config" OutputAssembly="$(OutputPath)\policy.0.1.$(AssemblyName).dll" KeyFile="$(KeyOriginatorFile)" Platform="$(Platform)" />
56+
</Target>
57+
2858
</Project>

N2/N2.Core/N2.Core.nproj

+2-26
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<MSBuildCommunityTasksPath Condition=" '$(MSBuildCommunityTasksPath)' == '' ">$(MSBuildProjectDirectory)\..\..\ExternalTools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
5-
</PropertyGroup>
6-
<UsingTask AssemblyFile="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll" TaskName="MSBuild.Community.Tasks.TemplateFile" />
73
<PropertyGroup>
84
<CommonFilesPath Condition=" '$(CommonFilesPath)' == '' ">..\..\Common</CommonFilesPath>
95
<NemerleVersion>Net-4.0</NemerleVersion>
@@ -138,28 +134,8 @@
138134
<Folder Include="Properties\" />
139135
</ItemGroup>
140136
<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
137+
<Import Project="$(CommonFilesPath)\NitraBuild.targets" />
141138
<Target Name="AfterBuild" Condition=" '$(Stage)' == '' ">
142-
<GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).dll">
143-
<Output TaskParameter="Assemblies" ItemName="OutputAssemblyIdentity" />
144-
</GetAssemblyIdentity>
145-
<ItemGroup>
146-
<Token Include="newVersion">
147-
<ReplacementValue>%(OutputAssemblyIdentity.Version)</ReplacementValue>
148-
</Token>
149-
<Token Include="oldVersion">
150-
<ReplacementValue>0.1.0.0</ReplacementValue>
151-
</Token>
152-
<Token Include="name">
153-
<ReplacementValue>$(AssemblyName)</ReplacementValue>
154-
</Token>
155-
<Token Include="publicKeyToken">
156-
<ReplacementValue>%(OutputAssemblyIdentity.PublicKeyToken)</ReplacementValue>
157-
</Token>
158-
<Token Include="culture">
159-
<ReplacementValue>%(OutputAssemblyIdentity.Culture)</ReplacementValue>
160-
</Token>
161-
</ItemGroup>
162-
<TemplateFile Template="$(MSBuildProjectDirectory)\..\..\AssemblyBindingPolicy.template" OutputFilename="$(MSBuildProjectDirectory)\$(OutputPath)\policy.0.1.$(AssemblyName).config" Tokens="@(Token)" />
163-
<AL LinkResources="$(OutputPath)\policy.0.1.$(AssemblyName).config" OutputAssembly="$(OutputPath)\policy.0.1.$(AssemblyName).dll" KeyFile="$(KeyOriginatorFile)" Platform="$(Platform)" />
139+
<CallTarget Targets="BuildPolicy01Assembly" />
164140
</Target>
165141
</Project>

N2/N2.Runtime/N2.Runtime.nproj

+2-26
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<MSBuildCommunityTasksPath Condition=" '$(MSBuildCommunityTasksPath)' == '' ">$(MSBuildProjectDirectory)\..\..\ExternalTools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
5-
</PropertyGroup>
6-
<UsingTask AssemblyFile="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll" TaskName="MSBuild.Community.Tasks.TemplateFile" />
73
<PropertyGroup>
84
<CommonFilesPath Condition=" '$(CommonFilesPath)' == '' ">..\..\Common</CommonFilesPath>
95
<NemerleVersion>Net-4.0</NemerleVersion>
@@ -401,28 +397,8 @@
401397
</Compile>
402398
</ItemGroup>
403399
<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
400+
<Import Project="$(CommonFilesPath)\NitraBuild.targets" />
404401
<Target Name="AfterBuild" Condition=" '$(Stage)' == '' ">
405-
<GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).dll">
406-
<Output TaskParameter="Assemblies" ItemName="OutputAssemblyIdentity" />
407-
</GetAssemblyIdentity>
408-
<ItemGroup>
409-
<Token Include="newVersion">
410-
<ReplacementValue>%(OutputAssemblyIdentity.Version)</ReplacementValue>
411-
</Token>
412-
<Token Include="oldVersion">
413-
<ReplacementValue>0.1.0.0</ReplacementValue>
414-
</Token>
415-
<Token Include="name">
416-
<ReplacementValue>$(AssemblyName)</ReplacementValue>
417-
</Token>
418-
<Token Include="publicKeyToken">
419-
<ReplacementValue>%(OutputAssemblyIdentity.PublicKeyToken)</ReplacementValue>
420-
</Token>
421-
<Token Include="culture">
422-
<ReplacementValue>%(OutputAssemblyIdentity.Culture)</ReplacementValue>
423-
</Token>
424-
</ItemGroup>
425-
<TemplateFile Template="$(MSBuildProjectDirectory)\..\..\AssemblyBindingPolicy.template" OutputFilename="$(MSBuildProjectDirectory)\$(OutputPath)\policy.0.1.$(AssemblyName).config" Tokens="@(Token)" />
426-
<AL LinkResources="$(OutputPath)\policy.0.1.$(AssemblyName).config" OutputAssembly="$(OutputPath)\policy.0.1.$(AssemblyName).dll" KeyFile="$(KeyOriginatorFile)" Platform="$(Platform)" />
402+
<CallTarget Targets="BuildPolicy01Assembly" />
427403
</Target>
428404
</Project>

0 commit comments

Comments
 (0)