forked from peterhuene/sqlite-net-wp8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlite-net-wp8.msbuild
85 lines (73 loc) · 3.16 KB
/
sqlite-net-wp8.msbuild
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<Project DefaultTargets="PushPackage" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\</SolutionDir>
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(SolutionDir).nuget\nuget.exe</NuGetExePath>
<NuGetServerAddress>http://localhost/NuGetServer/</NuGetServerAddress>
<NuGetServerApiKey>secret</NuGetServerApiKey>
</PropertyGroup>
<ItemGroup>
<NuspecFiles Include="**\*.nuspec" />
<NuGetNuspecTargets Include="*.nuspec" />
</ItemGroup>
<Target Name="Clean">
<ItemGroup>
<CleanFileList Include="*.nupkg"/>
<CleanFolderList Include="ARM;Release;.nuget"/>
</ItemGroup>
<MSBuild Projects="@(ProjectToBuild)" BuildInParallel="true" Targets="Clean" />
<Delete Files="@(CleanFileList)"/>
<RemoveDir Directories="@(CleanFolderList)" ContinueOnError="true"/>
</Target>
<ItemGroup>
<ProjectToBuild Include="Sqlite.vcxproj">
<Properties>Configuration=Release;Platform=Win32</Properties>
</ProjectToBuild>
<ProjectToBuild Include="Sqlite.vcxproj">
<Properties>Configuration=Release;Platform=ARM</Properties>
</ProjectToBuild>
</ItemGroup>
<Target Name="Build" DependsOnTargets="_DownloadNuGet">
<MSBuild Projects="@(ProjectToBuild)" BuildInParallel="true" Targets="Build" />
</Target>
<Target Name='Package' DependsOnTargets="Build">
<Exec Command='.nuget\NuGet.exe pack %(NuGetNuspecTargets.Identity) -NoPackageAnalysis -NonInteractive -Verbosity quiet' />
</Target>
<Target Name="PushPackage" DependsOnTargets="Clean;Package">
<ItemGroup>
<NupkgFiles Include="*.nupkg" Exclude="*.symbols.nupkg" />
</ItemGroup>
<Exec Command=".nuget\NuGet.exe push %(NupkgFiles.Identity) -s $(NuGetServerAddress) -NonInteractive $(NuGetServerApiKey)" />
</Target>
<Target Name="_DownloadNuGet">
<MakeDir Directories="$(SolutionDir).nuget" />
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition="!Exists('$(NuGetExePath)')" />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>