📄 build.xml
字号:
<condition> <not> <and> <isset property="protege.home.set"/> </and> </not> </condition> </fail> <copy file="${jarfile}" todir = "${protege.home}/plugins/${owlplugin}" overwrite = "true"/> </target> <!-- ================================================================ --> <!-- Copy files into the Protege plugin directory --> <!-- ================================================================ --> <target name="plugin.dir" depends="jar" description="Make the directory that becomes a Protege plugin dir"> <delete dir="${plugin}"/> <mkdir dir="${plugin}"/> <copy todir="${plugin}"> <fileset file="${jarfile}"/> <fileset dir="${lib}"> <exclude name="looks-2.1.3.jar"/> <exclude name="protege*.jar"/> </fileset> <fileset dir="${etc}"> <include name="plugin.properties"/> <include name="ont-policy.rdf"/> <include name="*.owl"/> <exclude name="MANIFEST.MF"/> <exclude name="OWL.pprj"/> </fileset> </copy> </target> <target name="plugin.zip" depends="plugin.dir" description="Create the protege-owl.zip file, containing the plugin dir"> <zip destfile="${dist}/${pluginName}.zip"> <fileset dir="${plugins}"> <include name="${owlplugin}/**"/> </fileset> </zip> </target> <target name = "install" depends = "plugin.zip"> <fail message = "set the protege.home variable to do an install"> <condition> <not> <isset property="protege.home.set"/> </not> </condition> </fail> <unzip src="${dist}/${pluginName}.zip" dest = "${protege.home}/plugins" overwrite = "true"/> <copy todir="${protege.home}/examples/pizza"> <fileset dir="./examples" includes="pizza.*"/> </copy> <copy todir="${protege.home}/examples/travel"> <fileset dir="./examples" includes="travel.*"/> </copy> <copy todir="${protege.home}/examples/family"> <fileset dir="./examples" includes="family.*"/> </copy> </target> <!-- Run targets --> <target name="debug" depends="install"> <java fork="true" dir="${protege.home}" classname="edu.stanford.smi.protege.Application"> <jvmarg value = "-Xdebug"/> <jvmarg value = "-Xrunjdwp:transport=dt_socket,address=8100,server=y,suspend=y"/> <classpath> <pathelement path="${protege.home}/protege.jar"/> <pathelement path="${protege.home}/looks-2.1.3.jar"/> <pathelement path="${protege.home}/unicode_panel.jar"/> <pathelement path="${protege.home}/plugins/edu.stanford.smi.protegex.changes/change-model.jar"/> <fileset dir="./dbdrivers"/> </classpath> </java> </target> <target name="run" depends="install"> <java fork="true" dir="${protege.home}" classname="edu.stanford.smi.protege.Application"> <classpath> <pathelement path="${protege.home}/protege.jar"/> <pathelement path="${protege.home}/looks-2.1.3.jar"/> <pathelement path="${protege.home}/unicode_panel.jar"/> <pathelement path="${protege.home}/plugins/edu.stanford.smi.protegex.changes/change-model.jar"/> <fileset dir="./dbdrivers"/> </classpath> </java> </target> <target name="run.server" depends="install"> <java fork="true" dir="${protege.home}" classname="edu.stanford.smi.protege.server.Server"> <jvmarg value = "-Djava.rmi.server.codebase=file:${protege.home}/protege.jar"/> <classpath> <pathelement path="${protege.home}/protege.jar"/> <pathelement path="${protege.home}/looks-2.1.3.jar"/> <pathelement path="${protege.home}/unicode_panel.jar"/> <pathelement path="${protege.home}/plugins/edu.stanford.smi.protegex.changes/change-model.jar"/> <fileset dir="./dbdrivers"/> </classpath> <arg value="examples/server/metaproject.pprj"/> </java> </target> <target name="debug.server" depends="install"> <java fork="true" dir="${protege.home}" classname="edu.stanford.smi.protege.server.Server"> <jvmarg value = "-Xdebug"/> <jvmarg value = "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/> <jvmarg value = "-Djava.rmi.server.codebase=file:${protege.home}/protege.jar"/> <classpath> <pathelement path="${protege.home}/protege.jar"/> <pathelement path="${protege.home}/looks-2.1.3.jar"/> <pathelement path="${protege.home}/unicode_panel.jar"/> <pathelement path="${protege.home}/plugins/edu.stanford.smi.protegex.changes/change-model.jar"/> <fileset dir="./dbdrivers"/> </classpath> <arg value="examples/server/metaproject.pprj"/> </java> </target> <!-- Junit targets --> <target name="codeGeneration" depends="jar"> <javac srcdir = "${junit}" destdir = "${classes}" debug = "on" includeAntRuntime="false" includes="**/GenerateJunitCode.java"> <classpath refid = "classpath.compile"/> <classpath> <pathelement location = "${jarfile}"/> </classpath> </javac> <delete dir="${gensrc}"/> <mkdir dir="${gensrc}"/> <java classname = "edu.stanford.smi.protegex.owl.javacode.tests.GenerateJunitCode" fork="true"> <classpath> <pathelement location="${classes}"/> <pathelement location = "${protege.lib}"/> <pathelement location = "${looks.lib}"/> <fileset dir="${lib}"> <include name = "*.jar"/> </fileset> </classpath> <jvmarg value="-Djava.util.logging.config.file=logging.properties"/> </java> </target> <target name = "junit-compile" depends = "jar,codeGeneration"> <javac srcdir = "${junit};${gensrc}" destdir = "${classes}" debug = "on" includeAntRuntime="false"> <classpath refid = "classpath.compile"/> <classpath> <pathelement location = "${jarfile}"/> <pathelement location = "${classes}"/> </classpath> </javac> <copy todir = "${build}/junit/projects"> <fileset dir="${junit}/projects"/> </copy> <copy file = "junit.properties" todir = "${build}"/> </target> <target name = "checkJunitConfiguration" depends = "junit-compile"> <java classname = "edu.stanford.smi.protegex.owl.junit_config.CheckConfiguration" dir="${build}" fork="true"> <classpath> <pathelement location="${classes}"/> <pathelement location = "${protege.lib}"/> <pathelement location = "${looks.lib}"/> <pathelement location = "${lib}/junit.jar"/> </classpath> </java> </target> <target name="junitResources"> <copy todir="${build}/examples"> <fileset dir="./examples"/> </copy> <copy todir="${build}" file="junit-logging.properties"/> </target> <!-- My experience is that "ant junit" provides almost no debugging information when things go wrong. (This was not true in my previous job and I don't know the difference. log4j??) When there is a problem I generally use my development environment to debug faulting junit. For scripting problems with the junits the options filtertrace="false" showoutput="true" give a little more information. Also when you know that some junits are failing, removing the option haltonfailure = "on" haltonerror = "on" is helpful for showing all the failures. But in the committed version I think that this option is very important because it means that the developer will never mistakenly believe that junits have succeeded. --> <!-- <jvmarg value="-Xdebug"/> <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8100,server=y,suspend=y"/> --> <target name = "junit" description = "run the tests (anybody can do it)" depends = "plugin.dir,junit-compile,checkJunitConfiguration, junitResources"> <property file="junit.properties"/> <junit printsummary="withOutAndErr" dir = "${build}" fork = "yes" filtertrace="${junit.filtertrace}" showoutput="${junit.showoutput}" haltonfailure = "${junit.haltonfailure}" haltonerror = "${junit.haltonerror}"> <jvmarg value="-Xmx${junit.memory}"/> <jvmarg value="-Djunit.server.protege.jar=${protege.lib}"/> <jvmarg value="-Djava.util.logging.config.file=junit-logging.properties"/> <classpath> <pathelement location="${classes}"/> <pathelement location = "${protege.lib}"/> <pathelement location = "${looks.lib}"/> <fileset dir="${plugin}"> <include name = "**/*.jar"/> </fileset> <fileset dir="dbdrivers"> <include name = "**/*.jar"/> </fileset> </classpath> <batchtest> <fileset dir="${junit}"> <include name = "${junit.includes}"/> <exclude name = "**/*Abstract*.java"/> <exclude name = "**/*FailedTestCase.java"/> </fileset> </batchtest> </junit> </target></project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -