forked from JetBrains/runAs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
66 lines (58 loc) · 2.3 KB
/
build.proj
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 ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version Condition=" '$(Version)' == '' ">1.0.34</Version>
</PropertyGroup>
<UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<Url ParameterType="System.String" Required="true" />
<LocalFilePath ParameterType="System.String" Required="true"/>
</ParameterGroup>
<Task>
<Using Namespace="System"/>
<Using Namespace="System.IO"/>
<Using Namespace="System.Net"/>
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
var dirName = Path.GetDirectoryName(LocalFilePath);
if (dirName != null && Directory.Exists(dirName))
{
Directory.CreateDirectory(dirName);
}
using (WebClient client = new WebClient())
{
client.DownloadFile(Url, LocalFilePath);
}
}
catch(Exception ex)
{
Log.LogMessage(MessageImportance.High, string.Format("##teamcity[buildProblem description='{0}' identity='{0}']", ex.Message));
throw;
}
]]>
</Code>
</Task>
</UsingTask>
<Target Name="GetNuGet">
<DownloadFile
Url="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
LocalFilePath="nuget.exe"/>
</Target>
<Target Name="RestorePackages" DependsOnTargets="GetNuGet">
<Exec Command="nuget.exe restore runAs.sln"/>
</Target>
<Target Name="Rebuild">
<MSBuild Projects="JetBrains.runAs\JetBrains.runAs.vcxproj" Targets="Rebuild" Properties="Configuration=Release;Platform=x86;OutDir=..\bin\Release\x86\"/>
<MSBuild Projects="JetBrains.runAs\JetBrains.runAs.vcxproj" Targets="Rebuild" Properties="Configuration=Release;Platform=x64;OutDir=..\bin\Release\x64\"/>
</Target>
<Target Name="Tests" DependsOnTargets="RestorePackages">
<MSBuild Projects="tests.proj" Targets="Tests"/>
</Target>
<Target Name="Build" DependsOnTargets="Rebuild;Tests"/>
<Target Name="CreatePackages" DependsOnTargets="Build">
<Exec Command="nuget.exe pack package.nuspec -Version $(Version) -OutputDirectory packages"/>
<Message Text="##teamcity[publishArtifacts 'packages\JetBrains.runAs.$(Version).nupkg=>JetBrains.runAs.$(Version).nupkg']" />
</Target>
</Project>