Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have created one batch file to build 2 solutions and to store the output exe's in a respective output directory for both Release and Debug mode. Its working fine but when I select one those mode the batch file is creating the output directory for both modes.

What I have tried:

set SOLUTION_PATH="%~dp0\..\..\VSSolution\Customer2013.sln"
set SOLUTION_PATH1="%~dp0\..\..\..\..\Customer1\Customer1.sln"

set mode=%1
echo %REL_PATH%
if /I "%mode%" == "release" (
set value="Release"
set filter="*64.dll"
) else (
set value="Debug"
set filter="*64d.dll"
)
echo "Build Mode set as %value%"

echo "Starting Debug Build for Customer solution"
devenv %SOLUTION_PATH% /rebuild Debug 
echo "Starting Debug Build for Customer1 solution"
devenv %SOLUTION_PATH1% /rebuild Debug

echo "Starting Release Build for Custome solution"
devenv %SOLUTION_PATH% /rebuild Release 
echo "Starting Release Build for Customer1  solution"
devenv %SOLUTION_PATH1% /rebuild Release
echo "Build is completed" 
Posted
Updated 24-Oct-18 0:47am
Comments
Richard MacCutchan 24-Oct-18 6:00am    
Look at your code, it builds both solutions for both types. You need to add some more tests around your devenv commands.
SureshMunna 24-Oct-18 6:01am    
can u plz provide me the output code
SureshMunna 24-Oct-18 6:02am    
The batch file should build both solutions as per the mode
SureshMunna 24-Oct-18 6:10am    
When I select any one of those mode it executes both of the solutions for both types. I need to execute those solutions as per I select the type
Richard MacCutchan 24-Oct-18 6:21am    
Look at the code. You check the selection made by the user but then at the end you have no if statements to determine which build(s) to execute, so you run them all.

1 solution

Try this,

set SOLUTION_PATH="%~dp0\..\..\VSSolution\Customer2013.sln"
set SOLUTION_PATH1="%~dp0\..\..\..\..\Customer1\Customer1.sln"

set mode=%1
echo %REL_PATH%
if /I "%mode%" == "release" (
set value="Release"
set filter="*64.dll"
) else (
set value="Debug"
set filter="*64d.dll"
)
echo "Build Mode set as %value%"

echo "Starting Debug Build for Customer solution"
devenv %SOLUTION_PATH% /rebuild %value%
echo "Starting Debug Build for Customer1 solution"
devenv %SOLUTION_PATH1% /rebuild %value%
echo "Build is completed"
 
Share this answer
 
v2
Comments
SureshMunna 25-Oct-18 5:24am    
how to copy the subfolder form source to destination.
xcopy /s /i /y %~dp0\..\windows\Resources %~dp0\..\..\build\windows\x64\%value%
I need to copy the Entire Resources folder to x64, but the above mentioned xcopy is copying the inside the resource files..instead of entire folder.
_Asif_ 26-Oct-18 0:53am    
You should try this
xcopy /s /i /y %~dp0\..\windows\Resources %~dp0\..\..\build\windows\x64\%value%\Resources

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900