Avoid all custom tasks, since this causes build issues in Visual Studio (Build.Tasks.dll gets loaded into the main AppDomain and remains locked, meaning you have to exit Visual Studio before rebuilding the project).

This commit is contained in:
the_fiddler 2010-10-06 14:14:15 +00:00
parent 61b4f2686e
commit fb9b355bcd
2 changed files with 28 additions and 22 deletions

View file

@ -14,7 +14,6 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup> </PropertyGroup>
<Import Project="..\..\Source\Build.Tasks\Common.xml" />
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{ADC34399-7613-44D2-90B2-19250F06FE7A}</ProjectGuid> <ProjectGuid>{ADC34399-7613-44D2-90B2-19250F06FE7A}</ProjectGuid>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
@ -24,19 +23,17 @@
<None Include="opentk.nsi" /> <None Include="opentk.nsi" />
</ItemGroup> </ItemGroup>
<Target Name="Build"> <Target Name="Build">
<DateStamp> <Exec Command="makensis opentk.nsi" />
<Output TaskParameter="Date" PropertyName="ShortDate" /> <ReadLinesFromFile File="../../Version.txt">
</DateStamp> <Output TaskParameter="Lines" ItemName="Version"/>
<Run Command="makensis opentk.nsi" /> </ReadLinesFromFile>
<Copy SourceFiles=".\opentk.exe" DestinationFiles="..\..\opentk-1.0.$(ShortDate).exe" /> <Copy SourceFiles=".\opentk.exe" DestinationFiles="@(Version->'../../opentk-%(Identity).exe')" />
</Target> </Target>
<Target Name="Clean"> <Target Name="Clean">
<ItemGroup Condition="'$(OS)' == 'Windows_NT'"> <CreateItem Include=".\opentk.exe;..\..\opentk-*.exe">
<FilesToDelete Include=".\opentk.exe;..\..\opentk-1.0.*.exe" /> <Output TaskParameter="Include" ItemName="FilesToDelete" />
</ItemGroup> </CreateItem>
<Delete Files="@(FilesToDelete)" Condition="'$(OS)' == 'Windows_NT'" /> <Delete Files="@(FilesToDelete)" />
<Exec Command="rm -f .\opentk.exe" Condition="'$(OS)' != 'Windows_NT'" />
<Exec Command="rm -f ..\..\opentk-1.0.*.exe" Condition="'$(OS)' != 'Windows_NT'" />
</Target> </Target>
<Target Name="Rebuild"> <Target Name="Rebuild">
<CallTarget Targets="Clean" /> <CallTarget Targets="Clean" />

View file

@ -12,7 +12,6 @@
<PropertyGroup Condition="'$(Configuration)' == 'Nsis'"> <PropertyGroup Condition="'$(Configuration)' == 'Nsis'">
<OutputPath>.\opentk\</OutputPath> <OutputPath>.\opentk\</OutputPath>
</PropertyGroup> </PropertyGroup>
<Import Project="..\..\Source\Build.Tasks\Common.xml" />
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{ADC34399-7613-44D2-90B2-19250F06FE7B}</ProjectGuid> <ProjectGuid>{ADC34399-7613-44D2-90B2-19250F06FE7B}</ProjectGuid>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
@ -20,8 +19,9 @@
<InputPath>..\..\</InputPath> <InputPath>..\..\</InputPath>
<OutputPath>.\opentk\</OutputPath> <OutputPath>.\opentk\</OutputPath>
</PropertyGroup> </PropertyGroup>
<Target Name="Build"> <Target Name="Build1">
<DelTree Path="$(OutputPath)" /> <CallTarget Targets="CleanTreeCopy" />
<!-- Make a clean copy of the source tree -->
<CreateItem <CreateItem
Include="$(InputPath)**\*.*" Include="$(InputPath)**\*.*"
Exclude="$(InputPath)**\.svn\**\*.*; Exclude="$(InputPath)**\.svn\**\*.*;
@ -32,27 +32,36 @@
$(InputPath)**\*.suo; $(InputPath)**\*.suo;
$(InputPath)**\*.pidb; $(InputPath)**\*.pidb;
$(InputPath)**\*.userprefs; $(InputPath)**\*.userprefs;
$(InputPath)**\opentk*.zip; $(InputPath)**\opentk-*.zip;
$(InputPath)**\opentk-*.exe;
$(InputPath)**\vshost*.exe; $(InputPath)**\vshost*.exe;
"> ">
<Output TaskParameter="Include" ItemName="FileList" /> <Output TaskParameter="Include" ItemName="FileList" />
</CreateItem> </CreateItem>
<DateStamp>
<Output TaskParameter="Date" PropertyName="ShortDate" />
</DateStamp>
<Copy SourceFiles="@(FileList)" DestinationFiles="@(FileList->'$(OutputPath)%(RecursiveDir)%(Filename)%(Extension)')" /> <Copy SourceFiles="@(FileList)" DestinationFiles="@(FileList->'$(OutputPath)%(RecursiveDir)%(Filename)%(Extension)')" />
<!-- Zip the copy of the source tree -->
<Run Command="7z a -tzip opentk.zip $(OutputPath)" /> <Run Command="7z a -tzip opentk.zip $(OutputPath)" />
<Copy SourceFiles=".\opentk.zip" DestinationFiles="..\..\opentk-1.0.$(ShortDate).zip" /> </Target>
<Target Name="Build">
<!-- Copy the zip file to the root directory and add a date stamp -->
<ReadLinesFromFile File="../../Version.txt">
<Output TaskParameter="Lines" ItemName="Version"/>
</ReadLinesFromFile>
<Copy SourceFiles=".\opentk.zip" DestinationFiles="@(Version->'..\..\opentk-%(Identity).zip')" />
</Target> </Target>
<Target Name="Clean"> <Target Name="Clean">
<CreateItem Include=".\opentk.zip;..\..\opentk-1.0.*.zip"> <CreateItem Include=".\opentk.zip;..\..\opentk-*.zip">
<Output TaskParameter="Include" ItemName="FilesToDelete" /> <Output TaskParameter="Include" ItemName="FilesToDelete" />
</CreateItem> </CreateItem>
<Delete Files="@(FilesToDelete)" /> <Delete Files="@(FilesToDelete)" />
<DelTree Path="$(OutputPath)" /> <CallTarget Targets="CleanTreeCopy" />
</Target> </Target>
<Target Name="Rebuild"> <Target Name="Rebuild">
<CallTarget Targets="Clean" /> <CallTarget Targets="Clean" />
<CallTarget Targets="Build" /> <CallTarget Targets="Build" />
</Target> </Target>
<Target Name="CleanTreeCopy">
<RemoveDir Directories="$(OutputPath)" Condition="$(OS) == 'Windows_NT'" />
<Exec Command="rm -rf '$(OutputPath)'" Condition="$(OS) != 'Windows_NT'" />
</Target>
</Project> </Project>