开发者

Eclipse/Flex: update a file every time I launch?

开发者 https://www.devze.com 2022-12-19 16:09 出处:网络
OK my project uses an xml file called Chart-app.xml inside this XML file there is a tag called <version></version> which I keep in the format like: <version>1.2.128</version> I

OK my project uses an xml file called Chart-app.xml inside this XML file there is a tag called <version></version> which I keep in the format like: <version>1.2.128</version> I am wondering if I can s开发者_如何学Pythonet it to append to the third number every time I run my project.

So if I ran it now it would be 1.2.129, then if i ran it again it would be 1.2.130

Thanks!!


After reading VonC's answer I don't know anything about ANT or creating custom builds, but he did give me an idea that seems to be working:

I already have a method to tell if the app is running in the ADL (within eclipse), so if it is, I just have my app open the file itself and change the value.


I am not sure there is a native Eclipse way to do this.

You can increment the number within that xml file either:

  • programmatically, launching a special class which do that, and then call your primary application Class
  • through a dependency during launch, for instance, you can make a JUnit test suite which will first call a Java class doing the increment, and then call your main method.

But in both case, you would have to somehow code the increment process.


Note: it is easier when you want to increment something each time you build, because you can add a custom builder.

0

精彩评论

暂无评论...
验证码 换一张
取 消