I want to use ANT build to translate .properties file into text file (code).
Input file my.properties:
FOO=foo bar
BAR=bar bar foo
Desired output file Constants.as:
package foo.bar {
public final class Constants {
public static const FOO:String = "FOO";
public static const BAR:String = "BAR";
}
}
Note: ActionScript can’t use properties files like Java, so I need to use this translation as a pre-build task. My properties file is localization and I want the keys as constants.
I’ve managed to hack it through
scriptdefin JavaScript.Any ideas how to do it better?