Skip to content

Commit 2c85c77

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 097a839 commit 2c85c77

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

platforms/Windows/bld/bld.wxs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
<Directory Id="_usr_lib_swift_migrator" Name="migrator" />
2222
</DirectoryRef>
2323

24-
<DirectoryRef Id="_usr">
25-
<Directory Name="share">
26-
<Directory Id="_usr_share_swift" Name="swift" />
27-
</Directory>
24+
<DirectoryRef Id="_usr_share">
25+
<Directory Id="_usr_share_swift" Name="swift" />
2826
</DirectoryRef>
2927

3028
<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</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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
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" />
4950
</Directory>
5051
</Directory>
5152
</Directory>

0 commit comments

Comments
 (0)