Zurück zu Willert.de

Using Rhapsody and the Willert RXF with automated builds

Using Rhapsody and the Willert RXF with automated builds

Postby eroemer » April 28th, 2014, 6:05 pm

The WSTDeployer can be integrated in an automated / nightly build environment for continuous software integration.

The following sample batch file structure shows how code can be generated from a user application UML model and deployed into the IDE. This sample is based on IBM Rational Rhapsody as modeling tool and Keil uVision as IDE.
Code: Select all
rem ==== STEP 1 ====
rem Generate/build model using RhapsodyCL

@echo on
cd "<Rhapsody path>"
RhapsodyCL.exe -verbose -dev_ed -lang=C -cmd=open "<model dir>\<model name>.rpy" -cmd=generate -cmd=syncmake
@if ERRORLEVEL 1 (
   echo Errorlevel of RhapsodyCL: %errorlevel%
   echo   List of error codes from Rhapsody help:
   echo   100: failed to open the project file 
   echo   101: license not found               
   echo   102: code generation failed           
   echo   103: failed to load the project       
   echo   104: failed to create/write CG folder
   echo   105: errors were found in check model
   echo   106: unresolved elements in scope
   echo   107: comp. or configuration name error
    echo   108: build failed
   exit /b %errorlevel%
)
@echo off


rem ==== STEP 2 ====
rem Use the WSTDeployer without need for the RhapsodyAPI to deploy files to the compiler toolchain

cd /d "<Willert RXF path>\Tools\WSTDeployer"
java -classpath bin;WSTDeployer.jar;log4j-1.2.14.jar;jdom.jar;"<Rhapsody path>\Share\JavaAPI\rhapsody.jar" -Djava.library.path="<Rhapsody path>\Share\JavaAPI" wst.WSTDeployer debug version "setSourceDir(<path to generated sources>)" "setDestProj(<path to IDE project file>)" version deploy
@if ERRORLEVEL 1 (
   echo Errorlevel of Deployer Java call: %errorlevel%
   exit /b %errorlevel%
)


rem ==== STEP 3 ====
rem Build IDE project from command line
   
"<Keil path>\UV4\Uv4.exe" -r "<path to IDE project file>"
... -o "<build result path>\BuildLog.txt"
@if ERRORLEVEL 1 (
  echo Errorlevel of compiler toolchain build: %errorlevel%
  exit /b %errorlevel%
)
@type "<build result path>\BuildLog.txt"
@if ERRORLEVEL 1 (
  echo Could not find compiler toolchain build log file.
  exit /b %errorlevel%
)
@if not exist "<build result path>\<hex or elf file>" (
  echo Could not find expected build output file
  exit /b 1
)


Please Note: Please note this is just a sample configuration and the automated build process may vary massively for different combinations of tools.
User avatar
eroemer
 
Posts: 9
Joined: October 14th, 2011, 10:16 am
Location: Bremen
Company: Willert Software Tools GmbH

Newer RXF Releases Launch the Deployer already in the Build

Postby eroemer » September 15th, 2016, 10:16 am

Newer frameworks call the WSTDeployer already in RhapsodyMake.bat (related to the build step), not anymore in RhapsodyRun.bat (which was related to the run executable command in Rhapsody).

So a syncmake command for RhapsodyCL would launch the deployer. But it is easy to prevent by setting und un-setting an environment variable before and after the RhapsodyCL call:

Code: Select all
set WST_DEPLOYER_DISABLED=true
RhapsodyCL......
set WST_DEPLOYER_DISABLED=


Afterwards the deployer can be called from the automated build batch as explained.
User avatar
eroemer
 
Posts: 9
Joined: October 14th, 2011, 10:16 am
Location: Bremen
Company: Willert Software Tools GmbH


Return to Application Notes

Who is online

Users browsing this forum: No registered users and 2 guests

cron