Formating

This commit is contained in:
Boos 2011-12-27 18:32:52 +01:00
parent 08b646da0b
commit 0af02c541e
10 changed files with 1755 additions and 1637 deletions

View File

@ -10,65 +10,35 @@
<project name="boosCooldown" default="default" basedir="."> <project name="boosCooldown" default="default" basedir=".">
<description>Builds, tests, and runs the project boosCooldown.</description> <description>Builds, tests, and runs the project boosCooldown.</description>
<import file="nbproject/build-impl.xml" /> <import file="nbproject/build-impl.xml" />
<!-- <!-- There exist several targets which are by default empty and which can
be used for execution of your tasks. These targets are usually executed before
There exist several targets which are by default empty and which can be and after some main targets. They are: -pre-init: called before initialization
used for execution of your tasks. These targets are usually executed of project properties -post-init: called after initialization of project
before and after some main targets. They are: properties -pre-compile: called before javac compilation -post-compile: called
after javac compilation -pre-compile-single: called before javac compilation
-pre-init: called before initialization of project properties of single file -post-compile-single: called after javac compilation of single
-post-init: called after initialization of project properties file -pre-compile-test: called before javac compilation of JUnit tests -post-compile-test:
-pre-compile: called before javac compilation called after javac compilation of JUnit tests -pre-compile-test-single: called
-post-compile: called after javac compilation before javac compilation of single JUnit test -post-compile-test-single:
-pre-compile-single: called before javac compilation of single file called after javac compilation of single JUunit test -pre-jar: called before
-post-compile-single: called after javac compilation of single file JAR building -post-jar: called after JAR building -post-clean: called after
-pre-compile-test: called before javac compilation of JUnit tests cleaning build products (Targets beginning with '-' are not intended to be
-post-compile-test: called after javac compilation of JUnit tests called on their own.) Example of inserting an obfuscator after compilation
-pre-compile-test-single: called before javac compilation of single JUnit test could look like this: <target name="-post-compile"> <obfuscate> <fileset
-post-compile-test-single: called after javac compilation of single JUunit test dir="${build.classes.dir}"/> </obfuscate> </target> For list of available
-pre-jar: called before JAR building properties check the imported nbproject/build-impl.xml file. Another way
-post-jar: called after JAR building to customize the build is by overriding existing main targets. The targets
-post-clean: called after cleaning build products of interest are: -init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution -init-macrodef-debug:
(Targets beginning with '-' are not intended to be called on their own.) defines macro for class debugging -init-macrodef-java: defines macro for
class execution -do-jar-with-manifest: JAR building (if you are using a manifest)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest) -do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project run: execution of project -javadoc-build: Javadoc generation test-report:
-javadoc-build: Javadoc generation JUnit report generation An example of overriding the target for project execution
test-report: JUnit report generation could look like this: <target name="run" depends="boosCooldown-impl.jar">
<exec dir="bin" executable="launcher.exe"> <arg file="${dist.jar}"/> </exec>
An example of overriding the target for project execution could look like this: </target> Notice that the overridden target depends on the jar target and
not only on the compile target as the regular run target does. Again, for
<target name="run" depends="boosCooldown-impl.jar"> a list of available properties which you can use, check the target you are
<exec dir="bin" executable="launcher.exe"> overriding in the nbproject/build-impl.xml file. -->
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project> </project>

View File

