I’m writing a post build event for visual studio project.
I have:
java -jar "$(ProjectDir)..\Tools\closure_compiler.jar"
but it turns out to be after compiled:
"D:\Projects\Source\Proj.Web\..\Tools\closure_compiler.jar"
which is an invalid directory, it just appends the dots. My problem is that I want to go back up 1 directory. The absolute file path is:
"D:\Projects\Source\Tools\closure_compiler.jar"
The full event is:
java -jar "$(ProjectDir)..\Tools\closure_compiler.jar" --js "$(ProjectDir)Scripts\*.debug.js" --js_output_file "$(ProjectDir)Scripts\script-bundle.min.js"
The error is:
Error 24 The command "java -jar "D:\Projects\Xormis\trunk\Source\Xormis.Web\..\Tools\closure_compiler.jar" --js "D:\Projects\Xormis\trunk\Source\Xormis.Web\Scripts\*.debug.js" --js_output_file "D:\Projects\Xormis\trunk\Source\Xormis.Web\Scripts\script-bundle.min.js"" exited with code 1. Xormis.Web
Here’s a possible workaround for this. You just need to convert the relative path to an absolute one. If visual studio can handle regular command prompt commands with command extensions, this may work:
You may need to tweak these to fit your needs.