0

I would like to set a variable in my swf at compile time that reads the current commit/branch from git and also edits the pom.xml with that name as the artifact id. I want to do this so that I can query a swf and retreive which version of the maven build it is.

Is this possible, and which plugins would I use to do this?

I have done this sort of thing using ANT in the past, but I need to be able to do it using Maven instead. My searches on the internet have mostly revealed ways to do this in Java but not in Actionscript.

Avik
  • 723
  • 6
  • 16
  • I see I need to wait for the answer to this question. http://stackoverflow.com/questions/13583953/deriving-maven-artifact-version-from-git-branch How can I "watch" it? – Avik Dec 05 '12 at 08:33

1 Answers1

0

I assume you are using the flexmojo's plugin. Have a look at the flexmojo's definesDeclaration parameter. This will allow you to pass in values for the compiler variables you define in your Actionscript project with the -define option (per the Adobe article you've linked to).

Then it's just a matter of setting that value to the artifact ID, date/time, or whatever.

Sunil D.
  • 17,983
  • 6
  • 53
  • 65
  • Thanks, that's a good starting point, but how do I programatically pull it from git? – Avik Dec 04 '12 at 20:32
  • Maybe something like [this](http://stackoverflow.com/questions/6359332/how-can-i-do-a-git-pull-in-maven) will help. – Sunil D. Dec 04 '12 at 21:02
  • Sorry, you misunderstood me. I mean how do I get the branch name into the version of the pom.xml. That is, I want to change the value in the pom before running through the build. (I'll then set that name as the compile time var in the swf) – Avik Dec 05 '12 at 08:19