OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.22k stars 2.34k forks source link

Create programmable MSBuild Tasks #4991

Open hishamco opened 4 years ago

hishamco commented 4 years ago

@jtkech I'm thinking to introduce programmable MSBuild tasks that will be useful for various reasons, such as:

I knew we can do that in .csproj files, be here we can have a benefit of test ability, readability, productivity, flexibility .. etc

jtkech commented 4 years ago

yes good idea

Piedone commented 3 months ago

Can you tell about some concrete use cases in more detail? Like, what exactly would "Copy Translations files" and "Cleanup files" do?

hishamco commented 3 months ago

Working with MSBuild tasks is a tedious work, also a tiny typo could break everything I remembered we using programmable MSBuild tasks in SimplCommerce long time ago, this way we can easy create, modify any task

Piedone commented 3 months ago

Sorry, this is really vague for me. Please provide examples.

hishamco commented 3 months ago

For instance, copying translation files is a simple task that took days if not weeks to make work fine as it is, I remember JT works heavily to get it done.

If we have a programmatic way to create MSBuild task this should not take a day IMHO, for that JT was interested on this at that time

Piedone commented 3 months ago

Aren't you looking to implement custom tasks in C#?

hishamco commented 3 months ago

The problem is not with writing the task itself, but rather how it is getting work with OC :)

Piedone commented 3 months ago

And how would such programmable tasks work? Wouldn't rather custom MSBuild targets that let you hook into the build pipeline of OC serve this?

Piedone commented 2 months ago

So, where do you want to go with this issue and PR?

hishamco commented 2 months ago

Hi @Piedone as you know we are on a holy month "Ramadhan" so I don't have much time to revise the remaining PRs. I'll struggle in the upcoming two weeks

Piedone commented 2 months ago

I see, no worries, and have a happy Ramadan!

hishamco commented 2 months ago

BTW the number of PRs -especially mine - has been reduced a lot, thanks for your ZoltanGC.Collect() :)

Piedone commented 2 months ago

Great :D.

hishamco commented 2 months ago

And how would such programmable tasks work? Wouldn't rather custom MSBuild targets that let you hook into the build pipeline of OC serve this?

Implementing programmable MSBuild tasks will open up the possibilities for doing anything during the build time:

The possibilities are endless, you can do whatever you want with the MSBuild black box instead of dealing with XML

Piedone commented 2 months ago

What I'm probably most missing is what you mean by "programmable" (and even after checking out the PR). Since MSBuild Tasks are already, for all intents and purposes, programmable. Because you previously said that you don't mean being able to write tasks in C#.

hishamco commented 2 months ago

What I'm probably most missing is what you mean by "programmable"

Programmatically

Since MSBuild Tasks are already, for all intents and purposes, programmable. Because you previously said that you don't mean being able to write tasks in C#.

I can write them in .csproj but they are tedious and time-consuming and you find yourself reading the docs all the time :)

I don't mean that we need to change all that we have, at least this PoC that C# tasks are easier and do not take much time. I think this is useful for the future use cases

Piedone commented 2 months ago

I understand what the word "programmable" means :). I don't understand though what you mean by it in this context. So, in the end, this is actually about writing MSBuild tasks in C# (and not the MSBuild XML)?

hishamco commented 2 months ago

Exactly, open the possibility to write MSBuild tasks in C#, so it's easier, time-saving and testable

Piedone commented 2 months ago

That's something I asked about previously too, but glad we cleared it up :).