This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Command line tools for CCS project seems broken

Other Parts Discussed in Thread: CCSTUDIO

Dear Team TI,

I am writing a script to automate building of 4 projects. 2 are ARM projects and 2 are DSP projects. All of them are ccsv5 projects. I have written following script

# Build test project

# Constants
$SCRIPT_PATH = split-path -parent $MyInvocation.MyCommand.Definition
$ECLIPSE_CONSOLE_PATH = "$env:ECLIPSE_HOME\eclipsec.exe"
$LIB_ARM_PROJECT_NAME = "TicLibArm"
$LIB_ARM_PROJECT_FOLDER = "$SCRIPT_PATH/../src/main/libArm"
$ARM_PROJECT_NAME = "TicArm"
$ARM_PROJECT_FOLDER = "$SCRIPT_PATH/../src/main/arm"
$LIB_DSP_PROJECT_NAME = "TicLibDsp"
$LIB_DSP_PROJECT_FOLDER = "$SCRIPT_PATH/../src/main/libDsp"
$DSP_PROJECT_NAME = "TicDsp"
$DSP_PROJECT_FOLDER = "$SCRIPT_PATH/../src/main/dsp"
$WORKSPACE_FOLDER = "$SCRIPT_PATH\workspace"

# Check whether the needed environment variable is set
if (!(Test-Path Env:\ECLIPSE_HOME))
{
"Sorry dude, but you forgot to define the ECLIPSE_HOME environment variable in the Windows system settings."
exit 1
}

# Delete existing temporary workspace folder if existing
if (Test-Path $WORKSPACE_FOLDER)
{
Remove-Item $WORKSPACE_FOLDER -Force -Recurse
}

# Create new temporary workspace folder
New-Item -ItemType directory -Path $WORKSPACE_FOLDER | Out-Null

# Import TicLibArm project into temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectImport –ccs.location $LIB_ARM_PROJECT_FOLDER

# Build TicLibArm project using the temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectBuild -ccs.projects $LIB_ARM_PROJECT_NAME

# Cleanup
Remove-Item $WORKSPACE_FOLDER -Force -Recurse

# Delete existing temporary workspace folder if existing
if (Test-Path $WORKSPACE_FOLDER)
{
Remove-Item $WORKSPACE_FOLDER -Force -Recurse
}

# Create new temporary workspace folder
New-Item -ItemType directory -Path $WORKSPACE_FOLDER | Out-Null

# Import TicArm project into temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectImport –ccs.location $ARM_PROJECT_FOLDER

# Build TicArm project using the temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectBuild -ccs.projects $ARM_PROJECT_NAME

# Cleanup
Remove-Item $WORKSPACE_FOLDER -Force -Recurse

# Delete old source code
if (Test-Path $TARGET_FOLDER)
{
Remove-Item "$TARGET_FOLDER\*" -Include *.cpp,*.h -Force -Recurse
}

# Copy source code from TicLibArm project to TicLibDsp project and make it read-only
robocopy $LIB_ARM_PROJECT_FOLDER $LIB_DSP_PROJECT_FOLDER /MIR /S /IF *.cpp *.h /XD Debug Release .config .svn /A+:R | Out-Null
"Copied source code from TicLibArm project to TicLibDsp project."

# Delete existing temporary workspace folder if existing
if (Test-Path $WORKSPACE_FOLDER)
{
Remove-Item $WORKSPACE_FOLDER -Force -Recurse
}

# Create new temporary workspace folder
New-Item -ItemType directory -Path $WORKSPACE_FOLDER | Out-Null

# Import TicLibDsp project into temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectImport –ccs.location $LIB_DSP_PROJECT_FOLDER

# Build TicLibDsp project using the temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectBuild -ccs.projects $LIB_DSP_PROJECT_NAME

# Cleanup
Remove-Item $WORKSPACE_FOLDER -Force -Recurse

# Delete existing temporary workspace folder if existing
if (Test-Path $WORKSPACE_FOLDER)
{
Remove-Item $WORKSPACE_FOLDER -Force -Recurse
}

# Create new temporary workspace folder
New-Item -ItemType directory -Path $WORKSPACE_FOLDER | Out-Null

# Import TicDsp project into temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectImport –ccs.location $DSP_PROJECT_FOLDER

