forked from OpenIdentityPlatform/OpenICF.Net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Framework.targets
106 lines (92 loc) · 4.97 KB
/
Framework.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!--
====================
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of the Common Development
and Distribution License("CDDL") (the "License"). You may not use this file
except in compliance with the License.
You can obtain a copy of the License at
http://opensource.org/licenses/cddl1.php
See the License for the specific language governing permissions and limitations
under the License.
When distributing the Covered Code, include this CDDL Header Notice in each file
and include the License file at http://opensource.org/licenses/cddl1.php.
If applicable, add the following below this CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
====================
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<VersionFileIn>$(MSBuildProjectDirectory)\version.template</VersionFileIn>
<VersionFileOut>$(MSBuildProjectDirectory)\version.txt</VersionFileOut>
<Company>ForgeRock</Company>
<Copyright>Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved.</Copyright>
<FrameworkDistDir>$(MSBuildProjectDirectory)\..\Dist</FrameworkDistDir>
<!--FrameworkRootDir>$(MSBuildProjectDirectory)\..\..\</FrameworkRootDir-->
<FrameworkRootDir>$(MSBuildProjectDirectory)</FrameworkRootDir>
<TreatTestFailureAsBuildFailure>true</TreatTestFailureAsBuildFailure>
<MSBuildCommunityTasksPath>$(SolutionDir)\MSBuildTasks.1.5.0.235\tools</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<Target Name="GenerateAssemblyInfo">
<Version VersionFile="$(VersionFileIn)">
<Output TaskParameter="Major" PropertyName="Major" />
<Output TaskParameter="Minor" PropertyName="Minor" />
<Output TaskParameter="Build" PropertyName="Build" />
<Output TaskParameter="Revision" PropertyName="Revision" />
</Version>
<CreateProperty Value="$(Revision)" Condition=" '$(GIT_COMMIT)'=='' ">
<Output TaskParameter="Value" PropertyName="SVNRevision"/>
</CreateProperty>
<CreateProperty Value="$(GIT_COMMIT)" Condition=" '$(GIT_COMMIT)'!='' ">
<Output TaskParameter="Value" PropertyName="SVNRevision"/>
</CreateProperty>
<Message Text="$(MSBuildProjectName) Version: $(Major).$(Minor).$(Build).$(Revision) Revision: $(SVNRevision)"/>
<WriteLinesToFile File="$(VersionFileOut)" Lines="$(Major).$(Minor).$(Build).$(Revision)" Overwrite="true" />
<AssemblyInfo CodeLanguage="CS"
OutputFile="AssemblyInfo.cs"
AssemblyTitle="$(ProductName)"
AssemblyProduct="OpenICF"
AssemblyCopyright="$(Copyright)"
AssemblyCompany="$(Company)"
AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision) Revision $(SVNRevision)"
InternalsVisibleTo="$(InternalsVisibleTo)" />
</Target>
<Target Name="CopyOutput">
<MakeDir Directories="$(FrameworkDistDir)" Condition="!Exists('$(FrameworkDistDir)')" />
<Copy
SourceFiles="$(OutputPath)\$(TargetFileName)"
DestinationFolder="$(FrameworkDistDir)" />
</Target>
<Target Name="NUnit" DependsOnTargets="Build">
<CreateItem Include="$(OutputPath)\*Tests.dll">
<Output TaskParameter="Include" ItemName="TestAssembly" />
</CreateItem>
<MSBuild.Community.Tasks.NUnit DisableShadowCopy="true" Assemblies="@(TestAssembly)" ExcludeCategory="LongRunning" ToolPath="$(NUNIT_HOME)" OutputXmlFile="$(OutputPath)\NUnitResults_$(Configuration).xml" ShowLabels="True">
<Output TaskParameter="ExitCode" PropertyName="NUnitResult" />
</MSBuild.Community.Tasks.NUnit>
</Target>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<BuildDependsOn>
FrameworkBeforeBuild;
$(BuildDependsOn);
FrameworkAfterBuild
</BuildDependsOn>
<CleanDependsOn>
$(CleanDependsOn);
FrameworkClean
</CleanDependsOn>
</PropertyGroup>
<Target Name="FrameworkBeforeBuild">
<CallTarget Targets="GenerateAssemblyInfo" />
</Target>
<Target Name="FrameworkAfterBuild">
<CallTarget Condition=" '$(CopyOutput)'=='true' " Targets="CopyOutput" />
</Target>
<Target Name="FrameworkClean">
<RemoveDir Directories="$(FrameworkDistDir)"/>
</Target>
</Project>