For my custom control I need to add the following Attribute to the AssemblyInfo.cs:
using System.Windows;
[assembly: ThemeInfo(ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]
Is it somehow possible with the available options in FAKE or does it need another attribute implementation?
Solution: As mentioned by AlexM UpdateAttribute is the key where the ThemeAttribute is already in the AssemblyInfo. Here the chance final code for reference by using the defaults of ProjectScaffold:
Target "AssemblyInfo" (fun _ ->
let getAssemblyInfoAttributes projectName =
[ Attribute.Title (projectName)
Attribute.Product project
Attribute.Description summary
Attribute.Version release.AssemblyVersion
Attribute.FileVersion release.AssemblyVersion
]
let getProjectDetails projectPath =
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
( projectPath,
projectName,
System.IO.Path.GetDirectoryName(projectPath),
(getAssemblyInfoAttributes projectName)
)
!! "src/**/*.??proj"
|> Seq.map getProjectDetails
|> Seq.iter (fun (projFileName, projectName, folderName, attributes) ->
match projFileName with
| Fsproj -> UpdateAttributes (folderName </> "AssemblyInfo.fs") attributes
| Csproj -> UpdateAttributes ((folderName </> "Properties") </> "AssemblyInfo.cs") attributes
| Vbproj -> UpdateAttributes ((folderName </> "My Project") </> "AssemblyInfo.vb") attributes
| Shproj -> ()
)
)