-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathpostbuild.ps1
More file actions
41 lines (39 loc) · 1.6 KB
/
postbuild.ps1
File metadata and controls
41 lines (39 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Copyright 2022 Chuongmep.com \(^_^)/
param ($Configuration, $ProjectDir, $SolutionDir)
Write-Host "Solution Directory:" $SolutionDir
Write-Host "Project Directory:" $ProjectDir
Write-Host "Configuration Name Current:" $Configuration
$bundle = "C:\ProgramData\Autodesk\ApplicationPlugins\CADPythonShell.bundle\"
$content = "PackageContents.xml"
$AutodeskProcessName = "acad"
if($Configuration -match "Debug"){
$proc = Get-Process $AutodeskProcessName -ErrorAction SilentlyContinue
if($proc)
{
Write-Host "Warning : Please Close Autocad Or Civil3D To Auto Copy Resouce And Debug \(^_^)/"
}
else
{
Write-Host "************Start Create Folder And Check File \(^.^)/"
if(Test-Path $bundle){
Write-Host "Exits Path, So Remove All File Exits"
Remove-Item ($bundle) -Recurse
Write-Host "Removed All File Exist"
}
Write-Host "************ Start Copy New File"
xcopy ($SolutionDir + $content) $bundle /Y
xcopy ($ProjectDir + "*.*") $bundle /Y /I /E /R
Write-Host "************ Oh my got ! Copy Complete! Chuongmep.com \(^_^)/"
}
}
else
{
Write-Host "Please Toggle To Debug Model If You Want Copy File And Debug \(^_^)/ , config in postbuild.ps1"
}
## Recommended Content
## https://docs.microsoft.com/en-us/visualstudio/ide/how-to-change-the-build-output-directory?view=vs-2022
#if you want try with post build event
#set bundle="C:\ProgramData\Autodesk\ApplicationPlugins\CADPythonShell.bundle\"
#if not exist "%bundle%" mkdir "%bundle%"
#xcopy "$(TargetDir)*.*" "%bundle%" /Y /I /E /R
#xcopy "$(SolutionDir)PackageContents.xml" "%bundle%" /Y /R