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

Sharing .props file between projets #5

Open
jgiacomini opened this issue Sep 30, 2021 · 5 comments
Open

Sharing .props file between projets #5

jgiacomini opened this issue Sep 30, 2021 · 5 comments

Comments

@jgiacomini
Copy link

jgiacomini commented Sep 30, 2021

Hello,

Your file Shared.props seem shared to all your csprojs files.

.NET have a built-in mechanism to do it. Please find an article which explain how to use it:
https://thomaslevesque.com/2017/09/18/common-msbuild-properties-and-items-with-directory-build-props/

The dotnet team use it on the majority of the projects I read from them.
https://github.com/dotnet/project-system
If you have a reason to not use it, I am very curious don’t hesitate to share it. 😊

You source code is very interesting to read.

Jérôme

@jgiacomini jgiacomini changed the title Share .props file between projets Sharing .props file between projets Sep 30, 2021
@Kuinox
Copy link
Contributor

Kuinox commented Sep 30, 2021

The reason we do not use the Directory.Build.props is simply because our Shared.props is older than the Directory.Build.props feature :D.
I'm not against migrating to that, because it often happen that we forget to Import the Shared.props and lead to various issues later.
It cause only one issue: how a project can opt out, if needed ?

The migration will most likely be made with a CKli apply settings command.

You source code is very interesting to read.

Thanks! Sadly there is no enough documentation there :(.

The packages defined in this repo, will be depended in our apps, and processed post app compilation by our static DI, with a plugin.

You can play around the tql language that you may have seen in this repo in this playground: https://kuinox.github.io/TQLBlazorDemo/ (and there is some doc about the language itself in this docx )

@olivier-spinelli
Copy link
Member

I'd like to add that the Shared.props is here because it's an opt-in. Opting out of a Directory.Build.props is simply not possible and, for instance, a Tests/Integration project (well, ok, curently we don't have so much of these but we'd like to!) may have to fight against some of them.
IMO, explicit is always better than implicit and an explicit import seems both clearer and bearable enough to me...

@Kuinox
Copy link
Contributor

Kuinox commented Oct 1, 2021

I think we can test in the props if it is a "Test/*," csproj then don't apply the rules.

@olivier-spinelli
Copy link
Member

And this would still be more implicit than explicit: by looking at a project csproj, you cannot understand what's going on....

@jgiacomini
Copy link
Author

jgiacomini commented Oct 1, 2021

Hello guys,

Thanks for your detailed answers.

We can opt-out specific projet in the Directory.Build.props by adding a specific condition but if you need it, it's more clearer to use your current solution by adding it the reference in each csproj when it's needed.

CKli is a very interesting tool.
I am very surprised the numbers of tool you have made. Great job guys !

If I remember well .NET team have also a tool named arcade (https://github.com/dotnet/arcade) to allow them to update all their repo easily.
I never used it. It can be interesting to see if they have good ideas to take :)

Have a great day !
Jérôme

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

No branches or pull requests

3 participants