SlideShare a Scribd company logo
Msbuild basic
Anney
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
Extension naming rule


.proj




.targets




用於 import

.props




main 入口

僅放 PropertyGroup

.tasks


自製的 UsingTask
本日練習主題


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
Copy Task
Show output parameter


Copy Task



http://msdn.microsoft.com/en-us/library/vstudio/ms164287.aspx
Delete Task
Target Build Order
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.
Demo - InitialTargets
Demo – InitialTargets(2)
Demo – InitialTargets(3)
Demo – DefaultTargets
Demo – DefaultTargets(2)
Demo - DependsOnTargets
Demo – DependsOnTargets(2)
Demo – DependsOnTargets(2)
Demo –BeforeTargets
Demo – AfterTargets
Demo –BeforeTargets and AfterTargets
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.
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
~ THE END ~

More Related Content

What's hot

Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)
Foyzul Karim
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
TO THE NEW | Technology
 

What's hot (14)

Unit testing
Unit testingUnit testing
Unit testing
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)
 
Unit Test + Functional Programming = Love
Unit Test + Functional Programming = LoveUnit Test + Functional Programming = Love
Unit Test + Functional Programming = Love
 
AngularDart Introduction
AngularDart IntroductionAngularDart Introduction
AngularDart Introduction
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Unit test-using-spock in Grails
Unit test-using-spock in GrailsUnit test-using-spock in Grails
Unit test-using-spock in Grails
 
Refactoring
RefactoringRefactoring
Refactoring
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
 
Unit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqUnit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and Moq
 

Viewers also liked

Sql server 交易機制與 log
Sql server 交易機制與 logSql server 交易機制與 log
Sql server 交易機制與 log
LearningTech
 
X document xpath 小發現
X document xpath 小發現X document xpath 小發現
X document xpath 小發現
LearningTech
 
Observer pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expressionObserver pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expression
LearningTech
 

Viewers also liked (6)

Yield howar 20130607d
Yield howar 20130607dYield howar 20130607d
Yield howar 20130607d
 
Sql server 交易機制與 log
Sql server 交易機制與 logSql server 交易機制與 log
Sql server 交易機制與 log
 
Html basic
Html basicHtml basic
Html basic
 
X document xpath 小發現
X document xpath 小發現X document xpath 小發現
X document xpath 小發現
 
Observer pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expressionObserver pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expression
 
Peggy optimist
Peggy   optimistPeggy   optimist
Peggy optimist
 

Similar to 20131104 basic msbuild by Anney

Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
Apache ant
Apache antApache ant
Apache ant
koniik
 
Batching and Incremental Build
Batching and Incremental BuildBatching and Incremental Build
Batching and Incremental Build
LearningTech
 
End To End Build Automation With Team Build
End To End Build Automation With Team BuildEnd To End Build Automation With Team Build
End To End Build Automation With Team Build
wbarthol
 

Similar to 20131104 basic msbuild by Anney (20)

20120420 - Target buildorder
20120420 - Target buildorder20120420 - Target buildorder
20120420 - Target buildorder
 
Extending the build workflow of TFS 2010
Extending the build workflow of TFS 2010Extending the build workflow of TFS 2010
Extending the build workflow of TFS 2010
 
JobTestbuild.xml Builds, tests, and runs the project J.docx
JobTestbuild.xml      Builds, tests, and runs the project J.docxJobTestbuild.xml      Builds, tests, and runs the project J.docx
JobTestbuild.xml Builds, tests, and runs the project J.docx
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
Apache ant
Apache antApache ant
Apache ant
 
tSQLt Database Unit Testing
tSQLt Database Unit TestingtSQLt Database Unit Testing
tSQLt Database Unit Testing
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle builds
 
Batching and Incremental Build
Batching and Incremental BuildBatching and Incremental Build
Batching and Incremental Build
 
End To End Build Automation With Team Build
End To End Build Automation With Team BuildEnd To End Build Automation With Team Build
End To End Build Automation With Team Build
 
Quick Tour to Front-End Unit Testing Using Jasmine
Quick Tour to Front-End Unit Testing Using JasmineQuick Tour to Front-End Unit Testing Using Jasmine
Quick Tour to Front-End Unit Testing Using Jasmine
 
Automation patterns on practice
Automation patterns on practiceAutomation patterns on practice
Automation patterns on practice
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
 
Using Drupal Features in B-Translator
Using Drupal Features in B-TranslatorUsing Drupal Features in B-Translator
Using Drupal Features in B-Translator
 
Simple build tool
Simple build toolSimple build tool
Simple build tool
 
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docxBroncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
 
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docxBroncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
 
Java scriptforjavadev part2a
Java scriptforjavadev part2aJava scriptforjavadev part2a
Java scriptforjavadev part2a
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 

More from LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection &amp; activator
Reflection &amp; activatorReflection &amp; activator
Reflection &amp; activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 

20131104 basic msbuild by Anney

Editor's Notes

  1. http://msdn.microsoft.com/en-us/library/vstudio/ee216359.aspx