@ -1,25 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!-- *** GENERATED FROM project.xml - DO NOT EDIT *** *** EDIT ../build.xml
*** GENERATED FROM project.xml - DO NOT EDIT *** INSTEAD *** For the purpose of easier reading the script is divided into
*** EDIT ../build.xml INSTEAD *** following sections: - initialization - compilation - jar - execution - debugging
- javadoc - junit compilation - junit execution - junit debugging - applet
For the purpose of easier reading the script - cleanup -->
is divided into following sections: <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"
xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3"
- initialization xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".."
- compilation default="default" name="boosCooldown-impl">
- jar
- execution
- debugging
- javadoc
- junit compilation
- junit execution
- junit debugging
- applet
- cleanup
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="boosCooldown-impl">
<fail message="Please build using Ant 1.7.1 or higher."> <fail message="Please build using Ant 1.7.1 or higher.">
<condition> <condition>
<not> <not>
@ -27,12 +15,9 @@ is divided into following sections:
</not> </not>
</condition> </condition>
</fail> </fail>
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> <target depends="test,jar,javadoc" description="Build and test whole project."
<!-- name="default" />
====================== <!-- ====================== INITIALIZATION SECTION ====================== -->
INITIALIZATION SECTION
======================
-->
<target name="-pre-init"> <target name="-pre-init">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
@ -53,7 +38,9 @@ is divided into following sections:
<property file="nbproject/configs/${config}.properties" /> <property file="nbproject/configs/${config}.properties" />
<property file="nbproject/project.properties" /> <property file="nbproject/project.properties" />
</target> </target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> <target
depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property"
name="-do-init">
<available file="${manifest.file}" property="manifest.available" /> <available file="${manifest.file}" property="manifest.available" />
<condition property="splashscreen.available"> <condition property="splashscreen.available">
<and> <and>
@ -184,7 +171,8 @@ is divided into following sections:
<istrue value="${do.depend}" /> <istrue value="${do.depend}" />
</condition> </condition>
<path id="endorsed.classpath.path" path="${endorsed.classpath}" /> <path id="endorsed.classpath.path" path="${endorsed.classpath}" />
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> <condition else="" property="endorsed.classpath.cmd.line.arg"
value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
<length length="0" string="${endorsed.classpath}" when="greater" /> <length length="0" string="${endorsed.classpath}" when="greater" />
</condition> </condition>
<condition else="false" property="jdkBug6558476"> <condition else="false" property="jdkBug6558476">
@ -204,7 +192,8 @@ is divided into following sections:
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init"
name="-init-check">
<fail unless="src.dir">Must set src.dir</fail> <fail unless="src.dir">Must set src.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail> <fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail> <fail unless="build.dir">Must set build.dir</fail>
@ -225,13 +214,15 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors"> <target depends="-init-ap-cmdline-properties" if="ap.supported.internal"
name="-init-macrodef-javac-with-processors">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}" name="srcdir" /> <attribute default="${src.dir}" name="srcdir" />
<attribute default="${build.classes.dir}" name="destdir" /> <attribute default="${build.classes.dir}" name="destdir" />
<attribute default="${javac.classpath}" name="classpath" /> <attribute default="${javac.classpath}" name="classpath" />
<attribute default="${javac.processorpath}" name="processorpath" /> <attribute default="${javac.processorpath}" name="processorpath" />
<attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> <attribute default="${build.generated.sources.dir}/ap-source-output"
name="apgeneratedsrcdir" />
<attribute default="${includes}" name="includes" /> <attribute default="${includes}" name="includes" />
<attribute default="${excludes}" name="excludes" /> <attribute default="${excludes}" name="excludes" />
<attribute default="${javac.debug}" name="debug" /> <attribute default="${javac.debug}" name="debug" />
@ -242,7 +233,11 @@ is divided into following sections:
<property location="${build.dir}/empty" name="empty.dir" /> <property location="${build.dir}/empty" name="empty.dir" />
<mkdir dir="${empty.dir}" /> <mkdir dir="${empty.dir}" />
<mkdir dir="@{apgeneratedsrcdir}" /> <mkdir dir="@{apgeneratedsrcdir}" />
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> <javac debug="@{debug}" deprecation="${javac.deprecation}"
destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}"
fork="${javac.fork}" includeantruntime="false" includes="@{includes}"
source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}"
target="${javac.target}" tempdir="${java.io.tmpdir}">
<src> <src>
<dirset dir="@{gensrcdir}" erroronmissingdir="false"> <dirset dir="@{gensrcdir}" erroronmissingdir="false">
<include name="*" /> <include name="*" />
@ -265,13 +260,15 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal"> <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors"
unless="ap.supported.internal">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}" name="srcdir" /> <attribute default="${src.dir}" name="srcdir" />
<attribute default="${build.classes.dir}" name="destdir" /> <attribute default="${build.classes.dir}" name="destdir" />
<attribute default="${javac.classpath}" name="classpath" /> <attribute default="${javac.classpath}" name="classpath" />
<attribute default="${javac.processorpath}" name="processorpath" /> <attribute default="${javac.processorpath}" name="processorpath" />
<attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> <attribute default="${build.generated.sources.dir}/ap-source-output"
name="apgeneratedsrcdir" />
<attribute default="${includes}" name="includes" /> <attribute default="${includes}" name="includes" />
<attribute default="${excludes}" name="excludes" /> <attribute default="${excludes}" name="excludes" />
<attribute default="${javac.debug}" name="debug" /> <attribute default="${javac.debug}" name="debug" />
@ -281,7 +278,11 @@ is divided into following sections:
<sequential> <sequential>
<property location="${build.dir}/empty" name="empty.dir" /> <property location="${build.dir}/empty" name="empty.dir" />
<mkdir dir="${empty.dir}" /> <mkdir dir="${empty.dir}" />
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> <javac debug="@{debug}" deprecation="${javac.deprecation}"
destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}"
fork="${javac.fork}" includeantruntime="false" includes="@{includes}"
source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}"
target="${javac.target}" tempdir="${java.io.tmpdir}">
<src> <src>
<dirset dir="@{gensrcdir}" erroronmissingdir="false"> <dirset dir="@{gensrcdir}" erroronmissingdir="false">
<include name="*" /> <include name="*" />
@ -297,13 +298,16 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac"> <target
depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors"
name="-init-macrodef-javac">
<macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}" name="srcdir" /> <attribute default="${src.dir}" name="srcdir" />
<attribute default="${build.classes.dir}" name="destdir" /> <attribute default="${build.classes.dir}" name="destdir" />
<attribute default="${javac.classpath}" name="classpath" /> <attribute default="${javac.classpath}" name="classpath" />
<sequential> <sequential>
<depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> <depend cache="${build.dir}/depcache" destdir="@{destdir}"
excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
<classpath> <classpath>
<path path="@{classpath}" /> <path path="@{classpath}" />
</classpath> </classpath>
@ -338,9 +342,12 @@ is divided into following sections:
<attribute default="**" name="testincludes" /> <attribute default="**" name="testincludes" />
<sequential> <sequential>
<property name="junit.forkmode" value="perTest" /> <property name="junit.forkmode" value="perTest" />
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> <junit dir="${work.dir}" errorproperty="tests.failed"
failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}"
showoutput="true" tempdir="${build.dir}">
<batchtest todir="${build.test.results.dir}"> <batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}"
includes="@{includes}">
<filename name="@{testincludes}" /> <filename name="@{testincludes}" />
</fileset> </fileset>
</batchtest> </batchtest>
@ -360,7 +367,9 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/> <target
depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check"
name="profile-init" />
<target name="-profile-pre-init"> <target name="-profile-pre-init">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
@ -383,7 +392,8 @@ is divided into following sections:
<sequential> <sequential>
<property environment="env" /> <property environment="env" />
<resolve name="profiler.current.path" value="${profiler.info.pathvar}" /> <resolve name="profiler.current.path" value="${profiler.info.pathvar}" />
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}"> <java classname="@{classname}" dir="${profiler.info.dir}" fork="true"
jvm="${profiler.info.jvm}">
<jvmarg value="${profiler.info.jvmargs.agent}" /> <jvmarg value="${profiler.info.jvmargs.agent}" />
<jvmarg line="${profiler.info.jvmargs}" /> <jvmarg line="${profiler.info.jvmargs}" />
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}" /> <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}" />
@ -400,9 +410,13 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check"> <target
<fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile"
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> name="-profile-init-check">
<fail unless="profiler.info.jvm">Must set JVM to use for profiling in
profiler.info.jvm</fail>
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in
profiler.info.jvmargs.agent</fail>
</target> </target>
<target depends="-init-debug-args" name="-init-macrodef-nbjpda"> <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
@ -410,7 +424,8 @@ is divided into following sections:
<attribute default="${debug.classpath}" name="classpath" /> <attribute default="${debug.classpath}" name="classpath" />
<attribute default="" name="stopclassname" /> <attribute default="" name="stopclassname" />
<sequential> <sequential>
<nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> <nbjpdastart addressproperty="jpda.address" name="@{name}"
stopclassname="@{stopclassname}" transport="${debug-transport}">
<classpath> <classpath>
<path path="@{classpath}" /> <path path="@{classpath}" />
</classpath> </classpath>
@ -438,13 +453,16 @@ is divided into following sections:
<contains string="${version-output}" substring="java version &quot;1.3" /> <contains string="${version-output}" substring="java version &quot;1.3" />
</or> </or>
</condition> </condition>
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> <condition else="-Xdebug" property="debug-args-line"
value="-Xdebug -Xnoagent -Djava.compiler=none">
<istrue value="${have-jdk-older-than-1.4}" /> <istrue value="${have-jdk-older-than-1.4}" />
</condition> </condition>
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> <condition else="dt_socket" property="debug-transport-by-os"
value="dt_shmem">
<os family="windows" /> <os family="windows" />
</condition> </condition>
<condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> <condition else="${debug-transport-by-os}" property="debug-transport"
value="${debug.transport}">
<isset property="debug.transport" /> <isset property="debug.transport" />
</condition> </condition>
</target> </target>
@ -457,9 +475,11 @@ is divided into following sections:
<java classname="@{classname}" dir="${work.dir}" fork="true"> <java classname="@{classname}" dir="${work.dir}" fork="true">
<jvmarg line="${endorsed.classpath.cmd.line.arg}" /> <jvmarg line="${endorsed.classpath.cmd.line.arg}" />
<jvmarg line="${debug-args-line}" /> <jvmarg line="${debug-args-line}" />
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> <jvmarg
value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}" />
<jvmarg value="-Dfile.encoding=${runtime.encoding}" /> <jvmarg value="-Dfile.encoding=${runtime.encoding}" />
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> <redirector errorencoding="${runtime.encoding}"
inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}" />
<jvmarg line="${run.jvmargs}" /> <jvmarg line="${run.jvmargs}" />
<classpath> <classpath>
<path path="@{classpath}" /> <path path="@{classpath}" />
@ -482,7 +502,8 @@ is divided into following sections:
<java classname="@{classname}" dir="${work.dir}" fork="true"> <java classname="@{classname}" dir="${work.dir}" fork="true">
<jvmarg line="${endorsed.classpath.cmd.line.arg}" /> <jvmarg line="${endorsed.classpath.cmd.line.arg}" />
<jvmarg value="-Dfile.encoding=${runtime.encoding}" /> <jvmarg value="-Dfile.encoding=${runtime.encoding}" />
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> <redirector errorencoding="${runtime.encoding}"
inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}" />
<jvmarg line="${run.jvmargs}" /> <jvmarg line="${run.jvmargs}" />
<classpath> <classpath>
<path path="@{classpath}" /> <path path="@{classpath}" />
@ -513,8 +534,12 @@ is divided into following sections:
<globmapper from="*" to="lib/*" /> <globmapper from="*" to="lib/*" />
</chainedmapper> </chainedmapper>
</pathconvert> </pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> <taskdef
<copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs"
classpath="${libs.CopyLibs.classpath}" name="copylibs" />
<copylibs compress="${jar.compress}" index="${jar.index}"
indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}"
runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}" /> <fileset dir="${build.classes.dir}" />
<manifest> <manifest>
<attribute name="Class-Path" value="${jar.classpath}" /> <attribute name="Class-Path" value="${jar.classpath}" />
@ -534,8 +559,10 @@ is divided into following sections:
<target name="-init-ap-cmdline-properties"> <target name="-init-ap-cmdline-properties">
<property name="annotation.processing.enabled" value="true" /> <property name="annotation.processing.enabled" value="true" />
<property name="annotation.processing.processors.list" value="" /> <property name="annotation.processing.processors.list" value="" />
<property name="annotation.processing.processor.options" value=""/> <property name="annotation.processing.processor.options"
<property name="annotation.processing.run.all.processors" value="true"/> value="" />
<property name="annotation.processing.run.all.processors"
value="true" />
<property name="javac.processorpath" value="${javac.classpath}" /> <property name="javac.processorpath" value="${javac.classpath}" />
<property name="javac.test.processorpath" value="${javac.test.classpath}" /> <property name="javac.test.processorpath" value="${javac.test.classpath}" />
<condition property="ap.supported.internal" value="true"> <condition property="ap.supported.internal" value="true">
@ -544,23 +571,24 @@ is divided into following sections:
</not> </not>
</condition> </condition>
</target> </target>
<target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported"> <target depends="-init-ap-cmdline-properties" if="ap.supported.internal"
<condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}"> name="-init-ap-cmdline-supported">
<condition else="" property="ap.processors.internal"
value="-processor ${annotation.processing.processors.list}">
<isfalse value="${annotation.processing.run.all.processors}" /> <isfalse value="${annotation.processing.run.all.processors}" />
</condition> </condition>
<condition else="" property="ap.proc.none.internal" value="-proc:none"> <condition else="" property="ap.proc.none.internal" value="-proc:none">
<isfalse value="${annotation.processing.enabled}" /> <isfalse value="${annotation.processing.enabled}" />
</condition> </condition>
</target> </target>
<target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported"
name="-init-ap-cmdline">
<property name="ap.cmd.line.internal" value="" /> <property name="ap.cmd.line.internal" value="" />
</target> </target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> <target
<!-- depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline"
=================== name="init" />
COMPILATION SECTION <!-- =================== COMPILATION SECTION =================== -->
===================
-->
<target name="-deps-jar-init" unless="built-jar.properties"> <target name="-deps-jar-init" unless="built-jar.properties">
<property location="${build.dir}/built-jar.properties" name="built-jar.properties" /> <property location="${build.dir}/built-jar.properties" name="built-jar.properties" />
<delete file="${built-jar.properties}" quiet="true" /> <delete file="${built-jar.properties}" quiet="true" />
@ -577,9 +605,11 @@ is divided into following sections:
<entry key="${basedir}" value="" /> <entry key="${basedir}" value="" />
</propertyfile> </propertyfile>
</target> </target>
<target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> <target depends="init,-check-automatic-build,-clean-after-automatic-build"
name="-verify-automatic-build" />
<target depends="init" name="-check-automatic-build"> <target depends="init" name="-check-automatic-build">
<available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> <available file="${build.classes.dir}/.netbeans_automatic_build"
property="netbeans.automatic.build" />
</target> </target>
<target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
<antcall target="clean" /> <antcall target="clean" />
@ -593,16 +623,20 @@ is divided into following sections:
</target> </target>
<target if="do.depend.true" name="-compile-depend"> <target if="do.depend.true" name="-compile-depend">
<pathconvert property="build.generated.subdirs"> <pathconvert property="build.generated.subdirs">
<dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> <dirset dir="${build.generated.sources.dir}"
erroronmissingdir="false">
<include name="*" /> <include name="*" />
</dirset> </dirset>
</pathconvert> </pathconvert>
<j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}" /> <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}" />
</target> </target>
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile"> <target
depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend"
if="have.sources" name="-do-compile">
<j2seproject3:javac gensrcdir="${build.generated.sources.dir}" /> <j2seproject3:javac gensrcdir="${build.generated.sources.dir}" />
<copy todir="${build.classes.dir}"> <copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}"
includes="${includes}" />
</copy> </copy>
</target> </target>
<target if="has.persistence.xml" name="-copy-persistence-xml"> <target if="has.persistence.xml" name="-copy-persistence-xml">
@ -615,26 +649,29 @@ is divided into following sections:
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> <target
depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile"
description="Compile project." name="compile" />
<target name="-pre-compile-single"> <target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> <fail unless="javac.includes">Must select some files in the IDE or set
javac.includes</fail>
<j2seproject3:force-recompile /> <j2seproject3:force-recompile />
<j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/> <j2seproject3:javac excludes=""
gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"
sourcepath="${src.dir}" />
</target> </target>
<target name="-post-compile-single"> <target name="-post-compile-single">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> <target
<!-- depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"
==================== name="compile-single" />
JAR BUILDING SECTION <!-- ==================== JAR BUILDING SECTION ==================== -->
====================
-->
<target depends="init" name="-pre-pre-jar"> <target depends="init" name="-pre-pre-jar">
<dirname file="${dist.jar}" property="dist.jar.dir" /> <dirname file="${dist.jar}" property="dist.jar.dir" />
<mkdir dir="${dist.jar.dir}" /> <mkdir dir="${dist.jar.dir}" />
@ -643,41 +680,54 @@ is divided into following sections:
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available"> <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive"
name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
<j2seproject1:jar /> <j2seproject1:jar />
</target> </target>
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available"> <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available"
name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
<j2seproject1:jar manifest="${manifest.file}" /> <j2seproject1:jar manifest="${manifest.file}" />
</target> </target>
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available"> <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class"
name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
<j2seproject1:jar manifest="${manifest.file}"> <j2seproject1:jar manifest="${manifest.file}">
<j2seproject1:manifest> <j2seproject1:manifest>
<j2seproject1:attribute name="Main-Class" value="${main.class}"/> <j2seproject1:attribute name="Main-Class"
value="${main.class}" />
</j2seproject1:manifest> </j2seproject1:manifest>
</j2seproject1:jar> </j2seproject1:jar>
<echo level="info">To run this application from the command line without Ant, try:</echo> <echo level="info">To run this application from the command line without
Ant, try:</echo>
<property location="${build.classes.dir}" name="build.classes.dir.resolved" /> <property location="${build.classes.dir}" name="build.classes.dir.resolved" />
<property location="${dist.jar}" name="dist.jar.resolved" /> <property location="${dist.jar}" name="dist.jar.resolved" />
<pathconvert property="run.classpath.with.dist.jar"> <pathconvert property="run.classpath.with.dist.jar">
<path path="${run.classpath}" /> <path path="${run.classpath}" />
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}" /> <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}" />
</pathconvert> </pathconvert>
<echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> <echo level="info">java -cp "${run.classpath.with.dist.jar}"
${main.class}</echo>
</target> </target>
<target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available"> <target depends="init" if="do.archive"
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
<tempfile deleteonexit="true" destdir="${build.dir}"
property="tmp.manifest.file" />
<touch file="${tmp.manifest.file}" verbose="false" /> <touch file="${tmp.manifest.file}" verbose="false" />
</target> </target>
<target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest"> <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> <tempfile deleteonexit="true" destdir="${build.dir}"
property="tmp.manifest.file" />
<copy file="${manifest.file}" tofile="${tmp.manifest.file}" /> <copy file="${manifest.file}" tofile="${tmp.manifest.file}" />
</target> </target>
<target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main"> <target
depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest"
if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
<manifest file="${tmp.manifest.file}" mode="update"> <manifest file="${tmp.manifest.file}" mode="update">
<attribute name="Main-Class" value="${main.class}" /> <attribute name="Main-Class" value="${main.class}" />
</manifest> </manifest>
</target> </target>
<target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen"> <target
depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest"
if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
<basename file="${application.splash}" property="splashscreen.basename" /> <basename file="${application.splash}" property="splashscreen.basename" />
<mkdir dir="${build.classes.dir}/META-INF" /> <mkdir dir="${build.classes.dir}/META-INF" />
<copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF" /> <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF" />
@ -685,29 +735,34 @@ is divided into following sections:
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}" /> <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}" />
</manifest> </manifest>
</target> </target>
<target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack"> <target
depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen"
if="do.mkdist" name="-do-jar-with-libraries-pack">
<j2seproject3:copylibs manifest="${tmp.manifest.file}" /> <j2seproject3:copylibs manifest="${tmp.manifest.file}" />
<echo level="info">To run this application from the command line without Ant, try:</echo> <echo level="info">To run this application from the command line without
Ant, try:</echo>
<property location="${dist.jar}" name="dist.jar.resolved" /> <property location="${dist.jar}" name="dist.jar.resolved" />
<echo level="info">java -jar "${dist.jar.resolved}"</echo> <echo level="info">java -jar "${dist.jar.resolved}"</echo>
</target> </target>
<target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest"> <target depends="-do-jar-with-libraries-pack" if="do.archive"
name="-do-jar-with-libraries-delete-manifest">
<delete> <delete>
<fileset file="${tmp.manifest.file}" /> <fileset file="${tmp.manifest.file}" />
</delete> </delete>
</target> </target>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/> <target
depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest"
name="-do-jar-with-libraries" />
<target name="-post-jar"> <target name="-post-jar">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/> <target
<!-- depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar"
================= description="Build JAR." name="jar" />
EXECUTION SECTION <!-- ================= EXECUTION SECTION ================= -->
================= <target depends="init,compile" description="Run a main class."
--> name="run">
<target depends="init,compile" description="Run a main class." name="run">
<j2seproject1:java> <j2seproject1:java>
<customize> <customize>
<arg line="${application.args}" /> <arg line="${application.args}" />
@ -723,18 +778,16 @@ is divided into following sections:
</target> </target>
<target depends="init,compile-test-single" name="run-test-with-main"> <target depends="init,compile-test-single" name="run-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail> <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> <j2seproject1:java classname="${run.class}"
classpath="${run.test.classpath}" />
</target> </target>
<!-- <!-- ================= DEBUGGING SECTION ================= -->
=================
DEBUGGING SECTION
=================
-->
<target depends="init" if="netbeans.home" name="-debug-start-debugger"> <target depends="init" if="netbeans.home" name="-debug-start-debugger">
<j2seproject1:nbjpdastart name="${debug.class}" /> <j2seproject1:nbjpdastart name="${debug.class}" />
</target> </target>
<target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> <j2seproject1:nbjpdastart classpath="${debug.test.classpath}"
name="${debug.class}" />
</target> </target>
<target depends="init,compile" name="-debug-start-debuggee"> <target depends="init,compile" name="-debug-start-debuggee">
<j2seproject3:debug> <j2seproject3:debug>
@ -743,35 +796,44 @@ is divided into following sections:
</customize> </customize>
</j2seproject3:debug> </j2seproject3:debug>
</target> </target>
<target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee"
description="Debug project in IDE." if="netbeans.home" name="debug" />
<target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
<j2seproject1:nbjpdastart stopclassname="${main.class}" /> <j2seproject1:nbjpdastart stopclassname="${main.class}" />
</target> </target>
<target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> <target
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"
if="netbeans.home" name="debug-stepinto" />
<target depends="init,compile-single" if="netbeans.home"
name="-debug-start-debuggee-single">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject3:debug classname="${debug.class}" /> <j2seproject3:debug classname="${debug.class}" />
</target> </target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> <target
<target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"
if="netbeans.home" name="debug-single" />
<target depends="init,compile-test-single" if="netbeans.home"
name="-debug-start-debuggee-main-test">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> <j2seproject3:debug classname="${debug.class}"
classpath="${debug.test.classpath}" />
</target> </target>
<target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> <target
depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test"
if="netbeans.home" name="debug-test-with-main" />
<target depends="init" name="-pre-debug-fix"> <target depends="init" name="-pre-debug-fix">
<fail unless="fix.includes">Must set fix.includes</fail> <fail unless="fix.includes">Must set fix.includes</fail>
<property name="javac.includes" value="${fix.includes}.java" /> <property name="javac.includes" value="${fix.includes}.java" />
</target> </target>
<target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home"
name="-do-debug-fix">
<j2seproject1:nbjpdareload /> <j2seproject1:nbjpdareload />
</target> </target>
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home"
<!-- name="debug-fix" />
================= <!-- ================= PROFILING SECTION ================= -->
PROFILING SECTION <target depends="profile-init,compile" description="Profile a project in the IDE."
================= if="netbeans.home" name="profile">
-->
<target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
<nbprofiledirect> <nbprofiledirect>
<classpath> <classpath>
<path path="${run.classpath}" /> <path path="${run.classpath}" />
@ -779,7 +841,8 @@ is divided into following sections:
</nbprofiledirect> </nbprofiledirect>
<profile /> <profile />
</target> </target>
<target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single"> <target depends="profile-init,compile-single" description="Profile a selected class in the IDE."
if="netbeans.home" name="profile-single">
<fail unless="profile.class">Must select one file in the IDE or set profile.class</fail> <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
<nbprofiledirect> <nbprofiledirect>
<classpath> <classpath>
@ -788,12 +851,9 @@ is divided into following sections:
</nbprofiledirect> </nbprofiledirect>
<profile classname="${profile.class}" /> <profile classname="${profile.class}" />
</target> </target>
<!-- <!-- ========================= APPLET PROFILING SECTION ========================= -->
========================= <target depends="profile-init,compile-single" if="netbeans.home"
APPLET PROFILING SECTION name="profile-applet">
=========================
-->
<target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
<nbprofiledirect> <nbprofiledirect>
<classpath> <classpath>
<path path="${run.classpath}" /> <path path="${run.classpath}" />
@ -805,18 +865,17 @@ is divided into following sections:
</customize> </customize>
</profile> </profile>
</target> </target>
<!-- <!-- ========================= TESTS PROFILING SECTION ========================= -->
========================= <target depends="profile-init,compile-test-single" if="netbeans.home"
TESTS PROFILING SECTION name="profile-test-single">
=========================
-->
<target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
<nbprofiledirect> <nbprofiledirect>
<classpath> <classpath>
<path path="${run.test.classpath}" /> <path path="${run.test.classpath}" />
</classpath> </classpath>
</nbprofiledirect> </nbprofiledirect>
<junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true"> <junit dir="${profiler.info.dir}" errorproperty="tests.failed"
failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}"
showoutput="true">
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}" /> <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}" />
<jvmarg value="${profiler.info.jvmargs.agent}" /> <jvmarg value="${profiler.info.jvmargs.agent}" />
<jvmarg line="${profiler.info.jvmargs}" /> <jvmarg line="${profiler.info.jvmargs}" />
@ -832,21 +891,23 @@ is divided into following sections:
<formatter type="xml" /> <formatter type="xml" />
</junit> </junit>
</target> </target>
<!-- <!-- =============== JAVADOC SECTION =============== -->
===============
JAVADOC SECTION
===============
-->
<target depends="init" if="have.sources" name="-javadoc-build"> <target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}" /> <mkdir dir="${dist.javadoc.dir}" />
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}"
charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8"
encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}"
nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}"
source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}"
useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath> <classpath>
<path path="${javac.classpath}" /> <path path="${javac.classpath}" />
</classpath> </classpath>
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/*.java" /> <filename name="**/*.java" />
</fileset> </fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> <fileset dir="${build.generated.sources.dir}"
erroronmissingdir="false">
<include name="**/*.java" /> <include name="**/*.java" />
</fileset> </fileset>
</javadoc> </javadoc>
@ -854,20 +915,19 @@ is divided into following sections:
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/doc-files/**" /> <filename name="**/doc-files/**" />
</fileset> </fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> <fileset dir="${build.generated.sources.dir}"
erroronmissingdir="false">
<include name="**/doc-files/**" /> <include name="**/doc-files/**" />
</fileset> </fileset>
</copy> </copy>
</target> </target>
<target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse"
unless="no.javadoc.preview">
<nbbrowse file="${dist.javadoc.dir}/index.html" /> <nbbrowse file="${dist.javadoc.dir}/index.html" />
</target> </target>
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> <target depends="init,-javadoc-build,-javadoc-browse"
<!-- description="Build Javadoc." name="javadoc" />
========================= <!-- ========================= JUNIT COMPILATION SECTION ========================= -->
JUNIT COMPILATION SECTION
=========================
-->
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
<mkdir dir="${build.test.classes.dir}" /> <mkdir dir="${build.test.classes.dir}" />
</target> </target>
@ -876,75 +936,100 @@ is divided into following sections:
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target if="do.depend.true" name="-compile-test-depend"> <target if="do.depend.true" name="-compile-test-depend">
<j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> <j2seproject3:depend classpath="${javac.test.classpath}"
destdir="${build.test.classes.dir}" srcdir="${test.src.dir}" />
</target> </target>
<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> <target
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/> depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend"
if="have.tests" name="-do-compile-test">
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}"
classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}"
processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}" />
<copy todir="${build.test.classes.dir}"> <copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}"
includes="${includes}" />
</copy> </copy>
</target> </target>
<target name="-post-compile-test"> <target name="-post-compile-test">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> <target
depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"
name="compile-test" />
<target name="-pre-compile-test-single"> <target name="-pre-compile-test-single">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> <target
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single"
if="have.tests" name="-do-compile-test-single">
<fail unless="javac.includes">Must select some files in the IDE or set
javac.includes</fail>
<j2seproject3:force-recompile destdir="${build.test.classes.dir}" /> <j2seproject3:force-recompile destdir="${build.test.classes.dir}" />
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/> <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}"
classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}"
excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}"
sourcepath="${test.src.dir}" srcdir="${test.src.dir}" />
<copy todir="${build.test.classes.dir}"> <copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}"
includes="${includes}" />
</copy> </copy>
</target> </target>
<target name="-post-compile-test-single"> <target name="-post-compile-test-single">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> <target
<!-- depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"
======================= name="compile-test-single" />
JUNIT EXECUTION SECTION <!-- ======================= JUNIT EXECUTION SECTION ======================= -->
=======================
-->
<target depends="init" if="have.tests" name="-pre-test-run"> <target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}" /> <mkdir dir="${build.test.results.dir}" />
</target> </target>
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> <target depends="init,compile-test,-pre-test-run" if="have.tests"
name="-do-test-run">
<j2seproject3:junit testincludes="**/*Test.java" /> <j2seproject3:junit testincludes="**/*Test.java" />
</target> </target>
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> <target depends="init,compile-test,-pre-test-run,-do-test-run"
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> if="have.tests" name="-post-test-run">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details
above.</fail>
</target> </target>
<target depends="init" if="have.tests" name="test-report" /> <target depends="init" if="have.tests" name="test-report" />
<target depends="init" if="netbeans.home+have.tests" name="-test-browse" /> <target depends="init" if="netbeans.home+have.tests" name="-test-browse" />
<target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> <target
depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse"
description="Run unit tests." name="test" />
<target depends="init" if="have.tests" name="-pre-test-run-single"> <target depends="init" if="have.tests" name="-pre-test-run-single">
<mkdir dir="${build.test.results.dir}" /> <mkdir dir="${build.test.results.dir}" />
</target> </target>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> <target depends="init,compile-test-single,-pre-test-run-single"
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> if="have.tests" name="-do-test-run-single">
<fail unless="test.includes">Must select some files in the IDE or set
test.includes</fail>
<j2seproject3:junit excludes="" includes="${test.includes}" /> <j2seproject3:junit excludes="" includes="${test.includes}" />
</target> </target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> <target
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single"
if="have.tests" name="-post-test-run-single">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details
above.</fail>
</target> </target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> <target
<!-- depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single"
======================= description="Run single unit test." name="test-single" />
JUNIT DEBUGGING SECTION <!-- ======================= JUNIT DEBUGGING SECTION ======================= -->
======================= <target depends="init,compile-test" if="have.tests"
--> name="-debug-start-debuggee-test">
<target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail> <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> <property location="${build.test.results.dir}/TEST-${test.class}.xml"
name="test.report.file" />
<delete file="${test.report.file}" /> <delete file="${test.report.file}" />
<mkdir dir="${build.test.results.dir}" /> <mkdir dir="${build.test.results.dir}" />
<j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}"> <j2seproject3:debug
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"
classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
<customize> <customize>
<syspropertyset> <syspropertyset>
<propertyref prefix="test-sys-prop." /> <propertyref prefix="test-sys-prop." />
@ -952,24 +1037,28 @@ is divided into following sections:
</syspropertyset> </syspropertyset>
<arg value="${test.class}" /> <arg value="${test.class}" />
<arg value="showoutput=true" /> <arg value="showoutput=true" />
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> <arg
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter" />
<arg
value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}" />
</customize> </customize>
</j2seproject3:debug> </j2seproject3:debug>
</target> </target>
<target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> <target depends="init,compile-test" if="netbeans.home+have.tests"
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> name="-debug-start-debugger-test">
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}"
name="${test.class}" />
</target> </target>
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> <target
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test"
name="debug-test" />
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home"
name="-do-debug-fix-test">
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}" /> <j2seproject1:nbjpdareload dir="${build.test.classes.dir}" />
</target> </target>
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home"
<!-- name="debug-fix-test" />
========================= <!-- ========================= APPLET EXECUTION SECTION ========================= -->
APPLET EXECUTION SECTION
=========================
-->
<target depends="init,compile-single" name="run-applet"> <target depends="init,compile-single" name="run-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject1:java classname="sun.applet.AppletViewer"> <j2seproject1:java classname="sun.applet.AppletViewer">
@ -978,12 +1067,9 @@ is divided into following sections:
</customize> </customize>
</j2seproject1:java> </j2seproject1:java>
</target> </target>
<!-- <!-- ========================= APPLET DEBUGGING SECTION ========================= -->
========================= <target depends="init,compile-single" if="netbeans.home"
APPLET DEBUGGING SECTION name="-debug-start-debuggee-applet">
=========================
-->
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject3:debug classname="sun.applet.AppletViewer"> <j2seproject3:debug classname="sun.applet.AppletViewer">
<customize> <customize>
@ -991,20 +1077,20 @@ is divided into following sections:
</customize> </customize>
</j2seproject3:debug> </j2seproject3:debug>
</target> </target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> <target
<!-- depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"
=============== if="netbeans.home" name="debug-applet" />
CLEANUP SECTION <!-- =============== CLEANUP SECTION =============== -->
===============
-->
<target name="-deps-clean-init" unless="built-clean.properties"> <target name="-deps-clean-init" unless="built-clean.properties">
<property location="${build.dir}/built-clean.properties" name="built-clean.properties"/> <property location="${build.dir}/built-clean.properties"
name="built-clean.properties" />
<delete file="${built-clean.properties}" quiet="true" /> <delete file="${built-clean.properties}" quiet="true" />
</target> </target>
<target if="already.built.clean.${basedir}" name="-warn-already-built-clean"> <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
<echo level="warn" message="Cycle detected: boosCooldown was already built" /> <echo level="warn" message="Cycle detected: boosCooldown was already built" />
</target> </target>
<target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps"> <target depends="init,-deps-clean-init" name="deps-clean"
unless="no.deps">
<mkdir dir="${build.dir}" /> <mkdir dir="${build.dir}" />
<touch file="${built-clean.properties}" verbose="false" /> <touch file="${built-clean.properties}" verbose="false" />
<property file="${built-clean.properties}" prefix="already.built.clean." /> <property file="${built-clean.properties}" prefix="already.built.clean." />
@ -1015,13 +1101,15 @@ is divided into following sections:
</target> </target>
<target depends="init" name="-do-clean"> <target depends="init" name="-do-clean">
<delete dir="${build.dir}" /> <delete dir="${build.dir}" />
<delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/> <delete dir="${dist.dir}" followsymlinks="false"
includeemptydirs="true" />
</target> </target>
<target name="-post-clean"> <target name="-post-clean">
<!-- Empty placeholder for easier customization. --> <!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. --> <!-- You can override this target in the ../build.xml file. -->
</target> </target>
<target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> <target depends="init,deps-clean,-do-clean,-post-clean"
description="Clean build products." name="clean" />
<target name="-check-call-dep"> <target name="-check-call-dep">
<property file="${call.built.properties}" prefix="already.built." /> <property file="${call.built.properties}" prefix="already.built." />
<condition property="should.call.dep"> <condition property="should.call.dep">

View File

@ -21,13 +21,11 @@ public class boosConfigManager {
File f = new File(boosCoolDown.getDataFolder(), "config.yml"); File f = new File(boosCoolDown.getDataFolder(), "config.yml");
conf = null; conf = null;
if (f.exists()) if (f.exists()) {
{
conf = new Configuration(f); conf = new Configuration(f);
conf.load(); conf.load();
} } else {
else {
this.confFile = new File(boosCoolDown.getDataFolder(), "config.yml"); this.confFile = new File(boosCoolDown.getDataFolder(), "config.yml");
this.conf = new Configuration(confFile); this.conf = new Configuration(confFile);
conf.setProperty("commands.cooldown./spawn", 60); conf.setProperty("commands.cooldown./spawn", 60);
@ -39,10 +37,14 @@ public class boosConfigManager {
conf.setProperty("commands.options.unit_seconds", "seconds"); conf.setProperty("commands.options.unit_seconds", "seconds");
conf.setProperty("commands.options.unit_minutes", "minutes"); conf.setProperty("commands.options.unit_minutes", "minutes");
conf.setProperty("commands.options.unit_hours", "hours"); conf.setProperty("commands.options.unit_hours", "hours");
conf.setProperty("commands.options.message_warmup_cancelled", "&6Warm-ups have been cancelled due to receiving damage.&f"); conf.setProperty("commands.options.message_warmup_cancelled",
conf.setProperty("commands.options.message_cooldown", "&6Wait&e &seconds& &unit&&6 before you can use command&e &command& &6again.&f"); "&6Warm-ups have been cancelled due to receiving damage.&f");
conf.setProperty("commands.options.message_warmup", "&6Wait&e &seconds& &unit&&6 before command&e &command& &6has warmed up.&f"); conf.setProperty("commands.options.message_cooldown",
conf.setProperty("commands.options.message_warmup_alreadystarted", "&6Warm-Up process for&e &command& &6has already started.&f"); "&6Wait&e &seconds& &unit&&6 before you can use command&e &command& &6again.&f");
conf.setProperty("commands.options.message_warmup",
"&6Wait&e &seconds& &unit&&6 before command&e &command& &6has warmed up.&f");
conf.setProperty("commands.options.message_warmup_alreadystarted",
"&6Warm-Up process for&e &command& &6has already started.&f");
conf.save(); conf.save();
} }
} }
@ -70,31 +72,47 @@ public class boosConfigManager {
} }
static String getCoolDownMessage() { static String getCoolDownMessage() {
return conf.getString("commands.options.message_cooldown", "&6Wait&e &seconds& seconds&6 before you can use command&e &command& &6again.&f"); return conf
.getString(
"commands.options.message_cooldown",
"&6Wait&e &seconds& seconds&6 before you can use command&e &command& &6again.&f");
} }
static String getWarmUpCancelledMessage() { static String getWarmUpCancelledMessage() {
return conf.getString("commands.options.message_warmup_cancelled", "&6Warm-ups have been cancelled due to receiving damage.&f"); return conf.getString("commands.options.message_warmup_cancelled",
"&6Warm-ups have been cancelled due to receiving damage.&f");
} }
static String getWarmUpMessage() { static String getWarmUpMessage() {
return conf.getString("commands.options.message_warmup", "&6Wait&e &seconds& seconds&6 before command&e &command& &6has warmed up.&f"); return conf
.getString("commands.options.message_warmup",
"&6Wait&e &seconds& seconds&6 before command&e &command& &6has warmed up.&f");
} }
static String getWarmUpAlreadyStartedMessage() { static String getWarmUpAlreadyStartedMessage() {
return conf.getString("commands.options.message_warmup_alreadystarted", "&6Warm-Up process for&e &command& &6has already started.&f"); return conf.getString("commands.options.message_warmup_alreadystarted",
"&6Warm-Up process for&e &command& &6has already started.&f");
} }
static String getUnitSecondsMessage() { static String getUnitSecondsMessage() {
return conf.getString("commands.options.unit_seconds", "seconds"); return conf.getString("commands.options.unit_seconds", "seconds");
} }
static String getUnitMinutesMessage() { static String getUnitMinutesMessage() {
return conf.getString("commands.options.unit_minutes", "minutes"); return conf.getString("commands.options.unit_minutes", "minutes");
} }
static String getUnitHoursMessage() { static String getUnitHoursMessage() {
return conf.getString("commands.options.unit_hours", "hours"); return conf.getString("commands.options.unit_hours", "hours");
} }
static boolean getClearOnRestart() { static boolean getClearOnRestart() {
return conf.getBoolean("commands.options.clear_on_restart", false); return conf.getBoolean("commands.options.clear_on_restart", false);
} }
static boolean getCancelWarmUpOnDamage() { static boolean getCancelWarmUpOnDamage() {
return conf.getBoolean("commands.options.cancel_warmup_on_damage", false); return conf.getBoolean("commands.options.cancel_warmup_on_damage",
false);
} }
} }

View File

@ -15,8 +15,10 @@ import java.util.logging.Logger;
public class boosCoolDown extends JavaPlugin { public class boosCoolDown extends JavaPlugin {
private final boosCoolDownPlayerListener playerListener = new boosCoolDownPlayerListener(this); private final boosCoolDownPlayerListener playerListener = new boosCoolDownPlayerListener(
private final boosCoolDownEntityListener entityListener = new boosCoolDownEntityListener(this); this);
private final boosCoolDownEntityListener entityListener = new boosCoolDownEntityListener(
this);
public static final Logger log = Logger.getLogger("Minecraft"); public static final Logger log = Logger.getLogger("Minecraft");
public static PluginDescriptionFile pdfFile; public static PluginDescriptionFile pdfFile;
public static Configuration conf; public static Configuration conf;
@ -28,10 +30,13 @@ public class boosCoolDown extends JavaPlugin {
pdfFile = this.getDescription(); pdfFile = this.getDescription();
PluginManager pm = getServer().getPluginManager(); PluginManager pm = getServer().getPluginManager();
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Event.Priority.Lowest, this); pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener,
Event.Priority.Lowest, this);
PluginDescriptionFile pdfFile = this.getDescription(); PluginDescriptionFile pdfFile = this.getDescription();
log.info("[" + pdfFile.getName() + "]" + " version " + pdfFile.getVersion() + " by " + pdfFile.getAuthors() + " is enabled!"); log.info("[" + pdfFile.getName() + "]" + " version "
+ pdfFile.getVersion() + " by " + pdfFile.getAuthors()
+ " is enabled!");
boosConfigManager boosConfigManager = new boosConfigManager(this); boosConfigManager boosConfigManager = new boosConfigManager(this);
boosConfigManager.load(); boosConfigManager.load();
@ -39,7 +44,8 @@ public class boosCoolDown extends JavaPlugin {
boosCoolDownManager boosCoolDownManager = new boosCoolDownManager(this); boosCoolDownManager boosCoolDownManager = new boosCoolDownManager(this);
boosCoolDownManager.load(); boosCoolDownManager.load();
if (boosConfigManager.getCancelWarmUpOnDamage()) { if (boosConfigManager.getCancelWarmUpOnDamage()) {
pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Event.Priority.Normal, this); pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener,
Event.Priority.Normal, this);
} }
if (boosConfigManager.getClearOnRestart() == true) { if (boosConfigManager.getClearOnRestart() == true) {
boosCoolDownManager.clear(); boosCoolDownManager.clear();
@ -54,19 +60,21 @@ public class boosCoolDown extends JavaPlugin {
boosCoolDownManager.clear(); boosCoolDownManager.clear();
} else { } else {
} }
log.info("[" + pdfFile.getName() + "]" + " version " + pdfFile.getVersion() + " disabled!"); log.info("[" + pdfFile.getName() + "]" + " version "
+ pdfFile.getVersion() + " disabled!");
} }
@Override @Override
public boolean onCommand(CommandSender sender, Command c, String commandLabel, String[] args) { public boolean onCommand(CommandSender sender, Command c,
String commandLabel, String[] args) {
String command = c.getName().toLowerCase(); String command = c.getName().toLowerCase();
if (command.equalsIgnoreCase("boosCoolDown")) { if (command.equalsIgnoreCase("boosCoolDown")) {
boosConfigManager.reload(); boosConfigManager.reload();
boosChat.sendMessageToCommandSender(sender, "&6[" + pdfFile.getName() + "]" + " config reloaded"); boosChat.sendMessageToCommandSender(sender,
"&6[" + pdfFile.getName() + "]" + " config reloaded");
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -24,7 +24,8 @@ public class boosCoolDownEntityListener extends EntityListener {
Player player = (Player) entity; Player player = (Player) entity;
if (player != null) { if (player != null) {
if (boosWarmUpManager.hasWarmUps(player)) { if (boosWarmUpManager.hasWarmUps(player)) {
boosChat.sendMessageToPlayer(player,boosConfigManager.getWarmUpCancelledMessage()); boosChat.sendMessageToPlayer(player,
boosConfigManager.getWarmUpCancelledMessage());
boosWarmUpManager.cancelWarmUps(player); boosWarmUpManager.cancelWarmUps(player);
} }

View File

@ -61,22 +61,26 @@ public class boosCoolDownManager {
// clear cooldown // clear cooldown
cooldown.clear(); cooldown.clear();
if (confusers.getKeys("users." + players.get(i) + ".cooldown") != null) { if (confusers.getKeys("users." + players.get(i) + ".cooldown") != null) {
cooldown.addAll(confusers.getKeys("users." + players.get(i) + ".cooldown")); cooldown.addAll(confusers.getKeys("users." + players.get(i)
+ ".cooldown"));
} }
int j = 0; int j = 0;
while (j < cooldown.size()) { while (j < cooldown.size()) {
confusers.removeProperty("users." + players.get(i) + ".cooldown." + cooldown.get(j)); confusers.removeProperty("users." + players.get(i)
+ ".cooldown." + cooldown.get(j));
j++; j++;
} }
confusers.removeProperty("users." + players.get(i) + ".cooldown"); confusers.removeProperty("users." + players.get(i) + ".cooldown");
// clear warmup // clear warmup
warmup.clear(); warmup.clear();
if (confusers.getKeys("users." + players.get(i) + ".warmup") != null) { if (confusers.getKeys("users." + players.get(i) + ".warmup") != null) {
warmup.addAll(confusers.getKeys("users." + players.get(i) + ".warmup")); warmup.addAll(confusers.getKeys("users." + players.get(i)
+ ".warmup"));
} }
int k = 0; int k = 0;
while (k < warmup.size()) { while (k < warmup.size()) {
confusers.removeProperty("users." + players.get(i) + ".warmup." + warmup.get(k)); confusers.removeProperty("users." + players.get(i) + ".warmup."
+ warmup.get(k));
k++; k++;
} }
confusers.removeProperty("users." + players.get(i) + ".warmup"); confusers.removeProperty("users." + players.get(i) + ".warmup");
@ -112,14 +116,20 @@ public class boosCoolDownManager {
String msg = boosConfigManager.getCoolDownMessage(); String msg = boosConfigManager.getCoolDownMessage();
msg = msg.replaceAll("&command&", pre); msg = msg.replaceAll("&command&", pre);
if (waitSeconds >= 60 && 3600 >= waitSeconds) { if (waitSeconds >= 60 && 3600 >= waitSeconds) {
msg = msg.replaceAll("&seconds&", Long.toString(waitMinutes)); msg = msg.replaceAll("&seconds&",
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitMinutesMessage()); Long.toString(waitMinutes));
msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitMinutesMessage());
} else if (waitMinutes >= 60) { } else if (waitMinutes >= 60) {
msg = msg.replaceAll("&seconds&", Long.toString(waitHours)); msg = msg.replaceAll("&seconds&",
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitHoursMessage()); Long.toString(waitHours));
msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitHoursMessage());
} else { } else {
msg = msg.replaceAll("&seconds&", Long.toString(waitSeconds)); msg = msg.replaceAll("&seconds&",
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitSecondsMessage()); Long.toString(waitSeconds));
msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitSecondsMessage());
} }
boosChat.sendMessageToPlayer(player, msg); boosChat.sendMessageToPlayer(player, msg);
return true; return true;
@ -132,10 +142,12 @@ public class boosCoolDownManager {
static void cancelCoolDowns(Player player) { static void cancelCoolDowns(Player player) {
List<String> cooldown = new LinkedList<String>(); List<String> cooldown = new LinkedList<String>();
cooldown.clear(); cooldown.clear();
cooldown.addAll(confusers.getKeys("users." + player.getName() + ".cooldown")); cooldown.addAll(confusers.getKeys("users." + player.getName()
+ ".cooldown"));
int j = 0; int j = 0;
while (j < cooldown.size()) { while (j < cooldown.size()) {
confusers.removeProperty("users." + player.getName() + ".cooldown." + cooldown.get(j)); confusers.removeProperty("users." + player.getName() + ".cooldown."
+ cooldown.get(j));
j++; j++;
} }
confusers.removeProperty("users." + player.getName() + ".cooldown"); confusers.removeProperty("users." + player.getName() + ".cooldown");
@ -163,14 +175,20 @@ public class boosCoolDownManager {
String msg = boosConfigManager.getCoolDownMessage(); String msg = boosConfigManager.getCoolDownMessage();
msg = msg.replaceAll("&command&", pre); msg = msg.replaceAll("&command&", pre);
if (waitSeconds >= 60 && 3600 >= waitSeconds) { if (waitSeconds >= 60 && 3600 >= waitSeconds) {
msg = msg.replaceAll("&seconds&", Long.toString(waitMinutes)); msg = msg.replaceAll("&seconds&",
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitMinutesMessage()); Long.toString(waitMinutes));
msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitMinutesMessage());
} else if (waitMinutes >= 60) { } else if (waitMinutes >= 60) {
msg = msg.replaceAll("&seconds&", Long.toString(waitHours)); msg = msg.replaceAll("&seconds&",
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitHoursMessage()); Long.toString(waitHours));
msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitHoursMessage());
} else { } else {
msg = msg.replaceAll("&seconds&", Long.toString(waitSeconds)); msg = msg.replaceAll("&seconds&",
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitSecondsMessage()); Long.toString(waitSeconds));
msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitSecondsMessage());
} }
boosChat.sendMessageToPlayer(player, msg); boosChat.sendMessageToPlayer(player, msg);
return false; return false;
@ -186,7 +204,8 @@ public class boosCoolDownManager {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
currTime = sdf.format(cal.getTime()); currTime = sdf.format(cal.getTime());
confusers.setProperty("users." + player.getName() + ".cooldown." + pre, currTime); confusers.setProperty("users." + player.getName() + ".cooldown." + pre,
currTime);
confusers.save(); confusers.save();
} }
@ -208,7 +227,8 @@ public class boosCoolDownManager {
static Date getTime(Player player, String pre) { static Date getTime(Player player, String pre) {
pre = pre.toLowerCase(); pre = pre.toLowerCase();
String confTime = ""; String confTime = "";
confTime = confusers.getString("users." + player.getName() + ".cooldown." + pre, null); confTime = confusers.getString("users." + player.getName()
+ ".cooldown." + pre, null);
if (confTime != null && !confTime.equals("")) { if (confTime != null && !confTime.equals("")) {
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
@ -236,14 +256,16 @@ public class boosCoolDownManager {
static void setWarmUpOK(Player player, String pre, String message) { static void setWarmUpOK(Player player, String pre, String message) {
pre = pre.toLowerCase(); pre = pre.toLowerCase();
confusers.setProperty("users." + player.getName() + ".warmup." + pre, 1); confusers
.setProperty("users." + player.getName() + ".warmup." + pre, 1);
confusers.save(); confusers.save();
} }
static boolean checkWarmUpOK(Player player, String pre, String message) { static boolean checkWarmUpOK(Player player, String pre, String message) {
pre = pre.toLowerCase(); pre = pre.toLowerCase();
int ok = 0; int ok = 0;
ok = confusers.getInt("users." + player.getName() + ".warmup." + pre, ok); ok = confusers.getInt("users." + player.getName() + ".warmup." + pre,
ok);
if (ok == 1) { if (ok == 1) {
return true; return true;
} }
@ -252,7 +274,8 @@ public class boosCoolDownManager {
static void removeWarmUpOK(Player player, String pre, String message) { static void removeWarmUpOK(Player player, String pre, String message) {
pre = pre.toLowerCase(); pre = pre.toLowerCase();
confusers.removeProperty("users." + player.getName() + ".warmup." + pre); confusers
.removeProperty("users." + player.getName() + ".warmup." + pre);
confusers.save(); confusers.save();
} }
} }

View File

@ -7,7 +7,6 @@ import org.bukkit.event.player.PlayerMoveEvent;
//import org.bukkit.event.entity.EntityDamageEvent; //import org.bukkit.event.entity.EntityDamageEvent;
public class boosCoolDownPlayerListener extends PlayerListener { public class boosCoolDownPlayerListener extends PlayerListener {
private final boosCoolDown plugin; private final boosCoolDown plugin;
@ -32,55 +31,59 @@ public class boosCoolDownPlayerListener extends PlayerListener {
on = true; on = true;
} }
if (on) { if (on) {
int i = message.indexOf(' '); int i = message.indexOf(' ');
if(i < 0) { i = message.length(); } if (i < 0) {
i = message.length();
}
String preCommand = message.substring(0, i); String preCommand = message.substring(0, i);
String messageCommand = message.substring(i, message.length()); String messageCommand = message.substring(i, message.length());
boolean onCooldown = this.checkCooldown(event, player, preCommand, messageCommand); boolean onCooldown = this.checkCooldown(event, player, preCommand,
messageCommand);
if (!onCooldown && messageCommand.length() > 1) { if (!onCooldown && messageCommand.length() > 1) {
int j = messageCommand.indexOf(' ', 1); int j = messageCommand.indexOf(' ', 1);
if(j < 0) { j = messageCommand.length(); } if (j < 0) {
j = messageCommand.length();
}
String preSub = messageCommand.substring(1, j); String preSub = messageCommand.substring(1, j);
String messageSub = messageCommand.substring(j, messageCommand.length()); String messageSub = messageCommand.substring(j,
messageCommand.length());
preSub = preCommand + ' ' + preSub; preSub = preCommand + ' ' + preSub;
onCooldown = this.checkCooldown(event, player, preSub, messageSub); onCooldown = this.checkCooldown(event, player, preSub,
messageSub);
} }
} }
} }
// Returns true if the command is on cooldown, false otherwise // Returns true if the command is on cooldown, false otherwise
private boolean checkCooldown(PlayerCommandPreprocessEvent event, Player player, String pre, String message) { private boolean checkCooldown(PlayerCommandPreprocessEvent event,
Player player, String pre, String message) {
int warmUpSeconds = boosConfigManager.getWarmUp(player, pre); int warmUpSeconds = boosConfigManager.getWarmUp(player, pre);
if (warmUpSeconds > 0) { if (warmUpSeconds > 0) {
if (!boosCoolDownManager.checkWarmUpOK(player, pre, message)) { if (!boosCoolDownManager.checkWarmUpOK(player, pre, message)) {
if (boosCoolDownManager.checkCoolDownOK(player, pre, message)) { if (boosCoolDownManager.checkCoolDownOK(player, pre, message)) {
boosWarmUpManager.startWarmUp(this.plugin, player, pre, message, warmUpSeconds); boosWarmUpManager.startWarmUp(this.plugin, player, pre,
message, warmUpSeconds);
event.setCancelled(true);
return true;
} else {
event.setCancelled(true); event.setCancelled(true);
return true; return true;
} }
else { } else {
event.setCancelled(true);
return true;
}
}
else {
if (boosCoolDownManager.coolDown(player, pre, message)) { if (boosCoolDownManager.coolDown(player, pre, message)) {
event.setCancelled(true); event.setCancelled(true);
return true; return true;
} } else {
else {
boosCoolDownManager.removeWarmUpOK(player, pre, message); boosCoolDownManager.removeWarmUpOK(player, pre, message);
} }
} }
} } else {
else {
if (boosCoolDownManager.coolDown(player, pre, message)) { if (boosCoolDownManager.coolDown(player, pre, message)) {
event.setCancelled(true); event.setCancelled(true);
return true; return true;

View File

@ -12,7 +12,8 @@ public class boosWarmUpManager {
static Timer scheduler; static Timer scheduler;
public static void startWarmUp(boosCoolDown bCoolDown, Player player, String pre, String message, int warmUpSeconds) { public static void startWarmUp(boosCoolDown bCoolDown, Player player,
String pre, String message, int warmUpSeconds) {
pre = pre.toLowerCase(); pre = pre.toLowerCase();
long warmUpMinutes = Math.round(warmUpSeconds / 60) + 1; long warmUpMinutes = Math.round(warmUpSeconds / 60) + 1;
long warmUpHours = Math.round(warmUpMinutes / 60) + 1; long warmUpHours = Math.round(warmUpMinutes / 60) + 1;
@ -22,29 +23,33 @@ public class boosWarmUpManager {
msg = msg.replaceAll("&command&", pre); msg = msg.replaceAll("&command&", pre);
if (warmUpSeconds >= 60 && 3600 >= warmUpSeconds) { if (warmUpSeconds >= 60 && 3600 >= warmUpSeconds) {
msg = msg.replaceAll("&seconds&", Long.toString(warmUpMinutes)); msg = msg.replaceAll("&seconds&", Long.toString(warmUpMinutes));
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitMinutesMessage()); msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitMinutesMessage());
} else if (warmUpMinutes >= 60) { } else if (warmUpMinutes >= 60) {
msg = msg.replaceAll("&seconds&", Long.toString(warmUpHours)); msg = msg.replaceAll("&seconds&", Long.toString(warmUpHours));
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitHoursMessage()); msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitHoursMessage());
} else { } else {
msg = msg.replaceAll("&seconds&", Long.toString(warmUpSeconds)); msg = msg.replaceAll("&seconds&", Long.toString(warmUpSeconds));
msg = msg.replaceAll("&unit&", boosConfigManager.getUnitSecondsMessage()); msg = msg.replaceAll("&unit&",
boosConfigManager.getUnitSecondsMessage());
} }
boosChat.sendMessageToPlayer(player, msg); boosChat.sendMessageToPlayer(player, msg);
scheduler = new Timer(); scheduler = new Timer();
boosWarmUpTimer scheduleMe = new boosWarmUpTimer(bCoolDown, scheduler, player, pre, message); boosWarmUpTimer scheduleMe = new boosWarmUpTimer(bCoolDown,
scheduler, player, pre, message);
playercommands.put(player.getName() + "@" + pre, scheduleMe); playercommands.put(player.getName() + "@" + pre, scheduleMe);
scheduler.schedule(scheduleMe, warmUpSeconds * 1000); scheduler.schedule(scheduleMe, warmUpSeconds * 1000);
} } else {
else {
String msg = boosConfigManager.getWarmUpAlreadyStartedMessage(); String msg = boosConfigManager.getWarmUpAlreadyStartedMessage();
msg = msg.replaceAll("&command&", pre); msg = msg.replaceAll("&command&", pre);
boosChat.sendMessageToPlayer(player, msg); boosChat.sendMessageToPlayer(player, msg);
} }
} }
public static boolean isWarmUpProcess(Player player, String pre, String message) { public static boolean isWarmUpProcess(Player player, String pre,
String message) {
pre = pre.toLowerCase(); pre = pre.toLowerCase();
if (playercommands.containsKey(player.getName() + "@" + pre)) { if (playercommands.containsKey(player.getName() + "@" + pre)) {
return true; return true;

View File

@ -5,7 +5,6 @@ import java.util.TimerTask;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class boosWarmUpTimer extends TimerTask { public class boosWarmUpTimer extends TimerTask {
boosCoolDown bCoolDown; boosCoolDown bCoolDown;
@ -13,19 +12,22 @@ public class boosWarmUpTimer extends TimerTask {
String pre; String pre;
String message; String message;
public boosWarmUpTimer(boosCoolDown bCoolDown, Timer timer, Player player, String pre, String message){ public boosWarmUpTimer(boosCoolDown bCoolDown, Timer timer, Player player,
String pre, String message) {
this.bCoolDown = bCoolDown; this.bCoolDown = bCoolDown;
this.player = player; this.player = player;
this.pre = pre; this.pre = pre;
this.message = message; this.message = message;
} }
public boosWarmUpTimer() { public boosWarmUpTimer() {
} }
public void run() { public void run() {
if (player.isOnline()) { if (player.isOnline()) {
boosCoolDownManager.setWarmUpOK(player, pre, message); boosCoolDownManager.setWarmUpOK(player, pre, message);
boosWarmUpManager.removeWarmUpProcess(this.player.getName() + "@" + pre); boosWarmUpManager.removeWarmUpProcess(this.player.getName() + "@"
+ pre);
player.chat(pre + message); player.chat(pre + message);
} }
} }