Custom build event

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

AS7, Windows 10

 

Hi there,

 

I wonder if it is possible to add a "pre" build event to the build process. At the end of the day I want to have the revision number of git/svn automatically added to my source code so that release distinction can be done during run time.

 

I only want to put the build button and the release number is gathered (git or svn by a script) and added to any source file.

 

Are there solutions out there?

The script I can write my self but I don't know how to add such a script into the build process.

 

Thanks for any help.

Cheers Nik

 

This topic has a solution.
Last Edited: Wed. Feb 19, 2020 - 03:07 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I *think* that AS7 is using MSBuild behind the scenes so I think you can probably use a .targets to achieve a custom build step just as you would do in any MSBuild driven project.

 

The only thing though is whether the UI exists to bind such an even to the build chain as it does in Visual Studio:

 

 

 

EDIT: OK so scratch that as an idea - having looked at AS7 it seems to have no way (well no way in the UI) to add steps so it looks like you are limited to the Pre/Post events they provide by default.

Last Edited: Wed. Feb 19, 2020 - 12:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Studio does use msbuild, the .targets files are in the Vs folder in your Studio installation... 

 

(Normal dragons applies ofc when it comes to changing .targets smiley)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Looks like you might be able to "hack into" compiler.targets but one would need to be very careful with backups and so on.

 

but it seems to me that the existing:

 

 

should be all that's required - it's not like you need to "break into" the build sequence between compile and link or the other kind of things you might usually use .targets for.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, this helps!! Thank you very much!!