Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build.ps1 « Windows « Installers « src - github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f8df1c71922945516e1de6181c8b36341d2120ab (plain)
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
90
91
92
93
94
95
96
97
98
99
100
#
# This script requires internal-only access to the code which generates ANCM installers.
#

#requires -version 5
[cmdletbinding()]
param(
    [string]$Configuration = 'Debug',
    [Parameter(Mandatory = $true)]
    [Alias("x86")]
    [string]$Runtime86Zip,
    [Parameter(Mandatory = $true)]
    [Alias("x64")]
    [string]$Runtime64Zip,
    [string]$BuildNumber = 't000',
    [switch]$IsFinalBuild,
    [string]$SignType = '',
    [string]$PackageVersionPropsUrl = $null,
    [string]$AccessTokenSuffix = $null,
    [string]$AssetRootUrl = $null,
    [switch]$clean
)

$ErrorActionPreference = 'Stop'
$repoRoot = Resolve-Path "$PSScriptRoot/../../../"
Import-Module -Scope Local "$repoRoot/scripts/common.psm1" -Force
$msbuild = Get-MSBuildPath -Prerelease -requires 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'

$harvestRoot = "$repoRoot/obj/sfx/"
if ($clean) {
    Remove-Item -Recurse -Force $harvestRoot -ErrorAction Ignore | Out-Null
}

New-Item "$harvestRoot/x86", "$harvestRoot/x64" -ItemType Directory -ErrorAction Ignore | Out-Null

if (-not (Test-Path "$harvestRoot/x86/shared/")) {
    Expand-Archive $Runtime86Zip -DestinationPath "$harvestRoot/x86"
}

if (-not (Test-Path "$harvestRoot/x64/shared/")) {
    Expand-Archive $Runtime64Zip -DestinationPath "$harvestRoot/x64"
}

Push-Location $PSScriptRoot
try {
    Invoke-Block { & $msbuild `
            tasks/InstallerTasks.csproj `
            -nologo `
            -m `
            -v:m `
            -nodeReuse:false `
            -restore `
            -t:Build `
            "-p:Configuration=$Configuration"
    }

    [string[]] $msbuildArgs = @()

    if ($clean) {
        $msbuildArgs += '-t:Clean'
    }

    if ($AssetRootUrl) {
        $msbuildArgs += "-p:DotNetAssetRootUrl=$AssetRootUrl"
    }

    if ($AccessTokenSuffix) {
        $msbuildArgs += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix"
    }

    if ($PackageVersionPropsUrl) {
        $IntermediateDir = Join-Path $PSScriptRoot 'obj'
        $PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props'
        New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null
        Get-RemoteFile "${PackageVersionPropsUrl}${AccessTokenSuffix}" $PropsFilePath
        $msbuildArgs += "-p:DotNetPackageVersionPropsPath=$PropsFilePath"
    }

    $msbuildArgs += '-t:Build'

    Invoke-Block { & $msbuild `
            WindowsInstallers.proj `
            -restore `
            -nologo `
            -m `
            -v:m `
            -nodeReuse:false `
            -clp:Summary `
            "-p:SharedFrameworkHarvestRootPath=$repoRoot/obj/sfx/" `
            "-p:Configuration=$Configuration" `
            "-p:BuildNumber=$BuildNumber" `
            "-p:SignType=$SignType" `
            "-p:IsFinalBuild=$IsFinalBuild" `
            "-bl:$repoRoot/artifacts/logs/installers.msbuild.binlog" `
            @msbuildArgs
    }
}
finally {
    Pop-Location
}