-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Introduce MSBuild tasks programability #12364
Conversation
c8f93fe
to
005b627
Compare
This pull request has merge conflicts. Please resolve those before requesting a review. |
Is this something you'd like to revisit any time soon @hishamco or should we close? |
I tried this PR last week but there's an issue to discover the task, I will try one more time if all goes well I will update the PR otherwise I will close it |
I'm wondering why the assembly file path doesn't resolved properly @MikeAlhayek @Piedone any idea? |
924a93b
to
c9fc713
Compare
Finally, seems I forgot to generalize the build configuration instead of using |
...re/OrchardCore.Application.Cms.Core.Targets/OrchardCore.Application.Cms.Core.Targets.targets
Outdated
Show resolved
Hide resolved
Can we wright unit tests? Why not!! |
It's good to demo it this week |
Before I deep dive into reviewing this, please answer me here: #4991 (comment) I'd like to first understand what your goal is, and what issue you're trying to solve, and why with the implementation you choose and not the alternatives I asked about. I'm wholly unclear about all of these. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see the advantages mentioned under #4991 (comment). Now instead of MSBuild one-liners we have classes and a test project, while OrchardCore.Application.Cms.Core.Targets.targets
didn't become less complex, just different. Maybe it's faster, but we're talking about creating two folders and three files, so there can't be a significant different.
Probably it would make more sense to use C# tasks for indeed complex MSBuild logic.
|
||
<PropertyGroup> | ||
<TargetFrameworks>$(CommonTargetFrameworks)</TargetFrameworks> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't be needed if #15764 is merged first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this under the test
solution folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was there, but I'd like to separate them into another project to make it clear that's not related to the actual OC tests project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests and even benchmarks are there, so this is suitable (and it's already in the same file system folder).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmarks in a separated project, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The benchmarks in a separate project OrchardCore.Benchmarks
too, so we don't want not mixed things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm talking about moving this project to the test
solution folder. Not move it into a different project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that while I was preparing a demo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use CLI, I think there's an issue in some VS versions, but I investigate on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should just work in VS too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebase to the main and then try again ..
FYI sometimes VS makes me crazy I notice that in this & sources generator PRs :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's unfortunately the case indeed. Same happened for Lombiq/Helpful-Libraries#238.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is
|
||
public abstract class CreateWebFolderTask : MSBuildTask | ||
{ | ||
public abstract string FolderName { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public abstract string FolderName { get; } | |
public abstract string FolderPath { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a folder name, not a path, such as wwwroot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How it's used is a path. Passing wwwroot/some/sub/folder
to it would work too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it could be
@@ -1,4 +1,12 @@ | |||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
|
|||
<PropertyGroup> | |||
<_OrchardCoreBuildTasksAssembly>$(ProjectDir)..\..\OrchardCore.Build.Tasks\bin\$(Configuration)\$(CommonTargetFrameworks)\OrchardCore.Build.Tasks.dll</_OrchardCoreBuildTasksAssembly> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work if the DLL already exists but if you build the solution for the first time, it won't. Won't this cause issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be there during the build, if it's not there the GitHub Workflow will not pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but this line will be executed even when one just opens the solution and anything else that MSBuild does, not just during a build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work if the DLL already exists but if you build the solution for the first time, it won't. Won't this cause issues?>
This is weird, could you please try the following:
- Add this reference
<ProjectReference Include="..\OrchardCore.Build.Tasks\OrchardCore.Build.Tasks.csproj" />
toOC.Cms.Web
- Open CMD and locate the web project
- Run
dotnet clean
- Run
dotnet build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please make sure you test all of such scenarios? And in VS, the solution should still work with F5.
This pull request has merge conflicts. Please resolve those before requesting a review. |
This pull request has merge conflicts. Please resolve those before requesting a review. |
It seems that this pull request didn't really move for quite a while. Is this something you'd like to revisit any time soon or should we close? Please comment if you'd like to pick it up. |
for instructions on how to resolve the merge conflicts due to #16572 please follow the step listed in this comment. |
It seems that this pull request didn't really move for quite a while. Is this something you'd like to revisit any time soon or should we close? Please comment if you'd like to pick it up. |
Closing this pull request because it has been stale for very long. If you think this is still relevant, feel free to reopen it. |
Fixes #4991