Java's annotations (which are mostly equivalent to C#'s attributes) can be consumed at compile time using annotation processors. If C# had this feature for attributes, could attributes have been used here?
Java's annotations (which are mostly equivalent to C#'s attributes) can be consumed at compile time using annotation processors. If C# had this feature for attributes, could attributes have been used here?
C# have this feature, it's called roslyn code generator.
I believe your java annotations cannot change the build parameters of the package being currently compiled, which is why you wouldnt be able to do that in java.
btw, anything that is present in the AST could be used for that, but I think the preprocessor directive is the most sensible choice.