Atmel Studio 7 pre-build event for all configurations never executed?

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I have a simple command to run as pre-build event in Atmel Studio 7. I want to run it for all configurations so I have put it in "Pre-build event command line" with Configuration set to "All configurations". For some reason it seems like AS7 never executes the command:

 

------ Rebuild All started: Project: MySecretProject, Configuration: Debug ARM ------
Build started.
Project "MySecretProject.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\svn\SECRET_PROJECT\trunk\firmware\MySecretProject\MySecretProject.cproj" (target "Build" depends on it):
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync 

 

I am quite sure I had this problem before and the only solution I found was to define the pre-build event for each configuration I had. This works also for this project:

 

------ Build started: Project: MySecretProject, Configuration: Debug ARM ------
Build started.
Project "MySecretProject.cproj" (default targets):
Target "PreBuildEvent" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "D:\svn\SECRET_PROJECT\trunk\firmware\MySecretProject\MySecretProject.cproj" (target "Build" depends on it):
    Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "Exec"
        cd D:\svn\SECRET_PROJECT\trunk\firmware\
..\tools\svn2c\svn2c\bin\Debug\svn2c.exe -ss MySecretProject\version.c svn_revision_str
        Modified line: char *svn_revision_str = "3018M";
                1 fil(er) kopierad(e).
    Done executing task "Exec".
Done building target "PreBuildEvent" in project "MySecretProject.cproj".

Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\svn\SECRET_PROJECT\trunk\firmware\MySecretProject\MySecretProject.cproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll"

 

But I don't like this. Is there a better solution?

 

NOTE: path and project name has been modified since this is a top-secret project! ;-)

/Jakob Selbing

Last Edited: Tue. May 21, 2019 - 09:06 AM