summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-02-16 09:04:11 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-02-16 09:04:11 -0800
commit8564a69eea659f225f30b5e21fa8fbe6888dfda6 (patch)
treee040df0f8a937faaf8d28c124135a9ac80621b45
parent8be14608f4c8321eefa7f77dadfc1346d426f02d (diff)
downloadDotNetOpenAuth-8564a69eea659f225f30b5e21fa8fbe6888dfda6.zip
DotNetOpenAuth-8564a69eea659f225f30b5e21fa8fbe6888dfda6.tar.gz
DotNetOpenAuth-8564a69eea659f225f30b5e21fa8fbe6888dfda6.tar.bz2
Split out the doc and sample publishing targets.
-rw-r--r--build.proj7
-rw-r--r--doc/doc.proj56
-rw-r--r--samples/Samples.proj85
-rw-r--r--tools/Publish.targets132
4 files changed, 142 insertions, 138 deletions
diff --git a/build.proj b/build.proj
index 3947b28..791f77a 100644
--- a/build.proj
+++ b/build.proj
@@ -1,6 +1,5 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildProjectDirectory)\tools\DotNetOpenAuth.automated.props"/>
- <Import Project="$(ProjectRoot)tools\Publish.targets"/>
<Import Project="$(ProjectRoot)tools\Translation.targets"/>
<ItemGroup>
@@ -231,11 +230,7 @@
<Zip Files="@(AllDropTargets)" ZipFileName="$(DropZip)" WorkingDirectory="$(DropsRoot)" ZipLevel="$(ZipLevel)" />
</Target>
- <!-- Although Nightly includes publishing samples and docs, those targets are conditioned for
- running only when the SampleWebRoot and DocWebRoot properties are set, respectively. -->
- <Target Name="Nightly" DependsOnTargets="Drop;Tools;PublishSamples;PublishDocumentation">
-
- </Target>
+ <Target Name="Nightly" DependsOnTargets="Drop;Tools" />
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/>
</Project>
diff --git a/doc/doc.proj b/doc/doc.proj
index 5dcfc80..75f3cdc 100644
--- a/doc/doc.proj
+++ b/doc/doc.proj
@@ -1,9 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- Properties that must be set for these targets to function:
+ $(BranchName): The name of the branch being built. Used to determine the web subdirectory for publishing.
+
+ For creating web sites:
+ $(PublishDocsWebSiteName): The name of the web site under which the documentation web applications will be created/deleted.
+
+ For creating or publishing to web sites:
+ $(DocWebRoot): the full physical path to where documentation should be copied to, excluding $(BranchName)
+ -->
+
<Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/>
<Target Name="Build" DependsOnTargets="BuildProduct;Chm" Condition=" '$(NoDocumentation)' != 'true' " />
+ <Target Name="Prepare">
+ <Error Text="The BranchName property must be set." Condition=" '$(BranchName)' == '' " />
+ <Error Text="The DocWebRoot property must be set." Condition=" '$(DocWebRoot)' == '' " />
+ <PropertyGroup>
+ <PublishDocsWebSiteVirtualPath>/$(BranchName)</PublishDocsWebSiteVirtualPath>
+ </PropertyGroup>
+ </Target>
+
+ <Target Name="PrepareForPublish" DependsOnTargets="Prepare;BuildProduct;Html">
+ <ItemGroup>
+ <DocSources Include="$(ProjectRoot)doc\api\**\*" />
+ <DocTargets Include="@(DocSources->'$(DocWebRoot)\$(BranchName)\%(RecursiveDir)%(Filename)%(Extension)')" />
+ </ItemGroup>
+ </Target>
+
+ <Target Name="Publish"
+ DependsOnTargets="PrepareForPublish"
+ Inputs="@(DocSources)"
+ Outputs="@(DocTargets)">
+ <RemoveDir Directories="$(DocWebRoot)\$(BranchName)" />
+ <MakeDir Directories="$(DocWebRoot)\$(BranchName)" />
+ <Copy SourceFiles="@(DocSources)" DestinationFiles="@(DocTargets)" SkipUnchangedFiles="true" />
+ </Target>
+
+ <Target Name="Unpublish"
+ DependsOnTargets="DeleteSiteOnIis"
+ Condition=" '$(DocWebRoot)' != '' ">
+ </Target>
+
+ <Target Name="CreateSiteOnIis" DependsOnTargets="Prepare">
+ <Error Text="The PublishDocsWebSiteName property must be set." Condition=" '$(PublishDocsWebSiteName)' == '' "/>
+ <CreateWebApplication
+ WebSiteName="$(PublishDocsWebSiteName)"
+ PhysicalPaths="$(DocWebRoot)\$(BranchName)"
+ VirtualPaths="$(PublishDocsWebSiteVirtualPath)"
+ />
+ </Target>
+
+ <Target Name="DeleteSiteOnIis" DependsOnTargets="Prepare">
+ <Error Text="The PublishDocsWebSiteName property must be set." Condition=" '$(PublishDocsWebSiteName)' == '' "/>
+ <DeleteWebApplication
+ WebSiteName="$(PublishDocsWebSiteName)"
+ VirtualPaths="$(PublishDocsWebSiteVirtualPath)"
+ />
+ </Target>
+
<Import Project="$(ProjectRoot)tools\Documentation.targets"/>
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/>
</Project> \ No newline at end of file
diff --git a/samples/Samples.proj b/samples/Samples.proj
index b8fe558..c79a0a4 100644
--- a/samples/Samples.proj
+++ b/samples/Samples.proj
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- Properties that must be set for these targets to function:
+ $(BranchName): The name of the branch being built. Used to determine the web subdirectory for publishing.
+
+ For creating web sites:
+ $(PublishSamplesWebSiteName): The name of the web site under which the sample web applications will be created/deleted.
+
+ For creating or publishing to web sites:
+ $(SampleWebRoot): the full physical path to where samples should be copied to, excluding $(BranchName)
+ -->
<Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/>
<ItemGroup>
@@ -17,5 +26,81 @@
<MSBuild Projects="$(SolutionPath)" Targets="@(SampleSites)" BuildInParallel="$(BuildInParallel)" />
</Target>
+ <Target Name="Prepare">
+ <Error Text="The BranchName property must be set." Condition=" '$(BranchName)' == '' " />
+ <Error Text="The SampleWebRoot property must be set." Condition=" '$(SampleWebRoot)' == '' " />
+ <PropertyGroup>
+ <PublishSamplesWebSiteVirtualPath>/$(BranchName)</PublishSamplesWebSiteVirtualPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <_SampleWebConfigs Include="$(ProjectRoot)samples\*\web.config" />
+ <PublishableWebSamples Include="@(_SampleWebConfigs->'%(RootDir)%(Directory)')" />
+ </ItemGroup>
+
+ <!-- Trim the trailing slash on the web sample paths so we can just get the leaf directory name. -->
+ <Trim
+ Inputs="@(PublishableWebSamples)"
+ EndCharacters="\">
+ <Output TaskParameter="Outputs" ItemName="_PublishableWebSamplesNoTrailingSlash" />
+ </Trim>
+
+ <ItemGroup>
+ <PublishableWebSamplesVirtualPaths Include="@(_PublishableWebSamplesNoTrailingSlash->'$(PublishSamplesWebSiteVirtualPath)/%(Filename)')" />
+ <PublishableWebSamplesPhysicalPaths Include="@(_PublishableWebSamplesNoTrailingSlash->'$(SampleWebRoot)\$(BranchName)\%(Filename)')" />
+ </ItemGroup>
+ </Target>
+
+ <Target Name="PrepareForPublish" DependsOnTargets="Prepare;Build">
+ <ItemGroup>
+ <SampleSources Include="$(ProjectRoot)samples\**\*" />
+ <SampleSources>
+ <PublishedLocation>$(SampleWebRoot)\$(BranchName)\%(RecursiveDir)%(Filename)%(Extension)</PublishedLocation>
+ </SampleSources>
+ </ItemGroup>
+
+ <FilterItems
+ InputItems="@(SampleSources)"
+ StartsWithAny="@(PublishableWebSamples)">
+ <Output TaskParameter="FilteredItems" ItemName="PublishableWebSampleSources" />
+ </FilterItems>
+
+ <ItemGroup>
+ <PublishableWebSampleTargets Include="@(PublishableWebSampleSources->'%(PublishedLocation)')" />
+ </ItemGroup>
+ </Target>
+
+ <Target Name="Publish"
+ DependsOnTargets="PrepareForPublish"
+ Inputs="@(PublishableWebSampleSources)"
+ Outputs="@(PublishableWebSampleTargets)"
+ Condition=" '$(SampleWebRoot)' != '' ">
+ <RemoveDir Directories="$(SampleWebRoot)\$(BranchName)" />
+ <MakeDir Directories="$(SampleWebRoot)\$(BranchName)" />
+ <Copy SourceFiles="@(PublishableWebSampleSources)" DestinationFiles="@(PublishableWebSampleTargets)" SkipUnchangedFiles="true" />
+ </Target>
+
+ <Target Name="Unpublish"
+ DependsOnTargets="DeleteSitesOnIis"
+ Condition=" '$(SampleWebRoot)' != '' ">
+ </Target>
+
+ <Target Name="CreateSitesOnIis" DependsOnTargets="Prepare">
+ <Error Text="The PublishSamplesWebSiteName property must be set." Condition=" '$(PublishSamplesWebSiteName)' == '' "/>
+ <Error Text="The SampleWebRoot property must be set." Condition=" '$(SampleWebRoot)' == '' " />
+ <CreateWebApplication
+ WebSiteName="$(PublishSamplesWebSiteName)"
+ PhysicalPaths="@(PublishableWebSamplesPhysicalPaths)"
+ VirtualPaths="@(PublishableWebSamplesVirtualPaths)"
+ />
+ </Target>
+
+ <Target Name="DeleteSitesOnIis" DependsOnTargets="Prepare">
+ <Error Text="The PublishSamplesWebSiteName property must be set." Condition=" '$(PublishSamplesWebSiteName)' == '' "/>
+ <DeleteWebApplication
+ WebSiteName="$(PublishSamplesWebSiteName)"
+ VirtualPaths="@(PublishableWebSamplesVirtualPaths)"
+ />
+ </Target>
+
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/>
</Project>
diff --git a/tools/Publish.targets b/tools/Publish.targets
deleted file mode 100644
index 415750c..0000000
--- a/tools/Publish.targets
+++ /dev/null
@@ -1,132 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- Properties that must be set for these targets to function:
- $(BranchName): The name of the branch being built. Used to determine the web subdirectory for publishing.
-
- For creating web sites:
- $(PublishSamplesWebSiteName): The name of the web site under which the sample web applications will be created/deleted.
- $(PublishDocsWebSiteName): The name of the web site under which the documentation web applications will be created/deleted.
-
- For creating or publishing to web sites:
- $(SampleWebRoot): the full physical path to where samples should be copied to, excluding $(BranchName)
- $(DocWebRoot): the full physical path to where documentation should be copied to, excluding $(BranchName)
- -->
-
- <Target Name="PrepareForIIS">
- <Error Text="The BranchName property must be set." Condition=" '$(BranchName)' == '' " />
-
- <PropertyGroup>
- <PublishSamplesWebSiteVirtualPath>/$(BranchName)</PublishSamplesWebSiteVirtualPath>
- <PublishDocsWebSiteVirtualPath>/$(BranchName)</PublishDocsWebSiteVirtualPath>
- </PropertyGroup>
- </Target>
-
- <Target Name="PrepareForPublishSamples"
- Condition=" '$(SampleWebRoot)' != '' "
- DependsOnTargets="BuildSamples">
- <Error Text="The BranchName property must be set." Condition=" '$(BranchName)' == '' " />
-
- <ItemGroup>
- <_SampleWebConfigs Include="$(ProjectRoot)samples\*\web.config" />
- <PublishableWebSamples Include="@(_SampleWebConfigs->'%(RootDir)%(Directory)')" />
- <SampleSources Include="$(ProjectRoot)samples\**\*" />
- <SampleSources>
- <PublishedLocation>$(SampleWebRoot)\$(BranchName)\%(RecursiveDir)%(Filename)%(Extension)</PublishedLocation>
- </SampleSources>
- </ItemGroup>
-
- <!-- Trim the trailing slash on the web sample paths so we can just get the leaf directory name. -->
- <Trim
- Inputs="@(PublishableWebSamples)"
- EndCharacters="\">
- <Output TaskParameter="Outputs" ItemName="_PublishableWebSamplesNoTrailingSlash" />
- </Trim>
-
- <ItemGroup>
- <PublishableWebSamplesVirtualPaths Include="@(_PublishableWebSamplesNoTrailingSlash->'$(PublishSamplesWebSiteVirtualPath)/%(Filename)')" />
- <PublishableWebSamplesPhysicalPaths Include="@(_PublishableWebSamplesNoTrailingSlash->'$(SampleWebRoot)\$(BranchName)\%(Filename)')" />
- </ItemGroup>
-
- <FilterItems
- InputItems="@(SampleSources)"
- StartsWithAny="@(PublishableWebSamples)">
- <Output TaskParameter="FilteredItems" ItemName="PublishableWebSampleSources" />
- </FilterItems>
-
- <ItemGroup>
- <PublishableWebSampleTargets Include="@(PublishableWebSampleSources->'%(PublishedLocation)')" />
- </ItemGroup>
- </Target>
-
- <Target Name="PublishSamples"
- DependsOnTargets="PrepareForPublishSamples"
- Inputs="@(PublishableWebSampleSources)"
- Outputs="@(PublishableWebSampleTargets)"
- Condition=" '$(SampleWebRoot)' != '' ">
- <RemoveDir Directories="$(SampleWebRoot)\$(BranchName)" />
- <MakeDir Directories="$(SampleWebRoot)\$(BranchName)" />
- <Copy SourceFiles="@(PublishableWebSampleSources)" DestinationFiles="@(PublishableWebSampleTargets)" SkipUnchangedFiles="true" />
- </Target>
-
- <Target Name="UnpublishSamples"
- DependsOnTargets="DeleteSampleSitesOnIis"
- Condition=" '$(SampleWebRoot)' != '' ">
- </Target>
-
- <Target Name="PrepareForPublishDocumentation" DependsOnTargets="Documentation">
- <ItemGroup>
- <DocSources Include="$(ProjectRoot)doc\api\**\*" />
- <DocTargets Include="@(DocSources->'$(DocWebRoot)\$(BranchName)\%(RecursiveDir)%(Filename)%(Extension)')" />
- </ItemGroup>
- </Target>
-
- <Target Name="PublishDocumentation"
- DependsOnTargets="PrepareForPublishDocumentation"
- Inputs="@(DocSources)"
- Outputs="@(DocTargets)"
- Condition=" '$(DocWebRoot)' != '' ">
- <RemoveDir Directories="$(DocWebRoot)\$(BranchName)" />
- <MakeDir Directories="$(DocWebRoot)\$(BranchName)" />
- <Copy SourceFiles="@(DocSources)" DestinationFiles="@(DocTargets)" SkipUnchangedFiles="true" />
- </Target>
-
- <Target Name="UnpublishDocumentation"
- DependsOnTargets="DeleteDocumentationSiteOnIis"
- Condition=" '$(DocWebRoot)' != '' ">
- </Target>
-
- <Target Name="CreateSampleSitesOnIis" DependsOnTargets="PrepareForIIS;PrepareForPublishSamples">
- <Error Text="The PublishSamplesWebSiteName property must be set." Condition=" '$(PublishSamplesWebSiteName)' == '' "/>
- <Error Text="The SampleWebRoot property must be set." Condition=" '$(SampleWebRoot)' == '' " />
- <CreateWebApplication
- WebSiteName="$(PublishSamplesWebSiteName)"
- PhysicalPaths="@(PublishableWebSamplesPhysicalPaths)"
- VirtualPaths="@(PublishableWebSamplesVirtualPaths)"
- />
- </Target>
-
- <Target Name="DeleteSampleSitesOnIis" DependsOnTargets="PrepareForIIS">
- <Error Text="The PublishSamplesWebSiteName property must be set." Condition=" '$(PublishSamplesWebSiteName)' == '' "/>
- <DeleteWebApplication
- WebSiteName="$(PublishSamplesWebSiteName)"
- VirtualPaths="@(PublishableWebSamplesVirtualPaths)"
- />
- </Target>
-
- <Target Name="CreateDocumentationSiteOnIis" DependsOnTargets="PrepareForIIS">
- <Error Text="The PublishDocsWebSiteName property must be set." Condition=" '$(PublishDocsWebSiteName)' == '' "/>
- <Error Text="The DocWebRoot property must be set." Condition=" '$(DocWebRoot)' == '' " />
- <CreateWebApplication
- WebSiteName="$(PublishDocsWebSiteName)"
- PhysicalPaths="$(DocWebRoot)\$(BranchName)"
- VirtualPaths="$(PublishDocsWebSiteVirtualPath)"
- />
- </Target>
-
- <Target Name="DeleteDocumentationSiteOnIis" DependsOnTargets="PrepareForIIS">
- <Error Text="The PublishDocsWebSiteName property must be set." Condition=" '$(PublishDocsWebSiteName)' == '' "/>
- <DeleteWebApplication
- WebSiteName="$(PublishDocsWebSiteName)"
- VirtualPaths="$(PublishDocsWebSiteVirtualPath)"
- />
- </Target>
-</Project>