forked from Unity-Technologies/Git-for-Unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreate-Packages.ps1
70 lines (58 loc) · 2.26 KB
/
Create-Packages.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
<#
.SYNOPSIS
Packages a build of GitHub for Unity
.DESCRIPTION
Packages a build of GitHub for Unity
#>
[CmdletBinding()]
Param(
[string]
$Version,
[string]
$TmpDir = '',
[switch]
$SkipUnity = $false,
[switch]
$SkipPackman = $false,
[switch]
$SkipUpm = $false,
[switch]
$Trace = $false
)
Set-StrictMode -Version Latest
if ($Trace) {
Set-PSDebug -Trace 1
}
. $PSScriptRoot\helpers.ps1 | out-null
if ($Version -eq '') {
Die -1 "You need to pass the -Version parameter"
}
$tmpDir=$TmpDir
if ($tmpDir -eq '') {
$tmpDir="$rootDirectory\obj"
} elseif (![System.IO.Path]::IsPathRooted($tmpDir)) {
$tmpDir="$rootDirectory\$tmpDir"
}
$artifactDir="$rootDirectory\artifacts"
$packageDir="$rootDirectory\build\packages"
$srcDir="$rootDirectory\src"
$packagingScriptsDir="$rootDirectory\packaging\create-unity-packages"
Write-Output "Cleaning up previous build artifacts from $tmpDir..."
Remove-Item $tmpDir -Force -Recurse -ErrorAction SilentlyContinue
Remove-Item $artifactDir -Force -Recurse -ErrorAction SilentlyContinue
$pkgName="com.unity.git.api"
$pkgSrcDir="$packageDir\$pkgName"
$ignorefile="$srcDir\$pkgName\.npmignore"
$baseInstall="Packages\$pkgName"
$outDir=$artifactDir
Write-Verbose "$packagingScriptsDir\run.ps1 -Source $pkgSrcDir -Out $artifactDir -Name $pkgName -Version $Version -Ignore $ignorefile -BaseInstall $baseInstall"
Write-Output "Packaging $pkgName..."
Invoke-Command -Fatal { & $packagingScriptsDir\run.ps1 -Source $pkgSrcDir -Out $artifactDir -Name $pkgName -Version $Version -Ignore $ignorefile -BaseInstall $baseInstall -Tmp $tmpDir -SkipUnity:$SkipUnity -SkipPackman:$SkipPackman -SkipUpm:$SkipUpm }
$pkgName="com.unity.git.ui"
$pkgSrcDir="$packageDir\$pkgName"
$ignorefile="$srcDir\$pkgName\.npmignore"
$baseInstall="Packages\$pkgName"
$outDir=$artifactDir
Write-Verbose "$packagingScriptsDir\run.ps1 -Source $pkgSrcDir -Out $artifactDir -Name $pkgName -Version $Version -Ignore $ignorefile -BaseInstall $baseInstall"
Write-Output "Packaging $pkgName..."
Invoke-Command -Fatal { & $packagingScriptsDir\run.ps1 -Source $pkgSrcDir -Out $artifactDir -Name $pkgName -Version $Version -Ignore $ignorefile -BaseInstall $baseInstall -Tmp $tmpDir -SkipUnity:$SkipUnity -SkipPackman:$SkipPackman -SkipUpm:$SkipUpm }