BMuuN / vsts-assemblyinfo-task

Assembly Info is an extension for Azure DevOps that populates assembly information metadata from a build pipeline.
https://marketplace.visualstudio.com/items?itemName=bleddynrichards.Assembly-Info-Task
MIT License
44 stars 25 forks source link

Multiline AssemblyDescription with Description attributes error. #309

Closed seawerst closed 1 year ago

seawerst commented 1 year ago

Using the YAML definition for this task allow to use multiline description but the AssemblyInfo output is not valid

    - task: Assembly-Info-NetFramework@3
      inputs:
        Path: '$(Build.SourcesDirectory)'
        FileNames: |
          **\AssemblyInfo.cs
          **\AssemblyInfo.vb
        InsertAttributes: true
        FileEncoding: 'auto'
        WriteBOM: false
        Title: 'MyTool'
        Product: 'MyTool v$(baseversion)' 
        Description: |
          version: $(version)
          build: $(Build.DefinitionName), version: $(Build.DefinitionVersion), reason: $(Build.Reason)
          Queue by: $(Build.QueuedBy), id: $(Build.QueuedById), email $(Build.QueuedByEmail)
          TeamProject: $(System.TeamProject)
          Repo: $(Build.Repository.Name)
          Source : $(Build.Repository.Uri)
          Branch: $(Build.SourceBranch)
          Commit: $(Build.SourceVersion)
          Last commit message: $(Build.SourceVersionMessage)
        VersionNumber: '$(dotnetVersionNumber)'
        FileVersionNumber: '$(baseversion)
[assembly: AssemblyTitle("MyTool")]
[assembly: AssemblyDescription("version: 1.0.20230228.10
build: xxxxx, version: 1, reason: Manual
Queue by: xxxxxxxxxxxxxxxxxxxxx
TeamProject: xxxxx
Repo: xxxxxxxxx
Branch: refs/heads/Feature/xxxxxxxxxxx
Commit: 389de44dae737da7d266453607231852f5b4d4d1
Last commit message: My message")]
[assembly: AssemblyConfiguration("debug")]

The assembly attribute should have been like this, note the @ for multi-line string.

[assembly: AssemblyDescription(@"version: 1.0.20230228.10
build: xxxxx, version: 1, reason: Manual
..
..
..
Commit: 389de44dae737da7d266453607231852f5b4d4d1")]
BMuuN commented 1 year ago

A fix for this will be available in the upcoming release v3.2.3