Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (75 sloc) 5.07 KB
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="$(Configuration)==''">Debug</Configuration>
<Root>$(MSBuildProjectDirectory)\</Root>
<Version Condition="$(BUILD_NUMBER)!=''">$(BUILD_NUMBER)</Version>
<Version Condition="$(Version)==''">0.0.0.0</Version>
<ClickOnceFolder>$(Root)artifacts\ClickOnce\</ClickOnceFolder>
<ProviderUrl Condition="$(ProviderUrl)=='' AND $(BlobTargetUrl) !=''">$(BlobTargetUrl)MarkPad.application</ProviderUrl>
</PropertyGroup>
<Target Name="Clean">
<ItemGroup>
<ProjectFiles Include="$(Root)**\*.*proj" />
<OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)bin')" />
<OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)obj')" />
</ItemGroup>
<Delete Files="@(OldArtifacts)" ContinueOnError="true" />
<RemoveDir Directories="..\artifacts" ContinueOnError="true" />
<RemoveDir Directories="@(OldDirectories)" ContinueOnError="true" />
</Target>
<Target Name="Build" DependsOnTargets="Clean">
<MSBuild Projects="$(Root)src\MarkPad.sln" Targets="Rebuild" Properties="Configuration=$(Configuration);Platform=x86" />
</Target>
<Target Name="Test" DependsOnTargets="Build">
<Exec Command="$(Root)tools\xunit\xunit.console.clr4.x86.exe $(Root)src\MarkPad.Tests\bin\$(Configuration)\MarkPad.Tests.dll" />
</Target>
<Target Name="Publish" DependsOnTargets="Test">
<PropertyGroup>
<ClickOnceFiles>$(ClickOnceFolder)$(Version)\</ClickOnceFiles>
<Mage>$(Root)tools\mage.exe</Mage>
<ProviderUrlArg Condition="$(ProviderUrl)!=''">-ProviderURL $(ProviderUrl)</ProviderUrlArg>
<ClickOnceName Condition="$(ClickOnceName)==''">MarkPad</ClickOnceName>
</PropertyGroup>
<ItemGroup>
<XmlFiles Include="$(Root)src\MarkPad\bin\$(Configuration)\*.xml" />
<ClickOnceFilesToDelete Include="$(ClickOnceFolder)\**\*.*" />
</ItemGroup>
<Delete Files="@(ClickOnceFilesToDelete)" />
<RemoveDir Directories="@(ClickOnceFolder)" />
<ItemGroup>
<SourceFiles Include="$(Root)src\MarkPad\bin\$(Configuration)\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(SourceFiles)" DestinationFolder="$(ClickOnceFiles)%(SourceFiles.RecursiveDir)"/>
<Exec Command="$(Mage) -New Application -ToFile $(ClickOnceFiles)MarkPad.exe.manifest -Processor x86 -name &quot;$(ClickOnceName)&quot; -Version $(VERSION) -FromDirectory $(ClickOnceFiles) -IconFile markpad.ico" />
<Exec Command="powershell.exe -ExecutionPolicy RemoteSigned -NoProfile $(Root)tools\UpdateManifest.ps1 -ManifestFile $(ClickOnceFiles)MarkPad.exe.manifest" />
<Exec Command="$(Mage) -New Deployment -ToFile $(ClickOnceFolder)MarkPad.application -name &quot;$(ClickOnceName)&quot; -Processor x86 -Install true -Version $(Version) -Publisher &quot;Code52&quot; -AppManifest $(ClickOnceFiles)MarkPad.exe.manifest $(ProviderUrlArg)" />
<Exec Command="powershell.exe -ExecutionPolicy RemoteSigned -NoProfile $(Root)tools\UpdateApplicationManifest.ps1 -ManifestFile $(ClickOnceFolder)MarkPad.application" />
<ItemGroup>
<DeploymentFiles Include="$(ClickOnceFiles)**\*.*" Exclude="$(ClickOnceFiles)MarkPad.exe.manifest" />
</ItemGroup>
<Move SourceFiles="@(DeploymentFiles)" DestinationFiles="@(DeploymentFiles->'%(RootDir)%(Directory)%(FileName)%(Extension).deploy')" />
</Target>
<Target Name="PublishInstallToAzure" DependsOnTargets="Publish">
<!--To build and publish to azure: msbuild MarkPad.msbuild /p:BlobTargetUrl=https://myaccount.blob.core.windows.net/mycontainer/ /p:BlobTargetKey=key /target:PublishInstallToAzure-->
<!--$(BlobTargetUrl) = https://myaccount.blob.core.windows.net/mycontainer/ -->
<!--Upload everything except the application manifest as it should be done last (once everything else is uploaded)-->
<Move SourceFiles="$(ClickOnceFolder)MarkPad.application" DestinationFolder="$(ClickOnceFolder)ClickOnceApplicationFile\" />
<Exec Command="$(Root)tools\AzCopy.exe $(ClickOnceFolder) $(BlobTargetUrl) /destkey:$(BlobTargetKey) /S /V /Y" />
<Exec Command="$(Root)tools\AzCopy.exe $(ClickOnceFolder)ClickOnceApplicationFile\ $(BlobTargetUrl) /destkey:$(BlobTargetKey) /S /V /Y" />
</Target>
<Target Name="Chocolatey" DependsOnTargets="Build">
<PropertyGroup>
<AssemblyConfig Condition=" '$(AssemblyConfig)' != '' ">-$(AssemblyConfig)</AssemblyConfig>
<BuildNumber Condition=" '$(BuildNumber)' == '0' "></BuildNumber>
<BuildNumber Condition=" '$(AssemblyConfig)' == '' And $(BuildNumber) != '' ">.$(BuildNumber)</BuildNumber>
<NuGet>..\src\.nuget\NuGet.exe</NuGet>
<OutputDirectory>-OutputDirectory "..\artifacts"</OutputDirectory>
<VersionArg>-Version $(CurrentVersion)$(AssemblyConfig)$(BuildNumber)</VersionArg>
<ConfigArg>-Prop Configuration=$(Configuration)</ConfigArg>
</PropertyGroup>
<ItemGroup>
<NuSpec Include="$(Root)artifacts\*.nuspec" />
</ItemGroup>
<Exec Command='$(NuGet) pack "%(NuSpec.Identity)" $(OutputDirectory) $(VersionArg) $(ConfigArg)' />
</Target>
</Project>
Something went wrong with that request. Please try again.