Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preprocessor directives #535

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
Remove-Item -Path "ms-dynamics-smb.al-latest" -Force -Recurse -Verbose;
7z x "ALLanguage_next.vsix" "-oms-dynamics-smb.al-latest" extension\bin\Analyzers -r;
- name: Build next
run: dotnet build --no-restore --configuration Release
run: dotnet build /p:DefineConstants=PreRelease --no-restore --configuration Release

- name: Upload a Build next
uses: actions/[email protected]
Expand Down
13 changes: 10 additions & 3 deletions Design/Rule0033AppManifestRuntimeBehind.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration; // AL Language v12
using Microsoft.Dynamics.Nav.Analyzers.Common; // AL Language v13
using Microsoft.Dynamics.Nav.CodeAnalysis;
using Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics;
using Microsoft.Dynamics.Nav.CodeAnalysis.Packaging;
#if PreRelease
using Microsoft.Dynamics.Nav.Analyzers.Common; // AL Language v13
#else
using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration; // AL Language v12
#endif
using System.Collections.Immutable;

namespace BusinessCentral.LinterCop.Design
Expand All @@ -16,8 +19,12 @@ class Rule0033AppManifestRuntimeBehind : DiagnosticAnalyzer

private void CheckAppManifestRuntime(CompilationAnalysisContext ctx)
{
//NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(ctx.Compilation); // AL Language v12
#if PreRelease
NavAppManifest manifest = ManifestHelper.GetManifest(ctx.Compilation); // AL Language v13
#else
NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(ctx.Compilation); // AL Language v12
#endif

if (manifest == null) return;
if (manifest.Runtime == null) return;
if (manifest.Application == null && manifest.Platform == null) return;
Expand Down
14 changes: 11 additions & 3 deletions Design/Rule0052and0053InternalProceduresNotReferenced.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
using Microsoft.Dynamics.Nav.CodeAnalysis.Symbols;
using Microsoft.Dynamics.Nav.CodeAnalysis.Syntax;
using Microsoft.Dynamics.Nav.CodeAnalysis.Packaging;
//using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration; // AL Language v12
using Microsoft.Dynamics.Nav.Analyzers.Common; // AL Language v13
#if PreRelease
using Microsoft.Dynamics.Nav.Analyzers.Common; // AL Language v13
#else
using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration; // AL Language v12
#endif

using System.Collections.Immutable;

namespace BusinessCentral.LinterCop.Design
Expand All @@ -27,8 +31,12 @@ private class MethodSymbolAnalyzer : IDisposable

public MethodSymbolAnalyzer(CompilationAnalysisContext compilationAnalysisContext)
{
//NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(compilationAnalysisContext.Compilation); // AL Language v12
#if PreRelease
NavAppManifest manifest = ManifestHelper.GetManifest(compilationAnalysisContext.Compilation); // AL Language v13
#else
NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(compilationAnalysisContext.Compilation); // AL Language v12
#endif

if (manifest.InternalsVisibleTo != null && manifest.InternalsVisibleTo.Any())
{
return;
Expand Down
Loading