How to build a CodeWarrior v6.3 Project in command line? - command-line

Refer to this documentation, I try to build an old Code Warrior V6.3 Project (.mcp) via command line.
PS C:\Program Files (x86)\Freescale\CodeWarrior for Microcontrollers V6.3\bin> .\cmdide /q /f n /b C:\Users\ps\Desktop\LadeHeiz_WORKON\LadeHeiz.mcp
Freescale CodeWarrior IDE. Hit /? for help
No Error. (Code 0)
So console output says No Error but the UI-IDE is opening and gives me this error message:
A look to the bin folder of my project tells me, that the generated .s19 is not updated, so the build process didn't run.
Question: Has anyone experiences with CW6.3 command line tool and can give me some hints how to build the old project? The GUI based IDE is not an option, because we have to automatically build the project in an CI-System.

The answer is very simple. The option /q (quit) must not be called without calling /c (close) before.
PS C:\Program Files (x86)\Freescale\CodeWarrior for Microcontrollers V6.3\bin> .\cmdide /r /b C:\Users\ps\Desktop\LadeHeiz_WORKON\LadeHeiz.mcp /c /q
Freescale CodeWarrior IDE. Hit /? for help
No Error. (Code 0)
Now there is the following workflow
Delete old build files
Build new files (refer to the specific path)
Close project
Quit CodeWarrior

Related

Getting workspace path in Notepad++ run commands

I am using Notepad++ with workspaces, created through "Open Folder as Workspace".
I am trying to launch external command from Notepad++ using the Run command menu.
The variable FULL_CURRENT_PATH give me the current file path but I need to get the worskpace path to launch some deployment script in the root of the workspace.
Is there a variable for workspace path ?
I'm afraid there is no such variable. You can see a list of all variables in the source code of Notpad++:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp
You can read the Workspace directories from the configuration file, but the file will only be written if Notepad ++ is closed. Maybe someone has an idea how to trigger that
cmd /c echo. |powershell -Command [xml]$nb = Get-Content $env:appdata\Notepad++\config.xml; Write-Output $nb.NotepadPlus.FileBrowser.root.foldername

create a link in windows so it can find msbuild without full path

Not sure how to do this... I work mostly on OSX and linux systems, so when I install an app or use for example G++ or xcodebuild, I just call it from terminal.
On Windows, I did install msbuild with VS2015, but if I am in powershell or regular command prompt, typing msbuild result in an error. I have to specify the whole path to make it work.
What is the equivalent in Windows world, of setting console so when I type msbuild, it gets the correct path?
You can set your path like so in:
PowerShell
$Env:Path = "<Path_to_msbuild>;${Env:Path}"
Batch/Cmd
set "PATH=<Path_to_msbuild>;%PATH%"
Note: The <path_to_msbuild> is the folder where msbuild.exe exists, and NOT the direct path to the executable itself
How it works
This will add the msbuild binary to your path, so you can invoke it from anywhere!
To verify which location msbuild is running from you can simply run (in both languages!):
where.exe msbuild
If you create just a link to msbuild you still won't be able to call for example the compiler from the command line. Which is why VS provides a convenient (pretty much canonical) way to do this by supplying a batch file which sets up the PATH and all the other build-related environment variables.
Example if you are on cmd.exe:
> "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
> msbuild
Microsoft (R) Build Engine version 14.0.25420.1
...
> cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24213.1 for x86
...
You can invoke this from the Start menu as well: hit start, type pro vs to look for matches, select Developer Command Prompt for VS2015.
For PowerShell (which I'd recommend spending time on instead of cmd) you'll need an extra function like presented here: https://stackoverflow.com/a/21652729/128384

Configuring Eclipse tool to run a Windows command

I would like to make a tool to run the following command in Eclipse. However, I haven't had success because "copy" is not a "Location" of a program, and so Eclipse doesn't recognize it.
copy /b ${env_var:SERVER_HOME}\pickup\star-web-custom.plan +,,
Any suggestions? I'm fairly new to Eclipse.
In "Location" put ${env_var:SystemRoot}\system32\cmd.exe
In "Arguments" put /c "copy /b ${env_var:SERVER_HOME}\pickup\star-web-custom.plan +,,"
It should help. If something goes wrong, then just try to play with "Arguments" as of something simple like /c "somesimplecommandhere"
Put this command in a script and then set the location of that script (full path, including the full name of the script) in the "Location" text box.
I would usually write this sort of thing as an Ant task instead of an External Tool configuration. That's not to say that you can't do it. One advantage of the Ant task is that it is more portable.

findstr is not recognized when trying to start Jboss server

I've downloaded Jboss jboss-5.0.0.CR2-jdk6.zip file and extracted the zip. Then I've set system variable JBOSS_HOME=F:\jboss-5.0.0.CR2. When I'm trying to run the jboss by double click on run.bat it executes for a while and then windows are automatically closed. If I run the run.bat file from command prompt it shows the error depicted below:
I am not able to find out where is the problem, please help me.
Have a look at this JBoss wiki
The problem is findstr is not in your path, set it and restart command prompt .
You can set path containing findstr to rid out of this.
Here is material how to set path

VS2008 Command Prompt + Cygwin

I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can 'import' the vcvars32.bat functionality into the cygwin environment so I can call "tfs checkout" from cygwin itself?
According to this page you need to:
"Depending on your preference, you can either add the variables required for compilation direct to your environment, or use the vcvars32.bat script to set them for you. Note you have to compile from a cygwin bash shell, to use vcvars32, first run a DOS shell, then run vcvars32.bat, then run cygwin.bat from the directory where you installed cygwin. You can speed this up by adding the directory containgin vcvars32 (somewhere under \Microsoft Visual Studio\VC98\bin) and the directory containing cygwin.bat to your path."
Here is my sample Cygwin.bat file that configures Visual studio and starts mintty
#echo off
#REM Select the latest VS Tools
IF EXIST %VS100COMNTOOLS% (
CALL "%VS100COMNTOOLS%\vsvars32.bat"
GOTO :start_term
)
IF EXIST %VS90COMNTOOLS% (
CALL "%VS90COMNTOOLS%\vsvars32.bat"
GOTO :start_term
)
IF EXIST %VS80COMNTOOLS% (
CALL "%VS80COMNTOOLS%\vsvars32.bat"
GOTO :start_term
)
:start_term
C:
chdir C:\cygwin\bin
START mintty.exe -i /Cygwin-Terminal.ico -
witkamp's answer works for vs2005 -- for vs2008, use
CALL "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"