forked from libgit2/libgit2sharp.nativebinaries
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildpackage.ps1
More file actions
41 lines (34 loc) · 1.26 KB
/
buildpackage.ps1
File metadata and controls
41 lines (34 loc) · 1.26 KB
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
Param(
[Parameter(Mandatory=$true)]
[string]$version,
[switch]$pre
)
$buildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
$versionSuffix = ""
if ($pre.IsPresent) { $versionSuffix = "-pre$BuildDate" }
$projectDirectory = Split-Path $MyInvocation.MyCommand.Path
$x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x86\native"
$x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x64\native"
$osxDirectory = Join-Path $projectDirectory "nuget.package\runtimes\osx\native"
$linuxDirectory = Join-Path $projectDirectory "nuget.package\runtimes\linux-x64\native"
if ( -Not (Test-Path $x86Directory\*.dll) )
{
mkdir -fo $x86Directory > $null
Set-Content $x86Directory\addbinaries.here $null
}
if ( -Not (Test-Path $x64Directory\*.dll) )
{
mkdir -fo $x64Directory > $null
Set-Content $x64Directory\addbinaries.here $null
}
if ( -Not (Test-Path $osxDirectory\*.dylib) )
{
mkdir -fo $osxDirectory > $null
Set-Content $osxDirectory\addbinaries.here $null
}
if ( -Not (Test-Path $linuxDirectory\*.so) )
{
mkdir -fo $linuxDirectory > $null
Set-Content $linuxDirectory\addbinaries.here $null
}
.\Nuget.exe Pack nuget.package\NativeBinaries.nuspec -Version $version$versionSuffix -NoPackageAnalysis