Skip to content

Commit 86db32b

Browse files
authored
Raise analysis level and bump major version (#9818)
* Enable ImplicitUsings, incease LanguageVersion, specify WarningLevel, AnalysisLevel, and other build properties * Update expected codegen output * Ensure npm app is built only once * Increase timeouts in OrleansTaskSchedulerAdvancedTests_Set2
1 parent 804a703 commit 86db32b

File tree

62 files changed

+323
-231
lines changed

Some content is hidden

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

62 files changed

+323
-231
lines changed

Directory.Build.props

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,27 @@
1818
<PrivateRepositoryUrl>$(RepositoryUrl)</PrivateRepositoryUrl>
1919
<RepositoryUrl>$(RepositoryUrl)</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
21-
<LangVersion>12</LangVersion>
21+
<LangVersion>preview</LangVersion>
2222
<Features>strict</Features>
23+
<WarningLevel>3</WarningLevel>
24+
<AnalysisLevel>preview</AnalysisLevel>
25+
<!-- TODO: Uncomment this and fix errors -->
26+
<!-- <AnalysisMode>All</AnalysisMode> -->
27+
<!-- TODO: Uncomment this and fix errors -->
28+
<!-- <Nullable>enable</Nullable> -->
2329
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2430
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2531
<DebugType>embedded</DebugType>
2632
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
2733
<IncludeSymbols>false</IncludeSymbols>
2834
<IncludeSource>false</IncludeSource>
35+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
36+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
37+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
38+
<ImplicitUsings>enable</ImplicitUsings>
39+
<!--<NoWarn>$(NoWarn);2003</NoWarn>-->
40+
<!-- TODO: Disable and ensure all public members are documented: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1591 -->
41+
<NoWarn>$(NoWarn);1591</NoWarn>
2942
</PropertyGroup>
3043

3144
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' or '$(GITHUB_ACTIONS)' == 'true'">
@@ -36,12 +49,6 @@
3649
<None Include="$(SourceRoot)assets/logo_128.png" Pack="true" Visible="false" PackagePath="/" />
3750
</ItemGroup>
3851

39-
<!-- Common compile parameters -->
40-
<PropertyGroup>
41-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
42-
<NoWarn>$(NoWarn);1591;2003</NoWarn>
43-
</PropertyGroup>
44-
4552
<!-- FSharp SDK overrides -->
4653
<PropertyGroup>
4754
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
@@ -50,8 +57,8 @@
5057

5158
<!-- Versioning properties -->
5259
<PropertyGroup>
53-
<AssemblyVersion>9.0.0.0</AssemblyVersion>
54-
<VersionPrefix Condition=" '$(VersionPrefix)'=='' ">9.1.0</VersionPrefix>
60+
<AssemblyVersion>10.0.0.0</AssemblyVersion>
61+
<VersionPrefix Condition=" '$(VersionPrefix)'=='' ">10.0.0</VersionPrefix>
5562
</PropertyGroup>
5663

5764
<!-- For Debug builds generated a date/time dependent version suffix -->

Directory.Build.targets

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
</PropertyGroup>
66

77
<Import Condition=" '$(OrleansBuildTimeCodeGen)' == 'true' " Project="$(MSBuildThisFileDirectory)src/Orleans.CodeGenerator/build/Microsoft.Orleans.CodeGenerator.props" />
8-
<Import Condition=" '$(OrleansBuildTimeCodeGen)' == 'true' " Project="$(MSBuildThisFileDirectory)src/Orleans.Sdk/build/Microsoft.Orleans.Sdk.targets" />
8+
<Import
9+
Condition=" '$(OrleansBuildTimeCodeGen)' == 'true' and '$(IsOrleansFrameworkPart)' != 'false' and '$(PackageId)' != 'Microsoft.Orleans.Core.Abstractions' "
10+
Project="$(MSBuildThisFileDirectory)src/Orleans.Core/build/Microsoft.Orleans.Core.targets" />
11+
912
<ItemGroup>
1013
<!-- Enable code generator -->
1114
<ProjectReference

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@
158158
<PackageVersion Update="System.Memory.Data" Version="10.0.0" />
159159
<PackageVersion Update="System.Text.Json" Version="10.0.0" />
160160
</ItemGroup>
161-
</Project>
161+
</Project>

playground/Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1212
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1313
<ServerGarbageCollection>true</ServerGarbageCollection>
14-
<ImplicitUsings>enable</ImplicitUsings>
1514
</PropertyGroup>
1615

1716
</Project>

src/Azure/Orleans.Journaling.AzureStorage/Orleans.Journaling.AzureStorage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<PackageId>Microsoft.Orleans.Journaling.AzureStorage</PackageId>
55
<PackageReadmeFile>README.md</PackageReadmeFile>
6-
<TargetFramework>net8.0</TargetFramework>
6+
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
<VersionSuffix Condition="$(VersionSuffix) != ''">$(VersionSuffix).alpha.1</VersionSuffix>

src/Dashboard/Orleans.Dashboard.Abstractions/Orleans.Dashboard.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PackageId>Microsoft.Orleans.Dashboard.Abstractions</PackageId>
55
<Title>Microsoft Orleans Dashboard Abstractions</Title>
66
<Description>Shared types used by the Orleans Dashboard package.</Description>
7-
<TargetFramework>net8.0</TargetFramework>
7+
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
88
<RootNamespace>Orleans.Dashboard</RootNamespace>
99
<PackageReadmeFile>README.md</PackageReadmeFile>
1010
</PropertyGroup>

src/Dashboard/Orleans.Dashboard/Orleans.Dashboard.Frontend.targets

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
<Delete Files="$(NpmAppBuildMarker)" />
3030
</Target>
3131

32-
<!-- Build the frontend -->
33-
<Target Name="BuildNpmApp" BeforeTargets="AssignTargetPaths;BeforeTargets;Compile" Inputs="@(NpmAppSources)" Outputs="$(NpmAppBuildMarker)">
32+
<!-- Build the frontend (runs once regardless of target frameworks)
33+
See: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once -->
34+
<Target Name="BuildNpmApp" Inputs="@(NpmAppSources)" Outputs="$(NpmAppBuildMarker)">
3435
<!-- Use Azure DevOps npmrc and build command if running in CI, otherwise use defaults -->
3536
<PropertyGroup>
3637
<NpmConfigArg Condition="'$(TF_BUILD)' == 'true'">--userconfig &quot;$(AzureDevOpsNpmrcFile)&quot;</NpmConfigArg>
@@ -48,6 +49,23 @@
4849
<Touch Files="$(NpmAppBuildMarker)" AlwaysCreate="true" />
4950
</Target>
5051

52+
<!-- Hook BuildNpmApp to run once before DispatchToInnerBuilds for multi-targeted builds -->
53+
<Target
54+
Name="BuildNpmAppBeforeOuterBuild"
55+
DependsOnTargets="BuildNpmApp"
56+
BeforeTargets="DispatchToInnerBuilds"
57+
/>
58+
59+
<!-- Hook BuildNpmApp to run once before inner build targets (invokes outer build) -->
60+
<Target
61+
Name="BuildNpmAppBeforeInnerBuild"
62+
BeforeTargets="AssignTargetPaths;BeforeBuild;Compile">
63+
<MSBuild
64+
Projects="$(MSBuildProjectFullPath)"
65+
Targets="BuildNpmApp"
66+
RemoveProperties="TargetFramework" />
67+
</Target>
68+
5169
<!-- Include frontend assets as embedded resources -->
5270
<ItemGroup>
5371
<EmbeddedResource

src/Dashboard/Orleans.Dashboard/Orleans.Dashboard.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PackageId>Microsoft.Orleans.Dashboard</PackageId>
55
<Title>Microsoft Orleans Dashboard</Title>
66
<Description>Real-time monitoring and visualization dashboard for Microsoft Orleans showing grain statistics, performance metrics, and cluster health.</Description>
7-
<TargetFramework>net8.0</TargetFramework>
7+
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
88
<OrleansBuildTimeCodeGen>true</OrleansBuildTimeCodeGen>
99
<PackageReadmeFile>README.md</PackageReadmeFile>
1010
<RootNamespace>Orleans.Dashboard</RootNamespace>

src/Directory.Build.props

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
<Import Project="$(_ParentDirectoryBuildPropsPath)" Condition="Exists('$(_ParentDirectoryBuildPropsPath)')"/>
77

88
<PropertyGroup>
9-
<WarningLevel>3</WarningLevel>
10-
<AnalysisLevel>preview</AnalysisLevel>
11-
<Features>strict</Features>
129
</PropertyGroup>
1310

1411
<PropertyGroup>
@@ -21,7 +18,9 @@
2118
</PropertyGroup>
2219

2320
<PropertyGroup>
24-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
21+
<ReadMePath>$(MSBuildProjectDirectory)\README.md</ReadMePath>
22+
<ReadMeExists Condition="Exists('$(ReadMePath)')">true</ReadMeExists>
23+
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' And '$(ReadMeExists)' == 'true'">README.md</PackageReadmeFile>
2524
</PropertyGroup>
2625

2726
<PropertyGroup>

src/Orleans.CodeGenerator/SerializerGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,12 +1273,12 @@ public SerializableMember(CodeGenerator codeGenerator, IMemberDescription member
12731273
/// <summary>
12741274
/// Gets a value indicating whether or not this member represents an accessible field.
12751275
/// </summary>
1276-
private bool IsGettableField => Field is { } field && _codeGenerator.Compilation.IsSymbolAccessibleWithin(field, Compilation.Assembly) && !IsObsolete;
1276+
private bool IsGettableField => Field is { } fieldInfo && _codeGenerator.Compilation.IsSymbolAccessibleWithin(fieldInfo, Compilation.Assembly) && !IsObsolete;
12771277

12781278
/// <summary>
12791279
/// Gets a value indicating whether or not this member represents an accessible, mutable field.
12801280
/// </summary>
1281-
private bool IsSettableField => Field is { } field && IsGettableField && !field.IsReadOnly;
1281+
private bool IsSettableField => Field is { } fieldInfo && IsGettableField && !fieldInfo.IsReadOnly;
12821282

12831283
/// <summary>
12841284
/// Gets a value indicating whether or not this member represents a property with an accessible, non-obsolete getter.

0 commit comments

Comments
 (0)