20131104 basic msbuild by Anney

409 views

Published on

basic msbuild by Anney

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
409
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • http://msdn.microsoft.com/en-us/library/vstudio/ee216359.aspx
  • 20131104 basic msbuild by Anney

    1. 1. Msbuild basic Anney
    2. 2. Basic MSBuild Elements  <Project>    Root element Include one or more target , propertyGroup, itemGroup elements. <Target>  Include one or more Tasks  <PropertyGroup>  <ItemGroup>  Tasks  Copy  Delete  Message
    3. 3. Extension naming rule  .proj   .targets   用於 import .props   main 入口 僅放 PropertyGroup .tasks  自製的 UsingTask
    4. 4. 本日練習主題  Copy Files    Copy D:testMSBuildMyApp Folder to D:testMSBuildMyApp1 Task: Copy Delete Files    Delete D:testMSBuildMyApp1*.txt Task: Delete Show Files    Show D:testMSBuildMyApp1 Files Task: Message Task References  http://msdn.microsoft.com/en-us/library/vstudio/7z253716.aspx
    5. 5. Copy Task
    6. 6. Show output parameter  Copy Task  http://msdn.microsoft.com/en-us/library/vstudio/ms164287.aspx
    7. 7. Delete Task
    8. 8. Target Build Order
    9. 9. Target Build Order  InitialTargets   DefaultTargets   This Project atttribute specifies which targets are run if a target is not specified explicitly on the command line. DependsOnTargets   This Project attribute specifies the targets that will run first, even if targets are specified on the command line or in the DefaultTargets attribute. This Target attribute specifies targets that must run before this target can run. BeforeTargets and AfterTargets  These Target attributes specify that this target should run before or after the specified targets.
    10. 10. Demo - InitialTargets
    11. 11. Demo – InitialTargets(2)
    12. 12. Demo – InitialTargets(3)
    13. 13. Demo – DefaultTargets
    14. 14. Demo – DefaultTargets(2)
    15. 15. Demo - DependsOnTargets
    16. 16. Demo – DependsOnTargets(2)
    17. 17. Demo – DependsOnTargets(2)
    18. 18. Demo –BeforeTargets
    19. 19. Demo – AfterTargets
    20. 20. Demo –BeforeTargets and AfterTargets
    21. 21. Determining the Target Build Order  InitialTargets targets are run.  Targets specified on the command line by the /target switch are run. If you specify no targets on the command line, then the DefaultTargets targets are run. If neither is present, then the first target encountered is run.  The Condition attribute of the target is evaluated. If the Condition attribute is present and evaluates to false, the target isn't executed and has no further effect on the build.  Before a target is executed, its DependsOnTargets targets are run.  Before a target is executed, any target that lists it in a BeforeTargets attribute is run.  Before a target is executed, its Inputs attribute and Outputs attribute are compared. If MSBuild determines that any output files are out of date with respect to the corresponding input file or files, then MSBuild executes the target. Otherwise, MSBuild skips the target.  After a target is executed or skipped, any target that lists it in an AfterTargets attribute is run.
    22. 22. References  http://msdn.microsoft.com/en-us/library/vstudio/7z253716.aspx  http://msdn.microsoft.com/en-us/library/ms164313.aspx  http://msdn.microsoft.com/zhtw/library/microsoft.build.utilities.taskitem.aspx  http://msdn.microsoft.com/en-us/library/vstudio/ms164287.aspx
    23. 23. ~ THE END ~

    ×