Skip to content

Commit 9fc0075

Browse files
committed
packaging: update rules for unified package manifest in SPM
This updates the devtools packaging to account for the unified module layout that SPM adopted in swiftlang/swift-package-manager#3464.
1 parent d4eccb0 commit 9fc0075

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

.ci/templates/devtools-msi.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,20 @@ jobs:
5656
solution: $(Build.SourcesDirectory)/wix/windows-devtools.wixproj
5757
msbuildArguments: /p:RunWixToolsOutOfProc=true -p:OutputPath=$(Build.BinariesDirectory)\devtools-msi\ -p:IntermediateOutputPath=$(Build.BinariesDirectory)\sdk-msi\ -p:DEVTOOLS_ROOT=$(devtools.directory) -p:TENSORFLOW=${{ parameters.tensorflow }}
5858

59-
- ${{ if ne(parameters.VERSION, '5.4') }}:
59+
- ${{ if eq(parameters.VERSION, '5.5') }}:
6060
- task: MSBuild@1
6161
displayName: ${{ parameters.platform }}-devtools-${{ parameters.proc }}.msi
6262
inputs:
6363
solution: $(Build.SourcesDirectory)/wix/windows-devtools.wixproj
6464
msbuildArguments: /p:RunWixToolsOutOfProc=true -p:OutputPath=$(Build.BinariesDirectory)\devtools-msi\ -p:IntermediateOutputPath=$(Build.BinariesDirectory)\sdk-msi\ -p:DEVTOOLS_ROOT=$(devtools.directory) -p:HAVE_SWIFT_CRYPTO=true -p:HAVE_SWIFT_PACKAGE_COLLECTIONS=true -p:TENSORFLOW=${{ parameters.tensorflow }}
6565

66+
- ${{ if and(ne(parameters.VERSION, '5.4'), ne(parameters.VERSION, '5.5')) }}:
67+
- task: MSBuild@1
68+
displayName: ${{ parameters.platform }}-devtools-${{ parameters.proc }}.msi
69+
inputs:
70+
solution: $(Build.SourcesDirectory)/wix/windows-devtools.wixproj
71+
msbuildArguments: /p:RunWixToolsOutOfProc=true -p:OutputPath=$(Build.BinariesDirectory)\devtools-msi\ -p:IntermediateOutputPath=$(Build.BinariesDirectory)\sdk-msi\ -p:DEVTOOLS_ROOT=$(devtools.directory) -p:HAVE_SWIFT_CRYPTO=true -p:HAVE_SWIFT_PACKAGE_COLLECTIONS=true -p:HAVE_UNIFIED_SPM_MANIFEST=true -p:TENSORFLOW=${{ parameters.tensorflow }}
72+
6673
- script: |
6774
signtool sign /f $(certificate.secureFilePath) /p $(CERTIFICATE_PASSWORD) /tr http://timestamp.digicert.com /fd sha256 /td sha256 $(Build.BinariesDirectory)/devtools-msi/devtools.msi
6875
displayName: Sign ${{ parameters.platform }}-devtools-${{ parameters.proc }}.msi

wix/windows-devtools.wixproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
<PropertyGroup>
2626
<HAVE_SWIFT_CRYPTO Condition=" '$(HAVE_SWIFT_CRYPTO)' == '' ">false</HAVE_SWIFT_CRYPTO>
2727
<HAVE_SWIFT_PACKAGE_COLLECTIONS Condition=" '$(HAVE_SWIFT_PACKAGE_COLLECTIONS)' == '' ">false</HAVE_SWIFT_PACKAGE_COLLECTIONS>
28+
<HAVE_UNIFIED_SPM_MANIFEST Condition=" '$(HAVE_UNIFIED_SPM_MANIFEST)' == '' ">false</HAVE_UNIFIED_SPM_MANIFEST>
2829
</PropertyGroup>
2930

3031
<Import Project="$(WixTargetsPath)" />
3132

3233
<PropertyGroup>
33-
<DefineConstants>DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);HAVE_SWIFT_CRYPTO=$(HAVE_SWIFT_CRYPTO);HAVE_SWIFT_PACKAGE_COLLECTIONS=$(HAVE_SWIFT_PACKAGE_COLLECTIONS)</DefineConstants>
34+
<DefineConstants>DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);HAVE_SWIFT_CRYPTO=$(HAVE_SWIFT_CRYPTO);HAVE_SWIFT_PACKAGE_COLLECTIONS=$(HAVE_SWIFT_PACKAGE_COLLECTIONS);HAVE_UNIFIED_SPM_MANIFEST=$(HAVE_UNIFIED_SPM_MANIFEST)</DefineConstants>
3435
<HarvestDirectoryAutogenerateGuids>false</HarvestDirectoryAutogenerateGuids>
3536
<HarvestDirectoryGenerateGuidsNow>true</HarvestDirectoryGenerateGuidsNow>
3637
<HarvestDirectoryNoLogo>true</HarvestDirectoryNoLogo>

