fumeng
fumeng

Reputation: 1830

Define version as compiler option

If I define the current version of my web app via a compiler arg is that considered bad form?

-define=CONFIG::VERSION,1.005

Should I really be loading an XML file with this info?

Just want to use the best approach.

Thank you!

Upvotes: 0

Views: 83

Answers (1)

fsbmain
fsbmain

Reputation: 5267

Versioning via defining compile parameters is the best approach in my opinion as well because it's the simplest way to integrate as3 runtime-accessbile version and build scripts. It's also quite extendable without modifying existing code:

  1. You have version in as3 code without loading (or embedding) and parsing xml configs.
  2. You can easily pass version in build script and if you use ant buildnumber target it will automatically increment version and store it in the external file.
  3. Storing version in external file in version control system automatically marks the sources so you can easily check out it later for the given version.
  4. You can still add the creation of version.xml file in build script (and place it in the build directory for example) later if you need to share version with other modules or server.

I use such approach for several years in different projects (from small test applications to big online games) and it always works fine for me.

Upvotes: 2

Related Questions