📄 build.xml
字号:
<group title="Core API" packages="org.hibernate:org.hibernate.classic:org.hibernate.criterion:org.hibernate.metadata:org.hibernate.cfg:org.hibernate.usertype"/> <group title="Extension API" packages="org.hibernate.id:org.hibernate.connection:org.hibernate.transaction:org.hibernate.type:org.hibernate.dialect*:org.hibernate.cache*:org.hibernate.event*:org.hibernate.action:org.hibernate.property:org.hibernate.loader*:org.hibernate.persister*:org.hibernate.proxy:org.hibernate.tuple:org.hibernate.transform:org.hibernate.collection:org.hibernate.jdbc"/> <group title="Miscellaneous API" packages="org.hibernate.stat:org.hibernate.tool.hbm2ddl:org.hibernate.jmx:org.hibernate.mapping:org.hibernate.tool.instrument"/> <group title="Internal Implementation" packages="org.hibernate.engine:org.hibernate.impl:org.hibernate.sql:org.hibernate.lob:org.hibernate.util:org.hibernate.exception:org.hibernate.hql:org.hibernate.hql.ast:org.hibernate.hql.antlr:org.hibernate.hql.classic:org.hibernate.intercept:org.hibernate.secure:org.hibernate.pretty"/> </javadoc> <copy file="${doc.api.dir}/package.html" todir="${dist.api.dir}"/> </target> <target name="refdoc" depends="splash" description="Generate and copy reference documentation"> <ant dir="${doc.ref.dir}" inheritall="false" target="all.doc"/> <copy todir="${dist.ref.dir}"> <fileset dir="${doc.ref.dir}/build"/> </copy> <mkdir dir="${dist.doc.dir}/other"/> <copy file="${doc.dir}/other/hibernate-quickref.pdf" todir="${dist.doc.dir}/other"/> </target> <!-- <target name="fetchwikidoc" description="Fetch current Wiki snapshot if Internet connection exists"> <echo message="Fetching Wiki snapshot from hibernate.org"/> <mkdir dir="${dist.dir}"/> <get src="http://www.hibernate.org/wiki_snapshot.tar.gz" ignoreerrors="true" dest="${dist.dir}/wiki_snapshot.tar.gz" verbose="true" /> <available file="${dist.dir}/wiki_snapshot.tar.gz" property="wiki-snapshot-exists"/> </target> <target name="wikidoc" description="Fetch current Wiki snapshot and extract it" depends="splash,fetchwikidoc" if="wiki-snapshot-exists"> <untar compression="gzip" src="${dist.dir}/wiki_snapshot.tar.gz" dest="${dist.doc.dir}"/> <delete file="${dist.dir}/wiki_snapshot.tar.gz"/> <delete dir="${dist.doc.dir}/wiki/hib_docs"/> <replace dir="${dist.doc.dir}/wiki" token="hib_docs/" value="../"> <include name="**/*.html"/> </replace> </target> --> <target name="extras" description="Copies miscellaneous files to root dir"> <copy todir="${dist.eg.dir}"> <fileset dir="eg"/> </copy> <copy todir="${dist.etc.dir}"> <fileset dir="etc"/> </copy> <copy file="readme.txt" todir="${dist.dir}"/> <copy file="lgpl.txt" todir="${dist.dir}"/> <copy file="changelog.txt" todir="${dist.dir}"/> <copy file="build.xml" todir="${dist.dir}"/> <copy file="build.bat" todir="${dist.dir}"/> <copy file="hibernate_logo.gif" todir="${dist.dir}"/> <!-- we don't want a user build to clobber their install dir --> <replace file="${dist.dir}/build.xml"> <replacetoken><![CDATA[../${name}]]></replacetoken> <replacevalue><![CDATA[../${name}]]></replacevalue> </replace> <replace file="${dist.dir}/build.xml"> <replacetoken><![CDATA[name="jdbc.dir" value="lib"]]></replacetoken> <replacevalue><![CDATA[name="jdbc.dir" value="lib"]]></replacevalue> </replace> </target> <target name="splash" unless="nosplash" description="Display the logo"> <property name="splash.dir" location="."/> <splash imageurl="file:${splash.dir}/hibernate_logo.gif" showduration="0"/> </target> <target name="dist" depends="splash,versioncheck,jar,javadoc,copysource,copylib,extras,refdoc" description="Build everything and package"> <zip zipfile="${dist.dir}.zip"> <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/> </zip> <tar tarfile="${dist.dir}.tar"> <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/> </tar> <gzip src="${dist.dir}.tar" zipfile="${dist.dir}.tar.gz"/> <delete file="${dist.dir}.tar"/> </target> <target name="info" description="Echo system properties"> <echoproperties/> <!-- <echo message="java.vm.info=${java.vm.info}"/> <echo message="java.vm.name=${java.vm.name}"/> <echo message="java.vm.vendor=${java.vm.vendor}"/> <echo message="java.vm.version=${java.vm.version}"/> <echo message="os.arch=${os.arch}"/> <echo message="os.name=${os.name}"/> <echo message="os.version=${os.version}"/> <echo message="java.home = ${java.home}"/> <echo message="java.class.path = ${java.class.path}"/> <echo message="build.compiler = ${build.compiler}"/> <echo message="file.encoding=${file.encoding}"/> <echo message="user.home = ${user.home}"/> <echo message="user.language=${user.language}"/> <echo message="driver.jar=${driver.jar}"/> --> </target> <target name="junit" depends="cleantestdb,compiletest,instrument" description="Run the test suite (requires driver.jar property)"> <mkdir dir="${test.out.dir}"/> <!-- The forkmode="perBatch" setting makes the tests run faster. <junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}" maxmemory="256M"> --> <junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}" maxmemory="256M" forkmode="perBatch"> <classpath> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> <fileset dir="${jdbc.dir}"> <include name="**/*.jar"/> <include name="**/*.zip"/> </fileset> <pathelement path="${classes.dir}"/> <pathelement path="${etc.dir}"/> <pathelement path="${testclasses.dir}"/> <!--pathelement path="${src.dir}"/ --> <!-- pick up properties from here --> <!--pathelement path="${test.dir}"/ --> <!-- pick up mappings from here --> <pathelement path="."/> <pathelement path="${driver.jar}"/> <pathelement path="${clover.jar}"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> <test name="org.hibernate.test.lazyonetoone.LazyOneToOneTest" todir="${test.out.dir}" haltonfailure="no"/> <test name="org.hibernate.test.instrument.InstrumentTest" todir="${test.out.dir}" haltonfailure="no"/> <batchtest todir="${test.out.dir}" haltonfailure="no"> <fileset dir="${testclasses.dir}"> <include name="org/hibernate/test/**/*Test.class"/> <exclude name="org/hibernate/test/*PerformanceTest.class"/> </fileset> </batchtest> </junit> </target> <target name="junitinstrument" depends="clean,compiletest,instrument" description="Run the instrument test suite (requires driver.jar property)"> <mkdir dir="${test.out.dir}"/> <junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}"> <classpath> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> <fileset dir="${jdbc.dir}"> <include name="**/*.jar"/> <include name="**/*.zip"/> </fileset> <pathelement path="${classes.dir}"/> <pathelement path="${etc.dir}"/> <pathelement path="${testclasses.dir}"/> <pathelement path="."/> <pathelement path="${driver.jar}"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> <test name="org.hibernate.test.lazyonetoone.LazyOneToOneTest" todir="${test.out.dir}" haltonfailure="no"/> <test name="org.hibernate.test.instrument.InstrumentTest" todir="${test.out.dir}" haltonfailure="no"/> </junit> </target> <target name="perf" depends="cleantestdb,compiletest" description="Run the performance tests"> <mkdir dir="${test.out.dir}"/> <junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}"> <classpath> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> <fileset dir="${jdbc.dir}"> <include name="**/*.jar"/> <include name="**/*.zip"/> </fileset> <pathelement path="${classes.dir}"/> <pathelement path="${testclasses.dir}"/> <!--pathelement path="${src.dir}"/ --> <!-- pick up properties from here --> <!--pathelement path="${test.dir}"/ --> <!-- pick up mappings from here --> <pathelement path="."/> <pathelement path="${driver.jar}"/> <pathelement path="${clover.jar}"/> </classpath> <formatter type="plain"/> <test name="org.hibernate.test.NewPerformanceTest" todir="${test.out.dir}" haltonfailure="no"/> <test name="org.hibernate.test.NewerPerformanceTest" todir="${test.out.dir}" haltonfailure="no"/> <test name="org.hibernate.test.PerformanceTest" todir="${test.out.dir}" haltonfailure="no"/> </junit> </target> <target name="junitreport" depends="splash,junit" description="Run tests and create JUnit report (requires driver.jar property)"> <junitreport todir="${test.out.dir}"> <fileset dir="${test.out.dir}"> <include name="TEST-*.xml"/> </fileset> <report format="frames" todir="${test.out.dir}"/> </junitreport> </target> <!-- Run a single unit test. --> <target name="junitsingle" depends="cleantestdb,compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)"> <mkdir dir="${test.out.dir}"/> <junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}"> <classpath> <pathelement path="${etc.dir}"/> <!-- pick up property resources from the 'etc' directory first --> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> <pathelement path="${classes.dir}"/> <pathelement path="${testclasses.dir}"/> <pathelement path="${src.dir}"/> <!-- pick up property resources from here (after classes and etc) --> <pathelement path="."/> <pathelement path="${driver.jar}"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> <test fork="yes" todir="${test.out.dir}" haltonfailure="no" name="${testname}"/> </junit> </target> <!-- Makes one patch file containing all local changes. Use this if target if you have a local copy of sources from CVS and want to contribute any fixes you have made. The generated patch.txt file should be attached in a new "Patch" issue in JIRA at http://opensource.atlassian.com/projects/hibernate/ (where you'll have to register and log in). --> <target name="patch" depends="checkstyle" description="Create a patch"> <cvs command="-q diff -u -N" output="patch.txt"/> </target> <target name="checkstyle" description="Check coding style"> <checkstyle config="checkstyle_checks.xml"> <fileset dir="${src.dir}"> <include name="**/*.java"/> </fileset> <formatter type="plain"/> </checkstyle> </target> <target name="eg" description="Compile and run the simple example"> <!-- works only in distribution, not in CVS tree --> <available classname="org.eclipse.core.launcher.Main" property="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" classpath="${java.class.path}"/> <javac srcdir="${egsrc.dir}" destdir="${egsrc.dir}" debug="${javac.debug}" optimize="${javac.optimize}" nowarn="on"> <classpath> <pathelement path="${jar.name}.jar"/> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> </classpath> </javac> <echo message="remember to place your JDBC driver in the lib directory"/> <java classname="org.hibernate.auction.Main" fork="true" failonerror="true"> <classpath> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> <include name="**/*.zip"/> </fileset> <pathelement path="${jar.name}.jar"/> <pathelement path="${etc.dir}"/> <!-- properties files live here --> <pathelement path="${egsrc.dir}"/> <!-- compiled into here --> </classpath> </java> <echo message="for more examples, download the hibernate-examples package"/> </target> <target name="replace" description="do a text search replace"> <replace dir="${replace.dir}" token="${replace.token}" value="${replace.value}"/> </target> <target name="with.clover"> <clover-setup initString="clover_coverage.db"/> </target> <target name="cloverreport.html" depends="with.clover" description="Generate a clover report from the current clover database."> <clover-report> <current outfile="${clover.out.dir}"> <format type="html"/> </current> </clover-report> </target> <target name="cloverreport" depends="with.clover,junitreport,cloverreport.html" description="Run the tests and generate a clover report"> </target> <target name="instrument" depends="compiletest"> <!-- depends="jar" --> <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask"> <classpath path="${jar.path}"/> <classpath path="${classes.dir}"/> <classpath refid="lib.class.path"/> </taskdef> <instrument verbose="true"> <fileset dir="${testclasses.dir}/org/hibernate/test/instrument"> <include name="*.class"/> <exclude name="*Test.class"/> </fileset> <fileset dir="${testclasses.dir}/org/hibernate/test/lazyonetoone"> <include name="*.class"/> <exclude name="*Test.class"/> </fileset> </instrument> <jar jarfile="${build.dir}/instrumented-classes.jar"> <fileset dir="${testclasses.dir}"> <include name="org/hibernate/test/lazyonetoone/*.class"/> <exclude name="org/hibernate/test/lazyonetoone/*Test.class"/> <include name="org/hibernate/test/instrument/*.class"/> <exclude name="org/hibernate/test/instrument/*Test.class"/> </fileset> </jar> </target></project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -