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

Commit80b8c9e

Browse files
brettfoKevinRansom
authored andcommitted
Add WriteCodeFragment build task (#3702)
* add WriteCodeFragment build task for assembly-level attribute generation* move InternalsVisibleTo to the project files where possible
1 parent3634f0c commit80b8c9e

File tree

49 files changed

+687
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+687
-209
lines changed

‎VisualFSharp.sln‎

Lines changed: 234 additions & 1 deletion
Large diffs are not rendered by default.

‎build-everything.proj‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@
5555

5656
<ItemGroupCondition="'$(TEST_NET40_COREUNIT_SUITE)'=='1'" >
5757
<ProjectsWithNet40Include="src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj"/>
58+
<ProjectsWithNet40Include="src/fsharp/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj"/>
5859
</ItemGroup>
5960

6061
<ItemGroupCondition="'$(TEST_CORECLR_COREUNIT_SUITE)'=='1'">
6162
<ProjectsWithCoreClrInclude="src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj"/>
63+
<ProjectsWithCoreClrInclude="src/fsharp/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj"/>
6264
</ItemGroup>
6365

6466
<ItemGroupCondition="'$(TEST_NET40_COMPILERUNIT_SUITE)'=='1'" >

‎build.cmd‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,9 @@ if "%TEST_NET40_COREUNIT_SUITE%" == "1" (
828828
setOUTPUTARG=--output:"!OUTPUTFILE!"
829829
)
830830

831+
echo"!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3"!OUTPUTARG!!ERRORARG! --work:"!FSCBINPATH!""!FSCBINPATH!\FSharp.Build.Unittests.dll"!WHERE_ARG_NUNIT!
832+
"!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3"!OUTPUTARG!!ERRORARG! --work:"!FSCBINPATH!""!FSCBINPATH!\FSharp.Build.Unittests.dll"!WHERE_ARG_NUNIT!
833+
831834
echo"!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3"!OUTPUTARG!!ERRORARG! --work:"!FSCBINPATH!""!FSCBINPATH!\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
832835
"!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3"!OUTPUTARG!!ERRORARG! --work:"!FSCBINPATH!""!FSCBINPATH!\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
833836

@@ -851,6 +854,9 @@ if "%TEST_CORECLR_COREUNIT_SUITE%" == "1" (
851854
setOUTPUTFILE=!RESULTSDIR!\test-coreclr-coreunit-output.log
852855
setERRORFILE=!RESULTSDIR!\test-coreclr-coreunit-errors.log
853856

857+
echo"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Build.Unittests\FSharp.Build.Unittests.dll"!WHERE_ARG_NUNIT!
858+
"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Build.Unittests\FSharp.Build.Unittests.dll"!WHERE_ARG_NUNIT!
859+
854860
echo"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
855861
"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
856862

‎build.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ printf "\n"
388388

389389
build_status"Done with arguments, starting preparation"
390390

391-
_msbuildexe="xbuild"
391+
_msbuildexe="msbuild"
392392
msbuildflags=""
393393

394394
# Perform any necessary setup and system configuration prior to running builds.
@@ -466,7 +466,7 @@ if [ "$BUILD_PROTO" = '1' ]; then
466466
{pushd ./lkg/fsc&&eval"$_dotnetexe publish project.json --no-build -o${_scriptdir}Tools/lkg -r$_architecture"&&popd; }|| failwith"dotnet publish failed"
467467
{pushd ./lkg/fsi&&eval"$_dotnetexe publish project.json --no-build -o${_scriptdir}Tools/lkg -r$_architecture"&&popd; }|| failwith"dotnet publish failed"
468468

469-
{ printeval"$_msbuildexe$msbuildflags src/fsharp-proto-build.proj"; }|| failwith"compiler proto build failed"
469+
{ printeval"$_msbuildexe$msbuildflags src/fsharp-proto-build.proj /p:Configuration=Proto"; }|| failwith"compiler proto build failed"
470470

471471
# { printeval "$_ngenexe install Proto/net40/bin/fsc-proto.exe /nologo"; } || failwith "NGen of proto failed"
472472
else

‎src/FSharpSource.targets‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@
363363
<UsingTaskTaskName="FSharpEmbedResXSource"
364364
AssemblyFile="$(FSharpSourcesRoot)\..\Proto\net40\bin\FSharp.Build-proto.dll"
365365
Condition="'$(Configuration)' != 'Proto'" />
366+
<UsingTaskTaskName="WriteCodeFragment"
367+
AssemblyFile="$(FSharpSourcesRoot)\..\Proto\net40\bin\FSharp.Build-proto.dll"
368+
Condition="'$(Configuration)' != 'Proto'" />
366369

367370
<TargetName="GenerateFSharpTextResources"
368371
BeforeTargets="CoreResGen;PrepareForBuild"
@@ -395,6 +398,37 @@
395398

396399
</Target>
397400

401+
<PropertyGroupCondition="'$(Configuration)' != 'Proto'">
402+
<GeneratedFSharpInternalsVisibleToFile>$(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedFSharpInternalsVisibleToFile>
403+
</PropertyGroup>
404+
405+
<TargetName="PrepareFSharpGenerateInternalsVisibleToFile"
406+
Condition="'$(Configuration)' != 'Proto' and '@(InternalsVisibleTo)' != ''">
407+
<PropertyGroup>
408+
<_PublicKey>002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293</_PublicKey>
409+
</PropertyGroup>
410+
<ItemGroup>
411+
<_InternalsVisibleToAttributeInclude="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
412+
<_Parameter1Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key)</_Parameter1>
413+
<_Parameter1Condition="'%(InternalsVisibleTo.Key)' == ''">%(InternalsVisibleTo.Identity), PublicKey=$(_PublicKey)</_Parameter1>
414+
</_InternalsVisibleToAttribute>
415+
</ItemGroup>
416+
</Target>
417+
418+
<TargetName="GenerateFSharpInternalsVisibleToFile"
419+
Inputs="$(MSBuildProjectFile)"
420+
Outputs="$(GeneratedFSharpInternalsVisibleToFile)"
421+
DependsOnTargets="PrepareFSharpGenerateInternalsVisibleToFile;PrepareForBuild"
422+
Condition="'$(Configuration)' != 'Proto' and '@(InternalsVisibleTo)' != ''"
423+
BeforeTargets="CoreCompile">
424+
<WriteCodeFragmentAssemblyAttributes="@(_InternalsVisibleToAttribute)"
425+
Language="$(Language)"
426+
OutputFile="$(GeneratedFSharpInternalsVisibleToFile)">
427+
<OutputTaskParameter="OutputFile"ItemName="CompileBefore" />
428+
<OutputTaskParameter="OutputFile"ItemName="FileWrites" />
429+
</WriteCodeFragment>
430+
</Target>
431+
398432
<UsingTaskTaskName="ReplaceFileText"TaskFactory="CodeTaskFactory"AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
399433
<ParameterGroup>
400434
<InputFilenameParameterType="System.String"Required="true" />

‎src/assemblyinfo/assemblyinfo.FSharp.Build.dll.fs‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ open System.Reflection
99
[<assembly:AssemblyProduct("Microsoft\174 F#")>]
1010
do()
1111

12-
#if NO_STRONG_NAMES
13-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("VisualFSharp.Unittests")>]
14-
#endif
15-
#if STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY
16-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("VisualFSharp.Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
17-
#endif
18-
1912
// Until dotnet sdk can version assemblies, use this
2013
#if BUILD_FROM_SOURCE
2114
[<assembly: System.Reflection.AssemblyInformationalVersion("4.4.1.0")>]

‎src/assemblyinfo/assemblyinfo.FSharp.Compiler.Interactive.Settings.dll.fs‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@ open System.Runtime.InteropServices
1111
[<assembly:AssemblyProduct("Microsoft\174 F#")>]
1212
[<assembly:ComVisible(false)>]
1313

14-
#if NO_STRONG_NAMES
15-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("fsi")>]
16-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("fsiAnyCpu")>]
17-
#endif
18-
19-
#if STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY
20-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("fsi, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
21-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("fsiAnyCpu, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
22-
#endif
23-
24-
#if STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY
25-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("fsi, PublicKey=002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee")>]
26-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("fsiAnyCpu, PublicKey=002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee")>]
27-
#endif
28-
2914
// Until dotnet sdk can version assemblies, use this
3015
#if BUILD_FROM_SOURCE
3116
[<assembly: System.Reflection.AssemblyInformationalVersion("4.4.1.0")>]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp