SlideShare une entreprise Scribd logo
1  sur  14
MSBuild-Inline Task
Anney
需求說明

 在 MSBuild 中想要自行撰寫程式。
 Task Name 為 MyTest
 參數為 P1

2

2013/12/17
UsingTask Task

3

2013/12/17
Example

4

2013/12/17
Properties
Property
TaskName

[require]

AssemblyFile

[require]
這項屬性接受完整路徑或相對路徑。
可以使用 AssemblyName 屬性來指定內嵌 TaskFactory 類別
的完整名稱,它通常位於全域組件快取 (GAC) 中。

TaskFactory

5

Description

[require]

2013/12/17
Child Element
Element

Description

ParameterGroup

Inline 程式中所需要的 input or output 的參數

Task
Reference
Using

namespaces that you want to access.

Code

6

specifies references to the .NET assemblies that you
are using in your code.
Inline 程式碼

2013/12/17
ParameterGroup Properties
Property
Required

[optional]
預設為 false

ParameterType

[optional]
預設為 System.String

Output

7

Description

[optional]
預設為 false 的選擇性屬性。若為 true,則在
從 Execute 方法傳回之前必須提供值給此參數。

2013/12/17
Code Element - Properties
Property

Description

Language

指定用於撰寫程式碼的語言。
可接受的值為 cs (適用於 C#)、vb (適用於 Visual Basic),
和 js (適用於 JScript)。

Type

•
•
•

8

Class,則 Code 項目會包含衍生自 ITask 介面之類別的
程式碼。
Method,則程式碼會定義 ITask 介面之 Execute 方法
的覆寫。
Fragment,則程式碼會定義 Execute 方法的內容,但
並非簽章或 return 陳述式。

2013/12/17
Example

9

2013/12/17
本日練習主題
 Copy Target
 Copy D:testMSBuildMyApp Folder to D:testMSBuildDST
 Task: Copy

 Delete Target
 Delete D:testMSBuildDST*.txt
 Task: Delete

 Show Target
 Show D:testMSBuildDST*.* Files
 Task: Message

 Clean Target
 Task: RemoveDir

 Task References
 http://msdn.microsoft.com/en-us/library/vstudio/7z253716.aspx

10

2013/12/17
本日練習主題(2) - Incremental

 請在 Copy, Del Target 上加入 Incremental build
 請執行 msbuild Test.targets /t:Copy;Del;Show 2 次,結果
為何?

11

2013/12/17
本日練習主題(3) - UsingTask

 Taskname: MyReplaceTextTask
 Input Param: oldText, newText

12

2013/12/17
Reference

 http://msdn.microsoft.com/en-us/library/dd722601.aspx

13

2013/12/17
~ THE END~

14

2013/12/17

Contenu connexe

Similaire à 20131209 ms build_using_task By Anney

J2ee面试知识
J2ee面试知识J2ee面试知识
J2ee面试知识
yiditushe
 
Kissy component model
Kissy component modelKissy component model
Kissy component model
yiming he
 
Ecma script edition5-小试
Ecma script edition5-小试Ecma script edition5-小试
Ecma script edition5-小试
lydiafly
 
旺铺前端设计和实现
旺铺前端设计和实现旺铺前端设计和实现
旺铺前端设计和实现
hua qiu
 
NeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style GuideNeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style Guide
jenkinv
 
Spring入门纲要
Spring入门纲要Spring入门纲要
Spring入门纲要
yiditushe
 

Similaire à 20131209 ms build_using_task By Anney (7)

Ch07
Ch07Ch07
Ch07
 
J2ee面试知识
J2ee面试知识J2ee面试知识
J2ee面试知识
 
Kissy component model
Kissy component modelKissy component model
Kissy component model
 
Ecma script edition5-小试
Ecma script edition5-小试Ecma script edition5-小试
Ecma script edition5-小试
 
旺铺前端设计和实现
旺铺前端设计和实现旺铺前端设计和实现
旺铺前端设计和实现
 
NeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style GuideNeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style Guide
 
Spring入门纲要
Spring入门纲要Spring入门纲要
Spring入门纲要
 

Plus de 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 & activator
Reflection & activatorReflection & activator
Reflection & 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
 

20131209 ms build_using_task By Anney