What is the difference between 'DependsOnTargets' and 'AfterTargets'?

前端 未结 6 1150
孤街浪徒
孤街浪徒 2020-12-24 04:38

What is the difference between DependsOnTargets and AfterTargets? I can not distinguish these two.

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-24 05:33

    DependsOnTarget

    Let's assume that you have two tasks:

    1. Build Project
    2. Copy all content.

    You can start your build by executing task 2 and then in the task declaration define its dependencies. So if you define that task 2 depends on task 1, the build process will start and execute task 1 and then 2.

    AfterTargets

    Much simpler: it means only tasks which are execute after other targets. So taking the example from above - after Task 1 - build project execute task 2.

    I hope this helps

提交回复
热议问题