开发者

How to version control generated code from Flex model driven development?

开发者 https://www.devze.com 2023-02-01 02:00 出处:网络
We are using Flash builders data services feature to generate ActionScript services/ValueObjects code along with PHP services code using the MySQL data source.

We are using Flash builders data services feature to generate ActionScript services/ValueObjects code along with PHP services code using the MySQL data source.

Flash-builder manages this by creating a model file({projectname}.fml) which comprises the configuration required for Flash-builder to auto-generate the Super services/value object classes.

Since the Super classes are generated from model file on every developers machine, we decided to remove them from version control and instead include the .fml into version control so that the code-base remains in sync.

The problem we are struggling with is that the model file contains hard-coded references to system server path and server URL which would vary from machine to machine. Following is a configuration for one service in the model.

<item name="PHP_RELATIVE_LOCATION">flex/bin-debug/services/PropertyService.php</item>
  <item name="PHP_SERVER_ROOT">C:/xampp/htdocs/video</item>
  <item name="DEFAULT_ENTITY_PACKAGE">valueObjects</item>
  <item name="PHP_SERVICES_FOLDER">C:/xampp/htdocs/video/flex/bin-debug/services</item>
  <item name="PHP_LOCATION">C:/xampp/htdocs/video/flex/bin-debug/services/PropertyService.php</item>
  <item name="LINKED_FILE">PropertyService.php</item>
  <item name="PHP_SERVER_ROOT_URL">http://localhost/video/</item>
  <item name="ABSOLUTE_ENDPOINT">http://localhost/video/flex/bin-debug/gateway.php</item>
  <item name="PHP_CLASS_NAME">PropertyService</ite开发者_如何学JAVAm>

Therefore, there is a problem in version controlling the model .fml file.


You will need to add linked resources in eclipse. You can ex. do a SERVER_ROOT that goes in second line like this:<item name="PHP_SERVER_ROOT">{SERVER_ROOT}</item>and points to C:/xampp/htdocs/video or whatever directory that developer has on his machine. You can configure those in Eclipse/ FB via window->preferences->linked resources.

(I have not tested the syntax in the above example btw.)

0

精彩评论

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