wix/windows-devtools.wxs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,15 @@
4646
<!-- FIXME(compnerd) should we include the TSC, SPM import libraries? -->
4747
<Directory Id="USR_LIB_SWIFT" Name="swift">
4848
<Directory Id="USR_LIB_SWIFT_PM" Name="pm">
49+
<?if $(var.HAVE_UNIFIED_SPM_MANIFEST) = true?>
50+
<Directory Id="USR_LIB_SWIFT_PM_MANIFEST_API" Name="ManifestAPI">
51+
</Directory>
52+
<?else?>
4953
<Directory Id="USR_LIB_SWIFT_PM_4" Name="4">
5054
</Directory>
5155
<Directory Id="USR_LIB_SWIFT_PM_4_2" Name="4_2">
5256
</Directory>
57+
<?endif?>
5358
</Directory>
5459
<!--
5560
FIXME(compnerd) should we include the import libraries and swiftmodules for Yams, ArgumentParser?
@@ -251,6 +256,22 @@
251256
<?endif?>
252257
</DirectoryRef>
253258

259+
<?if $(var.HAVE_UNIFIED_SPM_MANIFEST) = true?>
260+
<DirectoryRef Id="USR_LIB_SWIFT_PM_MANIFEST_API">
261+
<Component Id="MANIFEST_API" Guid="8680a7e7-654d-4980-be93-6d34142846f2">
262+
<File Id="MANIFEST_API_PACKAGE_DESCRIPTION_DLL" Source="$(var.DEVTOOLS_ROOT)\usr\lib\swift\pm\ManifestAPI\PackageDescription.dll" Checksum="yes" />
263+
<File Id="MANIFEST_API_PACKAGE_DESCRIPTION_LIB" Source="$(var.DEVTOOLS_ROOT)\usr\lib\swift\pm\ManifestAPI\PackageDescription.lib" Checksum="yes" />
264+
<File Id="MANIFEST_API_PACKAGE_DESCRIPTION_SWIFTDOC" Source="$(var.DEVTOOLS_ROOT)\usr\lib\swift\pm\ManifestAPI\PackageDescription.swiftdoc" Checksum="yes" />
265+
<File Id="MANIFEST_API_PACKAGE_DESCRIPTION_SWIFTMODULE" Source="$(var.DEVTOOLS_ROOT)\usr\lib\swift\pm\ManifestAPI\PackageDescription.swiftmodule" Checksum="yes" />
266+
</Component>
267+
268+
<?ifdef INCLUDE_DEBUG_INFO?>
269+
<Component Id="MANIFEST_API_DEBUGINFO" Guid="f4c75c22-bdc9-4cf2-b7d0-cf9ac8a95bef">
270+
<File Id="MANIFESAT_API_PACKAGE_DESCRIPTION_PDB" Source="$(var.DEVTOOLS_ROOT)\usr\lib\swift\pm\ManifestAPI\PackageDescription.pdb" Checksum="yes" />
271+
</Component>
272+
<?endif?>
273+
</DirectoryRef>
274+
<?else?>
254275
<DirectoryRef Id="USR_LIB_SWIFT_PM_4">
255276
<!-- Swift PackageDescription 4 -->
256277
<Component Id="SWIFT_PD_4" Guid="c827d4fc-2498-402d-8052-aff2ed731d0a">
@@ -282,6 +303,7 @@
282303
</Component>
283304
<?endif?>
284305
</DirectoryRef>
306+
<?endif?>
285307

286308
<Feature Id="DEVTOOLS" Level="1">
287309
<ComponentRef Id="INDEXSTOREDB_BINS" />
@@ -294,8 +316,12 @@
294316
<ComponentRef Id="SWIFT_DRIVER_BINS" />
295317
<ComponentRef Id="SWIFT_PACKAGE_MANAGER_BINS" />
296318
<ComponentRef Id="SWIFT_TOOLS_SUPPORT_CORE_BINS" />
319+
<?if $(var.HAVE_UNIFIED_SPM_MANIFEST) = true?>
320+
<ComponentRef Id="MANIFEST_API" />
321+
<?else?>
297322
<ComponentRef Id="SWIFT_PD_4" />
298323
<ComponentRef Id="SWIFT_PD_4_2" />
324+
<?endif?>
299325
<ComponentRef Id="YAMS_BINS" />
300326
</Feature>
301327

@@ -312,8 +338,12 @@
312338
<ComponentRef Id="SWIFT_DRIVER_DEBUGINFO" />
313339
<ComponentRef Id="SWIFT_PACKAGE_MANAGER_DEBUGINFO" />
314340
<ComponentRef Id="SWIFT_TOOLS_SUPPORT_CORE_DEBUGINFO" />
341+
<?if $(var.HAVE_UNIFIED_SPM_MANIFEST) = true?>
342+
<ComponentRef Id="MANIFEST_API_DEBUGINFO" />
343+
<?else?>
315344
<ComponentRef Id="SWIFT_PD_4_DEBUGINFO" />
316345
<ComponentRef Id="SWIFT_PD_4_2_DEBUGINFO" />
346+
<?endif?>
317347
<ComponentRef Id="YAMS_DEBUGINFO" />
318348
</Feature>
319349
<?endif?>

0 commit comments

Comments
 (0)