|
1 | 1 | # Generating AssemblyInfo files
|
2 | 2 |
|
3 |
| -**Note: This documentation is for FAKE.exe before version 5 (or the non-netcore version). The documentation needs te be updated, please help! ** |
| 3 | +**Note: This documentation is for FAKE.exe after version 5. The documentation for previous version (<=4) can be found [here](legacy-assemblyinfo.html)! ** |
4 | 4 |
|
5 | 5 | In this article the AssemblyInfo task is used in order to set specific version information to .NET assemblies.
|
6 | 6 |
|
7 | 7 | If you succeeded with the [Getting Started tutorial](gettingstarted.html), then you just have to modify your *BuildApp* target to the following:
|
8 | 8 |
|
9 |
| - open Fake.AssemblyInfoFile |
10 |
| - |
11 |
| - Target "BuildApp" (fun _ -> |
12 |
| - CreateCSharpAssemblyInfo "./src/app/Calculator/Properties/AssemblyInfo.cs" |
13 |
| - [Attribute.Title "Calculator Command line tool" |
14 |
| - Attribute.Description "Sample project for FAKE - F# MAKE" |
15 |
| - Attribute.Guid "A539B42C-CB9F-4a23-8E57-AF4E7CEE5BAA" |
16 |
| - Attribute.Product "Calculator" |
17 |
| - Attribute.Version version |
18 |
| - Attribute.FileVersion version] |
19 |
| - |
20 |
| - CreateCSharpAssemblyInfo "./src/app/CalculatorLib/Properties/AssemblyInfo.cs" |
21 |
| - [Attribute.Title "Calculator library" |
22 |
| - Attribute.Description "Sample project for FAKE - F# MAKE" |
23 |
| - Attribute.Guid "EE5621DB-B86B-44eb-987F-9C94BCC98441" |
24 |
| - Attribute.Product "Calculator" |
25 |
| - Attribute.Version version |
26 |
| - Attribute.FileVersion version] |
27 |
| - |
28 |
| - MSBuildRelease buildDir "Build" appReferences |
| 9 | + open Fake.Core |
| 10 | + |
| 11 | + Target.Create "BuildApp" (fun _ -> |
| 12 | + AssemblyInfoFile.CreateCSharp "./src/app/Calculator/Properties/AssemblyInfo.cs" |
| 13 | + [AssemblyInfo.Title "Calculator Command line tool" |
| 14 | + AssemblyInfo.Description "Sample project for FAKE - F# MAKE" |
| 15 | + AssemblyInfo.Guid "A539B42C-CB9F-4a23-8E57-AF4E7CEE5BAA" |
| 16 | + AssemblyInfo.Product "Calculator" |
| 17 | + AssemblyInfo.Version version |
| 18 | + AssemblyInfo.FileVersion version] |
| 19 | + |
| 20 | + AssemblyInfoFile.CreateCSharp "./src/app/CalculatorLib/Properties/AssemblyInfo.cs" |
| 21 | + [AssemblyInfo.Title "Calculator library" |
| 22 | + AssemblyInfo.Description "Sample project for FAKE - F# MAKE" |
| 23 | + AssemblyInfo.Guid "EE5621DB-B86B-44eb-987F-9C94BCC98441" |
| 24 | + AssemblyInfo.Product "Calculator" |
| 25 | + AssemblyInfo.Version version |
| 26 | + AssemblyInfo.FileVersion version] |
| 27 | + |
| 28 | + MSBuild.MSBuildRelease buildDir "Build" appReferences |
29 | 29 | |> Log "AppBuild-Output: "
|
30 | 30 | )
|
31 | 31 |
|
@@ -53,7 +53,7 @@ If your solution is inside a git repository you can get the git hash like this (
|
53 | 53 |
|
54 | 54 | And set like this:
|
55 | 55 |
|
56 |
| - Attribute.Metadata("githash", commitHash) |
| 56 | + AssemblyInfo.Metadata("githash", commitHash) |
57 | 57 |
|
58 | 58 | One of the easiest ways to retrieve this hash is to load use a reflector program, like [ILSpy](https://github.com/icsharpcode/ILSpy):
|
59 | 59 |
|
|
0 commit comments