Skip to content

Order of AfterTargets/BeforeTargets is incorrect #2894

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

Closed
wants to merge 1 commit into from

Conversation

igor-uzhviev
Copy link

@igor-uzhviev igor-uzhviev commented Mar 19, 2019

The order of AfterTargets and BeforeTargets is incorrect in in the last section "Determine the target build order".
However it is correct in the example above (about Compile, Optimize, Link).

To be more specific AfterTargets means after which targets the current target will be executed, BeforeTargets means before which targets the current target will be executed.
So the order is: AfterTargets -> the current target -> BeforeTargets.

It seems to be it is just a mistype in the documentation.

The order of AfterTargets and BeforeTargets is incorrect in in the last section "Determine the target build order".
However it is correct in the example above (about Compile, Optimize, Link).

To be more specific AfterTargets means after which targets the current target will be executed, BeforeTargets means before which targets the current target will be executed.
So the order is: AfterTargets -> the current target -> BeforeTargets.

It seems to be it is just mistype in the documentation.
@Mikejo5000
Copy link
Collaborator

@igor-uzhviev Thanks for working to improve the docs.
You are right about the definitions, it's the phrasing that can be confusing. To use the good example (Optimize, Link) that you cited, step 5 could be restated this way:

Before a target (e.g., "Link") is executed or skipped, any target ("Optimize") that lists it ("Link") in a BeforeTargets attribute is run.

I will try to think of a better phrasing that might avoid confusion. But the existing text is, I believe, technically correct.

@PRMerger7
Copy link
Contributor

@igor-uzhviev : Thanks for your contribution! The author, @Mikejo5000, has been notified to review your proposed change.

@igor-uzhviev
Copy link
Author

igor-uzhviev commented Mar 21, 2019

@igor-uzhviev Thanks for working to improve the docs.
You are right about the definitions, it's the phrasing that can be confusing. To use the good example (Optimize, Link) that you cited, step 5 could be restated this way:

Before a target (e.g., "Link") is executed or skipped, any target ("Optimize") that lists it ("Link") in a BeforeTargets attribute is run.

I will try to think of a better phrasing that might avoid confusion. But the existing text is, I believe, technically correct.

@Mikejo5000 Thanks for looking into this. Yes, I agree that the wording is really confusing, especially considering the difference between DependsOnTargets and AfterTargets.
However it would be great if the order in this list would be according to the execution order (e.g. #1 is executed first, then #2, etc.)

Also if you are planning to do some updates in this document it would be nice if you can add some more explanations what the difference between DependsOnTargets and AfterTargets is (something like it is explained here: https://stackoverflow.com/a/2856018/3681541).

Thanks again!

@ghogen ghogen closed this Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants