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

Commit84dec29

Browse files
committed
adding tests: building FSharp.Core for Profile78
1 parent7360b82 commit84dec29

File tree

2 files changed

+62
-20
lines changed

2 files changed

+62
-20
lines changed

‎src/FSharpSource.targets‎

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,37 @@
159159
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
160160
</PropertyGroup>
161161

162+
<!-- Target Portable-->
163+
<PropertyGroupCondition="'$(TargetFramework)'=='netcore78'">
164+
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
165+
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
166+
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
167+
<DefineConstants>$(DefineConstants);FX_NO_EXIT</DefineConstants>
168+
<DefineConstants>$(DefineConstants);FX_NO_CHAR_PARSE</DefineConstants>
169+
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE</DefineConstants>
170+
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONSOLE</DefineConstants>
171+
<DefineConstants>$(DefineConstants);FX_NO_TPL_PARALLEL</DefineConstants>
172+
<DefineConstants>$(DefineConstants);FX_NO_BINARY_SERIALIZATION</DefineConstants>
173+
<DefineConstants>$(DefineConstants);FX_ATLEAST_PORTABLE</DefineConstants>
174+
<DefineConstants>$(DefineConstants);FX_NO_BIGINT</DefineConstants>
175+
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_KEY_SORT</DefineConstants>
176+
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_METADATA_TOKENS</DefineConstants>
177+
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_EMIT</DefineConstants>
178+
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
179+
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE</DefineConstants>
180+
<DefineConstants>$(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START</DefineConstants>
181+
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
182+
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
183+
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
184+
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
185+
<DefineConstants>$(DefineConstants);FX_NO_THREADPOOL</DefineConstants>
186+
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
187+
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
188+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
189+
<OtherFlags>$(OtherFlags) --targetprofile:netcore</OtherFlags>
190+
</PropertyGroup>
191+
192+
162193
<!-- Target Silverlight 3.0-->
163194
<PropertyGroupCondition="'$(TargetFramework)'=='sl3'">
164195
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
@@ -493,6 +524,11 @@
493524
<FSharpTargetsPath>..\Proto\$(protoCLIDir)\bin\Microsoft.Portable.FSharp-proto.Targets</FSharpTargetsPath>
494525
</PropertyGroup>
495526
</When>
527+
<WhenCondition="'$(TargetFramework)'=='netcore78'">
528+
<PropertyGroup>
529+
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.Portable.FSharp.Targets</FSharpTargetsPath>
530+
</PropertyGroup>
531+
</When>
496532
<WhenCondition="'$(TargetFramework)'=='sl3' or '$(TargetFramework)'=='sl4' or '$(TargetFramework)'=='sl5' or '$(TargetFramework)'=='sl5-compiler'">
497533
<PropertyGroup>
498534
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\Silverlight\$(SilverlightVersion)\FSharpSource.Silverlight.Common.targets</FSharpTargetsPath>
@@ -554,13 +590,14 @@
554590
Text="Configuration '$(Configuration)' is not one of the supported configurations: Debug, Release, Proto"
555591
Condition="'$(Configuration)'!='Release' and '$(Configuration)'!='Debug' and '$(Configuration)'!='Proto'"/>
556592
<Error
557-
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, sl3-wp, sl5, sl5-compiler, portable47"
593+
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, sl3-wp, sl5, sl5-compiler, portable47, netcore78"
558594
Condition="! ('$(TargetFramework)' == 'net40' or
559595
'$(TargetFramework)' == 'net20' or
560596
'$(TargetFramework)' == 'sl5' or
561597
'$(TargetFramework)' == 'sl5-compiler' or
562598
'$(TargetFramework)' == 'sl3-wp' or
563-
'$(TargetFramework)' == 'portable47')"/>
599+
'$(TargetFramework)' == 'portable47' or
600+
'$(TargetFramework)' == 'netcore78')"/>
564601
<Error
565602
Text="TargetFramework '$(TargetFramework)' is only supported when building FSharp.Core.dll. All other components must be built with TargetFramework=net40"
566603
Condition="'$(AssemblyName)' != 'FSharp.Core' and '$(TargetFramework)' != 'net40'"/>

‎src/fsharp/build.fs‎

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
27322732
| None-> None
27332733
else None
27342734

2735-
membertcConfig.ResolveLibWithDirectories(AssemblyReference(m,nm))=
2735+
membertcConfig.ResolveLibWithDirectoriesccuLoadFaulureAction(AssemblyReference(m,nm))=
27362736
use unwindBuildPhase= PushThreadBuildPhaseUntilUnwind(BuildPhase.Parameter)
27372737
// test for both libraries and executables
27382738
letext= System.IO.Path.GetExtension(nm)
@@ -2747,11 +2747,13 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
27472747
[nm+".dll";nm+".exe";nm+".netmodule"]
27482748

27492749
match(List.tryPick(fun nm-> tcConfig.TryResolveLibWithDirectories(AssemblyReference(m,nm))) nms)with
2750-
| Some(res)-> res
2751-
2750+
| Some(res)-> Some res
27522751
| None->
2753-
letsearchMessage= String.concat"\n" tcConfig.SearchPathsForLibraryFiles
2754-
raise(FileNameNotResolved(nm,searchMessage,m))
2752+
match ccuLoadFaulureActionwith
2753+
| CcuLoadFailureAction.RaiseError->
2754+
letsearchMessage= String.concat"\n" tcConfig.SearchPathsForLibraryFiles
2755+
raise(FileNameNotResolved(nm,searchMessage,m))
2756+
| CcuLoadFailureAction.ReturnNone-> None
27552757

