Skip to content

Project configuration rules enhancements #58

@ewilde

Description

@ewilde

I'm starting on writing some conventions and wanted to share some thoughts

Description

In our team we have conventions on how to configure csproj files, described below

Global section

Property Value
Platform AnyCPU

Debug configuration sections

Property Value
DebugType Full
Prefer32bit false
Optimize false
TreatWarningsAsErrors true
Platform Can't be specified (must only appear in global)

Release configuration sections

Property Value
DebugType pdbonly
Prefer32bit false
Optimize true
TreatWarningsAsErrors true
Platform Can't be specified (must only appear in global)

I started to create implementations of IConvention<ProjectFileItems> to cover these scenarios.

  • ReleaseConfigurationDebugTypeIsPdbOnly
  • AllConfigurationsPrefer32bitIsFalse
  • ReleaseConfigurationOptimizeIsFalse
  • ....
  • DebugConfigurationDebugTypeIsFull

But this would lead to a lot of types and boiler plate, so I'm thinking of going with 1 types to cover configuration:

  • ConfigurationHasSpecificValue(ConfigurationType.Release, "Optimize", "true")
  • ConfigurationHasSpecificValue(ConfigurationType.All, "Platform", "AnyCPU")
  • ConfigurationHasSpecificValue(ConfigurationType.Debug, "Optimize", "false")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions