Skip to content

Commit

Permalink
Improve the --nativeaot description
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Feb 5, 2025
1 parent 49d1065 commit d55bc66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dotnet-ef/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
<value>The namespace to use. Matches the directory by default.</value>
</data>
<data name="NativeAotDescription" xml:space="preserve">
<value>Additionally generate all the code required for NativeAOT compilation and precompiled queries (experimental).</value>
<value>Generate additional code in the compiled model required for NativeAOT compilation and precompiled queries (experimental).</value>
</data>
<data name="NativeAotWarning" xml:space="preserve">
<value>NativeAOT support is experimental and can change in the future.</value>
Expand Down
6 changes: 6 additions & 0 deletions src/ef/Commands/DbContextOptimizeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ protected override int Execute(string[] args)
throw new CommandException(Resources.VersionRequired("6.0.0"));
}

if ((_precompileQueries!.HasValue() || _nativeAot!.HasValue())
&& new SemanticVersionComparer().Compare(EFCoreVersion, "9.0.0") < 0)

Check failure on line 42 in src/ef/Commands/DbContextOptimizeCommand.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

src/ef/Commands/DbContextOptimizeCommand.cs#L42

src/ef/Commands/DbContextOptimizeCommand.cs(42,54): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'EFCoreVersion' does not exist in the current context

Check failure on line 42 in src/ef/Commands/DbContextOptimizeCommand.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build macOS)

src/ef/Commands/DbContextOptimizeCommand.cs#L42

src/ef/Commands/DbContextOptimizeCommand.cs(42,54): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'EFCoreVersion' does not exist in the current context

Check failure on line 42 in src/ef/Commands/DbContextOptimizeCommand.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

src/ef/Commands/DbContextOptimizeCommand.cs#L42

src/ef/Commands/DbContextOptimizeCommand.cs(42,54): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'EFCoreVersion' does not exist in the current context

Check failure on line 42 in src/ef/Commands/DbContextOptimizeCommand.cs

View check run for this annotation

Azure Pipelines / efcore-ci (Build Linux)

src/ef/Commands/DbContextOptimizeCommand.cs#L42

src/ef/Commands/DbContextOptimizeCommand.cs(42,54): error CS0103: (NETCORE_ENGINEERING_TELEMETRY=Build) The name 'EFCoreVersion' does not exist in the current context
{
throw new CommandException(Resources.VersionRequired("9.0.0"));
}

var result = executor.OptimizeContext(
_outputDir!.Value(),
_namespace!.Value(),
Expand Down
2 changes: 1 addition & 1 deletion src/ef/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
<value>The namespace to use. Matches the directory by default.</value>
</data>
<data name="NativeAotDescription" xml:space="preserve">
<value>Additionally generate all the code required for NativeAOT compilation and precompiled queries (experimental).</value>
<value>Generate additional code in the compiled model required for NativeAOT compilation and precompiled queries (experimental).</value>
</data>
<data name="NativeAotWarning" xml:space="preserve">
<value>NativeAOT support is experimental and can change in the future.</value>
Expand Down

0 comments on commit d55bc66

Please sign in to comment.