天门市基础建设网站,2023还能上的网站,人才网招聘网招聘,做游戏脚本的网站编译SWC使用的是compc任务#xff0c;compc需要几个重要的参数#xff1a; 1、输出路径 2、包含的类 3、源路径 其中第2个参数是比较难拿到的#xff0c;需要使用ANT的几个其他的方法来将路径转换了类的完整路径#xff0c;先看完整的代码#xff1a; target namecompc需要几个重要的参数 1、输出路径 2、包含的类 3、源路径 其中第2个参数是比较难拿到的需要使用ANT的几个其他的方法来将路径转换了类的完整路径先看完整的代码 target namebuildLibpath idpathspathelement path${basedir}/..///pathpathconvert dirsep/ propertycovbasedir refidpaths/fileset dir${covbasedir}/src idfiles include name**/*.as//fileset pathconvert propertyclasses pathsep dirsep. refidfiles map from\ to// map from${covbasedir}/src/ to/ mapper chainedmapper globmapper from*.as to*/ /chainedmapper /mapper /pathconvertecho message${classes}/compc output${OUTPUT_DIR}/easily.swc include-classes${classes} optimizetrue benchmarktrue stricttrue actionscript-file-encodingutf-8 localeen_US allow-source-path-overlaptrue use-resource-bundle-metadatatruesource-path path-element${covbasedir}/src/compiler.external-library-path dir${LIBS_DIR} appendtrueinclude name*.swc//compiler.external-library-path/compc /target 路径转换需要经过以下几个步骤 1、拿到所有的.as文件的完整路径使用空格将所有路径分开比如c:\workspace\easily\src\com\easily\test\a1.as c:\workspace\easily\src\com\easily\test\a2.as 2、然后将这个字符串中的项目下的src路径替换成空字符串结果是com\easily\test\a1.as com\easily\test\a2.as 3、接着将其中的.as也换成空结果是com\easily\test\a1 com\easily\test\a2 4、最后一步将\替换成.结果是com.easily.test.a1 com.easily.test.a2 OK已经拿到了所有的类以 分开在compc中将include-classes${classes}转载于:https://www.cnblogs.com/yili16438/archive/2011/10/12/2208513.html