我有一个这样的目录结构:
plugins (directory)
- file1.php
- file1.xml
- file2.php
- file2.xml
- file3.php
- file3.xml
...
我需要的是这样的目录结构:
plugins (directory)
- file1 (directory)
-- file1.php
-- file1.xml
- file2 (directory)
-- file2.php
-- file2.xml
- file3 (directory)
-- file3.php
-- file3.xml
...
我正在尝试通过这样的 Phing(必须是 phing)来实现这一点:
<foreach param="file" absparam="absfilename" target="constructplugins">
<fileset dir="${dir.root}/plugins/">
<include name="*.php"/>
</fileset>
</foreach>
<target name="constructplugins" description="constructplugins">
<mkdir dir="${dir.tmp}/build/plugins/${file}" />
<copy file="${absfilename}" todir="${dir.tmp}/build/plugins/${file}" />
</target>
就像您已经看到的那样,我得到了一个目录名称,例如“file1.php”。我不知道如何剪切“.php”来创建正确的目录,因为 phing 映射器不会在这里工作。而且我也不知道如何复制 xml 文件。这必须是通用的,并且构建在 windows xp 下运行。
任何帮助表示赞赏。