Here is my build script:
<?xml version="1.0" encoding="utf-8" ?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/> <PropertyGroup> <ProjectPath>W:\Demo</ProjectPath> <DebugPath>W:\Demo\bin\Debug</DebugPath> <ReleasePath>W:\Demo\bin\Release</ReleasePath> <ProjectSolutionName>DemoTool</ProjectSolutionName> <NightlyBuildPath>W:\Nightly_Builds\Demo</NightlyBuildPath> <NightlyZipName>Demo</NightlyZipName> </PropertyGroup> <ItemGroup> <DebugApplicationFiles Include="$(DebugPath)\**\*.*" Exclude="$(DebugPath)\*vshost.exe*" /> <ReleaseApplicationFiles Include="$(ReleasePath)\**\*.*" Exclude="$(ReleasePath)\*vshost.exe*" /> </ItemGroup> <Target Name="DebugBuild"> <Message Text="Building $(ProjectSolutionName) Debug Build" /> <MSBuild Projects="$(ProjectPath)\$(ProjectSolutionName).sln" Targets="Clean" Properties="Configuration=Debug"/> <MSBuild Projects="$(ProjectPath)\$(ProjectSolutionName).sln" Targets="Build" Properties="Configuration=Debug"/> <Message Text="$(ProjectSolutionName) Debug Build Complete!" /> <CallTarget Targets="CreateNightlyZip" /> </Target> <Target Name="CreateNightlyZip"> <PropertyGroup> <StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate> </PropertyGroup> <MakeDir Directories="$(NightlyBuildPath)"/> <Zip Files="@(DebugApplicationFiles)" WorkingDirectory="$(DebugPath)" ZipFileName="$(NightlyBuildPath)\$(StringDate)_$(NightlyZipName).zip" ZipLevel="9" /> </Target> </Project>
My script works fine, there is only one weird problem. When I create a project for the first time, and there is no \bin\Debug folder and it was not created at build time, but the ZIP file is still empty. Running the build script a second time the \bin\Debug folder is now installed with embedded files, then the file is added to ZIP.
What could be the problem with running the script for the first time the zip file is empty?
source share