Create batch file for command line building

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

eddyfraga
Posts: 2
Joined: Sun Aug 24, 2014 4:53 pm

Create batch file for command line building

Sun Aug 24, 2014 5:56 pm

Hi,

I've been trying to implement a batch file to successfully build my Atmel Studio project outside of the GUI to eventually build my project from a CI.

My first step was to simply call the tool and execute a "clean". My batch file was inspired on the information found here:

http://avrstudio5.wordpress.com/2012/05 ... mand-line/

Here is what my batch file presently looks like:

*******************************************

@echo off
setlocal enabledelayedexpansion

set PROJECT_PATH="d:\foo\Project"
set PROJECT_FILE="MyProject.cproj"
set BUILD_TOOL="atmelstudio.exe"
set BUILD_TOOL_PATH="C:\Program Files (x86)\Atmel\Atmel Studio 6.2"

cd /d %PROJECT_PATH%
%BUILD_TOOL_PATH%\%BUILD_TOOL% %PROJECT_FILE% /clean debug /out test.txt

*******************************************

Unfortunately, my output file tells me that an error occurred. Here is my output:

*******************************************

error  : Resolution of the dependency failed, type = "Atmel.VsIde.AvrStudio.Asf.DataProvider.Logging.IAvrSoftwareFrameworkLogger", name = "default".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, Atmel.VsIde.AvrStudio.Asf.DataProvider.Logging.IAvrSoftwareFrameworkLogger, is an interface and cannot be constructed. Are you missing a type mapping?
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Atmel.VsIde.AvrStudio.Asf.DataProvider.Logging.IAvrSoftwareFrameworkLogger,default

One or more projects in the solution were not loaded correctly.
Please see the Output Window for details.========== Clean: 0 succeeded, 0 failed, 0 skipped ==========

*******************************************

Does anyone have an idea what my error is? I'm a little baffled.

Kind regards,
eddyfraga
Posts: 2
Joined: Sun Aug 24, 2014 4:53 pm

Re: Create batch file for command line building

Sun Aug 31, 2014 2:07 am

Hi,

I just wanted to post that I solved my own issue. Here is the solution:

First, I modified the batch file to no longer build using "cproj" but rather the "atsln" file. Here is the corrected batch file example:

*******************************************

@echo off
setlocal enabledelayedexpansion

set PROJECT_PATH="d:\foo\Project"
set PROJECT_FILE="MyProject.atsln"
set BUILD_TOOL="atmelstudio.exe"
set BUILD_TOOL_PATH="C:\Program Files (x86)\Atmel\Atmel Studio 6.2"

cd /d %PROJECT_PATH%
%BUILD_TOOL_PATH%\%BUILD_TOOL% %PROJECT_FILE% /clean debug /out test.txt

*******************************************

When I tested the batch file with Atmel Studio 6.1, it worked beautifully but I was not able to get it working with version 6.2. Out of desperation I re-installed version 6.2 and re-tried the batch file and it worked.

Problem solved!

Despite the quietness of this thread, I would like to thank everyone who had viewed the post for taking the time/effort to look into this issue.

Regards!

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 1 guest