Skip to content

Commit c069d60

Browse files
authored
Improvements/implicit usings (#582)
* Use implicit usings and remove manual global usings * Explicitly use `Grand.Infrastructure.StartupBase` * Slightly re-order `Grand.Common.props` --------- Co-authored-by: Guy Taggar <guypago@outlook.com>
1 parent 48640c3 commit c069d60

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

src/Build/Grand.Common.props

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,44 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
33
<TargetFramework>net9.0</TargetFramework>
4+
<LangVersion>latest</LangVersion>
5+
<ImplicitUsings>true</ImplicitUsings>
46
</PropertyGroup>
57
<PropertyGroup>
68
<Product>grandnode</Product>
79
<PackageProjectUrl>https://grandnode.com/</PackageProjectUrl>
8-
<RepositoryUrl>https://github.com/grandnode/grandnode2</RepositoryUrl>
910
<PackageLicenseUrl>https://github.com/grandnode/grandnode2/blob/main/LICENSE</PackageLicenseUrl>
11+
<RepositoryUrl>https://github.com/grandnode/grandnode2</RepositoryUrl>
1012
<RepositoryType>Git</RepositoryType>
11-
<LangVersion>latest</LangVersion>
1213
</PropertyGroup>
1314
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
1415
<DebugSymbols>false</DebugSymbols>
1516
<DebugType>none</DebugType>
1617
<Optimize>true</Optimize>
1718
</PropertyGroup>
19+
1820
<ItemGroup>
19-
<Using Include="System" />
20-
<Using Include="System.Collections.Generic" />
21-
<Using Include="System.IO" />
22-
<Using Include="System.Text" />
23-
<Using Include="System.Linq" />
24-
<Using Include="System.Threading" />
25-
<Using Include="System.Threading.Tasks" />
21+
<Using Include="System.Text"/>
2622
</ItemGroup>
23+
2724
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation"
2825
Condition="'$(SourceRevisionId)'=='' And Exists('$(MSBuildProjectDirectory)\.git')">
2926
<Exec Command="git describe --long --always --exclude=* --abbrev=8" ConsoleToMSBuild="True"
3027
IgnoreExitCode="True">
31-
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput" />
28+
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput"/>
3229
</Exec>
3330
</Target>
3431
<Target Name="SetRepositoryBranch" BeforeTargets="InitializeSourceControlInformation"
3532
Condition="'$(GitBranch)'=='' And Exists('$(MSBuildProjectDirectory)\.git')">
3633
<Exec Command="git rev-parse --abbrev-ref HEAD" ConsoleToMSBuild="True" IgnoreExitCode="True">
37-
<Output PropertyName="branch" TaskParameter="ConsoleOutput" />
34+
<Output PropertyName="branch" TaskParameter="ConsoleOutput"/>
3835
</Exec>
3936
<ItemGroup>
40-
<AssemblyMetadata Include="GitBranch" Value="$(branch)" />
37+
<AssemblyMetadata Include="GitBranch" Value="$(branch)"/>
4138
</ItemGroup>
4239
</Target>
4340
<ItemGroup Condition="'$(GitBranch)'!=''">
44-
<AssemblyMetadata Include="GitBranch" Value="$(GitBranch)" />
41+
<AssemblyMetadata Include="GitBranch" Value="$(GitBranch)"/>
4542
</ItemGroup>
4643
<Target Name="SetVersion" BeforeTargets="PrepareForBuild">
4744
<PropertyGroup>

src/Web/Grand.Web.Admin/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using Grand.Infrastructure;
2-
using Grand.Web.Common.Extensions;
3-
using Microsoft.AspNetCore.Builder;
4-
using Microsoft.Extensions.Hosting;
1+
using Grand.Web.Common.Extensions;
2+
using StartupBase = Grand.Infrastructure.StartupBase;
53

64
var builder = WebApplication.CreateBuilder(args);
75

src/Web/Grand.Web.Vendor/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using Grand.Infrastructure;
21
using Grand.Web.Common.Extensions;
3-
using Microsoft.AspNetCore.Builder;
4-
using Microsoft.Extensions.Hosting;
2+
using StartupBase = Grand.Infrastructure.StartupBase;
53

64
var builder = WebApplication.CreateBuilder(args);
75

src/Web/Grand.Web/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using Grand.Web.Common.Extensions;
22
using Grand.Web.Common.Startup;
3-
using Microsoft.AspNetCore.Builder;
4-
using Microsoft.Extensions.Hosting;
53
using StartupBase = Grand.Infrastructure.StartupBase;
64

75
var builder = WebApplication.CreateBuilder(args);

0 commit comments

Comments
 (0)