Your SlideShare is downloading. ×
20131209 ms build_using_task By Anney
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

20131209 ms build_using_task By Anney

123
views

Published on

20131209 ms build_using_task By Anney

20131209 ms build_using_task By Anney


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
123
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. MSBuild-Inline Task Anney
  • 2. 需求說明  在 MSBuild 中想要自行撰寫程式。  Task Name 為 MyTest  參數為 P1 2 2013/12/17
  • 3. UsingTask Task 3 2013/12/17
  • 4. Example 4 2013/12/17
  • 5. Properties Property TaskName [require] AssemblyFile [require] 這項屬性接受完整路徑或相對路徑。 可以使用 AssemblyName 屬性來指定內嵌 TaskFactory 類別 的完整名稱,它通常位於全域組件快取 (GAC) 中。 TaskFactory 5 Description [require] 2013/12/17
  • 6. 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
  • 7. ParameterGroup Properties Property Required [optional] 預設為 false ParameterType [optional] 預設為 System.String Output 7 Description [optional] 預設為 false 的選擇性屬性。若為 true,則在 從 Execute 方法傳回之前必須提供值給此參數。 2013/12/17
  • 8. 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
  • 9. Example 9 2013/12/17
  • 10. 本日練習主題  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
  • 11. 本日練習主題(2) - Incremental  請在 Copy, Del Target 上加入 Incremental build  請執行 msbuild Test.targets /t:Copy;Del;Show 2 次,結果 為何? 11 2013/12/17
  • 12. 本日練習主題(3) - UsingTask  Taskname: MyReplaceTextTask  Input Param: oldText, newText 12 2013/12/17
  • 13. Reference  http://msdn.microsoft.com/en-us/library/dd722601.aspx 13 2013/12/17
  • 14. ~ THE END~ 14 2013/12/17