You want the version (build) of your app to auto-increment each time you build an AIR project.
Use a Ruby script as a Builder before compiling the application.
1. Get Ruby, install it to a path of your choice
2. Create a file version.rb in your project's source folder with the following contents:
#!/usr/bin/ruby
require 'rexml/document'
versionSeparator = "."
props = File.new("../.actionScriptProperties")
props_root = REXML::Document.new(props).root
filename = props_root.attributes["mainApplicationPath"].to_s
filename = filename.split(".")[0].to_s + "-app.xml"
file = File.new(filename)
root = REXML::Document.new(file).root
version = root.elements["version"].text.split(versionSeparator)
version[-1] = (version[-1].to_i + 1).to_s
root.elements["version"].text = version.join(versionSeparator)
File.open(filename,'w') do |f| f << root.parent end
3. Open your AIR Project's Properties, go to Builders, and add a new one of type "Program". Name it, say, "VersionIncrementer"
4. In it's "Edit Configuration" window, in the Main tab:
and in the Refresh tab:
5. Move the Builder to the top of the list.
Nota bene: if your version string is not of the type X.X.X you'll have to change the separator variable in the script.
+