20
20
// THE SOFTWARE.
21
21
-->
22
22
<!-- Common Settings used by SharpDX projects -->
23
- <Project DefaultTargets="PackageDev" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
24
-
23
+ <Project DefaultTargets="Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
25
24
<PropertyGroup>
26
25
<SharpDXRepo>$(MSBuildThisFileDirectory)..</SharpDXRepo>
27
- <SharDXNugetPackages>$(MSBuildThisFileDirectory)Packages</SharDXNugetPackages>
28
- <GitExe>"C:\Program Files (x86)\Git\bin\git.exe"</GitExe>
26
+ <SharpDXNugetPackageDir>$(MSBuildThisFileDirectory)Packages</SharpDXNugetPackageDir>
29
27
<ExtensionTasksPath>$(SharpDXRepo)\External\MSBuildExtensionPack\</ExtensionTasksPath>
30
28
<BuildSignedSharpDX>true</BuildSignedSharpDX>
31
29
<SharedAssemblyInfoFilePath>$(SharpDXRepo)\Source\SharedAssemblyInfo.cs</SharedAssemblyInfoFilePath>
32
30
<SharedAssemblyInfo>$([System.IO.File]::ReadAllText($(SharedAssemblyInfoFilePath)))</SharedAssemblyInfo>
33
- <SharpDXAssemblyPostFixVersion>-beta01</SharpDXAssemblyPostFixVersion>
31
+ <SharpDXPackagingDevName Condition="'$(SharpDXPackagingDevName)' == ''">alpha</SharpDXPackagingDevName>
32
+ <SharpDXBuildNumber Condition="'$(SharpDXBuildNumber)' == ''">1</SharpDXBuildNumber>
33
+ <SharpDXAssemblyPostFixVersion Condition="'$(SharpDXPackagingDev)' == 'true'">-$(SharpDXPackagingDevName)$([System.String]::Format('{0:000}', $([MSBuild]::Add($(SharpDXBuildNumber), 0))))</SharpDXAssemblyPostFixVersion>
34
34
<SharpDXAssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match($(SharedAssemblyInfo), `AssemblyVersion\("(.*)"`).Groups[1].Value)$(SharpDXAssemblyPostFixVersion)</SharpDXAssemblyVersion>
35
- <SharpDXDevZip>$(MSBuildThisFileDirectory)\SharpDX-SDK-LatestDev.exe</SharpDXDevZip>
36
- <SharpDXReleaseZip>$(MSBuildThisFileDirectory)\SharpDX-SDK-$(SharpDXAssemblyVersion).exe</SharpDXReleaseZip>
37
- <SharpDXLocalUpload>C:\inetpub\wwwroot\sharpdx\upload</SharpDXLocalUpload>
35
+ <SharpDXZipName>$(MSBuildThisFileDirectory)\SharpDX-SDK-$(SharpDXAssemblyVersion).exe</SharpDXZipName>
38
36
</PropertyGroup>
39
37
40
38
<Import Project="$(ExtensionTasksPath)MSBuild.ExtensionPack.tasks"/>
45
43
<Message Importance="high" Text="Use parameter /t:Pre-Build;Build to build SharpDX assemblies for non WP8 platforms. And /t:BuildForVS2012 for WP8"/>
46
44
</Target>
47
45
48
- <Target Name="PackageDev">
49
- <CallTarget Targets="Build"/>
46
+ <Target Name="Package">
47
+ <Message Importance="High" Text="Building SharpDX $(SharpDXAssemblyVersion)"/>
48
+ <CallTarget Targets="Build"/>
50
49
<CallTarget Targets="Nuget"/>
51
50
<CallTarget Targets="ZipBuild"/>
51
+ <CallTarget Condition="'$(SharpDXNugetPush)' == 'true'" Targets="NugetPush"/>
52
+ </Target>
53
+
54
+ <Target Name="Build">
55
+ <!--Build all targets / platforms-->
56
+ <Exec Command="RMDIR /Q /S $(SharpDXRepo)\Bin"/>
57
+ <MSBuild Targets="Clean;Build" Projects="$(SharpDXRepo)\SharpDX-Desktop.sln" Properties="Configuration=Release;Platform=Any CPU;SharpDXSign=true"/>
58
+ <MSBuild Targets="Clean;Build" Projects="$(SharpDXRepo)\SharpDX-StoreApp.sln" Properties="Configuration=Release;Platform=Any CPU;SharpDXSign=true"/>
52
59
</Target>
53
60
54
61
<Target Name="Nuget">
55
- <Exec Command="RMDIR /Q /S $(SharDXNugetPackages )"/>
56
- <MakeDir Directories="$(SharDXNugetPackages )"/>
62
+ <Exec Command="RMDIR /Q /S $(SharpDXNugetPackageDir )"/>
63
+ <MakeDir Directories="$(SharpDXNugetPackageDir )"/>
57
64
<ItemGroup>
58
65
<SharpDXNuspecs Include="$(SharpDXRepo)\Source\**\*.nuspec"/>
59
66
</ItemGroup>
60
- <Exec Command="nuget.exe pack -OutputDirectory $(SharDXNugetPackages ) -Properties version=$(SharpDXAssemblyVersion) -Symbols %(SharpDXNuspecs.Identity)"/>
67
+ <Exec Command="nuget.exe pack -OutputDirectory $(SharpDXNugetPackageDir ) -Properties version=$(SharpDXAssemblyVersion) -Symbols %(SharpDXNuspecs.Identity)"/>
61
68
</Target>
62
69
63
70
<Target Name="NugetPush">
64
71
<ItemGroup>
65
- <SharpDXNupkg Include="$(SharDXNugetPackages )\*.nupkg"/>
72
+ <SharpDXNupkg Include="$(SharpDXNugetPackageDir )\*.nupkg"/>
66
73
</ItemGroup>
67
- <Exec Command="nuget.exe push %(SharpDXNupkg.Identity)" IgnoreExitCode="true"/>
68
- </Target>
69
-
70
- <Target Name="Build">
71
- <!--Build all targets / platforms-->
72
- <Exec Command="RMDIR /Q /S $(SharpDXRepo)\Bin"/>
73
- <MSBuild Targets="Clean;Build" Projects="$(SharpDXRepo)\SharpDX-Desktop.sln" Properties="Configuration=Release;Platform=Any CPU;SharpDXSign=true"/>
74
- <MSBuild Targets="Clean;Build" Projects="$(SharpDXRepo)\SharpDX-StoreApp.sln" Properties="Configuration=Release;Platform=Any CPU;SharpDXSign=true"/>
74
+ <Error Condition="'$(SharpDXNugetApiKey)' == ''" Text="SharpDXNugetApiKey env variable is required when pushing nuget package"/>
75
+ <Exec Command="nuget.exe push -ApiKey $(SharpDXNugetApiKey) %(SharpDXNupkg.Identity)" IgnoreExitCode="true"/>
76
+ </Target>
77
+
78
+ <Target Name="ZipBuild">
79
+ <Delete Files="$(SharpDXZipName)"/>
80
+ <Exec WorkingDirectory="$(SharpDXRepo)" Command='$(SharpDXRepo)\External\7-Zip\7z.exe a -sfx7z.sfx -xr!External -xr!*.check -xr!*.pdb -xr!*.lib -xr!*.pri -xr!*.exp $(SharpDXZipName) Bin\*\*.* License.txt ReleaseNotes.md Readme.md'/>
75
81
</Target>
76
82
77
83
<!--Custom task for checking certification result (fail or pass), the project is excluded from solution build - needs to be rebuilt manually when needed-->
122
128
<VerifyCertificationResultTask File="$(SharpDXRepo)\Source\CertificationTests\Results\Test.WinRT.xml" />
123
129
<VerifyCertificationResultTask File="$(SharpDXRepo)\Source\CertificationTests\Results\Test.WP81.xml" />
124
130
</Target>
125
-
126
- <Target Name="ZipBuild">
127
- <Delete Files="$(SharpDXDevZip)"/>
128
- <Exec WorkingDirectory="$(SharpDXRepo)" Command='$(SharpDXRepo)\External\7-Zip\7z.exe a -sfx7z.sfx -xr!External -xr!*.check -xr!*.pdb -xr!*.lib -xr!*.pri -xr!*.exp $(SharpDXDevZip) Bin\*\*.* License.txt ReleaseNotes.md Readme.md'/>
129
- </Target>
130
-
131
- <Target Name="ZipRelease">
132
- <Delete Files="$(SharpDXReleaseZip)"/>
133
- <Exec WorkingDirectory="$(SharpDXRepo)" Command='$(SharpDXRepo)\External\7-Zip\7z.exe a -sfx7z.sfx -xr!External -xr!*.check -xr!*.pdb -xr!*.lib -xr!*.pri -xr!*.exp $(SharpDXReleaseZip) Bin\*\*.* License.txt ReleaseNotes.md Readme.md'/>
134
- </Target>
135
-
136
131
</Project>
0 commit comments