forked from peters/myget
-
Notifications
You must be signed in to change notification settings - Fork 3
/
myget.ps1
40 lines (30 loc) · 1.23 KB
/
myget.ps1
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
## Attempt to build a .nupkg for one of the sample projects using MyGet.org
param(
[string] $packageVersion = "",
[bool] $fakeBuildRunner = $false
)
# Initialization
$rootFolder = Split-Path -parent $script:MyInvocation.MyCommand.Path
. $rootFolder\myget.include.ps1
# Valid build runners
$validBuildRunners = @("myget")
# Fake build runner so that we can test that this script works.
if($fakeBuildRunner) {
MyGet-Set-EnvironmentVariable "BuildRunner" "myget"
MyGet-Set-EnvironmentVariable "PackageVersion" "1.0.0"
}
if(-not ($validBuildRunners -contains (MyGet-BuildRunner))) {
MyGet-Die "Try running .\examples\build.all.samples.ps1 DUDE!"
}
# Get package version
$packageVersion = MyGet-Package-Version $packageVersion
# AnyCpu
. $rootFolder\examples\build.sample.anycpu-BUILD-SOLUTION.ps1 -packageVersion $packageVersion
# x86/x64
. $rootFolder\examples\build.sample.mixedplatforms-BUILD-SOLUTION.ps1 -packageVersion $packageVersion
# Run powershell unit tests for myget.include.ps1
git submodule update --init --recursive
. $rootFolder\powershelltests.ps1
# Ensure to always reset environment variables (applies to local computer)
MyGet-Set-EnvironmentVariable "BuildRunner" ""
MyGet-Set-EnvironmentVariable "PackageVersion" ""