Skip to content

Commit daa04b7

Browse files
committed
WiX: package up DocC conditionally
Add support to package up DocC in the windows distribution. This is the last large component that was missing. At this point, the toolchain distribution is generally speaking complete with: - Preprocessor (clang) - Assembler (IAS) - C/C++/Swift Compiler (clang/clang++/swiftc) - Linker (lld) - Binary Utilities (LLVM) - Debugger (LLDB) - REPL - Package Manager (SwiftPM) - Runtime Inspection Tools (swift-inspect) - LSP (sourcekit-lsp) - Code Formatter (swift-format) - Documentation Tools (DocC) - Additional IDE integration Tools (lldb-vscode) - Redistributables (MSMs) - Runtime (host-only) - SDKs (AMD64, ARM64, X86)
1 parent fcbde7e commit daa04b7

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

platforms/Windows/bld/bld.wxs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
<Directory Id="_usr_lib_swift_swiftToCxx" Name="swiftToCxx" />
2929
</DirectoryRef>
3030

31-
<DirectoryRef Id="_usr">
32-
<Directory Name="share">
33-
<Directory Id="_usr_share_swift" Name="swift" />
34-
</Directory>
31+
<DirectoryRef Id="_usr_share">
32+
<Directory Id="_usr_share_swift" Name="swift" />
3533
</DirectoryRef>
3634

3735
<ComponentGroup Id="binutils" Directory="_usr_bin">

platforms/Windows/cli/cli.wixproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,26 @@
44
$(DefineConstants);
55
DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);
66
TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);
7+
SWIFT_DOCC_BUILD=$(SWIFT_DOCC_BUILD);
8+
INCLUDE_SWIFT_DOCC=$(INCLUDE_SWIFT_DOCC);
79
SWIFT_FORMAT_BUILD=$(SWIFT_FORMAT_BUILD);
810
INCLUDE_SWIFT_FORMAT=$(INCLUDE_SWIFT_FORMAT);
11+
SWIFT_DOCC_RENDER_ARTIFACT_ROOT_DIST=$(SWIFT_DOCC_RENDER_ARTIFACT_ROOT)\dist;
912
</DefineConstants>
1013
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
17+
</ItemGroup>
18+
19+
<ItemGroup Condition="'$(INCLUDE_SWIFT_DOCC)' == 'true'">
20+
<HarvestDirectory Include="$(SWIFT_DOCC_RENDER_ARTIFACT_ROOT)\dist">
21+
<ComponentGroupName>DocCRender</ComponentGroupName>
22+
<DirectoryRefId>_usr_share_docc_render</DirectoryRefId>
23+
<PreprocessorVariable>var.SWIFT_DOCC_RENDER_ARTIFACT_ROOT_DIST</PreprocessorVariable>
24+
<SuppressCom>true</SuppressCom>
25+
<SuppressRegistry>true</SuppressRegistry>
26+
<SuppressRootDirectory>true</SuppressRootDirectory>
27+
</HarvestDirectory>
28+
</ItemGroup>
1129
</Project>

platforms/Windows/cli/cli.wxs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@
231231
<!-- FIXME(compnerd) we should include the SPM import libraries -->
232232
</ComponentGroup>
233233

234+
<ComponentGroup Id="DocC" Directory="_usr_bin">
235+
<?if $(INCLUDE_SWIFT_DOCC) == true ?>
236+
<Component>
237+
<File Source="$(SWIFT_DOCC_BUILD)\docc.exe" />
238+
</Component>
239+
<?endif?>
240+
</ComponentGroup>
241+
234242
<ComponentGroup Id="swift_format" Directory="ToolsVersioned">
235243
<?if $(INCLUDE_SWIFT_FORMAT) == true ?>
236244
<Component Id="swift_format.exe">
@@ -252,6 +260,12 @@
252260
<ComponentGroupRef Id="llbuild" />
253261
<ComponentGroupRef Id="system" />
254262
<ComponentGroupRef Id="package_manager" />
263+
264+
<ComponentGroupRef Id="DocC" />
265+
<?if $(INCLUDE_SWIFT_DOCC) == true ?>
266+
<ComponentGroupRef Id="DocCRender" />
267+
<?endif?>
268+
255269
<ComponentGroupRef Id="swift_format" />
256270

257271
<ComponentGroupRef Id="VersionedDirectoryCleanup" />

platforms/Windows/shared/shared.wxs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
<Directory Id="_usr_lib_clang" Name="clang" />
4747
<Directory Id="_usr_lib_swift" Name="swift" />
4848
</Directory>
49+
<Directory Id="_usr_share" Name="share">
50+
<Directory Id="_usr_share_docc" Name="docc">
51+
<Directory Id="_usr_share_docc_render" Name="render" />
52+
</Directory>
53+
</Directory>
4954
</Directory>
5055
</Directory>
5156
</Directory>

0 commit comments

Comments
 (0)