日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

项目属性--生成事件--后期生成事件命令行

發(fā)布時(shí)間:2023/12/10 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 项目属性--生成事件--后期生成事件命令行 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

以開源記牌器https://github.com/Epix37/Hearthstone-Deck-Tracker 為例,Hearthstone Deck Tracker項(xiàng)目中的后期生成事件命令行:

?

if "$(ConfigurationName)" == "Release" (
rmdir /S /Q "..\Hearthstone Deck Tracker"
mkdir "..\Hearthstone Deck Tracker"
mkdir "..\Hearthstone Deck Tracker/Images"
mkdir "..\Hearthstone Deck Tracker/Files"
mkdir "..\Hearthstone Deck Tracker/Plugins"
xcopy /E /Y "Images\*.*" "..\Hearthstone Deck Tracker\Images"
xcopy /E /Y "Files\*.*" "..\Hearthstone Deck Tracker\Files"
xcopy /Y "HearthstoneDeckTracker.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HearthstoneDeckTracker.exe.config" "..\Hearthstone Deck Tracker"
ren "..\Hearthstone Deck Tracker\HearthstoneDeckTracker.exe" "Hearthstone Deck Tracker.exe" ? ? ? ? ? ? ? ? ? ? ? ? ? ?//重命名,目的是去掉空格
ren "..\Hearthstone Deck Tracker\HearthstoneDeckTracker.exe.config" "Hearthstone Deck Tracker.exe.config" ? ? ? ? //重命名,目的是去掉空格
xcopy /Y "HDTHelper.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HDTUpdate.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HDTUninstaller.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HtmlAgilityPack.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "MahApps.Metro.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "Newtonsoft.Json.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "System.Windows.Interactivity.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "Version.xml" "..\Hearthstone Deck Tracker" )

?

rmdir 參數(shù)說明

/S 除目錄本身外,還將刪除指定目錄下的所有子目錄和文件。用于刪除目錄樹。 /Q 安靜模式,帶 /S 刪除目錄樹時(shí)不要求確認(rèn) mkdir 創(chuàng)建目錄

xcopy 參數(shù)說明

xcopy /?

Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J]
[/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/V Verifies the size of each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/G Allows the copying of encrypted files to destination that does
not support encryption.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/N Copies using the generated short names.
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
/Z Copies networked files in restartable mode.
/B Copies the Symbolic Link itself versus the target of the link.
/J Copies using unbuffered I/O. Recommended for very large files.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy

/E 復(fù)制目錄和子目錄,包括空的。與 /S /E 相同。可以用來修改 /T。 Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options. /S 復(fù)制目錄和子目錄,除了空的。 Copies directories and subdirectories, unless they are empty. If you omit /s, xcopy works within a single directory. /T 創(chuàng)建目錄結(jié)構(gòu),但不復(fù)制文件。不包括空目錄或子目錄。/T /E 包括空目錄和子目錄。 Copies the subdirectory structure (that is, the tree) only, not files. To copy empty directories, you must include the /e command-line option. /Y 復(fù)制文件審核設(shè)置(隱含 /O)。現(xiàn)存目標(biāo)文件。【就是直接覆蓋——Three~注】???? ? ? ? ? 這個(gè)似乎更準(zhǔn)確:禁止提示以確認(rèn)改寫一個(gè)現(xiàn)存目標(biāo)文件。 Suppresses prompting to confirm that you want to overwrite an existing destination file. /D:m-d-y 復(fù)制在指定日期或指定日期以后更改的文件。如果沒有提供日期,只復(fù)制那些源時(shí)間比目標(biāo)時(shí)間新的文件。 /d [:MM-DD-YYYY] Copies source files changed on or after the specified date only. If you do not include a MM-DD-YYYY value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed.

ren是rename的縮寫,如果需要給文件重命名,可使用rename命令。

語法:rename<舊文件名><新文件名> =======================

rmdir /S /Q "..\IntelligentBuilding"
mkdir "..\IntelligentBuilding"
xcopy /Y "AxInterop.SliderExLib.dll" "..\IntelligentBuilding"
xcopy /Y "ClientApp.exe" "..\IntelligentBuilding"
xcopy /Y "ClientApp.exe.config" "..\IntelligentBuilding"
xcopy /Y "DevExpress.BonusSkins.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Charts.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Data.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Office.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Pdf.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Pdf.v16.1.Drawing.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Printing.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.RichEdit.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Sparkline.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Utils.v16.1.UI.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Utils.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraBars.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraCharts.v16.1.UI.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraCharts.v16.1.Wizard.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraCharts.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraEditors.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraGauges.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraGauges.v16.1.Win.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraGrid.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraLayout.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraNavBar.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraPrinting.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraRichEdit.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraTreeList.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraVerticalGrid.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "Interop.SliderExLib.dll" "..\IntelligentBuilding"
xcopy /Y "log4net.dll" "..\IntelligentBuilding"

?

實(shí)戰(zhàn)

現(xiàn)在有一個(gè)hotfix文件夾,5.1.0.0 Hotfix。在這個(gè)文件夾下有2個(gè)子文件夾

hotfix_5.1.1_Generic_20180911? 這個(gè)子文件夾下有一些module文件夾

hotfix_5.1.2_Generic_20180912? ?這個(gè)子文件夾是新創(chuàng)建的,現(xiàn)在需要把上面的子文件夾的folder復(fù)制到這個(gè)子文件夾

在hotfix_5.1.1_Generic_20180911文件夾中執(zhí)行命令

?xcopy /t . ..\hotfix_5.1.2_Generic_20180912\

xcopy /t . '..\..\5.1.0.0 Hotfix\hotfix_5.1.2_Generic_20180912\'? 這個(gè)命令執(zhí)行失敗,提示說,創(chuàng)建目錄失敗。

?

谷歌查詢之后,發(fā)現(xiàn)可以通過powershell的copy-item命令來操作

https://stackoverflow.com/questions/44678962/how-to-copy-folder-structure-only-with-powershell

?

?

?

轉(zhuǎn)載于:https://www.cnblogs.com/chucklu/p/4772184.html

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的项目属性--生成事件--后期生成事件命令行的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。