diff --git a/.editorconfig b/.editorconfig index 2bc8c96f..95da6cea 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ tab_width = 2 indent_size = 2 trim_trailing_whitespace = false # trailing whitespace is significant in markdown -[*.{json,js}] +[*.{json,js,ts}] tab_width = 2 indent_size = 2 trim_trailing_whitespace = true @@ -29,375 +29,22 @@ indent_size = 4 end_of_line = crlf trim_trailing_whitespace = true -# ********************************** -# ** .Net Code style & formatting ** -# ********************************** -[*.{cs,vb}] -file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License. - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -# Organize usings -dotnet_sort_system_directives_first = true -dotnet_separate_import_directive_groups = false - -# Styles -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion -dotnet_style_prefer_auto_properties = true:silent -dotnet_style_qualification_for_field = false:error -dotnet_style_qualification_for_property = false:error -dotnet_style_qualification_for_method = false:error -dotnet_style_qualification_for_event = false:error -dotnet_style_object_initializer = true:suggestion -dotnet_style_prefer_collection_expression = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_compound_assignment = true:suggestion -dotnet_style_prefer_simplified_interpolation = true:suggestion -dotnet_style_namespace_match_folder = true:suggestion -dotnet_style_readonly_field = true:suggestion -dotnet_style_predefined_type_for_locals_parameters_members = true:silent -dotnet_style_predefined_type_for_member_access = true:silent -dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent -dotnet_style_allow_statement_immediately_after_block_experimental = true:silent -dotnet_style_allow_multiple_blank_lines_experimental = true:silent -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent - -dotnet_code_quality_unused_parameters = all:suggestion - -# *************** -# ** C# styles ** -# *************** -[*.cs] -csharp_indent_labels = one_less_than_current -csharp_using_directive_placement = outside_namespace:error -csharp_prefer_simple_using_statement = true:suggestion -csharp_prefer_braces = true:silent -csharp_style_namespace_declarations = file_scoped:error -csharp_style_prefer_method_group_conversion = true:silent -csharp_style_prefer_top_level_statements = true:silent -csharp_style_prefer_primary_constructors = true:suggestion -csharp_style_expression_bodied_methods = false:error -csharp_style_expression_bodied_constructors = false:error -csharp_style_expression_bodied_operators = false:silent -csharp_style_expression_bodied_properties = true:silent -csharp_style_expression_bodied_indexers = true:silent -csharp_style_expression_bodied_accessors = true:silent -csharp_style_expression_bodied_lambdas = true:silent -csharp_style_expression_bodied_local_functions = false:silent -csharp_style_var_elsewhere = true:warning -csharp_style_var_when_type_is_apparent = true:error -csharp_style_var_for_built_in_types = true:error -csharp_space_around_binary_operators = before_and_after -csharp_style_throw_expression = true:suggestion -csharp_style_prefer_null_check_over_type_check = true:suggestion -csharp_prefer_simple_default_expression = true:suggestion -csharp_style_prefer_local_over_anonymous_function = true:suggestion -csharp_style_prefer_index_operator = true:suggestion -csharp_style_prefer_range_operator = true:suggestion -csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion -csharp_style_prefer_tuple_swap = true:suggestion -csharp_style_prefer_utf8_string_literals = true:suggestion -csharp_style_inlined_variable_declaration = true:suggestion -csharp_style_deconstructed_variable_declaration = true:suggestion -csharp_style_unused_value_assignment_preference = discard_variable:suggestion -csharp_style_unused_value_expression_statement_preference = discard_variable:silent -csharp_prefer_static_local_function = true:suggestion -csharp_style_prefer_readonly_struct = true:suggestion -csharp_style_prefer_readonly_struct_member = true:suggestion -csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent -csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent -csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent -csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent -csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent -csharp_style_conditional_delegate_call = true:suggestion -csharp_style_prefer_switch_expression = true:suggestion -csharp_style_prefer_pattern_matching = true:silent -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion -csharp_style_prefer_not_pattern = true:suggestion -csharp_style_prefer_extended_property_pattern = true:suggestion - - -# NOTE: We put code analysis rule configurations after setting up styles. - -# ******************************************* -# ** Set Diagnostic Rule Category Defaults ** -# ******************************************* -# Any rule set to 'warning' will be turned into an 'error' during any official/PR build. -# In local builds, this is preferable as it allows development to be faster while code is being written. -# This is why the default severity is usually warning here. -# Set severity to 'error' when the fix indicates a breaking change or using insecure/unsafe APIs/patterns. -[*.{cs,vb}] - -dotnet_analyzer_diagnostic.category-Design.severity = warning -dotnet_analyzer_diagnostic.category-Documentation.severity = warning -dotnet_analyzer_diagnostic.category-Globalization.severity = warning -dotnet_analyzer_diagnostic.category-Interoperability.severity = warning -dotnet_analyzer_diagnostic.category-Maintainability.severity = warning -dotnet_analyzer_diagnostic.category-Naming.severity = warning -dotnet_analyzer_diagnostic.category-Performance.severity = warning -dotnet_analyzer_diagnostic.category-Reliability.severity = warning -dotnet_analyzer_diagnostic.category-Security.severity = error -dotnet_analyzer_diagnostic.category-Style.severity = warning -dotnet_analyzer_diagnostic.category-Usage.severity = warning - -# ********************************* -# ** Code-style Diagnostic Rules ** -# ********************************* -# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ -# These all have the 'IDE' prefix -[*.{cs,vb}] - -dotnet_diagnostic.IDE0003.severity = error # this and Me preferences -dotnet_diagnostic.IDE0007.severity = error # Use 'var' instead of explicit type -dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives -dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement -dotnet_diagnostic.IDE0011.severity = none # Add braces -dotnet_diagnostic.IDE0018.severity = suggestion # Inline variable declaration (net8.0 doesn't respect the severity set for csharp_style_inlined_variable_declaration) -dotnet_diagnostic.IDE0028.severity = none # Use collection initializers or expressions -dotnet_diagnostic.IDE0042.severity = none # Deconstruct variable declaration -dotnet_diagnostic.IDE0043.severity = warning # Format string contains invalid placeholder -dotnet_diagnostic.IDE0045.severity = none # Use conditional expression for assignment -dotnet_diagnostic.IDE0046.severity = none # Use conditional expression for return -dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member -dotnet_diagnostic.IDE0052.severity = warning # Remove unread private member -dotnet_diagnostic.IDE0055.severity = warning # Formatting rule ("Fix formatting") - All formatting options use this rule. e.g. spacing, indentation, new lines, etc. -dotnet_diagnostic.IDE0057.severity = none # Use range operator -dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value -dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter -dotnet_diagnostic.IDE0061.severity = none # Use expression body for local functions -dotnet_diagnostic.IDE0063.severity = none # Use simple 'using' statement -dotnet_diagnostic.IDE0066.severity = none # Use switch expression -dotnet_diagnostic.IDE0064.severity = warning # Make struct fields writable -dotnet_diagnostic.IDE0070.severity = none # Use 'System.HashCode.Combine' -dotnet_diagnostic.IDE0073.severity = error # Require file header -dotnet_diagnostic.IDE0078.severity = none # Use pattern matching -dotnet_diagnostic.IDE0090.severity = warning # expression can be simplified -dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure -dotnet_diagnostic.IDE0161.severity = error # Namespace declaration preferences -dotnet_diagnostic.IDE0210.severity = none # Convert to top-level statements -dotnet_diagnostic.IDE0290.severity = suggestion # Use primary constructor -dotnet_diagnostic.IDE0300.severity = suggestion # Use collection expression for array -dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty -dotnet_diagnostic.IDE0305.severity = suggestion # Use collection expression for fluent -dotnet_diagnostic.IDE1006.severity = none # These words must begin with upper case characters - - -# *********************************** -# ** Code Quality Diagnostic Rules ** -# *********************************** -# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/?view=vs-2022 -[*.{cs,vb}] - -dotnet_diagnostic.CA1031.severity = error # Do not catch general exception types -dotnet_diagnostic.CA1063.severity = error # Implement IDisposable correctly -dotnet_diagnostic.CA1001.severity = error # Types that own disposable fields should be disposable -dotnet_diagnostic.CA1507.severity = error # Use nameof in place of string -dotnet_diagnostic.CS1573.severity = silent # Parameter has no matching param tag in the XML comment (but other parameters do). Justification: Don't require unneccessary comments. Only add comments for parameters that need clairification. -dotnet_diagnostic.CA1508.severity = warning # Avoid dead conditional code -dotnet_diagnostic.CA1700.severity = error # Do not name enum values 'Reserved' -dotnet_diagnostic.CA1707.severity = warning # Identifiers should not contain underscores -dotnet_diagnostic.CA1708.severity = error # Identifiers should differ by more than case -dotnet_diagnostic.CA1710.severity = error # Identifiers should have correct suffix -dotnet_diagnostic.CA1712.severity = error # Do not prefix enum values with type name -dotnet_diagnostic.CA1720.severity = error # Identifiers should not contain type names -dotnet_diagnostic.CA1802.severity = error # Use Literals Where Appropriate -dotnet_diagnostic.CA1805.severity = warning # Do not initialize unnecessarily -dotnet_diagnostic.CA1810.severity = error # Initialize reference type static fields inline -dotnet_diagnostic.CA1816.severity = error # Call GC.SuppressFinalize correctly -dotnet_diagnostic.CA1821.severity = error # Remove empty finalizers -dotnet_diagnostic.CA1822.severity = warning # Mark members as static -dotnet_diagnostic.CA1823.severity = warning # Avoid unused private fields -dotnet_diagnostic.CA1826.severity = warning # Use property instead of Linq Enumerable method -dotnet_diagnostic.CA1827.severity = warning # Do not use Count()/LongCount() when Any() can be used -dotnet_diagnostic.CA1849.severity = warning # Call async methods when in an async method -dotnet_diagnostic.CA2000.severity = error # Dispose objects before losing scope -dotnet_diagnostic.CA2213.severity = error # Disposable fields should be disposed -dotnet_diagnostic.CA2215.severity = error # Dispose methods should call base class dispose -dotnet_diagnostic.CA2216.severity = warning # Disposable types should declare finalizer - - -# ***************************************** -# ** Style Cop Analyzer Diagnostic Rules ** -# ***************************************** -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/DOCUMENTATION.md -# Note: The VS IDE generates these by placing the rule type name on the previous line, instead of on the same line. -[*.{cs,vb}] - -dotnet_diagnostic.SA0002.severity = error - -dotnet_diagnostic.SA1000.severity = error - -dotnet_diagnostic.SA1001.severity = error - -dotnet_diagnostic.SA1002.severity = error - -dotnet_diagnostic.SA1003.severity = error - -dotnet_diagnostic.SA1004.severity = error - -# SingleLineCommentsMustBeginWithSingleSpace -dotnet_diagnostic.SA1005.severity = warning - -dotnet_diagnostic.SA1006.severity = error - -dotnet_diagnostic.SA1007.severity = error - -dotnet_diagnostic.SA1008.severity = error - -dotnet_diagnostic.SA1009.severity = error - -dotnet_diagnostic.SA1010.severity = error - -dotnet_diagnostic.SA1100.severity = error - -dotnet_diagnostic.SA1102.severity = error - -dotnet_diagnostic.SA1103.severity = error - -dotnet_diagnostic.SA1104.severity = error - -dotnet_diagnostic.SA1105.severity = error - -dotnet_diagnostic.SA1107.severity = error - -# OpeningParenthesisMustBeOnDeclarationLine -dotnet_diagnostic.SA1110.severity = error - -# ClosingParenthesisMustBeOnLineOfLastParameter -dotnet_diagnostic.SA1111.severity = error - -# ClosingParenthesisMustBeOnLineOfOpeningParenthesis -dotnet_diagnostic.SA1112.severity = error - -# CommaMustBeOnSameLineAsPreviousParameter -dotnet_diagnostic.SA1113.severity = error - -# ParameterListMustFollowDeclaration -dotnet_diagnostic.SA1114.severity = error - -# ParameterMustFollowComma -dotnet_diagnostic.SA1115.severity = error - -# SplitParametersMustStartOnLineAfterDeclaration -dotnet_diagnostic.SA1116.severity = error - -# ParametersMustBeOnSameLineOrSeparateLines -dotnet_diagnostic.SA1117.severity = error - -# GenericTypeConstraintsMustBeOnOwnLine -dotnet_diagnostic.SA1120.severity = error - -# DoNotPlaceRegionsWithinElements -dotnet_diagnostic.SA1123.severity = error - -# UseShorthandForNullableTypes -dotnet_diagnostic.SA1125.severity = error - -# GenericTypeConstraintsMustBeOnOwnLine -dotnet_diagnostic.SA1127.severity = error - -# ConstructorInitializerMustBeOnOwnLine -dotnet_diagnostic.SA1128.severity = error - -# DoNotUseDefaultValueTypeConstructor -dotnet_diagnostic.SA1129.severity = error - -# UseLambdaSyntax -dotnet_diagnostic.SA1130.severity = error - -# UseReadableConditions -dotnet_diagnostic.SA1131.severity = error - -# DoNotCombineFields -dotnet_diagnostic.SA1132.severity = error - -# DoNotCombineAttributes -dotnet_diagnostic.SA1133.severity = error - -# AttributesMustNotShareLine -dotnet_diagnostic.SA1134.severity = error - -# UsingDirectivesMustBeQualified -dotnet_diagnostic.SA1135.severity = error - -# EnumValuesShouldBeOnSeparateLines -dotnet_diagnostic.SA1136.severity = error - -# UseLiteralsSuffixNotationInsteadOfCasting -dotnet_diagnostic.SA1139.severity = error - -# InterfaceNamesMustBeginWithI -dotnet_diagnostic.SA1302.severity = error - -# VariableNamesMustNotBePrefixed -dotnet_diagnostic.SA1308.severity = error - -# ParameterNamesMustBeginWithLowerCaseLetter -dotnet_diagnostic.SA1313.severity = error - -# End XM Documentation Warnings -# File/Class Naming Guidelines: These conflict with our function files mostly -dotnet_diagnostic.SA1402.severity = none - -# SYSLIB1045: Convert to 'GeneratedRegexAttribute'. -dotnet_diagnostic.SYSLIB1045.severity = none # Seems to be an IDE only rule atm - -dotnet_diagnostic.SX1309.severity = none +[*.{csproj,props,targets}] +tab_width = 2 +indent_size = 2 +trim_trailing_whitespace = false +# TODO: Add baseline rules for code files, e.g. file headers, ordering usings, etc. # ******************************** # ** Additional unordered rules ** # ******************************** # While may be empty, ensures that VS IDE can add additional rules after our categorized ones above. [*.{cs,vb}] + +### Disable warnings related to missing xml comments +# CS1573: Parameter has no matching param tag in the XML comment (but other parameters do) +dotnet_diagnostic.CS1573.severity = none + +# Disable IDE0005 (Unnecessary using directive) warning - so we don't have to enable GenerateDocumentationFile for all projects. +dotnet_diagnostic.IDE0005.severity = none diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b827a760..db523159 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,6 +18,11 @@ jobs: env: DOTNET_NOLOGO: true + # Pre-define global MSBuild properties + Configuration: Debug + # Ensure versioning is forced to a non-production version for CI builds + VersionSuffix: ${{ github.event_name == 'pull_request' && 'pr' || 'ci' }} + steps: - uses: actions/checkout@v4 with: @@ -25,23 +30,22 @@ jobs: - uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x + # dotnet-version: '8.0.x' + global-json-file: 'global.json' - run: dotnet --info - - name: Build (win) - run: ./build ci - shell: cmd - if: ${{ runner.os == 'Windows' }} + - name: Build PASopa.sln + run: dotnet build src/PASopa.sln - ## Only difference here is not forcing cmd - - name: Build (linux based) - run: ./build ci - if: ${{ runner.os != 'Windows' }} + # Pack so we can validate there are no warnings/errors + # We must explicitly set the configuration parameter otherwise it defaults to Release + - name: Pack - Formulas.Tools + run: dotnet pack --no-build -c ${{ env.Configuration }} src/PAModel/Microsoft.PowerPlatform.Formulas.Tools.csproj - - name: Test - Persistence - run: dotnet bin/Debug/Persistence.Tests/Persistence.Tests.dll + - name: Pack - Persistence + run: dotnet pack --no-build -c ${{ env.Configuration }} src/Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.csproj - - name: Test - PAModel - run: dotnet bin/Debug/PAModelTests/PAModelTests.dll + # Run tests + - name: Test - PASopa.sln + run: dotnet test --no-build src/PASopa.sln diff --git a/.version/PipelineAssemblyInfo.cs b/.version/PipelineAssemblyInfo.cs deleted file mode 100644 index f5cc4c28..00000000 --- a/.version/PipelineAssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// This is pipeline generated file. Do not modify. This will be replaced with the actual versions in the actual Pipeline. -using System.Reflection; -[assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.0.0.0")] -[assembly: AssemblyInformationalVersion("0.0.0.0-dev-00000000")] \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..ad5c1759 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,48 @@ + + + + + + $(MSBuildThisFileDirectory) + $([MSBuild]::NormalizeDirectory($(RepoRoot), 'src')) + $([MSBuild]::NormalizeDirectory($(RepoRoot), 'bin')) + $([MSBuild]::NormalizeDirectory($(RepoRoot), 'obj')) + + + $([MSBuild]::NormalizePath($(RepoRoot), '.version', 'PipelineAssemblyInfo.cs')) + + + + + Debug + + + $(RepoRoot)35MSSharedLib1024.snk + + + + $([MSBuild]::NormalizeDirectory($(RepoRoot), 'pkg')) + + + + + + + true + true + true + true + + + + + false + false + + diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 00000000..0afa1728 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a73d3319..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,189 +0,0 @@ -# Build Pipeline for signing PowerPlatform.Formulas.Tools - -trigger: - - master - -pr: - - master - -pool: - vmImage: 'windows-latest' - -variables: - Codeql.Enabled: true -# - group: 'Nuget And PSGallery Publishing Data' - -jobs: -- job: 'Build_PowerPlatform_Formulas_Tools' - displayName: 'Build PowerPlatform.Formulas.Tools Solution' - - strategy: - matrix: - Debug: - BuildConfiguration: 'Debug' - Release: - BuildConfiguration: 'Release' - - steps: - - task: UseDotNet@2 - displayName: 'Use dotnet SDK 8.0' - inputs: - version: 8.0.x - installationPath: '$(Agent.ToolsDirectory)/dotnet' - - - task: UseDotNet@2 - displayName: 'Use dotnet SDK 7.0' - inputs: - version: 7.0.x - installationPath: '$(Agent.ToolsDirectory)/dotnet' - - - task: UseDotNet@2 - displayName: 'Use dotnet SDK 6.0' - inputs: - version: 6.0.x - installationPath: '$(Agent.ToolsDirectory)/dotnet' - - - task: CodeQL3000Init@0 - - - task: DotNetCoreCLI@2 - displayName: 'Build' - inputs: - command: 'run' - projects: '$(Build.SourcesDirectory)/targets/targets.csproj' - arguments: '-- ci -c $(BuildConfiguration)' - - - task: DotNetCoreCLI@2 - displayName: 'Test Persistence' - inputs: - command: 'custom' - custom: '$(Build.SourcesDirectory)/bin/$(BuildConfiguration)/Persistence.Tests/Persistence.Tests.dll' - - - task: DotNetCoreCLI@2 - displayName: 'Test PAModel' - inputs: - command: 'custom' - custom: '$(Build.SourcesDirectory)/bin/$(BuildConfiguration)/PAModelTests/PAModelTests.dll' - - - task: CodeQL3000Finalize@0 - - - task: PublishTestResults@2 - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '**/*-*.trx' - searchFolder: '$(Build.SourcesDirectory)/' - mergeTestResults: true - failTaskOnFailedTests: true - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3 - displayName: 'Sign assemblies' - inputs: - ConnectedServiceName: 'ESRPCodeSigningConnection' - FolderPath: '$(Build.SourcesDirectory)/bin/$(BuildConfiguration)' - Pattern: | - /PAModel/Microsoft.PowerPlatform.Formulas.Tools.dll - /Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.dll - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-233863-SN", - "operationSetCode": "StrongNameSign", - "parameters": [ ], - "toolName": "sign", - "toolVersion": "1.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "Microsoft" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://www.microsoft.com" - }, - { - "parameterName": "Append", - "parameterValue": "/as" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd \"SHA256\"" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "sign", - "toolVersion": "1.0" - } - ] - ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v1' - - - task: DotNetCoreCLI@2 - displayName: 'Pack' - inputs: - command: 'run' - projects: '$(Build.SourcesDirectory)/targets/targets.csproj' - arguments: '-- pack -c $(BuildConfiguration) -p .\src\PAModel\Microsoft.PowerPlatform.Formulas.Tools.csproj .\src\Persistence\Microsoft.PowerPlatform.PowerApps.Persistence.csproj' - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3 - displayName: 'ESRP sign nuget packages' - inputs: - ConnectedServiceName: ESRPCodeSigningConnection - FolderPath: '$(Build.SourcesDirectory)/pkg/PackResult' - Pattern: '*.nupkg' - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "keyCode": "CP-401405", - "operationSetCode": "NuGetSign", - "parameters": [], - "toolName": "sign", - "toolVersion": "1.0" - }, - { - "keyCode": "CP-401405", - "operationSetCode": "NuGetVerify", - "parameters": [], - "toolName": "sign", - "toolVersion": "1.0" - } - ] - ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v1' - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'SBOM Task' - inputs: - BuildDropPath: '$(Build.SourcesDirectory)/bin' - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Binaries' - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/bin/$(BuildConfiguration)' - ArtifactName: 'Binaries' - publishLocation: 'Container' - condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release')) - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Packages' - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/pkg/PackResult' - ArtifactName: 'Packages' - publishLocation: 'Container' - condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release')) - - - task: tagBuildOrRelease@0 - inputs: - type: 'Build' - tags: 'deployable' - condition: eq(variables['PublicRelease'], 'true') diff --git a/build b/build deleted file mode 100755 index 09629a48..00000000 --- a/build +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -dotnet run --project "./targets/targets.csproj" -- "$@" diff --git a/build.cmd b/build.cmd deleted file mode 100644 index c994e016..00000000 --- a/build.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@pushd %~dp0 -@dotnet run --project "./targets/targets.csproj" -- %* -@popd diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c03d43bb..ac4205b3 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,36 +1,59 @@ - + + + + + $([MSBuild]::MakeRelative($(SrcPath), $(MSBuildProjectDirectory))) + + + $([MSBuild]::NormalizeDirectory($(RepoBinRoot), $(RelativeProjectPath))) + + + + $([MSBuild]::NormalizeDirectory($(RepoIntermediateRoot), $(RelativeProjectPath))) + + + + + Microsoft + crmsdk,Microsoft + © Microsoft Corporation. All rights reserved. + https://github.com/microsoft/PowerApps-Tooling + https://github.com/microsoft/PowerApps-Tooling + MIT + true + - false - $(TargetFrameworkVersion) True - 1591 + + + $(NoWarn);1591 + + SHA256 - - - true - true - true - true + + 0.1.0 + dev - - - false - false + + + false + false + false - - - Properties\PipelineAssemblyInfo.cs - + + @@ -38,56 +61,4 @@ - - - - Debug - - - - - true - full - TRACE;DEBUG - - - - - pdbonly - true - TRACE - - - - $(MSBuildThisFileDirectory) - $([System.IO.Path]::GetFullPath('$(SourcePath)..\bin')) - $([System.IO.Path]::GetFullPath('$(SourcePath)..\obj'))\ - $([MSBuild]::MakeRelative($(SourcePath), $(MSBuildProjectDirectory))) - - $(BinPath)\$(Configuration)\ - - - $(RootOutputPath)$(RelativeProjectPath)\ - - - $(ProjectOutputPath) - $(OutputPath) - - - $(IntermediatePath)$(Configuration)\ - - - $(RootIntermediateOutputPath)$(RelativeProjectPath)\ - $(ProjectIntermediateOutputPath) - $(IntermediatePath)NugetRestore\$(RelativeProjectPath) - - - $([System.IO.Path]::GetFullPath('$(SourcePath)..\pkg'))\ - - - - $(PackagesPath) - true - $(BaseIntermediateOutputPath) - diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 00000000..4d7701e9 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,29 @@ + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/PAModel/AssemblyInfo.cs b/src/PAModel/AssemblyInfo.cs deleted file mode 100644 index 1845b5ec..00000000 --- a/src/PAModel/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// In SDK-style projects such as this one, several assembly attributes that were historically -// defined in this file are now automatically added during build and populated with -// values defined in project properties. For details of which attributes are included -// and how to customize this process see: https://aka.ms/assembly-info-properties - - -// Setting ComVisible to false makes the types in this assembly not visible to COM -// components. If you need to access a type in this assembly from COM, set the ComVisible -// attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM. - -[assembly: Guid("269d7930-7dcd-4b27-952b-6757c868db5f")] - -[assembly: InternalsVisibleTo("PAModelTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -[assembly: InternalsVisibleTo("PASopa, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/PAModel/Microsoft.PowerPlatform.Formulas.Tools.csproj b/src/PAModel/Microsoft.PowerPlatform.Formulas.Tools.csproj index 283bf95a..09b991ab 100644 --- a/src/PAModel/Microsoft.PowerPlatform.Formulas.Tools.csproj +++ b/src/PAModel/Microsoft.PowerPlatform.Formulas.Tools.csproj @@ -1,28 +1,16 @@ - netstandard2.0;net8.0 12 - Microsoft.PowerPlatform.Formulas.Tools - Microsoft.PowerPlatform.Formulas.Tools - - - - - - $(OutDir)\$(TargetFramework) + true + true + + true - - - Microsoft.PowerPlatform.Formulas.Tools - Microsoft - crmsdk,Microsoft + PowerPlatform Canvas App Tools - https://github.com/microsoft/PowerApps-Tooling - MIT - true Preview Release: This takes a Canvas App (.msapp file) and converts to and from text files that can be checked into source control. Notice: @@ -32,15 +20,20 @@ See https://github.com/microsoft/PowerApps-Tooling/releases for the latest release notes. - © Microsoft Corporation. All rights reserved. - true - ../../35MSSharedLib1024.snk - true - - true - $(NoWarn);NU1601 + + + + + + + + + + + + @@ -51,11 +44,4 @@ Build/BuildVer.json - - - - - - - diff --git a/src/PAModel/packages.lock.json b/src/PAModel/packages.lock.json index e784c2c1..39830097 100644 --- a/src/PAModel/packages.lock.json +++ b/src/PAModel/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { "NETStandard.Library": { @@ -13,9 +13,9 @@ }, "Newtonsoft.Json": { "type": "Direct", - "requested": "[13.0.1, )", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" }, "System.Text.Encodings.Web": { "type": "Direct", @@ -98,9 +98,9 @@ "net8.0": { "Newtonsoft.Json": { "type": "Direct", - "requested": "[13.0.1, )", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" }, "System.Text.Encodings.Web": { "type": "Direct", diff --git a/src/PAModelTests/PAModelTests.csproj b/src/PAModelTests/PAModelTests.csproj index e060d228..bde38195 100644 --- a/src/PAModelTests/PAModelTests.csproj +++ b/src/PAModelTests/PAModelTests.csproj @@ -1,21 +1,22 @@ + net8.0 + Exe false + true - ../../35MSSharedLib1024.snk true true - Exe - - - - - - + + + + + + diff --git a/src/PASopa/PASopa.csproj b/src/PASopa/PASopa.csproj index 144cb4da..7e4a7f81 100644 --- a/src/PASopa/PASopa.csproj +++ b/src/PASopa/PASopa.csproj @@ -1,9 +1,10 @@ + net8.0 Exe + true - ../../35MSSharedLib1024.snk true diff --git a/src/Persistence.Tests/Persistence.Tests.csproj b/src/Persistence.Tests/Persistence.Tests.csproj index 493b649c..64edcbe9 100644 --- a/src/Persistence.Tests/Persistence.Tests.csproj +++ b/src/Persistence.Tests/Persistence.Tests.csproj @@ -1,7 +1,6 @@  - - $(TargetFrameworkVersion) + net8.0 enable enable true @@ -10,7 +9,6 @@ true true - ../../35MSSharedLib1024.snk true @@ -28,12 +26,12 @@ - - - - - - + + + + + + diff --git a/src/Persistence/AssemblyInfo.cs b/src/Persistence/AssemblyInfo.cs deleted file mode 100644 index 4b575c19..00000000 --- a/src/Persistence/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Persistence.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.csproj b/src/Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.csproj index 1ea78189..3a73adb0 100644 --- a/src/Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.csproj +++ b/src/Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.csproj @@ -1,21 +1,16 @@ - $(TargetFrameworkVersion) + net8.0 enable enable - SHA256 + + true + true - - - Microsoft.PowerPlatform.PowerApps.Persistence - Microsoft - crmsdk,Microsoft + Microsoft Power Platform Canvas App Persistence Library - https://github.com/microsoft/PowerApps-Tooling - MIT - true Preview Release Notice: @@ -26,19 +21,15 @@ See https://github.com/microsoft/PowerApps-Tooling/releases for the latest release notes. - © Microsoft Corporation. All rights reserved. - true - ../../35MSSharedLib1024.snk - true - - true - $(NoWarn);NU1601 - - - + + + + + + diff --git a/src/Persistence/PaYaml/Serialization/NamedObjectYamlConverter.cs b/src/Persistence/PaYaml/Serialization/NamedObjectYamlConverter.cs index 1124aa86..9d960103 100644 --- a/src/Persistence/PaYaml/Serialization/NamedObjectYamlConverter.cs +++ b/src/Persistence/PaYaml/Serialization/NamedObjectYamlConverter.cs @@ -8,8 +8,7 @@ namespace Microsoft.PowerPlatform.PowerApps.Persistence.PaYaml.Serialization; -// BUG 27469059: Internal classes not accessible to test project. InternalsVisibleTo attribute added to csproj doesn't get emitted because GenerateAssemblyInfo is false. -public class NamedObjectYamlConverter : YamlConverter> +internal class NamedObjectYamlConverter : YamlConverter> where TValue : notnull { public NamedObjectYamlConverter(PaYamlSerializationContext context) diff --git a/src/Persistence/PaYaml/Serialization/PFxExpressionYamlConverter.cs b/src/Persistence/PaYaml/Serialization/PFxExpressionYamlConverter.cs index 58aacb0c..515f39d1 100644 --- a/src/Persistence/PaYaml/Serialization/PFxExpressionYamlConverter.cs +++ b/src/Persistence/PaYaml/Serialization/PFxExpressionYamlConverter.cs @@ -8,8 +8,7 @@ namespace Microsoft.PowerPlatform.PowerApps.Persistence.PaYaml.Serialization; -// BUG 27469059: Internal classes not accessible to test project. InternalsVisibleTo attribute added to csproj doesn't get emitted because GenerateAssemblyInfo is false. -public class PFxExpressionYamlConverter : IYamlTypeConverter +internal class PFxExpressionYamlConverter : IYamlTypeConverter { private static readonly char[] LineTerminators = ['\r', '\n', '\x85', '\x2028', '\x2029']; diff --git a/src/Persistence/PaYaml/Serialization/PaYamlSerializationContext.cs b/src/Persistence/PaYaml/Serialization/PaYamlSerializationContext.cs index f33ef7dd..1e2db7ef 100644 --- a/src/Persistence/PaYaml/Serialization/PaYamlSerializationContext.cs +++ b/src/Persistence/PaYaml/Serialization/PaYamlSerializationContext.cs @@ -19,11 +19,9 @@ public class PaYamlSerializationContext(PaYamlSerializerOptions options) : IDisp /// public PaYamlSerializerOptions Options { get; } = options ?? throw new ArgumentNullException(nameof(options)); - // BUG 27469059: Internal classes not accessible to test project. InternalsVisibleTo attribute added to csproj doesn't get emitted because GenerateAssemblyInfo is false. - public IValueSerializer? ValueSerializer { get; set; } + internal IValueSerializer? ValueSerializer { get; set; } - // BUG 27469059: Internal classes not accessible to test project. InternalsVisibleTo attribute added to csproj doesn't get emitted because GenerateAssemblyInfo is false. - public IValueDeserializer? ValueDeserializer { get; set; } + internal IValueDeserializer? ValueDeserializer { get; set; } public ObjectDeserializer CreateObjectDeserializer(IParser parser) { @@ -39,8 +37,7 @@ public ObjectSerializer CreateObjectSerializer(IEmitter emitter) return (v, t) => valueSerializer.SerializeValue(emitter, v, t); } - // BUG 27469059: Internal classes not accessible to test project. InternalsVisibleTo attribute added to csproj doesn't get emitted because GenerateAssemblyInfo is false. - public void OnDeserialization() + internal void OnDeserialization() { _serializerState.OnDeserialization(); } @@ -83,12 +80,11 @@ private void AddTypeConverters(BuilderSkeleton builder) builder.WithTypeConverter(new NamedObjectYamlConverter(this)); } - // BUG 27469059: Internal classes not accessible to test project. InternalsVisibleTo attribute added to csproj doesn't get emitted because GenerateAssemblyInfo is false. /// /// Applies the formatting options on this instance to a serializer. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "TESTONLY")] - public void TESTONLY_ApplySerializerFormatting(SerializerBuilder builder) + internal void TESTONLY_ApplySerializerFormatting(SerializerBuilder builder) { ApplySerializerFormatting(builder); } diff --git a/src/Versions.props b/src/Versions.props deleted file mode 100644 index 1b4a289b..00000000 --- a/src/Versions.props +++ /dev/null @@ -1,16 +0,0 @@ - - - net8.0 - 15.1.6 - 17.7.1 - 3.2.2 - 3.2.2 - 3.2.2 - 6.0.0 - 6.12.0 - 4.3.0 - 8.0.0 - - 4.16.0 - - diff --git a/src/YamlValidator.Tests/YamlValidator.Tests.csproj b/src/YamlValidator.Tests/YamlValidator.Tests.csproj index 5cab08d7..39f20eee 100644 --- a/src/YamlValidator.Tests/YamlValidator.Tests.csproj +++ b/src/YamlValidator.Tests/YamlValidator.Tests.csproj @@ -10,7 +10,6 @@ true true - ../../35MSSharedLib1024.snk true @@ -21,9 +20,9 @@ - - - + + + diff --git a/src/YamlValidator/Microsoft.PowerPlatform.PowerApps.YamlValidator.csproj b/src/YamlValidator/Microsoft.PowerPlatform.PowerApps.YamlValidator.csproj index 0d13a6d5..17a85fcf 100644 --- a/src/YamlValidator/Microsoft.PowerPlatform.PowerApps.YamlValidator.csproj +++ b/src/YamlValidator/Microsoft.PowerPlatform.PowerApps.YamlValidator.csproj @@ -5,29 +5,21 @@ Latest enable enable + true - ../../35MSSharedLib1024.snk true - - - - - $(OutDir)\$(TargetFramework) - - - - - - - - + + + + + diff --git a/targets/Program.cs b/targets/Program.cs deleted file mode 100644 index 53052b38..00000000 --- a/targets/Program.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text.Json; -using CommandLine; -using SimpleExec; -using static Bullseye.Targets; -using static SimpleExec.Command; - -namespace targets -{ - internal sealed class Options - { - [Value(0, MetaName = "target", HelpText = "build target to run; see available with: '--list", Default = "rebuild")] - public string Target { get; set; } - - [Option('c', "configuration", Required = false, Default = "Debug")] - public string Configuration { get; set; } - - [Option('p', "projects", Required = false)] - public IEnumerable Projects { get; set; } - } - - public sealed class Program - { - static Options options; - - static void Main(string[] args) - { - - string RootDir = "", gitHash = ""; - bool gitExists = true; -#pragma warning disable CA1031 // Do not catch general exception types - try - { - RootDir = Read("git", "rev-parse --show-toplevel", noEcho: true).Trim(); - gitHash = Read("git", "rev-parse HEAD", noEcho: true).Trim(); - } - catch - { - RootDir = Directory.GetCurrentDirectory(); - Console.WriteLine("Unable to find root directory using git, assuming this script is being run from root = " + RootDir); - gitExists = false; - } -#pragma warning restore CA1031 // Do not catch general exception types - - string BinDir = Path.Combine(RootDir, "bin"); - string ObjDir = Path.Combine(RootDir, "obj"); - string PkgDir = Path.Combine(RootDir, "pkg"); - string SrcDir = Path.Combine(RootDir, "src"); - - string LogDir = Path.Combine(ObjDir, "logs"); - - string PAModelDir = Path.Combine(SrcDir, "PAModel"); - var solution = Path.Combine(SrcDir, "PASopa.sln"); - - var defaultPackProject = Path.Combine(PAModelDir, "Microsoft.PowerPlatform.Formulas.Tools.csproj"); - - Target("squeaky-clean", - () => - { - CleanDirectory(BinDir); - CleanDirectory(ObjDir); - CleanDirectory(PkgDir); - }); - - Target("clean", - () => RunDotnet("clean", $"{EscapePath(solution)} --configuration {options.Configuration}", gitExists, LogDir)); - - Target("restore", - DependsOn("clean"), - () => RunDotnet("restore", $"{EscapePath(solution)}", gitExists, LogDir)); - - Target("build", - () => - { - if (gitExists) - CreateBuildHashFile(ObjDir, gitHash); - RunDotnet("build", $"{EscapePath(solution)} --configuration {options.Configuration} --no-restore", gitExists, LogDir); - }); - - Target("rebuild", - DependsOn("restore", "build")); - - Target("pack", - () => - { - var projects = (options.Projects.Any()) ? options.Projects : new[] { defaultPackProject }; - - foreach (var project in projects) - RunDotnet("pack", $"{EscapePath(project)} --configuration {options.Configuration} --output {EscapePath(Path.Combine(PkgDir, "PackResult"))} --no-build -p:Packing=true", gitExists, LogDir); - }); - - Target("ci", - DependsOn("squeaky-clean", "rebuild")); - - Parser.Default.ParseArguments(args) - .WithParsed(o => - { - options = o; - RunTargetsAndExit(new[] { options.Target }, - logPrefix: options.Target, - messageOnly: ex => ex is NonZeroExitCodeException); - }) - .WithNotParsed(errs => - { - RunTargetsAndExit(args); - }); - } - - static void RunDotnet(string verb, string verbArgs, bool gitExists, string LogDir) - { - var gitDef = ""; - if (gitExists) - gitDef = "-p:GitExists=true"; - var optionsLogPath = Path.Combine(LogDir, $"{verb}-{options.Configuration}"); - var logSettings = $"/clp:verbosity=minimal /flp:Verbosity=normal;LogFile={EscapePath(optionsLogPath + ".log")} /flp3:PerformanceSummary;Verbosity=diag;LogFile={EscapePath(optionsLogPath + ".diagnostics.log")}"; - Run("dotnet", $"{verb} {verbArgs} {logSettings} {gitDef} /nologo"); - } - - static void CreateBuildHashFile(string objDir, string gitHash) - { - var filePath = Path.Combine(objDir, "buildver.json"); - var file = new System.IO.FileInfo(filePath); - file.Directory.Create(); - - var jsonContents = new - { - CommitHash = gitHash, -#if !ADOBuild - IsLocalBuild = true -#endif - }; - var text = JsonSerializer.Serialize(jsonContents); - File.WriteAllText(filePath, text); - } - - static void CleanDirectory(string directoryPath) - { - directoryPath = Path.GetFullPath(directoryPath); - Console.WriteLine($"Cleaning directory: {directoryPath}"); - try - { - if (Directory.Exists(directoryPath)) - { - Directory.Delete(directoryPath, recursive: true); - } - } - catch (AccessViolationException) { /* swallow */ } - } - - static string EscapePath(string path) - { - return $"\"{path}\""; - } - } -} diff --git a/targets/targets.csproj b/targets/targets.csproj deleted file mode 100644 index 5859a03f..00000000 --- a/targets/targets.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Exe - net8.0 - - - - $(DefineConstants);ADOBuild - - - - - - - - - - diff --git a/targets/targets.sln b/targets/targets.sln deleted file mode 100644 index cbdaa854..00000000 --- a/targets/targets.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30503.244 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "targets", "targets.csproj", "{A2D411CF-908C-43FD-B6E7-90238C452639}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A2D411CF-908C-43FD-B6E7-90238C452639}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2D411CF-908C-43FD-B6E7-90238C452639}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2D411CF-908C-43FD-B6E7-90238C452639}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2D411CF-908C-43FD-B6E7-90238C452639}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {28FF12F4-A5BD-4CA9-A853-FAF629D35ABE} - EndGlobalSection -EndGlobal