-
Notifications
You must be signed in to change notification settings - Fork 166
/
release.msproj
66 lines (51 loc) · 1.95 KB
/
release.msproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Start">
<Import Project="external\msbuild\MSBuild.Community.Tasks.Targets" />
<!-- Variables -->
<PropertyGroup>
<!-- Release Folder -->
<!-- To change the output folder, use the following parameter: /p:BuildDir=C:\BuildTest-->
<MainReleaseDir>release</MainReleaseDir>
<ReleaseDir>$(MainReleaseDir)\bin</ReleaseDir>
<!-- Build Folder -->
<OutDir>src\Cli\bin\Release\net6.0</OutDir>
</PropertyGroup>
<!-- "Autostart" -->
<Target Name="Start">
<CallTarget Targets="DeleteReleaseFolder"/>
<CallTarget Targets="Build"/>
<CallTarget Targets="CopyRelease"/>
<CallTarget Targets="Zip"/>
</Target>
<!-- delete and re-create build folder -->
<Target Name="DeleteReleaseFolder">
<RemoveDir Directories="$(MainReleaseDir)"/>
</Target>
<!-- compile solution as release -->
<Target Name="Build">
<MSBuild Projects="src\pytocs.sln" Properties="Configuration=Release"/>
</Target>
<!-- copy files to release folder -->
<Target Name="CopyRelease">
<Message Importance="high" Text="********* YOYOYOY" />
<MakeDir Directories="$(ReleaseDir)"/>
<ItemGroup>
<ReleaseFiles
Include="$(OutDir)\pytocs.exe;
README.md;"
Exclude="$(OutDir)\*.pdb;
$(OutDir)\*.xml">
</ReleaseFiles>
</ItemGroup>
<Message Importance="high" Text="The outdir is $(OutDir)" />
<Copy SourceFiles="@(ReleaseFiles)" DestinationFiles="@(ReleaseFiles -> '$(ReleaseDir)\%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target>
<!-- create zip file with content of release\bin folder -->
<Target Name="Zip">
<CreateItem Include="$(ReleaseDir)\*.*" >
<Output ItemName="ZipFiles" TaskParameter="Include"/>
</CreateItem>
<Message Text="Zipping $(ReleaseDir)\*.* @(ZipFiles)" />
<Zip ZipFileName="$(ReleaseDir)\zip\pytocs-$(VersionNumber).zip" WorkingDirectory="$(ReleaseDir)\bin" Files="@(ZipFiles)" />
</Target>
</Project>