forked from AArnott/CodeGeneration.Roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
27 lines (22 loc) · 831 Bytes
/
Program.cs
File metadata and controls
27 lines (22 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using CodeGeneration.Roslyn;
namespace BuildPropsConsumer
{
[CodeGenerationAttribute("BuildPropsGenerator.FrameworkInfoProviderGenerator, BuildPropsGenerator")]
class FrameworkInfoProviderAttribute : Attribute { }
[FrameworkInfoProvider]
partial class Program
{
static void Main(string[] args)
{
var program = new Program();
var frameworks = program.TargetFrameworks;
var currentFramework = program.CurrentTargetFramework;
Console.WriteLine("This project is build for the following frameworks: ");
foreach(var framework in frameworks) {
var message = framework == currentFramework ? $"{framework} (current)" : framework;
Console.WriteLine(message);
}
}
}
}