Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit e308900

Browse files
committed
Remodeled some of our build scripts after the new VC project system's .props and .targets pattern.
1 parent 2c163cc commit e308900

13 files changed

Lines changed: 65 additions & 79 deletions

build.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
<Import Project="$(MSBuildProjectDirectory)\tools\DotNetOpenAuth.Common.Settings.targets"/>
2+
<Import Project="$(MSBuildProjectDirectory)\tools\DotNetOpenAuth.props"/>
33
<PropertyGroup>
44
<AutomatedBuild>true</AutomatedBuild>
55
<SolutionPath>$(ProjectRoot)src\$(ProductName).sln</SolutionPath>
@@ -418,7 +418,7 @@
418418
<ItemGroup>
419419
<SampleProjectTargets Include="$(DropSamplesDirectory)**\*.csproj" />
420420
</ItemGroup>
421-
<FixupShippingToolSamples Projects="@(DropSamplesToolsProjects)" />
421+
<FixupShippingToolSamples Projects="@(DropSamplesToolsProjects)" RemoveImportsStartingWith="%24(ProjectRoot)tools\" />
422422
<ChangeProjectReferenceToAssemblyReference Projects="@(SampleProjectTargets)"
423423
ProjectReference="..\..\src\$(ProductName)\$(ProductName).csproj" Reference="..\..\Bin\$(ProductName).dll" />
424424
</Target>

lib/DotNetOpenAuth.BuildTasks.dll

512 Bytes
Binary file not shown.

lib/DotNetOpenAuth.BuildTasks.pdb

2 KB
Binary file not shown.

samples/OpenIdOfflineProvider/OpenIdOfflineProvider.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4+
<ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</ProjectRoot>
45
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
56
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
</PropertyGroup>
8+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.props" />
9+
<PropertyGroup>
610
<ProductVersion>9.0.30729</ProductVersion>
711
<SchemaVersion>2.0</SchemaVersion>
812
<ProjectGuid>{5C65603B-235F-47E6-B536-06385C60DE7F}</ProjectGuid>
@@ -21,7 +25,6 @@
2125
<DebugSymbols>true</DebugSymbols>
2226
<DebugType>full</DebugType>
2327
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
2528
<DefineConstants>DEBUG;TRACE</DefineConstants>
2629
<ErrorReport>prompt</ErrorReport>
2730
<WarningLevel>4</WarningLevel>
@@ -52,14 +55,10 @@
5255
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5356
<DebugType>pdbonly</DebugType>
5457
<Optimize>true</Optimize>
55-
<OutputPath>bin\Release\</OutputPath>
5658
<DefineConstants>TRACE</DefineConstants>
5759
<ErrorReport>prompt</ErrorReport>
5860
<WarningLevel>4</WarningLevel>
5961
</PropertyGroup>
60-
<PropertyGroup>
61-
<SignAssembly>true</SignAssembly>
62-
</PropertyGroup>
6362
<ItemGroup>
6463
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
6564
<SpecificVersion>False</SpecificVersion>
@@ -159,5 +158,5 @@
159158
<Resource Include="openid.ico" />
160159
</ItemGroup>
161160
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
162-
<Import Project="..\..\tools\DotNetOpenAuth.Versioning.targets" />
161+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
163162
</Project>

