Created
August 25, 2011 16:11
-
-
Save danieleli/1171055 to your computer and use it in GitHub Desktop.
MSBuild template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildAndPublish"><PropertyGroup><SourceFileRootFolder>D:\Projects\SampleSite\Source</SourceFileRootFolder><ReleaseFolder>D:\Projects\SampleSite\Builds\Latest Build\Build</ReleaseFolder></PropertyGroup><ItemGroup> | |
<!-- This definition will be used below on the copy task --> | |
<SampleSiteBin Include="$(SourceFileRootFolder)\bin\**\*.*"/></ItemGroup> | |
<!-- Cleaning task --> | |
<Target Name="CleanTarget"><Message Text="Removing all source files from $(ReleaseFolder)"/><RemoveDir Directories="$(ReleaseFolder)\"/></Target> | |
<!-- Build and publish task --> | |
<Target Name="BuildAndPublish"> | |
<!-- Building site --> | |
<MSBuild Targets="Clean;Build" Projects="$(SourceFileRootFolder)\SampleSite.sln"/><CallTarget Targets="CleanTarget"/> | |
<!-- Publishing site --> | |
<!-- First copying runtime files including main assembly, note the values used as targets--> | |
<MSBuild Targets="_CopyWebApplication;_BuiltWebOutputGroupOutput" Projects="$(SourceFileRootFolder)\SampleSite.csproj" Properties="OutDir=$(ReleaseFolder)\"/> | |
<!-- Now copying any file currently present on bin folder --> | |
<Copy DestinationFolder="$(ReleaseFolder)\_PublishedWebsites\SampleSite\bin\%(RecursiveDir)" SourceFiles="@(SampleSiteBin)"/></Target></Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment