Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbd952a

Browse files
authored
batch-sign assemblies using the Roslyn SignTool (#4088)
* batch-sign assemblies using the Roslyn SignTool* create MSI installers after the first round of signing
1 parent929c9e0 commitfbd952a

File tree

36 files changed

+374
-276
lines changed

36 files changed

+374
-276
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,4 @@ tests/fsharpqa/testenv/bin/System.ValueTuple.dll
124124
/fcs/TestResult.xml
125125
/tests/fcs/
126126
/fcs/.paket/Paket.Restore.targets
127+
msbuild.binlog

‎build.cmd‎

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ set TEST_VS_IDEUNIT_SUITE=0
7878
setINCLUDE_TEST_SPEC_NUNIT=
7979
setINCLUDE_TEST_TAGS=
8080

81+
setSIGN_TYPE=%PB_SIGNTYPE%
82+
8183
REM ------------------ Parse all arguments -----------------------
8284

8385
set_autoselect=1
@@ -293,6 +295,14 @@ if /i "%ARG%" == "release" (
293295
setBUILD_CONFIG=release
294296
)
295297

298+
if /i"%ARG%"=="test-sign" (
299+
setSIGN_TYPE=test
300+
)
301+
302+
if /i"%ARG%"=="real-sign" (
303+
setSIGN_TYPE=real
304+
)
305+
296306
if /i"%ARG%"=="test" (
297307
set_autoselect_tests=1
298308
)
@@ -427,6 +437,7 @@ echo.
427437
echo PB_SKIPTESTS=%PB_SKIPTESTS%
428438
echo PB_RESTORESOURCE=%PB_RESTORESOURCE%
429439
echo.
440+
echo SIGN_TYPE=%SIGN_TYPE%
430441
echo TEST_NET40_COMPILERUNIT_SUITE=%TEST_NET40_COMPILERUNIT_SUITE%
431442
echo TEST_NET40_COREUNIT_SUITE=%TEST_NET40_COREUNIT_SUITE%
432443
echo TEST_NET40_FSHARP_SUITE=%TEST_NET40_FSHARP_SUITE%
@@ -538,15 +549,6 @@ goto :eof
538549
:havemsbuild
539550
set_nrswitch=/nr:false
540551

541-
:: See <http://www.appveyor.com/docs/environment-variables>
542-
ifdefined APPVEYOR (
543-
rem See<http://www.appveyor.com/docs/build-phase>
544-
ifexist"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" (
545-
rem HACK HACK HACK
546-
set_msbuildexe=%_msbuildexe% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
547-
)
548-
)
549-
550552
ifdefined TF_BUILD (
551553
echo Adding remote 'visualfsharptools' for internal build.
552554
git remote add visualfsharptools https://github.com/Microsoft/visualfsharp.git
@@ -590,6 +592,13 @@ if "%RestorePackages%" == "true" (
590592
@if ERRORLEVEL1echo Error: Nuget restore failed&&goto :failure
591593
)
592594

595+
ifnot"%SIGN_TYPE%"=="" (
596+
setsigntoolnugetoptions=-PackagesDirectory%USERPROFILE%\.nuget\packages -ConfigFile%_nugetconfig%
597+
ifnot"%PB_RESTORESOURCE%"==""setsigntoolnugetoptions=!signtoolnugetoptions! -FallbackSource%PB_RESTORESOURCE%
598+
%_nugetexe% restore build\config\packages.config!signtoolnugetoptions!
599+
@if ERRORLEVEL1echo Error: Nuget restore failed&&goto :failure
600+
)
601+
593602
setrestore_fsharp_suite=0
594603
if"%TEST_NET40_FSHARP_SUITE%"=="1"setrestore_fsharp_suite=1
595604
if"%TEST_CORECLR_FSHARP_SUITE%"=="1"setrestore_fsharp_suite=1
@@ -673,7 +682,47 @@ if "%BUILD_PHASE%" == "1" (
673682
@if ERRORLEVEL1echo Error build failed&&goto :failure
674683
)
675684

676-
echo ---------------- Done with build, starting pack/update/prepare ---------------
685+
echo ---------------- Done with build, starting assembly signing ---------------
686+
687+
ifnot"%SIGN_TYPE%"=="" (
688+
echo build\scripts\run-signtool.cmd -MSBuild%_msbuildexe% -SignType%SIGN_TYPE% -ConfigFile build\config\AssemblySignToolData.json
689+
call build\scripts\run-signtool.cmd -MSBuild%_msbuildexe% -SignType%SIGN_TYPE% -ConfigFile build\config\AssemblySignToolData.json
690+
ifERRORLEVEL1echo Error running sign tool&&goto :failure
691+
)
692+
693+
if"%BUILD_SETUP%"=="1" (
694+
echo%_msbuildexe%%msbuildflags% setup\build-msi.proj /p:Configuration=%BUILD_CONFIG%
695+
%_msbuildexe%%msbuildflags% setup\build-msi.proj /p:Configuration=%BUILD_CONFIG%
696+
ifERRORLEVEL1echo Error building MSI&&goto :failure
697+
)
698+
699+
ifnot"%SIGN_TYPE%"=="" (
700+
echo build\scripts\run-signtool.cmd -MSBuild%_msbuildexe% -SignType%SIGN_TYPE% -ConfigFile build\config\MsiSignToolData.json
701+
call build\scripts\run-signtool.cmd -MSBuild%_msbuildexe% -SignType%SIGN_TYPE% -ConfigFile build\config\MsiSignToolData.json
702+
ifERRORLEVEL1echo Error running sign tool&&goto :failure
703+
)
704+
705+
if"%BUILD_SETUP%"=="1" (
706+
echo%_msbuildexe%%msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG%
707+
%_msbuildexe%%msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG%
708+
ifERRORLEVEL1echo Error building insertion packages&&goto :failure
709+
)
710+
711+
ifnot"%SIGN_TYPE%"=="" (
712+
echo build\scripts\run-signtool.cmd -MSBuild%_msbuildexe% -SignType%SIGN_TYPE% -ConfigFile build\config\InsertionSignToolData.json
713+
call build\scripts\run-signtool.cmd -MSBuild%_msbuildexe% -SignType%SIGN_TYPE% -ConfigFile build\config\InsertionSignToolData.json
714+
ifERRORLEVEL1echo Error running sign tool&&goto :failure
715+
)
716+
717+
echo ---------------- Done with signing, building insertion files ---------------
718+
719+
if"%BUILD_SETUP%"=="1" (
720+
echo%_msbuildexe%%msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG%
721+
%_msbuildexe%%msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG%
722+
ifERRORLEVEL1echo Error building .vsmanproj&&goto :failure
723+
)
724+
725+
echo ---------------- Done building insertion files, starting pack/update/prepare ---------------
677726

678727
if"%BUILD_NET40_FSHARP_CORE%"=="1" (
679728
echo ---------------- start update.cmd ---------------
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"sign": [
3+
{
4+
"certificate":"Microsoft",
5+
"strongName":"StrongName",
6+
"values": [
7+
"net40\\bin\\FSharp.Core.dll",
8+
"net40\\bin\\*\\FSharp.Core.resources.dll",
9+
"net40\\bin\\FSharp.Build.dll",
10+
"net40\\bin\\*\\FSharp.Build.resources.dll",
11+
"net40\\bin\\FSharp.Compiler.Private.dll",
12+
"net40\\bin\\*\\FSharp.Compiler.Private.resources.dll",
13+
"net40\\bin\\FSharp.Compiler.Server.Shared.dll",
14+
"net40\\bin\\FSharp.Compiler.Interactive.Settings.dll",
15+
"net40\\bin\\*\\FSharp.Compiler.Interactive.Settings.resources.dll",
16+
"net40\\bin\\fsc.exe",
17+
"net40\\bin\\fsi.exe",
18+
"net40\\bin\\fsiAnyCpu.exe",
19+
"net40\\bin\\FSharp.VS.FSI.dll",
20+
"net40\\bin\\*\\FSharp.VS.FSI.resources.dll",
21+
"net40\\bin\\FSharp.LanguageService.Base.dll",
22+
"net40\\bin\\*\\FSharp.LanguageService.Base.resources.dll",
23+
"net40\\bin\\FSharp.LanguageService.dll",
24+
"net40\\bin\\*\\FSharp.LanguageService.resources.dll",
25+
"net40\\bin\\FSharp.UIResources.dll",
26+
"net40\\bin\\*\\FSharp.UIResources.resources.dll",
27+
"net40\\bin\\FSharp.Editor.dll",
28+
"net40\\bin\\*\\FSharp.Editor.resources.dll",
29+
"net40\\bin\\FSharp.ProjectSystem.Base.dll",
30+
"net40\\bin\\*\\FSharp.ProjectSystem.Base.resources.dll",
31+
"net40\\bin\\FSharp.ProjectSystem.PropertyPages.dll",
32+
"net40\\bin\\*\\FSharp.ProjectSystem.PropertyPages.resources.dll",
33+
"net40\\bin\\FSharp.ProjectSystem.FSharp.dll",
34+
"net40\\bin\\*\\FSharp.ProjectSystem.FSharp.resources.dll",
35+
"coreclr\\bin\\FSharp.Core.dll",
36+
"coreclr\\bin\\*\\FSharp.Core.resources.dll",
37+
"coreclr\\bin\\FSharp.Build.dll",
38+
"coreclr\\bin\\*\\FSharp.Build.resources.dll",
39+
"coreclr\\bin\\FSharp.Compiler.Private.dll",
40+
"coreclr\\bin\\*\\FSharp.Compiler.Private.resources.dll",
41+
"coreclr\\bin\\FSharp.Compiler.Interactive.Settings.dll",
42+
"coreclr\\bin\\*\\FSharp.Compiler.Interactive.Settings.resources.dll",
43+
"coreclr\\bin\\fsc.exe",
44+
"coreclr\\bin\\fsi.exe"
45+
]
46+
},
47+
{
48+
"certificate":"VsixSHA2",
49+
"strongName":null,
50+
"values": [
51+
"net40\\bin\\VisualFSharpFull.vsix",
52+
"net40\\bin\\VisualFSharpTemplate.vsix",
53+
"net40\\bin\\VisualFSharpOpenSource.vsix",
54+
"insertion\\Microsoft.FSharp.Dependencies.vsix",
55+
"insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix"
56+
]
57+
}
58+
],
59+
"exclude": [
60+
"Microsoft.Build.Conversion.Core.dll",
61+
"Microsoft.Build.dll",
62+
"Microsoft.Build.Engine.dll",
63+
"Microsoft.Build.Framework.dll",
64+
"Microsoft.Build.Tasks.Core.dll",
65+
"Microsoft.Build.Utilities.Core.dll",
66+
"Microsoft.DiaSymReader.dll",
67+
"Microsoft.DiaSymReader.PortablePdb.dll",
68+
"Newtonsoft.Json.dll",
69+
"System.ValueTuple.4.3.1.nupkg",
70+
"System.Collections.Immutable.dll",
71+
"System.Reflection.Metadata.dll",
72+
"System.ValueTuple.dll"
73+
]
74+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"sign": [
3+
{
4+
"certificate":"VsixSHA2",
5+
"strongName":null,
6+
"values": [
7+
"insertion\\Microsoft.FSharp.SDK.Resources.ENU.vsix"
8+
]
9+
}
10+
],
11+
"exclude": [
12+
]
13+
}
14+

‎build/config/MsiSignToolData.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"sign": [
3+
{
4+
"certificate":"Microsoft400",
5+
"strongName":null,
6+
"values": [
7+
"msi\\Microsoft.FSharp.SDK.Core.msi",
8+
"msi\\Microsoft.FSharp.SDK.Resources.*.msi"
9+
]
10+
}
11+
],
12+
"exclude": [
13+
]
14+
}
15+

‎build/config/packages.config‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<packages>
2+
<packageid="MicroBuild.Core"version="0.2.0" />
3+
<packageid="MicroBuild.Core.Sentinel"version="1.0.0" />
4+
<packageid="RoslynTools.SignTool"version="1.0.0-beta-62328-01" />
5+
</packages>

‎build/scripts/run-signtool.cmd‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@echooff
2+
:: Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
3+
setlocalenableDelayedExpansion
4+
setscriptdir=%~dp0
5+
setMSBuild=
6+
setSignType=
7+
setConfigFile=
8+
9+
::
10+
:: Validate arguments
11+
::
12+
13+
:parsearg
14+
if"%1"==""goto doneargs
15+
setarg=%1
16+
setargv=%2
17+
18+
if /i"%arg%"=="/?"goto help
19+
if /i"%arg%"=="-h"goto help
20+
if /i"%arg%"=="--help"goto help
21+
if /i"%arg%"=="-MSBuild" (
22+
setMSBuild=%argv%
23+
shift
24+
)
25+
if /i"%arg%"=="-SignType" (
26+
setSignType=%argv%
27+
shift
28+
)
29+
if /i"%arg%"=="-ConfigFile" (
30+
setConfigFile=%argv%
31+
shift
32+
)
33+
34+
shift
35+
goto parsearg
36+
37+
:doneargs
38+
39+
ifnotdefined MSBuildecho Location of MSBuild.exe not specified.&&goto error
40+
ifnotdefined ConfigFileecho Configuration file not specified.&&goto error
41+
ifnotexist"%MSBuild%"echo The specified MSBuild.exe does not exist.&&goto error
42+
43+
setNUGET_PACKAGES=%USERPROFILE%\.nuget\packages
44+
set_signtoolexe=%NUGET_PACKAGES%\RoslynTools.SignTool\1.0.0-beta-62328-01\tools\SignTool.exe
45+
setSignToolArgs=-msbuildPath%MSBuild% -config"%ConfigFile%" -nugetPackagesPath"%NUGET_PACKAGES%"
46+
if /i"%SignType%"=="real"goto runsigntool
47+
if /i"%SignType%"=="test"setSignToolArgs=%SignToolArgs% -testSign&&goto runsigntool
48+
setSignToolArgs=%SignToolArgs% -test
49+
50+
:runsigntool
51+
52+
ifnotexist"%_signtoolexe%"echo The signing tool could not be found at location '%_signtoolexe%'&&goto error
53+
setSignToolArgs=%SignToolArgs%"%scriptdir%..\..\release"
54+
echo"%_signtoolexe%"%SignToolArgs%
55+
"%_signtoolexe%"%SignToolArgs%
56+
iferrorlevel1goto error
57+
goto :EOF
58+
59+
:help
60+
echo Usage:%0 -MSBuild path\to\msbuild.exe -ConfigFile path\to\SignToolData.json [-SignType^<real/test^>]
61+
goto :EOF
62+
63+
:error
64+
echo Error running the sign tool.
65+
exit /b1

‎setup/FSharp.SDK/FSharp.SDK.wixproj‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@
5656
<CompileCondition="'$(IsLangPack)' == 'true'"Include="component-groups\Runtime_LangPack.wxs" />
5757
</ItemGroup>
5858

59-
<ItemGroup>
60-
<FilesToSignInclude="$(OutDir)$(OutputName).msi">
61-
<Authenticode>Microsoft400</Authenticode>
62-
</FilesToSign>
63-
</ItemGroup>
64-
6559
<ImportProject="$(WixInstallPath)\wix.targets" />
6660
<ImportProject="$(FSharpTreeRoot)\src\Microbuild.Settings.targets" />
6761

@@ -77,7 +71,7 @@
7771
<ItemGroup>
7872
<MsiPathInclude="$(OutDir)$(OutputName).msi" />
7973
</ItemGroup>
80-
74+
8175
<CopySourceFiles="@(MsiPath)"DestinationFiles="@(MsiPath->'$(SetupRootFolder)\..\$(Configuration)\msi\%(Filename)%(Extension)')" />
8276
</Target>
8377
</Project>

‎setup/FSharp.Setup.props‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<SchemaVersion>2.0</SchemaVersion>
66
<ProductVersion>3.10</ProductVersion>
77
<WiXToolset2015Version>3.10.0.1503</WiXToolset2015Version>
8+
<SetupRootFolder>$(MSBuildThisFileDirectory)</SetupRootFolder>
89
<WixInstallPath>$(SetupRootFolder)\..\packages\WiX.Toolset.2015.$(WiXToolset2015Version)\tools\wix</WixInstallPath>
910
<NugetPackagesDir>$(SetupRootFolder)\..\packages</NugetPackagesDir>
1011
</PropertyGroup>
@@ -26,7 +27,7 @@
2627

2728
<PropertyGroup>
2829
<BinariesDir>$(SetupRootFolder)\..\$(Configuration)</BinariesDir>
29-
<VsixBuildLocation>$(BinariesDir)\$(TargetDotnetProfile)\bin</VsixBuildLocation>
30+
<VsixBuildLocation>$(BinariesDir)\$(TargetDotnetProfile)\bin\</VsixBuildLocation>
3031
<InsertionDir>$(BinariesDir)\insertion</InsertionDir>
3132
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
3233
<OutputPathCondition="'$(Lang)' == ''">$(BinariesDir)\setup</OutputPath>

‎setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<TargetName="CheckPropertiesArePassed">
3232
<ErrorCondition="'$(FSharpPackageVersion)' == ''"Text="A 'FSharpPackageVersion' property must be passed to the project." />
3333
</Target>
34-
35-
<TargetName="GatherBinariesToBeSigned"AfterTargets="CopyFilesToOutputDirectory">
36-
<!--SWIX plugin addsthebuilt vsix to signing automatically-->
34+
35+
<TargetName="SignFiles">
36+
<!--Signing is handled bytheRoslynSignTool-->
3737
</Target>
3838
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp