forked from charlesw/tesseract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyget.ps1
89 lines (73 loc) · 2.02 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
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
86
87
88
89
param(
[string[]]$projects = @(
"Tesseract.Net20\Tesseract.Net20.csproj",
"Tesseract.Net20\Tesseract.Net20.csproj", # 3.5
"Tesseract.Net40\Tesseract.Net40.csproj",
"Tesseract.Net45\Tesseract.Net45.csproj",
"Tesseract.Net45\Tesseract.Net45.csproj" # 4.5.1
),
[string[]]$platforms = @(
"x86"
),
[string[]]$targetFrameworks = @(
"v2.0",
"v3.5",
"v4.0",
"v4.5",
"v4.5.1"
),
[string]$packageVersion = $null,
[string]$config = "Release",
[string]$target = "Rebuild",
[string]$verbosity = "Minimal",
[bool]$clean = $true
)
# Initialization
$rootFolder = Split-Path -parent $script:MyInvocation.MyCommand.Definition
. $rootFolder\myget.include.ps1
# Avoid clean?
if($clean) { MyGet-Build-Clean $rootFolder }
# Build folders
$outputFolder = Join-Path $rootFolder "bin"
# Myget
$packageVersion = MyGet-Package-Version $packageVersion
$nugetExe = MyGet-NugetExe-Path
$nuspec = Join-Path $rootFolder "Tesseract.nuspec"
# Type of framework to use
$useFramework = @(
"v2.0",
"v3.5",
"v4.0",
"v4.5",
"v4.5.1"
)
$i = 0
$projects | ForEach-Object {
$project = $_
$targetFramework = $useFramework[$i]
$platforms | ForEach-Object {
$platform = $_
MyGet-Build-Project -rootFolder $rootFolder `
-project $project `
-outputFolder $outputFolder `
-config $config `
-target $target `
-targetFrameworks $targetFramework `
-platform $platform `
-version $packageVersion `
-verbosity $verbosity `
-MSBuildCustomProperties "/property:AllowUnsafeBlocks=true"
}
$i++
}
$platforms | ForEach-Object {
$platform = $_
$buildOutputFolder = Join-Path $outputFolder "$packageVersion\$platform\$config"
MyGet-Build-Nupkg -project $project `
-rootFolder $rootFolder `
-outputFolder $buildOutputFolder `
-config $config `
-version $packageVersion `
-nuspec $nuspec `
-platform $platform
}