Skip to content

Commit

Permalink
Update tools
Browse files Browse the repository at this point in the history
fixes #2197
ErikEJ committed Mar 2, 2024
1 parent fca8100 commit ceeb322
Showing 18 changed files with 43 additions and 22 deletions.
14 changes: 11 additions & 3 deletions src/Core/RevEng.Core.60/ReplacingCandidateNamingService.cs
Original file line number Diff line number Diff line change
@@ -14,16 +14,24 @@ public class ReplacingCandidateNamingService : CandidateNamingService
{
private readonly List<Schema> customNameOptions;
private readonly bool preserveCasingUsingRegex;
#if CORE80
private readonly bool usePrefixNaming;

#endif
public ReplacingCandidateNamingService(
#if CORE80
bool usePrefixNaming,
List<Schema> customNameOptions,
bool preserveCasingUsingRegex = false,
bool usePrefixNaming = false)
bool preserveCasingUsingRegex = false)
#else
List<Schema> customNameOptions,
bool preserveCasingUsingRegex = false)
#endif
{
this.customNameOptions = customNameOptions;
this.preserveCasingUsingRegex = preserveCasingUsingRegex;
#if CORE80
this.usePrefixNaming = usePrefixNaming;
#endif
}

public override string GenerateCandidateIdentifier(DatabaseTable originalTable)
2 changes: 1 addition & 1 deletion src/Core/RevEng.Core.60/ServiceProviderBuilder.cs
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ public static IServiceCollection AddEfpt(this IServiceCollection serviceCollecti
#if CORE80
if (options.CustomReplacers != null || options.UsePrefixNavigationNaming)
{
serviceCollection.AddSingleton<ICandidateNamingService>(provider => new ReplacingCandidateNamingService(options.CustomReplacers, options.PreserveCasingWithRegex, options.UsePrefixNavigationNaming));
serviceCollection.AddSingleton<ICandidateNamingService>(provider => new ReplacingCandidateNamingService(options.UsePrefixNavigationNaming, options.CustomReplacers, options.PreserveCasingWithRegex));
}
#else
if (options.CustomReplacers != null)
11 changes: 10 additions & 1 deletion src/Directory.Build.Props
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<PropertyGroup Label="Compile settings">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1573,1591,1712,CA1014</NoWarn>
</PropertyGroup>

<PropertyGroup Label="Analyzer settings">
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest-All</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.20.0.85982">
3 changes: 3 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerTools.csproj
Original file line number Diff line number Diff line change
@@ -19,9 +19,11 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>bin\Release\EFCorePowerTools.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>bin\Debug\EFCorePowerTools.xml</DocumentationFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -93,6 +95,7 @@
<DependentUpon>PickTablesDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EFCorePowerToolsPackage.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Locales\AboutLocale.Designer.cs">
<DependentUpon>AboutLocale.resx</DependentUpon>
<AutoGen>True</AutoGen>
8 changes: 8 additions & 0 deletions src/GUI/EFCorePowerTools/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:File should have header", Justification = "Generated by tooling")]
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\PowerToolsExtensionPack.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -44,6 +45,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\PowerToolsExtensionPack.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
2 changes: 2 additions & 0 deletions src/GUI/RevEng.Shared/Cli/CliConfigMapper.cs
Original file line number Diff line number Diff line change
@@ -327,7 +327,9 @@ private static List<T> Add<T>(IEnumerable<TableModel> models, List<T> entities)
var newItems = models.Where(o => o.ObjectType == objectType).ToList();
if (newItems.Count == 0)
{
#pragma warning disable S1168
return null;
#pragma warning restore S1168
}

var result = entities ?? new List<T>();
2 changes: 1 addition & 1 deletion src/GUI/RevEng.Shared/Providers.cs
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ public static string CreateReadme(ReverseEngineerCommandOptions commandOptions,

public static List<NuGetPackage> GetNeededPackages(DatabaseType databaseType, bool useSpatial, bool useNodaTime, bool useDateOnlyTimeOnly, bool useHierarchyId, bool discoverMultipleResultSets, bool hasProcedures, CodeGenerationMode codeGenerationMode)
{
// TODO Update versions here when adding provider and other updates
// Update versions here when adding provider and other updates
var packages = new List<NuGetPackage>();

if (databaseType == DatabaseType.SQLServer || databaseType == DatabaseType.SQLServerDacpac)
10 changes: 1 addition & 9 deletions src/GUI/Shared/Contracts/ViewModels/IPickTablesViewModel.cs
Original file line number Diff line number Diff line change
@@ -18,20 +18,12 @@ public interface IPickTablesViewModel : IViewModel
SearchMode SearchMode { get; set; }
IObjectTreeViewModel ObjectTree { get; }

/// <summary>
/// Adds the <paramref name="objects"/> to the <see cref="Tables"/>, wrapping it in a new <see cref="ITableInformationViewModel"/> instance.
/// </summary>
/// <param name="objects">The tables to add.</param>
void AddObjects(IEnumerable<TableModel> objects, IEnumerable<Schema> customReplacers);

/// <summary>
/// Selects the <paramref name="objects"/> from the <see cref="Tables"/> property, setting the <see cref="ITableInformationViewModel.IsSelected"/> to true, if both collections contain the table.
/// </summary>
/// <param name="objects">The tables to select.</param>
void SelectObjects(IEnumerable<SerializationTableModel> objects);

SerializationTableModel[] GetSelectedObjects();

Schema[] GetRenamedObjects();
}
}
}
2 changes: 1 addition & 1 deletion src/GUI/Shared/ItemWizard/ReverseEngineerWizardLauncher.cs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ namespace EFCorePowerTools.ItemWizard
{
public class ReverseEngineerWizardLauncher : IWizard
{
// TODO Update vstemplate version reference if main assembly version changes
// Update vstemplate version reference if main assembly version changes
// In \src\GUI\WizardItemTemplate\WizardItemTemplate.vstemplate
public void RunStarted(
object automationObject,
1 change: 1 addition & 0 deletions src/GUI/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\UnitTests.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework" />
2 changes: 2 additions & 0 deletions src/GUI/WizardItemTemplate/WizardItemTemplate.csproj
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\WizardItemTemplate.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -50,6 +51,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\WizardItemTemplate.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Binary file modified src/GUI/lib/efreveng60.exe.zip
Binary file not shown.
Binary file modified src/GUI/lib/efreveng70.exe.zip
Binary file not shown.
Binary file modified src/GUI/lib/efreveng80.exe.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -39,9 +39,6 @@ public Column(string name, IDictionary<TypeFormat, string> dataTypes, bool isIde
/// Initializes a new instance of the <see cref="Column" /> class.
/// </summary>
/// <param name="tSqlObject">The TSqlObject representing the column.</param>
/// <param name="tSqlTable">The table or view this column belongs to.</param>
/// <param name="primaryKeys">The primary keys.</param>
/// <param name="foreignKeys">The foreign keys.</param>
public Column(Dac.TSqlObject tSqlObject)
{
this.Name = tSqlObject.Name.Parts.Last();
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ public class Procedure
/// <summary>
/// Initializes a new instance of the <see cref="Procedure"/> class.
/// </summary>
/// <param name="prefix">The prefix used on stored procedure names.</param>
public Procedure(Dac.TSqlObject tSqlObject)
{
this.Name = tSqlObject.Name.Parts.Last();
Original file line number Diff line number Diff line change
@@ -26,8 +26,6 @@ public Table(string name, IEnumerable<Column> columns)
/// Initializes a new instance of the <see cref="Table" /> class.
/// </summary>
/// <param name="tSqlObject">The TSqlObject representing the table.</param>
/// <param name="primaryKeys">The primary keys.</param>
/// <param name="foreignKeys">The foreign keys.</param>
public Table(Dac.TSqlObject tSqlObject)
{
ArgumentNullException.ThrowIfNull(tSqlObject);

0 comments on commit ceeb322

Please sign in to comment.