src/DotNetOpenAuth.BuildTasks/FixupShippingToolSamples.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
namespace DotNetOpenAuth.BuildTasks {
88
using System;
99
using System.Collections.Generic;
10+
using System.IO;
1011
using System.Linq;
1112
using System.Text;
12-
using Microsoft.Build.Utilities;
13-
using Microsoft.Build.Framework;
14-
using System.IO;
1513
using Microsoft.Build.BuildEngine;
14+
using Microsoft.Build.Framework;
15+
using Microsoft.Build.Utilities;
1616

1717
/// <summary>
1818
/// Removes imports that only apply when a shipping tool sample builds as part of
@@ -22,6 +22,8 @@ public class FixupShippingToolSamples : Task {
2222
[Required]
2323
public ITaskItem[] Projects { get; set; }
2424

25+
public string[] RemoveImportsStartingWith { get; set; }
26+
2527
/// <summary>
2628
/// Executes this instance.
2729
/// </summary>
@@ -34,10 +36,12 @@ public override bool Execute() {
3436
Uri projectUri = new Uri(projectTaskItem.GetMetadata("FullPath"));
3537
project.Load(projectTaskItem.ItemSpec, ProjectLoadSettings.IgnoreMissingImports);
3638

37-
project.Imports.Cast<Import>()
38-
.Where(import => import.ProjectPath.StartsWith(@"..\..\tools\", StringComparison.OrdinalIgnoreCase))
39-
.ToList()
40-
.ForEach(import => project.Imports.RemoveImport(import));
39+
if (this.RemoveImportsStartingWith != null && this.RemoveImportsStartingWith.Length > 0) {
40+
project.Imports.Cast<Import>()
41+
.Where(import => this.RemoveImportsStartingWith.Any(start => import.ProjectPath.StartsWith(start, StringComparison.OrdinalIgnoreCase)))
42+
.ToList()
43+
.ForEach(import => project.Imports.RemoveImport(import));
44+
}
4145

4246
project.Save(projectTaskItem.ItemSpec);
4347
}

src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
<Import Project="..\..\tools\DotNetOpenAuth.props" />
32
<PropertyGroup>
3+
<ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</ProjectRoot>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
</PropertyGroup>
7+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.props" />
8+
<PropertyGroup>
69
<ProductVersion>9.0.30729</ProductVersion>
710
<SchemaVersion>2.0</SchemaVersion>
811
<ProjectGuid>{4376ECC9-C346-4A99-B13C-FA93C0FBD2C9}</ProjectGuid>
@@ -18,7 +21,6 @@
1821
<DebugSymbols>true</DebugSymbols>
1922
<DebugType>full</DebugType>
2023
<Optimize>false</Optimize>
21-
<OutputPath>..\..\bin\Debug\</OutputPath>
2224
<DefineConstants>DEBUG;TRACE</DefineConstants>
2325
<ErrorReport>prompt</ErrorReport>
2426
<WarningLevel>4</WarningLevel>
@@ -51,7 +53,6 @@
5153
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5254
<DebugType>pdbonly</DebugType>
5355
<Optimize>true</Optimize>
54-
<OutputPath>..\..\bin\Release\</OutputPath>
5556
<DefineConstants>TRACE</DefineConstants>
5657
<ErrorReport>prompt</ErrorReport>
5758
<WarningLevel>4</WarningLevel>
@@ -81,12 +82,8 @@
8182
<CodeContractsRunInBackground>True</CodeContractsRunInBackground>
8283
<CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
8384
</PropertyGroup>
84-
<PropertyGroup>
85-
<SignAssembly>true</SignAssembly>
86-
</PropertyGroup>
8785
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'CodeAnalysis|AnyCPU' ">
8886
<DebugSymbols>true</DebugSymbols>
89-
<OutputPath>..\..\bin\CodeAnalysis\</OutputPath>
9087
<DefineConstants>DEBUG;TRACE</DefineConstants>
9188
<DebugType>full</DebugType>
9289
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -336,5 +333,5 @@
336333
<Folder Include="OpenId\UI\" />
337334
</ItemGroup>
338335
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
339-
<Import Project="..\..\tools\DotNetOpenAuth.targets" />
336+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
340337
</Project>

src/DotNetOpenAuth/DotNetOpenAuth.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\..\tools\DotNetOpenAuth.props" />
43
<PropertyGroup>
4+
<ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</ProjectRoot>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
</PropertyGroup>
8+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.props" />
9+
<PropertyGroup>
710
<ProductVersion>9.0.30729</ProductVersion>
811
<SchemaVersion>2.0</SchemaVersion>
912
<ProjectGuid>{3191B653-F76D-4C1A-9A5A-347BC3AAAAB7}</ProjectGuid>
@@ -19,17 +22,16 @@ Code licensed under the Ms-PL License:
1922
http://opensource.org/licenses/ms-pl.html
2023
</StandardCopyright>
2124
<ApplicationIcon>DotNetOpenAuth.ico</ApplicationIcon>
25+
<DocumentationFile>$(OutputPath)DotNetOpenAuth.xml</DocumentationFile>
2226
</PropertyGroup>
2327
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2428
<DebugSymbols>true</DebugSymbols>
2529
<DebugType>full</DebugType>
2630
<Optimize>false</Optimize>
27-
<OutputPath>..\..\bin\Debug\</OutputPath>
2831
<DefineConstants>DEBUG;TRACE</DefineConstants>
2932
<ErrorReport>prompt</ErrorReport>
3033
<WarningLevel>4</WarningLevel>
3134
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
32-
<DocumentationFile>..\..\bin\Debug\DotNetOpenAuth.xml</DocumentationFile>
3335
<RunCodeAnalysis>false</RunCodeAnalysis>
3436
<CodeAnalysisRules>-Microsoft.Design#CA1054;-Microsoft.Design#CA1056;-Microsoft.Design#CA1055</CodeAnalysisRules>
3537
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
@@ -64,12 +66,10 @@ http://opensource.org/licenses/ms-pl.html
6466
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
6567
<DebugType>pdbonly</DebugType>
6668
<Optimize>true</Optimize>
67-
<OutputPath>..\..\bin\Release\</OutputPath>
6869
<DefineConstants>TRACE</DefineConstants>
6970
<ErrorReport>prompt</ErrorReport>
7071
<WarningLevel>4</WarningLevel>
7172
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
72-
<DocumentationFile>..\..\bin\Release\DotNetOpenAuth.xml</DocumentationFile>
7373
<RunCodeAnalysis>true</RunCodeAnalysis>
7474
<CodeAnalysisRules>-Microsoft.Design#CA1054;-Microsoft.Design#CA1056;-Microsoft.Design#CA1055</CodeAnalysisRules>
7575
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
@@ -101,14 +101,9 @@ http://opensource.org/licenses/ms-pl.html
101101
<CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
102102
<CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
103103
</PropertyGroup>
104-
<PropertyGroup>
105-
<SignAssembly>true</SignAssembly>
106-
</PropertyGroup>
107104
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'CodeAnalysis|AnyCPU' ">
108105
<DebugSymbols>true</DebugSymbols>
109-
<OutputPath>..\..\bin\CodeAnalysis\</OutputPath>
110106
<DefineConstants>$(DefineConstants);CONTRACTS_FULL;DEBUG;TRACE</DefineConstants>
111-
<DocumentationFile>..\..\bin\CodeAnalysis\DotNetOpenAuth.xml</DocumentationFile>
112107
<DebugType>full</DebugType>
113108
<PlatformTarget>AnyCPU</PlatformTarget>
114109
<CodeAnalysisRules>-Microsoft.Design#CA1054;-Microsoft.Design#CA1056;-Microsoft.Design#CA1055</CodeAnalysisRules>
@@ -689,5 +684,5 @@ http://opensource.org/licenses/ms-pl.html
689684
<Content Include="DotNetOpenAuth.ico" />
690685
</ItemGroup>
691686
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
692-
<Import Project="..\..\tools\DotNetOpenAuth.targets" />
687+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
693688
</Project>

tools/Documentation.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</ProjectRoot>
66
<OutputAssembly>DotNetOpenAuth</OutputAssembly>
7-
<OutputPath>$(ProjectRoot)bin\$(Configuration)\</OutputPath>
87
<DocOutputPath>$(ProjectRoot)doc\</DocOutputPath>
98
<IntermediatePath>$(ProjectRoot)obj\$(Configuration)\</IntermediatePath>
109
<DocumentationFile>$(OutputPath)$(OutputAssembly).xml</DocumentationFile>

tools/DotNetOpenAuth.Common.Settings.targets

Lines changed: 0 additions & 24 deletions
This file was deleted.

tools/DotNetOpenAuth.Versioning.targets

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
33
<!-- Import this .targets file to automatically generate AssemblyVersion
4-
attribute according to DotNetOpenAuth convention. -->
4+
attribute according to DotNetOpenAuth convention.
5+
This file assumes DotNetOpenAuth.props and DotNetOpenAuth.targets are also imported. -->
56
<PropertyGroup>
6-
<ProjectRoot Condition="'$(ProjectRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</ProjectRoot>
7-
<VersionCsFile>$(ProjectRoot)obj\$(Configuration)\$(AssemblyName).Version.cs</VersionCsFile>
7+
<VersionCsFile>$(IntermediatePath)\$(AssemblyName).Version.cs</VersionCsFile>
88
<NoWarn>$(NoWarn);1607</NoWarn>
99
</PropertyGroup>
1010

11-
<PropertyGroup Condition="'$(SignAssembly)' == 'true'">
12-
<DefineConstants>$(DefineConstants);StrongNameSigned</DefineConstants>
13-
<DelaySign>true</DelaySign>
14-
<PublicKeyFile Condition="'$(PublicKeyFile)' == ''">$(ProjectRoot)src\official-build-key.pub</PublicKeyFile>
15-
<AssemblyOriginatorKeyFile Condition="'$(AssemblyOriginatorKeyFile)' == ''">$(PublicKeyFile)</AssemblyOriginatorKeyFile>
16-
</PropertyGroup>
17-
18-
<Import Project="$(ProjectRoot)lib\DotNetOpenAuth.BuildTasks.targets" />
1911
<UsingTask AssemblyFile="$(ProjectRoot)lib\MSBuild.Community.Tasks.dll" TaskName="AssemblyInfo"/>
2012

2113
<Target Name="GetBuildVersion">
@@ -33,7 +25,7 @@
3325
<Message Condition=" '$(AssemblyInformationalVersion)' != '' " Text="Building version $(BuildVersion) from commit $(AssemblyInformationalVersion)"/>
3426
<Message Condition=" '$(AssemblyInformationalVersion)' == '' " Text="Building version $(BuildVersion)"/>
3527
</Target>
36-
28+
3729
<Target Name="BeforeBuild" DependsOnTargets="GetBuildVersion">
3830
<PropertyGroup>
3931
<NewVersionCsFile>$(VersionCsFile).new</NewVersionCsFile>

0 commit comments

Comments
 (0)