Other Parts Discussed in Thread: CCSTUDIO
Tool/software: Code Composer Studio
Hello,
I have some CCS projects which build fine when built manually from the CCS IDE, but now I want to automate the building procedure for the entire set of projects from Windows command line.
To do this it seems I need to use either javascript or gmake. The build succeeds with the CCS scripting console command "buildProject", but when doing the same from a .js file the buildProject function is not recognized.
Do I need to import some additional package?
Here is a simple javascript (buildAll.js) I have experimented with:
// Import the DSS packages into our namespace to save on typing
importPackage(Packages.com.ti.debug.engine.scripting)
importPackage(Packages.com.ti.ccstudio.scripting.environment)
importPackage(Packages.java.lang)
// Create our scripting environment object - which is the main entry point into any script and
// the factory for creating other Scriptable ervers and Sessions
var script = ScriptingEnvironment.instance()
script.traceBegin("CCSSession.xml", "DefaultStylesheet.xsl")
// Log everything
script.traceSetConsoleLevel(TraceLevel.ALL)
script.traceSetFileLevel(TraceLevel.ALL)
// Start up CCS
var ccsServer = script.getServer("CCSServer.1")
var ccsSession = ccsServer.openSession(".*")
// Build projects
buildProject("> armApp");
buildProject("> dspApp");
script.traceWrite("TEST SUCCEEDED!")
script.traceEnd()
// Terminate CCS
ccsSession.terminate()
ccsServer.stop()
This is how I run the script from the command line:
C:\ti\ccsv6\eclipse\eclipsec.exe -nosplash -data c:\myworkspace -application com.ti.ccstudio.apps.runScript -ccs.script buildAll.js
The output:
traceSetFileLevel: ENTRY sLevel: ALL
traceSetFileLevel: RETURN
getServer: ENTRY sServerName: CCSServer.1
getServer: Getting definition for: CCSServer.1
getServer: Constructing server
getServer: RETURN com.ti.ccstudio.scripting.CCSServer@75cea3
Opening Eclipse Platform Workbench. Please wait........
js: "buildAll.js", line 30: uncaught JavaScript runtime exception: ReferenceError: "buildProject" is not defined.
dvtLogOptions.xml DOES NOT exists
With the gmake the problem is how to add the include directories and all the required predefinitions and libs into the actual make operation without modifying the Makefile. In Linux this can be maybe done with "exports" command, but in Windows the same just does not work. I have tried with setting environment variables CFLAGS, C_FLAGS, CPPFLAGS and CXXFLAGS, but no success. I could use a Linux machine for automated building, but I want first see if either the javascript or gmake can be made working in a way or another.
Actually there is one more alternative: Building a CCS project with eclipsec, but it fails for the ARM project. Amazingly the build of DSP project succeeds with this alternative! But I don't want to use different tools for each project.
Output from the failing ARM build:
C:\ti\ccsv6\eclipse\eclipsec.exe -nosplash -data C:\myworkspace -application com.ti.ccstudio.apps.projectBuild -ccs.projects armApp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CCS headless build starting... [Sat Jan 05 14:37:05 EET 2019]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
================================================================================
Pre processing...
================================================================================
Building...
!ERROR: Project 'armApp' could not be loaded!
================================================================================
CCS headless build complete!
I appreciate any help for any of the 3 build alternatives I described above.
Best regards,
Ari