Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create programmable MSBuild Tasks #4991

Open
hishamco opened this issue Dec 10, 2019 · 19 comments
Open

Create programmable MSBuild Tasks #4991

hishamco opened this issue Dec 10, 2019 · 19 comments
Milestone

Comments

@hishamco
Copy link
Member

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

  • Copy Translations files

  • Cleanup files

  • or anything you may think of

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

@jtkech
Copy link
Member

jtkech commented Dec 10, 2019

yes good idea

@Piedone
Copy link
Member

Piedone commented Mar 24, 2024

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

@hishamco
Copy link
Member Author

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
Copy link
Member

Piedone commented Mar 24, 2024

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

@hishamco
Copy link
Member Author

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
Copy link
Member

Piedone commented Mar 24, 2024

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

@hishamco
Copy link
Member Author

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

@Piedone
Copy link
Member

Piedone commented Mar 24, 2024

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
Copy link
Member

Piedone commented Apr 6, 2024

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

@hishamco
Copy link
Member Author

hishamco commented Apr 7, 2024

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
Copy link
Member

Piedone commented Apr 7, 2024

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

@hishamco
Copy link
Member Author

hishamco commented Apr 8, 2024

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

@Piedone
Copy link
Member

Piedone commented Apr 8, 2024

Great :D.

@hishamco
Copy link
Member Author

hishamco commented Apr 14, 2024

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:

  • Reduce the time for creating a build task from within .csproj, I remember JT spend a lot of PR to make copying localization translations works
  • Easy to create if you know C# :)
  • We can create custom targets or use the built-in once
  • PERF nothing involves in the runtime
  • We can move almost the stuff that we did in .csproj into readable and understandable tasks such as:
  1. Copying translation files
  2. Creating wwwroot folder
  3. Creating NuGet packages
  4. and much more

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

@Piedone
Copy link
Member

Piedone commented Apr 15, 2024

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
Copy link
Member Author

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
Copy link
Member

Piedone commented Apr 15, 2024

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
Copy link
Member Author

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

@Piedone
Copy link
Member

Piedone commented Apr 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants