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:
- ###### Flex properties ##############################
- # Change this path to your flex SDK directory
- # Use "/" in your directory path e.g. C:/flexsdk/3.0.0
- Flex_home = D:/IDE/Adobe/flex builder 3/sdks/3.0.0
- ###### Project properties ###########################
- Src-Dir =$ {basedir}/src
- SWC-file = sample. SWC
- <Project name = "ant build SWC sample" basedir = "." default = "build SWC">
- <! -- Load user configuration properties -->
- <Property file = "build. properties"/>
- <Taskdef resource = "flextasks. Tasks" classpath = "$ {flex_home}/ANT/lib/flextasks. Jar"/>
- <Target name = "prepareenv">
- <Mkdir dir = "$ {basedir}/SWC"/>
- </Target>
- <Target name = "clear" depends = "prepareenv">
- <Delete file = "$ {basedir}/SWC/$ {SWC-file}"/>
- </Target>
- <Target name = "build SWC" depends = "clear">
- <Fileset dir = "$ {Src-Dir}" id = "src. Files">
- <Include name = "**/**"/>
- </Fileset>
- <Echo message = "$ {SRC. Files}"/>
- <Pathconvert
- Property = "evaframework_classes"
- Pathsep = ""
- Dirsep = "."
- RefID = "src. Files"
- >
- <Map from = "/" to = "/"/>
- <Map from = "$ {Src-Dir}/" to = ""/>
- <Mapper>
- <Chainedmapper>
- <Globmapper from = "*. As" to = "*"/>
- </Chainedmapper>
- </Mapper>
- </Pathconvert>
- <Echo message = "$ {evaframework_classes}"/>
- <Compc output = "$ {basedir}/SWC/$ {SWC-file }"
- Include-classes = "$ {evaframework_classes}">
- <Source-Path-element = "$ {Src-Dir}"/>
- </Compc>
- </Target>
- </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.