forked from compnerd/swift-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swift-argument-parser.yml
118 lines (98 loc) · 3.9 KB
/
swift-argument-parser.yml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# swift-argument-parser
pool:
vmImage: 'windows-latest'
resources:
repositories:
- repository: apple/swift-argument-parser
type: github
name: apple/swift-argument-parser
endpoint: GitHub
pr:
paths:
include:
- .ci/swift-argument-parser.yml
trigger:
branches:
include:
- master
variables:
toolchain.directory: $(Pipeline.Workspace)/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain
sdk.directory: $(Pipeline.Workspace)/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk
steps:
- script: |
git config --global --add core.autocrlf false
git config --global --add core.symlinks true
displayName: Configure GIT
- checkout: apple/swift-argument-parser
displayName: checkout swift-argument-parser
- script: |
git config --global user.name builder
git config --global user.email [email protected]
call :ApplyPatches "%SWIFT_ARGUMENT_PARSER_PR%" $(Build.SourcesDirectory)
goto :eof
:ApplyPatches
setlocal
set list=%~1
set repository=%~2
for /F "tokens=1*" %%P in ("%list%") do (
git -C %repository% fetch origin pull/%%P/merge
git -C %repository% merge FETCH_HEAD
if not "%%Q" == "" call :ApplyPatches "%%Q" %repository%
)
goto :eof
displayName: Apply Patches
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: '3133d6ab-80a8-4996-ac4f-03df25cd3224'
definition: '7'
buildVersionToDownload: 'latest'
allowPartiallySucceededBuilds: true
artifactName: 'toolchain-windows-x64'
targetPath: '$(Pipeline.Workspace)'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: '3133d6ab-80a8-4996-ac4f-03df25cd3224'
definition: '7'
buildVersionToDownload: 'latest'
allowPartiallySucceededBuilds: true
artifactName: 'sdk-windows-x64'
targetPath: '$(Pipeline.Workspace)'
- task: BatchScript@1
displayName: VsDevCmd
inputs:
filename: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/VsDevCmd.bat
arguments: -no_logo -arch=x64 -host_arch=x64
modifyEnvironment: true
- script: |
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/ucrt.modulemap" -o "%UniversalCRTSdkDir%\Include\%UCRTVersion%\ucrt\module.modulemap"
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/visualc.modulemap" -o "%VCToolsInstallDir%\include\module.modulemap"
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/visualc.apinotes" -o "%VCToolsInstallDir%\include\visualc.apinotes"
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/winsdk.modulemap" -o "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"
displayName: Configure SDK
- script: |
echo ##vso[task.prependpath]$(toolchain.directory)/usr/bin
displayName: Update PATH
- task: CMake@1
displayName: Configure swift-argument-parser
inputs:
cmakeArgs:
-B $(Build.BinariesDirectory)/swift-argument-parser
-D BUILD_SHARED_LIBS=YES
-D BUILD_TESTING=NO
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=$(Build.StagingDirectory)/swift-argument-parser-windows-x64/Library/swift-argument-parser-development/usr
-D CMAKE_Swift_FLAGS="-sdk $(sdk.directory) -resource-dir $(sdk.directory)/usr/lib/swift -I $(sdk.directory)/usr/lib/swift -L $(sdk.directory)/usr/lib/swift/windows"
-G Ninja
-S $(Build.SourcesDirectory)
- task: CMake@1
displayName: Build swift-argument-parser
inputs:
cmakeArgs: --build $(Build.BinariesDirectory)/swift-argument-parser
- task: CMake@1
displayName: Install swift-argument-parser
inputs:
cmakeArgs: --build $(Build.BinariesDirectory)/swift-argument-parser --target install
- publish: $(Build.StagingDirectory)/swift-argument-parser-windows-x64
artifact: swift-argument-parser-windows-x64