Use ant to compile the flex SWC File

Source: Internet
Author: User
Tags echo message

Today, a new Flex Library Project project is built, but the automatically compiled SWC file name cannot be defined. a swc file with the same project name is automatically generated. So I decided to use ant for self-compilation.

First you can refer to the http://blog.jodybrewster.net/2008/04/09/installing-ant-in-flex-builder-3/ document to install ant enviroment support in flex builder.

Build the build. xml and build. properties files as follows:

 

  1. ###### Flex properties ##############################
  2. # Change this path to your flex SDK directory
  3. # Use "/" in your directory path e.g. C:/flexsdk/3.0.0
  4. Flex_home = D:/IDE/Adobe/flex builder 3/sdks/3.0.0
  5. ###### Project properties ###########################
  6. Src-Dir =$ {basedir}/src
  7. SWC-file = sample. SWC

 

  1. <Project name = "ant build SWC sample" basedir = "." default = "build SWC">
  2. <! -- Load user configuration properties -->
  3. <Property file = "build. properties"/>
  4. <Taskdef resource = "flextasks. Tasks" classpath = "$ {flex_home}/ANT/lib/flextasks. Jar"/>
  5. <Target name = "prepareenv">
  6. <Mkdir dir = "$ {basedir}/SWC"/>
  7. </Target>
  8. <Target name = "clear" depends = "prepareenv">
  9. <Delete file = "$ {basedir}/SWC/$ {SWC-file}"/>
  10. </Target>
  11. <Target name = "build SWC" depends = "clear">
  12. <Fileset dir = "$ {Src-Dir}" id = "src. Files">
  13. <Include name = "**/**"/>
  14. </Fileset>
  15. <Echo message = "$ {SRC. Files}"/>
  16. <Pathconvert
  17. Property = "evaframework_classes"
  18. Pathsep = ""
  19. Dirsep = "."
  20. RefID = "src. Files"
  21. >
  22. <Map from = "/" to = "/"/>
  23. <Map from = "$ {Src-Dir}/" to = ""/>
  24. <Mapper>
  25. <Chainedmapper>
  26. <Globmapper from = "*. As" to = "*"/>
  27. </Chainedmapper>
  28. </Mapper>
  29. </Pathconvert>
  30. <Echo message = "$ {evaframework_classes}"/>
  31. <Compc output = "$ {basedir}/SWC/$ {SWC-file }"
  32. Include-classes = "$ {evaframework_classes}">
  33. <Source-Path-element = "$ {Src-Dir}"/>
  34. </Compc>
  35. </Target>
  36. </Project>

 

Run ant editing.

For more details and complex compilation environments, refer to the http://blog.jodybrewster.net/2008/04/09/installing-ant-in-flex-builder-3/ document.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.