# Build TicDsp project using the temporary workspace
&$ECLIPSE_CONSOLE_PATH -nosplash -data $WORKSPACE_FOLDER -application com.ti.ccstudio.apps.projectBuild -ccs.projects $DSP_PROJECT_NAME

# Cleanup
Remove-Item $WORKSPACE_FOLDER -Force -Recurse

Earlier I used cdt headless build command which was able to build libarm and lib dsp project but for arm and dsp projects gave error saying missing variable path include path missing.

I searched and read on your wiki that cdt headless build should only be used for C/C++ projects. So following your wiki I wrote the script that I have pasted above.

I get following error

Message in the log file is as follows:

!SESSION 2013-12-05 11:00:02.656 -----------------------------------------------
eclipse.buildId=I20120608-1200
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -application com.ti.ccstudio.apps.projectImport â€ccs.location C:\projects\tic\swf/../src/main/libArm

# Build TicLibArm project using the temporary workspace
&C:\ti\ccsv5\eclipse\eclipsec.exe -nosplash -data C:\projects\tic\swf\workspace -application com.ti.ccstudio.apps.projectBuild -ccs.projects TicLibArm

# Cleanup
Remove-Item C:\projects\tic\swf\workspace -Force -Recurse

# Delete existing temporary workspace folder if existing
if (Test-Path C:\projects\tic\swf\workspace)
{
Remove-Item C:\projects\tic\swf\workspace -Force -Recurse
}

# Create new temporary workspace folder
New-Item -ItemType directory -Path C:\projects\tic\swf\workspace | Out-Null

# Import TicArm project into temporary workspace
&C:\ti\ccsv5\eclipse\eclipsec.exe -nosplash -data C:\projects\tic\swf\workspace -application com.ti.ccstudio.apps.projectImport â€ccs.location C:\projects\tic\swf/../src/main/arm
Command-line arguments: -os win32 -ws win32 -arch x86 -data C:\projects\tic\swf\workspace -application com.ti.ccstudio.apps.projectImport â€ccs.location C:\projects\tic\swf/../src/main/libArm

# Build TicLibArm project using the temporary workspace
&C:\ti\ccsv5\eclipse\eclipsec.exe -nosplash -data C:\projects\tic\swf\workspace -application com.ti.ccstudio.apps.projectBuild -ccs.projects TicLibArm

# Cleanup
Remove-Item C:\projects\tic\swf\workspace -Force -Recurse

# Delete existing temporary workspace folder if existing
if (Test-Path C:\projects\tic\swf\workspace)
{
Remove-Item C:\projects\tic\swf\workspace -Force -Recurse
}

# Create new temporary workspace folder
New-Item -ItemType directory -Path C:\projects\tic\swf\workspace | Out-Null

# Import TicArm project into temporary workspace
&C:\ti\ccsv5\eclipse\eclipsec.exe -nosplash -data C:\projects\tic\swf\workspace -application com.ti.ccstudio.apps.projectImport â€ccs.location C:\projects\tic\swf/../src/main/arm

!ENTRY org.eclipse.equinox.http.jetty 4 0 2013-12-05 11:00:03.444
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.equinox.http.jetty.internal.Activator.start() of bundle org.eclipse.equinox.http.jetty.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1177)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: org.osgi.service.cm.ConfigurationException: default : Address already in use: bind
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:115)
at org.eclipse.equinox.http.jetty.internal.Activator.start(Activator.java:62)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 12 more
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:182)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:311)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:260)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.Server.doStart(Server.java:273)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:113)
... 16 more
Root exception:
org.osgi.service.cm.ConfigurationException: default : Address already in use: bind
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:115)
at org.eclipse.equinox.http.jetty.internal.Activator.start(Activator.java:62)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1177)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:182)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:311)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:260)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.Server.doStart(Server.java:273)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:113)
... 16 more

!ENTRY org.eclipse.osgi 4 0 2013-12-05 11:00:05.561
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
at com.ti.ccstudio.apps.internal.project.Import.getReturnCode(Import.java:196)
at com.ti.ccstudio.apps.internal.BaseHeadlessApp.start(BaseHeadlessApp.java:230)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

I able to build all the 4 projects in the studio but I need to automate the building of the project.

Looking forward to your help,

Dhara.