我有在Docbook中使用的Ant构建文件。现在我要将Ant构建文件转换为使用Xsltproc处理器的Makefile。我对Makefile或Ant并不是特别熟悉。所以请帮我转换它。有没有我应该遵循的资源?
我想要, 1.将文件夹结构及其内容复制到另一个文件夹中 2.配置java系统属性 3.配置classpath
在ant脚本中,它有这样的代码,
<copy todir="${output-dir}">
<fileset dir="${ant.file.dir}/template">
<include name="**/*"/>
</fileset>
</copy>
<java classname="com.nexwave.nquindexer.IndexerMain" fork="true">
<sysproperty key="htmlDir" value="${output-dir}/content"/>
<sysproperty key="htmlExtension" value="${html.extension}"/>
<classpath>
<path refid="classpath"/>
<pathelement location="${xercesImpl.jar}"/>
<pathelement location="/usr/share/xml-commons/lib/xml-apis.jar"/>
</classpath>
</java>
我想转换make中的2个以上代码。 谢谢.. !!
答案 0 :(得分:4)
Make和ANT是非常不同的技术。除了最简单的用例外,您的要求很难满足所有要求。
以下是一些技术挑战:
以下ANT java task
<java classname="com.nexwave.nquindexer.IndexerMain" fork="true">
<sysproperty key="htmlDir" value="${output-dir}/content"/>
<sysproperty key="htmlExtension" value="${html.extension}"/>
<classpath>
<path refid="classpath"/>
<pathelement location="${xercesImpl.jar}"/>
<pathelement location="/usr/share/xml-commons/lib/xml-apis.jar"/>
</classpath>
</java>
可以翻译成以下unix java命令行。
java \
-DhtmlDir=$PUT_OUTPUT_DIR_HERE \
-DhtmlExtension=$PUT_EXT_HERE \
-cp $CLASSPATH:$PATH_TO_XERCES_JAR:/usr/share/xml-commons/lib/xml-apis.jar \
com.nexwave.nquindexer.IndexerMain