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

Commit433b331

Browse files
brettfoKevinRansom
authored andcommitted
apply all patches from source-build repo (#3904)
1 parente0933b4 commit433b331

File tree

18 files changed

+11169
-67
lines changed

18 files changed

+11169
-67
lines changed

‎src/buildfromsource.cmd‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
set__scriptpath=%~dp0
44

55
rem build tools
6-
dotnet restore%__scriptpath%buildtools\fssrgen\fssrgen.fsproj
7-
ifERRORLEVEL1echo Error: failed&&goto :failure
8-
dotnet publish%__scriptpath%buildtools\fssrgen\fssrgen.fsproj -o%__scriptpath%..\Tools\fssrgen
9-
ifERRORLEVEL1echo Error: failed&&goto :failure
10-
116
dotnet restore%__scriptpath%buildtools\fslex\fslex.fsproj
127
ifERRORLEVEL1echo Error: failed&&goto :failure
138
dotnet publish%__scriptpath%buildtools\fslex\fslex.fsproj -o%__scriptpath%..\Tools\fslex
@@ -20,7 +15,7 @@ if ERRORLEVEL 1 echo Error: failed && goto :failure
2015
rem build and pack tools
2116
dotnet restore%__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj
2217
ifERRORLEVEL1echo Error: failed&&goto :failure
23-
dotnet pack%__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj -cdebug
18+
dotnet pack%__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj -cRelease
2419
ifERRORLEVEL1echo Error: failed&&goto :failure
2520

2621
goto :success

‎src/buildfromsource.sh‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
__scriptpath=$(cd"$(dirname"$0")";pwd -P)
44

55
# build tools
6-
dotnet restore$__scriptpath/buildtools/fssrgen/fssrgen.fsproj
7-
dotnet publish$__scriptpath/buildtools/fssrgen/fssrgen.fsproj -o$__scriptpath/../Tools/fssrgen
86
dotnet restore$__scriptpath/buildtools/fslex/fslex.fsproj
97
dotnet publish$__scriptpath/buildtools/fslex/fslex.fsproj -o$__scriptpath/../Tools/fslex
108
dotnet restore$__scriptpath/buildtools/fsyacc/fsyacc.fsproj
@@ -22,4 +20,4 @@ dotnet publish $__scriptpath/buildfromsource/Fsc/Fsc.fsproj
2220

2321
# build and pack tools
2422
dotnet restore$__scriptpath/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj
25-
dotnet pack$__scriptpath/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj -crelease
23+
dotnet pack$__scriptpath/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj -cRelease

‎src/buildfromsource/BuildFromSource.targets‎

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -43,55 +43,12 @@
4343
Condition="'$(DesignTimeBuild)' != 'true'">
4444

4545
<ItemGroup>
46-
<ResultsInclude="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')">
47-
<Lines>
48-
$([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText("%(CopyAndSubstituteText.FullPath)")), "%(CopyAndSubstituteText.Pattern1)", "%(CopyAndSubstituteText.Replacement1)"))
49-
</Lines>
50-
<Lines Condition ="'%(CopyAndSubstituteText.Pattern2)' != ''">
51-
$([System.Text.RegularExpressions.Regex]::Replace($(FileText), "%(CopyAndSubstituteText.Pattern2)", "%(CopyAndSubstituteText.Replacement2)"))
52-
</Lines>
53-
</Results>
54-
</ItemGroup>
55-
56-
<WriteLinesToFileFile="$(OutDir)%(Results.Filename)%(Results.Extension)"Lines="%(Results.Lines)"Overwrite="true" />
57-
</Target>
58-
59-
<!--
60-
=========================================================================
61-
Build FsSrGen files.
62-
=========================================================================
63-
-->
64-
<TargetName="CallFsSrGen"
65-
Inputs="@(FsSrGen)"
66-
Outputs="@(FsSrGen->'$(IntermediateOutputPath)%(Filename).fs');@(FsSrGen->'$(IntermediateOutputPath)%(Filename).resx')"
67-
Condition="'@(FsSrGen)' != ''">
68-
69-
<PropertyGroup>
70-
<FsSrGenPath>$(MSBuildThisFileDirectory)../../Tools/fssrgen/fssrgen.dll</FsSrGenPath>
71-
</PropertyGroup>
72-
73-
<!-- Create the output directory in case it doesn't exist yet-->
74-
<MakeDirDirectories="$(IntermediateOutputPath)" />
75-
76-
<!-- Run the tool-->
77-
<ExecCommand="&quot;$(DotNetExePath)&quot;&quot;$(FsSrGenPath)&quot;&quot;%(FsSrGen.FullPath)&quot;&quot;$(IntermediateOutputPath)%(FsSrGen.Filename).fs&quot;&quot;$(IntermediateOutputPath)%(FsSrGen.Filename).resx&quot; $(FsSrGenProjectName)" />
78-
</Target>
79-
80-
<TargetName="ProcessFsSrGen"
81-
DependsOnTargets="CallFsSrGen"
82-
Condition="'@(FsSrGen)'!=''"
83-
BeforeTargets="CoreResGen">
84-
85-
<ItemGroup>
86-
<CompileBeforeInclude="$(IntermediateOutputPath)%(FsSrGen.Filename).fs" />
87-
<FileWritesInclude="$(IntermediateOutputPath)%(FsSrGen.Filename).fs" />
88-
<FileWritesInclude="$(IntermediateOutputPath)%(FsSrGen.Filename).resx" />
89-
<EmbeddedResourceInclude="$(IntermediateOutputPath)%(FsSrGen.Filename).resx">
90-
<ManifestResourceName>%(FsSrGen.Filename)</ManifestResourceName>
91-
<Type>Resx</Type>
92-
<WithCulture>false</WithCulture>
93-
</EmbeddedResource>
46+
<FileTextMapInclude="%(CopyAndSubstituteText.TargetFilename)">
47+
<FileText>$([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText("%(CopyAndSubstituteText.FullPath)")), "%(CopyAndSubstituteText.Pattern1)", "%(CopyAndSubstituteText.Replacement1)"))</FileText>
48+
<FileText Condition ="'$(CurrentPattern2)' != ''">$([System.Text.RegularExpressions.Regex]::Replace($(FileText), "%(CopyAndSubstituteText.Pattern2)", "%(CopyAndSubstituteText.Replacement2)"))</FileText>
49+
</FileTextMap>
9450
</ItemGroup>
51+
<WriteLinesToFileFile="$(OutDir)%(FileTextMap.Identity)"Lines="%(FileTextMap.FileText)"Overwrite="true" />
9552
</Target>
9653

