But surely you can create a library in C# that does pretty much what Gradle does.
But why would you want to re-invent the wheel?
Ant is history, period. Build tools has matured a lot compared to how it was! And I don't know about C#, but in Java, it is not easy to do what Maven does. And it is not worth doing, when we already have a tool for this very purpose. We have a work on our plate, so it is wise to use existing tools to finish up things on time, rather than write those stuffs yourself and complicate it further.