27562758
membertcConfig.ResolveSourceFile(m,nm,pathLoadedFrom)=
27572759
data.ResolveSourceFile(m,nm,pathLoadedFrom)
@@ -3268,7 +3270,7 @@ type TcAssemblyResolutions(results : AssemblyResolution list, unresolved : Unres
32683270
static memberResolve(tcConfig:TcConfig,assemblyList:AssemblyReference list,knownUnresolved:UnresolvedAssemblyReference list):TcAssemblyResolutions=
32693271
letresolved,unresolved=
32703272
if tcConfig.useMonoResolutionthen
3271-
assemblyList|> List.map tcConfig.ResolveLibWithDirectories,[]
3273+
assemblyList|> List.map((tcConfig.ResolveLibWithDirectories CcuLoadFailureAction.RaiseError)>> Option.get),[]
32723274
else
32733275
TcConfig.TryResolveLibsUsingMSBuildRules(tcConfig,assemblyList,rangeStartup,ReportErrors)
32743276
TcAssemblyResolutions(resolved,unresolved@ knownUnresolved)
@@ -3699,7 +3701,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
36993701
| ILScopeRef.Module modref->
37003702
letkey= modref.Name
37013703
ifnot(auxModTable.ContainsKey(key))then
3702-
letresolution= tcConfig.ResolveLibWithDirectories(AssemblyReference(m,key))
3704+
letresolution= tcConfig.ResolveLibWithDirectories CcuLoadFailureAction.RaiseError(AssemblyReference(m,key))|> Option.get
37033705
letilModule,_= tcImports.OpenILBinaryModule(resolution.resolvedPath,m)
37043706
auxModTable.[key]<- ilModule
37053707
auxModTable.[key]
@@ -3826,7 +3828,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
38263828

38273829
letsystemRuntimeAssemblyVersion:System.Version=
38283830
letprimaryAssemblyRef= tcConfig.PrimaryAssemblyDllReference()
3829-
letresolution= tcConfig.ResolveLibWithDirectories(primaryAssemblyRef)
3831+
letresolution= tcConfig.ResolveLibWithDirectories CcuLoadFailureAction.RaiseErrorprimaryAssemblyRef|> Option.get
38303832
// MSDN: this method causes the file to be opened and closed, but the assembly is not added to this domain
38313833
letname= System.Reflection.AssemblyName.GetAssemblyName(resolution.resolvedPath)
38323834
name.Version
@@ -4207,7 +4209,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
42074209
| None->
42084210

42094211
if tcConfigP.Get().useMonoResolutionthen
4210-
ResultD[tcConfig.ResolveLibWithDirectories assemblyReference]
4212+
ResultD[(tcConfig.ResolveLibWithDirectoriesCcuLoadFailureAction.RaiseErrorassemblyReference)|> Option.get]
42114213
else
42124214
// This is a previously unencounterd assembly. Resolve it and add it to the list.
42134215
// But don't cache resolution failures because the assembly may appear on the disk later.
@@ -4246,17 +4248,20 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
42464248
// use existing resolutions before trying to search in known folders
42474249
letresolution=
42484250
match tcResolutions.TryFindByOriginalReference rwith
4249-
| Some r-> r
4251+
| Some r->Somer
42504252
| None->
42514253
match tcAltResolutions.TryFindByOriginalReference rwith
4252-
| Some r-> r
4253-
| None-> tcConfig.ResolveLibWithDirectories r
4254-
match frameworkTcImports.RegisterAndImportReferencedAssemblies(None,[resolution])with
4255-
|(_,[ResolvedImportedAssembly(ccu)])-> Some ccu
4256-
|_->
4257-
match loadFailureActionwith
4258-
| CcuLoadFailureAction.RaiseError-> error(InternalError("BuildFoundationalTcImports: no ccu for"+ r.Text, rangeStartup))
4259-
| CcuLoadFailureAction.ReturnNone-> None
4254+
| Some r-> Some r
4255+
| None-> tcConfig.ResolveLibWithDirectories loadFailureAction r
4256+
match resolutionwith
4257+
| Some resolution->
4258+
match frameworkTcImports.RegisterAndImportReferencedAssemblies(None,[resolution])with
4259+
|(_,[ResolvedImportedAssembly(ccu)])-> Some ccu
4260+
|_->
4261+
match loadFailureActionwith
4262+
| CcuLoadFailureAction.RaiseError-> error(InternalError("BuildFoundationalTcImports: no ccu for"+ r.Text, rangeStartup))
4263+
| CcuLoadFailureAction.ReturnNone-> None
4264+
| None-> None
42604265

42614266
letccuInitializer= tcConfig.GetPrimaryAssemblyCcuInitializer()
42624267
letilGlobals,state= ccuInitializer.BeginLoadingSystemRuntime((resolveAssembly CcuLoadFailureAction.RaiseError)>> Option.get, tcConfig.noDebugData)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp