Repository navigation
Expand file tree
/
Copy pathSelectRandomFairness.csproj
More file actions
198 lines (178 loc) · 12.2 KB
/
Copy pathSelectRandomFairness.csproj
File metadata and controls
198 lines (178 loc) · 12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(TargetFramework)'==''">net10.0</TargetFramework>
<RootNamespace>go</RootNamespace>
<AssemblyName>SelectRandomFairness</AssemblyName>
<Product>go2cs</Product>
<Description>$(AssemblyName) ($(TargetFramework) - $(Configuration))</Description>
<AssemblyTitle>$(Description)</AssemblyTitle>
<Authors>$(Product) Authors</Authors>
<Company>The $(Authors)</Company>
<Copyright>Copyright © 2018-2026 $(Company)</Copyright>
<RepositoryUrl>https://github.com/ritchiecarroll/go2cs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<ApplicationIcon>go2cs.ico</ApplicationIcon>
<!-- `annotations`, not `enable`: Go has no non-nullable pointer, interface, map, slice, channel
or func, so nullable flow analysis asks a question the source language cannot pose, and
would warn across the whole conversion. This keeps `?` meaningful (golib's `ж<T>?`) with
the analysis itself off. -->
<Nullable>annotations</Nullable>
<!-- Diagnostics that are structural to the Go emission model, not defects: Go type names
(CS8981/CS8860), split partial structs (CS0282), Go comparison operators on value types
(CS0660/CS0661), Go zero values (CS8618), generated unreachable code and labels
(CS0162/CS0164), generated self-assignment (CS1717), the NaN idiom (CS1718), function
values in a `map[string]any` (CS8974), and `init()` as a module initializer (CA2255). -->
<NoWarn>CS0162;CS0164;CS0282;CS0660;CS0661;CS1717;CS1718;CS8618;CS8860;CS8974;CS8981;IDE0060;IDE1006;CA2255</NoWarn>
<LangVersion Condition="'$(LangVersion)'==''">14</LangVersion>
<!-- Go strings in `any` slots: go2cs-gen's LiteralInterceptorGenerator boxes a bare C# literal the converter passes
there, through an interceptor in namespace go2cs.Interceptors; without this opt-in every such call is CS9137.
A go2cs-gen that cannot load is an error, not the compiler's warning (CS8032, CS8034, CS8784, CS8785, and
CS9057: it references a newer compiler than the one running it): otherwise the build would go on without the
interceptors, and the program would see System.String where Go has a string. -->
<InterceptorsNamespaces>$(InterceptorsNamespaces);go2cs.Interceptors</InterceptorsNamespaces>
<WarningsAsErrors>$(WarningsAsErrors);CS8032;CS8034;CS8784;CS8785;CS9057</WarningsAsErrors>
</PropertyGroup>
<!-- Build outputs are copied to $(OutDir), so this default must also defer to an explicit
$(BaseOutputPath); otherwise that redirection silently never takes effect. -->
<PropertyGroup Condition="'$(OutDir)'=='' AND '$(BaseOutputPath)'==''">
<OutDir>bin/$(Configuration)/$(TargetFramework)/</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(USERPROFILE)'==''">
<USERPROFILE>$(HOME)</USERPROFILE>
</PropertyGroup>
<PropertyGroup Condition="'$(go2csPath)'==''">
<go2csPath Condition="'$(Configuration)'!='Debug'">$(USERPROFILE)/go2cs/</go2csPath>
<go2csPath Condition="'$(Configuration)'=='Debug'">$(SolutionDir)</go2csPath>
</PropertyGroup>
<!-- Enable native compiled output optimizations. Publishing is an APPLICATION operation, so these
are scoped off Library: the SDK turns PublishTrimmed into EnableTrimAnalyzer at BUILD time, so
on a library it buys nothing but IL#### trim warnings the app publish recomputes over the whole
closure anyway. AllowUnsafeBlocks is a compile setting and stays unconditional. -->
<PropertyGroup Condition="'$(OutputType)'!='Library'">
<PublishReadyToRun>true</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
<!-- Trim the framework only: a full trim removes members golib and the converted code reach by reflection. -->
<TrimMode Condition="'$(TrimMode)'==''">partial</TrimMode>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<!-- Per-assembly ReadyToRun for a single file: the SDK's composite default, compressed, costs seconds of start-up. https://github.com/ritchiecarroll/go2cs/blob/master/docs/Tuning.md -->
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)'==''">false</PublishReadyToRunComposite>
<!-- Opt-in for Ubuntu's packaged .NET 10, where on-stack replacement can end a program early (0x80131506 or a silent
exit 0); costs about 90 ms of startup; becomes the default if a converted program reproduces it. https://github.com/ritchiecarroll/go2cs/blob/master/docs/KnownIssues.md -->
<!-- <TieredCompilationQuickJitForLoops>false</TieredCompilationQuickJitForLoops> -->
<!-- Count calls from the start: .NET otherwise waits until about 100 ms pass with no new method compiled, so a short
busy phase runs the standard library's small functions unoptimized. Another value is a delay in milliseconds;
`runtime` keeps .NET's own default. https://github.com/ritchiecarroll/go2cs/blob/master/docs/Tuning.md -->
<GoCallCountingDelayMs Condition="'$(GoCallCountingDelayMs)'==''">0</GoCallCountingDelayMs>
</PropertyGroup>
<ItemGroup Condition="'$(OutputType)'!='Library' AND '$(GoCallCountingDelayMs)'!='runtime'">
<RuntimeHostConfigurationOption Include="System.Runtime.TieredCompilation.CallCountingDelayMs" Value="$(GoCallCountingDelayMs)" />
</ItemGroup>
<!-- ReadyToRun compiles each assembly on its own: code in one cannot inline a call into another, and a loop entered
once never leaves its ReadyToRun code. So golib and the standard library keep ReadyToRun, where start time is
won, and the program's own code (this project and every project it references from outside $(go2csPath)core)
is compiled as it runs, so a hot loop is optimized across its calls into the standard library.
GoReadyToRunUserCode=true compiles it ahead of time too. https://github.com/ritchiecarroll/go2cs/blob/master/docs/Tuning.md -->
<Target Name="GoKeepOwnCodeOutOfReadyToRun" BeforeTargets="_PrepareForReadyToRunCompilation" DependsOnTargets="_ComputeAssembliesToPostprocessOnPublish"
Condition="'$(OutputType)'!='Library' AND '$(GoReadyToRunUserCode)'!='true'">
<PropertyGroup>
<_GoCoreRoot>$([System.IO.Path]::GetFullPath('$(go2csPath)core/').ToLowerInvariant())</_GoCoreRoot>
</PropertyGroup>
<ItemGroup>
<PublishReadyToRunExclude Include="$(AssemblyName).dll" />
<PublishReadyToRunExclude Include="%(ResolvedFileToPublish.Filename)%(ResolvedFileToPublish.Extension)"
Condition="'%(ResolvedFileToPublish.ReferenceSourceTarget)'=='ProjectReference' AND '%(ResolvedFileToPublish.Extension)'=='.dll' AND !$([System.String]::Copy('%(ResolvedFileToPublish.MSBuildSourceProjectFile)').ToLowerInvariant().StartsWith('$(_GoCoreRoot)'))" />
</ItemGroup>
</Target>
<PropertyGroup>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<!-- NuGet packaging metadata for library projects; packing itself is explicit ('dotnet pack' via push-nuget.ps1), so plain builds emit no .nupkg -->
<PropertyGroup Condition="'$(OutputType)'=='Library'">
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageId>go.$(AssemblyName)</PackageId>
<PackageLicenseFile Condition="Exists('$(MSBuildProjectDirectory)/LICENSE')">LICENSE</PackageLicenseFile>
<PackageDescription>$(Description) -- C# project converted from Go source</PackageDescription>
<PackageProjectUrl>https://github.com/ritchiecarroll/go2cs</PackageProjectUrl>
<PackageIcon>go2cs.png</PackageIcon>
<PackageTags>$(AssemblyName);go2cs;Golang;go</PackageTags>
</PropertyGroup>
<ItemGroup Condition="'$(OutputType)'=='Library'">
<None Include="go2cs.png" Pack="true" PackagePath="" Visible="false" />
<None Include="go2cs.ico" Pack="true" PackagePath="" Visible="false" />
<None Include="LICENSE" Pack="true" PackagePath="" Condition="Exists('$(MSBuildProjectDirectory)/LICENSE')" />
<None Include="NOTICE" Pack="true" PackagePath="" Condition="Exists('$(MSBuildProjectDirectory)/NOTICE')" />
<None Include="AUTHORS" Pack="true" PackagePath="" Condition="Exists('$(MSBuildProjectDirectory)/AUTHORS')" />
</ItemGroup>
<!-- Include the per-package README (emitted by the converter) in the NuGet package -->
<PropertyGroup Condition="'$(OutputType)'=='Library' AND Exists('$(MSBuildProjectDirectory)/README.md')">
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup Condition="'$(OutputType)'=='Library' AND Exists('$(MSBuildProjectDirectory)/README.md')">
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
<!-- Expose output of source generators as local files -->
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Remove="$(CompilerGeneratedFilesOutputPath)/**/*.cs" />
<ProjectReference Include="$(go2csPath)gen/go2cs-gen/go2cs-gen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" PrivateAssets="All" />
</ItemGroup>
<!-- Define Go type aliases -->
<ItemGroup>
<Using Include="go.builtin" Static="True" />
<Using Include="System" />
<Using Include="System.Numerics" />
<Using Include="System.Object" Alias="any" />
<Using Include="System.Byte" Alias="uint8" />
<Using Include="System.UInt16" Alias="uint16" />
<Using Include="System.UInt32" Alias="uint32" />
<Using Include="System.UInt64" Alias="uint64" />
<Using Include="System.SByte" Alias="int8" />
<Using Include="System.Int16" Alias="int16" />
<Using Include="System.Int32" Alias="int32" />
<Using Include="System.Int64" Alias="int64" />
<Using Include="System.Single" Alias="float32" />
<Using Include="System.Double" Alias="float64" />
<Using Include="System.Numerics.Complex" Alias="complex128" />
<Using Include="System.Int32" Alias="rune" />
<Using Include="System.Numerics.BigInteger" Alias="GoBigConst" />
<Using Include="System.ComponentModel.DescriptionAttribute" Alias="GoTagAttribute" />
<Using Include="System.Runtime.CompilerServices.ModuleInitializerAttribute" Alias="GoInitAttribute" />
</ItemGroup>
<ItemGroup>
<!-- Remove all .cs files, including those in sub-folders -->
<Compile Remove="**/*.cs" />
<!-- package_info.cs is compiled FIRST, ahead of the globs below. Roslyn orders module
initializers by compilation ITEM order, and the forced-init import hooks are module
initializers, so this is what makes "every import hook precedes every one of the package's
own inits" a deterministic guarantee rather than the alphabetical accident a bare glob
leaves it as (docs/phase4/DESIGN-import-hook-relocation.md S3).
Exists()-guarded because ONE shape has to serve every layout: a flat package holds the file
at its root, an L3 package holds it in the per-GOOS folder (the companion item is added
beside this one), and a platform-exclusive package built for another target has neither and
correctly contributes nothing. An unguarded item naming an absent file is not a no-op; it
is CS2001. -->
<Compile Include="package_info.cs" Condition="Exists('package_info.cs')" />
<!-- Include only .cs files from current folder -->
<Compile Include="*.cs" Exclude="package_info.cs" />
<!-- Converted test artifacts share this folder but belong to the colocated
<name>.tests.csproj, which compiles them. A Go test file is `*_test.go`, so its
conversion is `*_test.cs`. -->
<Compile Remove="*_test.cs;package_test_info.cs;go2cs_test_host.cs" />
<!--Remove all sub-folders -->
<None Remove="*/**/*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(go2csPath)core/golib/golib.csproj" />
<ProjectReference Include="$(go2csPath)core/fmt/fmt.csproj" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="go.GoModInfoAttribute">
<_Parameter1>path	go2cs/SelectRandomFairness mod	go2cs/SelectRandomFairness	(devel)	 </_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>