@@ -24,6 +24,11 @@ subst T: /d
24
24
subst T: %BuildRoot% || (exit /b)
25
25
set BuildRoot = T:
26
26
27
+ :: Identify the PackageRoot
28
+ set PackageRoot = %BuildRoot% \package
29
+
30
+ md %PackageRoot%
31
+
27
32
:: Identify the InstallRoot
28
33
set InstallRoot = %BuildRoot% \Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr
29
34
set PlatformRoot = %BuildRoot% \Library\Developer\Platforms\Windows.platform
@@ -38,10 +43,15 @@ set TMPDIR=%BuildRoot%\tmp
38
43
call :CloneDependencies || (exit /b)
39
44
call :CloneRepositories || (exit /b)
40
45
46
+ md " %BuildRoot% \Library"
47
+
41
48
:: TODO(compnerd) build ICU from source
42
49
curl.exe -sOL " https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-Win64-MSVC2017.zip" || (exit /b)
43
- md " %BuildRoot% \Library"
44
50
" %SystemDrive% \Program Files\Git\usr\bin\unzip.exe" -o icu4c-67_1-Win64-MSVC2017.zip -d %BuildRoot% \Library\icu-67.1
51
+ md %BuildRoot% \Library\icu-67.1\usr\bin
52
+ copy %BuildRoot% \Library\icu-67.1\bin64\icudt67.dll %BuildRoot% \Library\icu-67.1\usr\bin || (exit /b)
53
+ copy %BuildRoot% \Library\icu-67.1\bin64\icuin67.dll %BuildRoot% \Library\icu-67.1\usr\bin || (exit /b)
54
+ copy %BuildRoot% \Library\icu-67.1\bin64\icuuc67.dll %BuildRoot% \Library\icu-67.1\usr\bin || (exit /b)
45
55
46
56
:: FIXME(compnerd) is there a way to build the sources without downloading the amalgamation?
47
57
curl.exe -sOL " https://sqlite.org/2021/sqlite-amalgamation-3360000.zip" || (exit /b)
@@ -585,6 +595,73 @@ python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'D
585
595
:: TODO(compnerd) match the XCTest installation name
586
596
python -c " import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development' } }), encoding='utf-8'))" > %PlatformRoot% \Info.plist
587
597
598
+ :: Package toolchain.msi
599
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\toolchain.wixproj ^
600
+ -p:RunWixToolsOutOfProc=true ^
601
+ -p:OutputPath=%PackageRoot% \toolchain\ ^
602
+ -p:IntermediateOutputPath=%PackageRoot% \toolchain\ ^
603
+ -p:TOOLCHAIN_ROOT=%BuildRoot% \Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain
604
+ :: TODO(compnerd) actually perform the code-signing
605
+ :: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\toolchain\toolchain.msi
606
+
607
+ :: Package sdk.msi
608
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\CustomActions\SwiftInstaller\SwiftInstaller.vcxproj -t:restore
609
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\sdk.wixproj ^
610
+ -p:RunWixToolsOutOfProc=true ^
611
+ -p:OutputPath=%PackageRoot% \sdk\ ^
612
+ -p:IntermediateOutputPath=%PackageRoot% \sdk\ ^
613
+ -p:PLATFORM_ROOT=%PlatformRoot% \ ^
614
+ -p:SDK_ROOT=%SDKInstallRoot% \ ^
615
+ -p:SWIFT_SOURCE_DIR=%SourceRoot% \swift\ ^
616
+ -p:PlatformToolset=v142
617
+ :: TODO(compnerd) actually perform the code-signing
618
+ :: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\sdk\sdk.msi
619
+
620
+ :: Package runtime.msi
621
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\runtime.wixproj ^
622
+ -p:RunWixToolsOutOfProc=true ^
623
+ -p:OutputPath=%PackageRoot% \runtime\ ^
624
+ -p:IntermediateOutputPath=%PackageRoot% \runtime\ ^
625
+ -p:SDK_ROOT=%SDKInstallRoot% \
626
+ :: TODO(compnerd) actually perform the code-signing
627
+ :: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\runtime\runtime.msi
628
+
629
+ :: Package icu.msi
630
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\icu.wixproj ^
631
+ -p:RunWixToolsOutOfProc=true ^
632
+ -p:OutputPath=%PackageRoot% \icu\ ^
633
+ -p:IntermediateOutputPath=%PackageRoot% \icu\ ^
634
+ -p:ProductVersion=67.1 ^
635
+ -p:ProductVersionMajor=67 ^
636
+ -p:ICU_ROOT=%BuildRoot%
637
+ :: TODO(compnerd) actually perform the code-signing
638
+ :: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\icu\icu.msi
639
+
640
+ :: Package devtools.msi
641
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\devtools.wixproj ^
642
+ -p:RunWixToolsOutOfProc=true ^
643
+ -p:OutputPath=%PackageRoot% \devtools\ ^
644
+ -p:IntermediateOutputPath=%PackageRoot% \devtools\ ^
645
+ -p:DEVTOOLS_ROOT=%BuildRoot% \Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain
646
+ :: TODO(compnerd) actually perform the code-signing
647
+ :: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\devtools\devtools.msi
648
+
649
+ :: Collate MSIs
650
+ move %PackageRoot% \toolchain\toolchain.msi %PackageRoot% || (exit /b)
651
+ move %PackageRoot% \sdk\sdk.msi %PackageRoot% || (exit /b)
652
+ move %PackageRoot% \runtime\runtime.msi %PackageRoot% || (exit /b)
653
+ move %PackageRoot% \icu\icu.msi %PackageRoot% || (exit /b)
654
+ move %PackageRoot% \devtools\devtools.msi %PackageRoot% || (exit /b)
655
+
656
+ :: Build Installer
657
+ msbuild %SourceRoot% \swift-installer-scripts\platforms\Windows\installer.wixproj ^
658
+ -p:RunWixToolsOutOfProc=true ^
659
+ -p:OutputPath=%PackageRoot% \installer\ ^
660
+ -p:IntermediateOutputPath=%PackageRoot% \installer\ ^
661
+ -p:MSI_LOCATION=%PackageRoot% \
662
+ :: TODO(compnerd) actually perform the code-signing
663
+ :: signtool sign /f Apple_CodeSign.pfx /p Apple_CodeSign_Password /tr http://timestamp.digicert.com /fd sha256 %PackageRoot%\installer\installer.exe
664
+
588
665
:: Clean up the module cache
589
666
rd /s /q %LocalAppData% \clang\ModuleCache
590
667
0 commit comments