9754
<ItemGroup>
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// This is a generated file; the original input is 'FSBuild.txt'
2+
namespaceFSBuild
3+
4+
openMicrosoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
5+
openMicrosoft.FSharp.Reflection
6+
openSystem.Reflection
7+
// (namespaces below for specific case of using the tool to compile FSharp.Core itself)
8+
openMicrosoft.FSharp.Core
9+
openMicrosoft.FSharp.Core.Operators
10+
openMicrosoft.FSharp.Text
11+
openMicrosoft.FSharp.Collections
12+
openPrintf
13+
14+
typeinternalSRprivate()=
15+
16+
// BEGIN BOILERPLATE
17+
18+
static letgetCurrentAssembly()=
19+
#if DNXCORE50|| NETSTANDARD1_5|| NETSTANDARD1_6|| NETCOREAPP1_0
20+
typeof<SR>.GetTypeInfo().Assembly
21+
#else
22+
System.Reflection.Assembly.GetExecutingAssembly()
23+
#endif
24+
25+
static letgetTypeInfo(t:System.Type)=
26+
#if DNXCORE50|| NETSTANDARD1_5|| NETSTANDARD1_6|| NETCOREAPP1_0
27+
t.GetTypeInfo()
28+
#else
29+
t
30+
#endif
31+
32+
static letresources=lazy(new System.Resources.ResourceManager("FSBuild", getCurrentAssembly()))
33+
34+
static letGetString(name:string)=
35+
lets= resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture)
36+
#if DEBUG
37+
ifnull= sthen
38+
System.Diagnostics.Debug.Assert(false, sprintf"**RESOURCE ERROR**: Resource token%s does not exist!" name)
39+
#endif
40+
s
41+
42+
static letmkFunctionValue(tys:System.Type[])(impl:obj->obj)=
43+
FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl)
44+
45+
static letfunTyC= typeof<(obj-> obj)>.GetGenericTypeDefinition()
46+
47+
static letisNamedType(ty:System.Type)=not(ty.IsArray|| ty.IsByRef|| ty.IsPointer)
48+
static letisFunctionType(ty1:System.Type)=
49+
isNamedType(ty1)&& getTypeInfo(ty1).IsGenericType&&(ty1.GetGenericTypeDefinition()).Equals(funTyC)
50+
51+
static let recdestFunTy(ty:System.Type)=
52+
if isFunctionType tythen
53+
ty, ty.GetGenericArguments()
54+
else
55+
match getTypeInfo(ty).BaseTypewith
56+
|null-> failwith"destFunTy: not a function type"
57+
| b-> destFunTy b
58+
59+
static letbuildFunctionForOneArgPat(ty:System.Type)impl=
60+
let_,tys= destFunTy ty
61+
letrty= tys.[1]
62+
// PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf "%x"')
63+
mkFunctionValue tys(fun inp-> impl rty inp)
64+
65+
static letcapture1(fmt:string)i args ty(go:obj list->System.Type->int->obj):obj=
66+
match fmt.[i]with
67+
|'%'-> go args ty(i+1)
68+
|'d'
69+
|'f'
70+
|'s'-> buildFunctionForOneArgPat ty(fun rty n-> go(n::args) rty(i+1))
71+
|_-> failwith"bad format specifier"
72+
73+
// newlines and tabs get converted to strings when read from a resource file
74+
// this will preserve their original intention
75+
static letpostProcessString(s:string)=
76+
s.Replace("\\n","\n").Replace("\\t","\t").Replace("\\r","\r").Replace("\\\"","\"")
77+
78+
static letcreateMessageString(messageString:string)(fmt:Printf.StringFormat<'T>):'T=
79+
letfmt= fmt.Value// here, we use the actual error string, as opposed to the one stored as fmt
80+
letlen= fmt.Length
81+
82+
/// Function to capture the arguments and then run.
83+
let reccapture args ty i=
84+
if i>= len||(fmt.[i]='%'&& i+1>= len)then
85+
letb=new System.Text.StringBuilder()
86+
b.AppendFormat(messageString,[|for xin List.rev args-> x|])|> ignore
87+
box(b.ToString())
88+
// REVIEW: For these purposes, this should be a nop, but I'm leaving it
89+
// in incase we ever decide to support labels for the error format string
90+
// E.g., "<name>%s<foo>%d"
91+
elif System.Char.IsSurrogatePair(fmt,i)then
92+
capture args ty(i+2)
93+
else
94+
match fmt.[i]with
95+
|'%'->
96+
leti= i+1
97+
capture1 fmt i args ty capture
98+
|_->
99+
capture args ty(i+1)
100+
101+
(unbox(capture[](typeof<'T>)0): 'T)
102+
103+
static let mutableswallowResourceText=false
104+
105+
static letGetStringFunc((messageID:string),(fmt:Printf.StringFormat<'T>)):'T=
106+
if swallowResourceTextthen
107+
sprintf fmt
108+
else
109+
let mutablemessageString= GetString(messageID)
110+
messageString<- postProcessString messageString
111+
createMessageString messageString fmt
112+
113+
/// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines).
114+
static memberSwallowResourceTextwith get()= swallowResourceText
115+
andset(b)= swallowResourceText<- b
116+
// END BOILERPLATE
117+
118+
/// ToolPath is unknown; specify the path to fsc.exe as the ToolPath property.
119+
/// (Originally from FSBuild.txt:2)
120+
static membertoolpathUnknown()=(GetStringFunc("toolpathUnknown",",,,"))
121+
122+
/// Call this method once to validate that all known resources are valid; throws if not
123+
static memberRunStartupValidation()=
124+
ignore(GetString("toolpathUnknown"))
125+
()
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schemaid="root"xmlns=""xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:importnamespace="http://www.w3.org/XML/1998/namespace" />
64+
<xsd:elementname="root"msdata:IsDataSet="true">
65+
<xsd:complexType>
66+
<xsd:choicemaxOccurs="unbounded">
67+
<xsd:elementname="metadata">
68+
<xsd:complexType>
69+
<xsd:sequence>
70+
<xsd:elementname="value"type="xsd:string"minOccurs="0" />
71+
</xsd:sequence>
72+
<xsd:attributename="name"use="required"type="xsd:string" />
73+
<xsd:attributename="type"type="xsd:string" />
74+
<xsd:attributename="mimetype"type="xsd:string" />
75+
<xsd:attributeref="xml:space" />
76+
</xsd:complexType>
77+
</xsd:element>
78+
<xsd:elementname="assembly">
79+
<xsd:complexType>
80+
<xsd:attributename="alias"type="xsd:string" />
81+
<xsd:attributename="name"type="xsd:string" />
82+
</xsd:complexType>
83+
</xsd:element>
84+
<xsd:elementname="data">
85+
<xsd:complexType>
86+
<xsd:sequence>
87+
<xsd:elementname="value"type="xsd:string"minOccurs="0"msdata:Ordinal="1" />
88+
<xsd:elementname="comment"type="xsd:string"minOccurs="0"msdata:Ordinal="2" />
89+
</xsd:sequence>
90+
<xsd:attributename="name"type="xsd:string"use="required"msdata:Ordinal="1" />
91+
<xsd:attributename="type"type="xsd:string"msdata:Ordinal="3" />
92+
<xsd:attributename="mimetype"type="xsd:string"msdata:Ordinal="4" />
93+
<xsd:attributeref="xml:space" />
94+
</xsd:complexType>
95+
</xsd:element>
96+
<xsd:elementname="resheader">
97+
<xsd:complexType>
98+
<xsd:sequence>
99+
<xsd:elementname="value"type="xsd:string"minOccurs="0"msdata:Ordinal="1" />
100+
</xsd:sequence>
101+
<xsd:attributename="name"type="xsd:string"use="required" />
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:choice>
105+
</xsd:complexType>
106+
</xsd:element>
107+
</xsd:schema>
108+
<resheadername="resmimetype">
109+
<value>text/microsoft-resx</value>
110+
</resheader>
111+
<resheadername="version">
112+
<value>2.0</value>
113+
</resheader>
114+
<resheadername="reader">
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
<resheadername="writer">
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+
</resheader>
120+
<dataname="toolpathUnknown"xml:space="preserve">
121+
<value>ToolPath is unknown; specify the path to fsc.exe as the ToolPath property.</value>
122+
</data>
123+
</root>

‎src/buildfromsource/FSharp.Build/FSharp.Build.fsproj‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
<ImportProject="..\BuildFromSource.targets" />
1515
<ItemGroup>
16-
<FsSrGenInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Build\FSBuild.txt" />
16+
<EmbeddedResourceInclude="FSBuild.resx">
17+
<Link>FSBuild.resx</Link>
18+
</EmbeddedResource>
19+
<CompileInclude="FSBuild.fs" />
1720
<CompileInclude="$(FSharpSourcesRoot)\fsharp\FSharp.Build\InternalsVisibleTo.fs" />
1821
<CompileInclude="..\..\assemblyinfo\assemblyinfo.FSharp.Build.dll.fs" />
1922
<CompileInclude="..\..\utils\CompilerLocationUtils.fs" />

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp