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

Commit68747e0

Browse files
authored
Enable preferreduilang on Desktop compiler. And add it to buildtask (#3285)
* Enable preferreduilang on Desktop compiler. And add it to buildtask* Fix message
1 parent38a5d4e commit68747e0

File tree

12 files changed

+108
-59
lines changed

12 files changed

+108
-59
lines changed

‎.gitignore‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
# (These aren't generally useful to commit directly; if anything, they should be applied.)
88
scripts/*.patch
99

10-
/fcs/fsharp/FSharp.Compiler.Private/illex.fs
11-
/fcs/fsharp/FSharp.Compiler.Private/ilpars.fs
12-
/fcs/fsharp/FSharp.Compiler.Private/ilpars.fsi
13-
/fcs/fsharp/FSharp.Compiler.Private/lex.fs
14-
/fcs/fsharp/FSharp.Compiler.Private/pars.fs
15-
/fcs/fsharp/FSharp.Compiler.Private/pars.fsi
16-
/fcs/fsharp/FSharp.Compiler.Private/pplex.fs
17-
/fcs/fsharp/FSharp.Compiler.Private/pppars.fs
18-
/fcs/fsharp/FSharp.Compiler.Private/pppars.fsi
10+
/fcs/FSharp.Compiler.Service/illex.fs
11+
/fcs/FSharp.Compiler.Service/ilpars.fs
12+
/fcs/FSharp.Compiler.Service/ilpars.fsi
13+
/fcs/FSharp.Compiler.Service/lex.fs
14+
/fcs/FSharp.Compiler.Service/pars.fs
15+
/fcs/FSharp.Compiler.Service/pars.fsi
16+
/fcs/FSharp.Compiler.Service/pplex.fs
17+
/fcs/FSharp.Compiler.Service/pppars.fs
18+
/fcs/FSharp.Compiler.Service/pppars.fsi
1919
/src/*.userprefs
2020
/src/fsharp/FSStrings.resources
2121
/src/fsharp/FSharp.Build/*.resx

‎src/FSharpSource.Profiles.targets‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
<PropertyGroupCondition="'$(TargetDotnetProfile)'=='net40'">
66
<DefineConstantsCondition="'$(MonoPackaging)' == 'true'">$(DefineConstants);CROSS_PLATFORM_COMPILER</DefineConstants>
7+
<DefineConstants>$(DefineConstants);PREFERRED_UI_LANG</DefineConstants>
78
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
89
<DefineConstants>$(DefineConstants);BE_SECURITY_TRANSPARENT</DefineConstants>
910
<DefineConstants>$(DefineConstants);FX_LCIDFROMCODEPAGE</DefineConstants>

‎src/fsharp/CompileOptions.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ let codePageFlag (tcConfigB : TcConfigBuilder) =
728728

729729
#if PREFERRED_UI_LANG
730730
letpreferredUiLang(tcConfigB:TcConfigBuilder)=
731-
CompilerOption("preferreduilang", tagString, OptionString(fun s-> tcConfigB.preferredUiLang<- Some(s)), None, Some(FSComp.SR.optsStrongKeyContainer()))
731+
CompilerOption("preferreduilang", tagString, OptionString(fun s-> tcConfigB.preferredUiLang<- Some(s)), None, Some(FSComp.SR.optsPreferredUiLang()))
732732
#endif
733733

734734
letutf8OutputFlag(tcConfigB:TcConfigBuilder)=

‎src/fsharp/FSComp.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ optsUseHighEntropyVA,"Enable high-entropy ASLR"
905905
optsSubSystemVersion,"Specify subsystem version of this assembly"
906906
optsTargetProfile,"Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib"
907907
optsEmitDebugInfoInQuotations,"Emit debug information in quotations"
908-
optsPreferredUiLang,"Specify the preferred output language culture name (e.g. es-ES, ja-JP)"
908+
optsPreferredUiLang,"Specify the preferred output language culture name (e.g. es-ES, ja-JP)"
909909
optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries"
910910
1051,optsInvalidSubSystemVersion,"Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater."
911911
1052,optsInvalidTargetProfile,"Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'."

‎src/fsharp/FSharp.Build/Fsc.fs‎

Lines changed: 64 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
139139
let mutablepdbFile:string=null
140140
let mutableplatform:string=null
141141
let mutableprefer32bit:bool=false
142+
let mutablepreferredUILang:string=null
142143
let mutablepublicSign:bool=false
143144
let mutableprovideCommandLineArgs:bool=false
144145
let mutablereferences:ITaskItem[]=[||]
@@ -299,6 +300,8 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
299300
builder.AppendSwitch("--vserrors")
300301

301302
builder.AppendSwitchIfNotNull("--LCID:", vslcid)
303+
builder.AppendSwitchIfNotNull("--preferreduilang:", preferredUILang)
304+
302305
if utf8outputthen
303306
builder.AppendSwitch("--utf8output")
304307

@@ -332,45 +335,61 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
332335
memberfsc.BaseAddress
333336
with get()= baseAddress
334337
andset(s)= baseAddress<- s
338+
335339
// --codepage <int>: Specify the codepage to use when opening source files
336340
memberfsc.CodePage
337341
with get()= codePage
338342
andset(s)= codePage<- s
343+
339344
// -g: Produce debug file. Disables optimizations if a -O flag is not given.
340345
memberfsc.DebugSymbols
341346
with get()= debugSymbols
342347
andset(b)= debugSymbols<- b
348+
343349
// --debug <none/portable/embedded/pdbonly/full>: Emit debugging information
344350
memberfsc.DebugType
345351
with get()= debugType
346352
andset(s)= debugType<- s
353+
347354
memberfsc.DelaySign
348355
with get()= delaySign
349356
andset(s)= delaySign<- s
357+
350358
// --nowarn <string>: Do not report the given specific warning.
351359
memberfsc.DisabledWarnings
352360
with get()= disabledWarnings
353361
andset(a)= disabledWarnings<- a
362+
354363
// --define <string>: Define the given conditional compilation symbol.
355364
memberfsc.DefineConstants
356365
with get()= defineConstants
357366
andset(a)= defineConstants<- a
367+
358368
// --doc <string>: Write the xmldoc of the assembly to the given file.
359369
memberfsc.DocumentationFile
360370
with get()= documentationFile
361371
andset(s)= documentationFile<- s
372+
373+
memberfsc.DotnetFscCompilerPath
374+
with get()= dotnetFscCompilerPath
375+
andset(p)= dotnetFscCompilerPath<- p
376+
362377
memberfsc.EmbedAllSources
363378
with get()= embedAllSources
364379
andset(s)= embedAllSources<- s
380+
365381
memberfsc.Embed
366382
with get()= embed
367383
andset(e)= embed<- e
384+
368385
// --generate-interface-file <string>:
369386
// Print the inferred interface of the
370387
// assembly to a file.
388+
371389
memberfsc.GenerateInterfaceFile
372390
with get()= generateInterfaceFile
373391
andset(s)= generateInterfaceFile<- s
392+
374393
// --keyfile <string>:
375394
// Sign the assembly the given keypair file, as produced
376395
// by the .NET Framework SDK 'sn.exe' tool. This produces
@@ -380,31 +399,42 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
380399
memberfsc.KeyFile
381400
with get()= keyFile
382401
andset(s)= keyFile<- s
402+
403+
memberfsc.LCID
404+
with get()= vslcid
405+
andset(p)= vslcid<- p
406+
383407
// --noframework
384408
memberfsc.NoFramework
385409
with get()= noFramework
386410
andset(b)= noFramework<- b
411+
387412
// --optimize
388413
memberfsc.Optimize
389414
with get()= optimize
390415
andset(p)= optimize<- p
416+
391417
// --tailcalls
392418
memberfsc.Tailcalls
393419
with get()= tailcalls
394420
andset(p)= tailcalls<- p
421+
395422
// REVIEW: decide whether to keep this, for now is handy way to deal with as-yet-unimplemented features
396423
memberfsc.OtherFlags
397424
with get()= otherFlags
398425
andset(s)= otherFlags<- s
426+
399427
// -o <string>: Name the output file.
400428
memberfsc.OutputAssembly
401429
with get()= outputAssembly
402430
andset(s)= outputAssembly<- s
431+
403432
// --pdb <string>:
404433
// Name the debug output file.
405434
memberfsc.PdbFile
406435
with get()= pdbFile
407436
andset(s)= pdbFile<- s
437+
408438
// --platform <string>: Limit which platforms this code can run on:
409439
// x86
410440
// x64
@@ -414,34 +444,58 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
414444
memberfsc.Platform
415445
with get()= platform
416446
andset(s)= platform<- s
447+
417448
// indicator whether anycpu32bitpreferred is applicable or not
418449
memberfsc.Prefer32Bit
419450
with get()= prefer32bit
420451
andset(s)= prefer32bit<- s
452+
453+
memberfsc.PreferredUILang
454+
with get()= preferredUILang
455+
andset(s)= preferredUILang<- s
456+
457+
memberfsc.ProvideCommandLineArgs
458+
with get()= provideCommandLineArgs
459+
andset(p)= provideCommandLineArgs<- p
460+
421461
memberfsc.PublicSign
422462
with get()= publicSign
423463
andset(s)= publicSign<- s
464+
424465
// -r <string>: Reference an F# or .NET assembly.
425466
memberfsc.References
426467
with get()= references
427468
andset(a)= references<- a
469+
428470
// --lib
429471
memberfsc.ReferencePath
430472
with get()= referencePath
431473
andset(s)= referencePath<- s
474+
432475
// --resource <string>: Embed the specified managed resources (.resource).
433476
// Produce .resource files from .resx files using resgen.exe or resxc.exe.
434477
memberfsc.Resources
435478
with get()= resources
436479
andset(a)= resources<- a
480+
481+
memberfsc.SkipCompilerExecution
482+
with get()= skipCompilerExecution
483+
andset(p)= skipCompilerExecution<- p
484+
437485
// SourceLink
438486
memberfsc.SourceLink
439487
with get()= sourceLink
440488
andset(s)= sourceLink<- s
489+
441490
// source files
442491
memberfsc.Sources
443492
with get()= sources
444493
andset(a)= sources<- a
494+
495+
memberfsc.TargetProfile
496+
with get()= targetProfile
497+
andset(p)= targetProfile<- p
498+
445499
// --target exe: Produce an executable with a console
446500
// --target winexe: Produce an executable which does not have a
447501
// stdin/stdout/stderr
@@ -451,16 +505,20 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
451505
with get()= targetType
452506
andset(s)= targetType<- s
453507

508+
memberfsc.TreatWarningsAsErrors
509+
with get()= treatWarningsAsErrors
510+
andset(p)= treatWarningsAsErrors<- p
511+
512+
// For targeting other folders for "fsc.exe" (or ToolExe if different)
513+
memberfsc.ToolPath
514+
with get()= toolPath
515+
andset(s)= toolPath<- s
516+
454517
// --version-file <string>:
455518
memberfsc.VersionFile
456519
with get()= versionFile
457520
andset(s)= versionFile<- s
458521

459-
// For targeting other folders for "fsc.exe" (or ToolExe if different)
460-
memberfsc.ToolPath
461-
with get()= toolPath
462-
andset(s)= toolPath<- s
463-
464522
// For specifying a win32 native resource file (.res)
465523
memberfsc.Win32ResourceFile
466524
with get()= win32res
@@ -475,11 +533,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
475533
memberfsc.WarningLevel
476534
with get()= warningLevel
477535
andset(s)= warningLevel<- s
478-
479-
memberfsc.TreatWarningsAsErrors
480-
with get()= treatWarningsAsErrors
481-
andset(p)= treatWarningsAsErrors<- p
482-
536+
483537
memberfsc.WarningsAsErrors
484538
with get()= warningsAsErrors
485539
andset(s)= warningsAsErrors<- s
@@ -488,10 +542,6 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
488542
with get()= vserrors
489543
andset(p)= vserrors<- p
490544

491-
memberfsc.LCID
492-
with get()= vslcid
493-
andset(p)= vslcid<- p
494-
495545
memberfsc.Utf8Output
496546
with get()= utf8output
497547
andset(p)= utf8output<- p
@@ -504,22 +554,6 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
504554
with get()= highEntropyVA
505555
andset(p)= highEntropyVA<- p
506556

507-
memberfsc.TargetProfile
508-
with get()= targetProfile
509-
andset(p)= targetProfile<- p
510-
511-
memberfsc.DotnetFscCompilerPath
512-
with get()= dotnetFscCompilerPath
513-
andset(p)= dotnetFscCompilerPath<- p
514-
515-
memberfsc.SkipCompilerExecution
516-
with get()= skipCompilerExecution
517-
andset(p)= skipCompilerExecution<- p
518-
519-
memberfsc.ProvideCommandLineArgs
520-
with get()= provideCommandLineArgs
521-
andset(p)= provideCommandLineArgs<- p
522-
523557
[<Output>]
524558
memberfsc.CommandLineArgs
525559
with get()= List.toArray commandLineArgs

‎src/fsharp/FSharp.Build/Fsc.fsi‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

3-
/// This namespace contains FSharp.PowerPack extensions for FSharp.Build.dll. MSBuild tasks for the FsYacc and FsLex tools.
3+
/// This namespace contains. MSBuild tasks for the FsYacc and FsLex tools.
44
namespaceMicrosoft.FSharp.Build
55
typeFsc=class
66
inherit Microsoft.Build.Utilities.ToolTask
@@ -18,46 +18,47 @@ type Fsc = class
1818
member internal GetCapturedArguments: unit-> string[]
1919
member BaseAddress: string with get,set
2020
member CodePage: string with get,set
21+
member CommandLineArgs: Microsoft.Build.Framework.ITaskItem[] with get,set
2122
member DebugSymbols: bool with get,set
2223
member DebugType: string with get,set
2324
member DefineConstants: Microsoft.Build.Framework.ITaskItem[] with get,set
2425
member DelaySign: bool with get,set
2526
member DisabledWarnings: string with get,set
2627
member DocumentationFile: string with get,set
28+
member DotnetFscCompilerPath: string with get,set
2729
member Embed: string with get,set
2830
member EmbedAllSources: bool with get,set
2931
member GenerateInterfaceFile: string with get,set
32+
member HighEntropyVA: bool with get,set
3033
member KeyFile: string with get,set
34+
member LCID: string with get,set
3135
member NoFramework: bool with get,set
3236
member Optimize: bool with get,set
33-
member PublicSign: bool with get,set
34-
member Tailcalls: bool with get,set
3537
member OtherFlags: string with get,set
3638
member OutputAssembly: string with get,set
3739
member PdbFile: string with get,set
3840
member Platform: string with get,set
3941
member Prefer32Bit: bool with get,set
42+
member PreferredUILang: string with get,set
43+
member ProvideCommandLineArgs: bool with get,set
44+
member PublicSign: bool with get,set
4045
member VersionFile: string with get,set
4146
member References: Microsoft.Build.Framework.ITaskItem[] with get,set
4247
member ReferencePath: string with get,set
4348
member Resources: Microsoft.Build.Framework.ITaskItem[] with get,set
49+
member SkipCompilerExecution: bool with get,set
4450
member SourceLink: string with get,set
4551
member Sources: Microsoft.Build.Framework.ITaskItem[] with get,set
52+
member SubsystemVersion: string with get,set
53+
member Tailcalls: bool with get,set
4654
member TargetType: string with get,set
4755
member ToolPath: string with get,set
56+
member TargetProfile: string with get,set
4857
member TreatWarningsAsErrors: bool with get,set
4958
member Utf8Output: bool with get,set
5059
member VisualStudioStyleErrors: bool with get,set
51-
member LCID: string with get,set
5260
member WarningLevel: string with get,set
5361
member WarningsAsErrors: string with get,set
5462
member Win32ResourceFile: string with get,set
5563
member Win32ManifestFile: string with get,set
56-
member SubsystemVersion: string with get,set
57-
member HighEntropyVA: bool with get,set
58-
member TargetProfile: string with get,set
59-
member DotnetFscCompilerPath: string with get,set
60-
member SkipCompilerExecution: bool with get,set
61-
member ProvideCommandLineArgs: bool with get,set
62-
member CommandLineArgs: Microsoft.Build.Framework.ITaskItem[] with get,set
6364
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp