Merge branch 'antibuild' into 2.9

This commit is contained in:
KHobbits 2012-08-19 23:41:28 +01:00
commit 2dff343c10
29 changed files with 1965 additions and 602 deletions

3
.gitignore vendored
View File

@ -40,3 +40,6 @@
*.iml
/EssentialsGroupManager/bin
/EssentialsGroupManager/.externalToolBuilders
/EssentialsAntiBuild/nbproject/private/
/EssentialsAntiBuild/dist/
/EssentialsAntiBuild/build/

View File

@ -12,9 +12,9 @@ is divided into following sections:
- execution
- debugging
- javadoc
- test compilation
- test execution
- test debugging
- junit compilation
- junit execution
- junit debugging
- applet
- cleanup
@ -181,7 +181,6 @@ is divided into following sections:
</and>
</condition>
<property name="run.jvmargs" value=""/>
<property name="run.jvmargs.ide" value=""/>
<property name="javac.compilerargs" value=""/>
<property name="work.dir" value="${basedir}"/>
<condition property="no.deps">
@ -226,27 +225,6 @@ is divided into following sections:
<property name="jar.index.metainf" value="${jar.index}"/>
<property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
<condition property="junit.available">
<or>
<available classname="org.junit.Test" classpath="${run.test.classpath}"/>
<available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
</or>
</condition>
<condition property="testng.available">
<available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
</condition>
<condition property="junit+testng.available">
<and>
<istrue value="${junit.available}"/>
<istrue value="${testng.available}"/>
</and>
</condition>
<condition else="testng" property="testng.mode" value="mixed">
<istrue value="${junit+testng.available}"/>
</condition>
<condition else="" property="testng.debug.mode" value="-mixed">
<istrue value="${junit+testng.available}"/>
</condition>
</target>
<target name="-post-init">
<!-- Empty placeholder for easier customization. -->
@ -379,52 +357,11 @@ is divided into following sections:
</sequential>
</macrodef>
</target>
<target if="${junit.available}" name="-init-macrodef-junit-init">
<condition else="false" property="nb.junit.batch" value="true">
<and>
<istrue value="${junit.available}"/>
<not>
<isset property="test.method"/>
</not>
</and>
</condition>
<condition else="false" property="nb.junit.single" value="true">
<and>
<istrue value="${junit.available}"/>
<isset property="test.method"/>
</and>
</condition>
</target>
<target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
<target name="-init-macrodef-junit">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<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}">
<test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<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}">
@ -433,270 +370,32 @@ is divided into following sections:
<filename name="@{testincludes}"/>
</fileset>
</batchtest>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
<target if="${testng.available}" name="-init-macrodef-testng">
<macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
<isset property="test.method"/>
</condition>
<union id="test.set">
<fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
</union>
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
<testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="BuildAll" testname="TestNG tests" workingDir="${work.dir}">
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
<propertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</propertyset>
<customize/>
</testng>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-test-impl">
<macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<echo>No tests executed.</echo>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
<macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize/>
</j2seproject3:junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
<macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize/>
</j2seproject3:testng>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
<macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<sequential>
<j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
</customize>
</j2seproject3:test-impl>
</sequential>
</macrodef>
</target>
<target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
<macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<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}">
<test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
<macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<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}">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
</batchtest>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
<macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize/>
</j2seproject3:junit-debug>
</sequential>
</macrodef>
</target>
<target if="${testng.available}" name="-init-macrodef-testng-debug">
<macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<element name="customize2" optional="true"/>
<sequential>
<condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
<isset property="test.method"/>
</condition>
<condition else="-suitename BuildAll -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
<matches pattern=".*\.xml" string="@{testClass}"/>
</condition>
<delete dir="${build.test.results.dir}" quiet="true"/>
<mkdir dir="${build.test.results.dir}"/>
<j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
<customize>
<customize2/>
<jvmarg value="-ea"/>
<arg line="${testng.debug.mode}"/>
<arg line="-d ${build.test.results.dir}"/>
<arg line="-listener org.testng.reporters.VerboseReporter"/>
<arg line="${testng.cmd.args}"/>
</customize>
</j2seproject3:debug>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
<macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<element implicit="true" name="customize2" optional="true"/>
<sequential>
<j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
<customize2/>
</j2seproject3:testng-debug>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
<macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<sequential>
<j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="-ea"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
</customize>
</j2seproject3:test-debug-impl>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
<macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<sequential>
<j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
<customize2>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
</customize2>
</j2seproject3:testng-debug-impl>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
<!--
pre NB7.2 profiling section; consider it deprecated
-->
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
<target if="profiler.info.jvmargs.agent" name="-profile-pre-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">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="profiler.info.jvmargs.agent" name="-profile-post-init">
<target name="-profile-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
<target name="-profile-init-macrodef-profile">
<macrodef name="resolve">
<attribute name="name"/>
<attribute name="value"/>
@ -728,13 +427,10 @@ is divided into following sections:
</sequential>
</macrodef>
</target>
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" 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>
<!--
end of pre NB7.2 profiling section
-->
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${main.class}" name="name"/>
@ -792,7 +488,6 @@ is divided into following sections:
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
@ -809,7 +504,6 @@ is divided into following sections:
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${main.class}" name="classname"/>
<attribute default="${run.classpath}" name="classpath"/>
<attribute default="jvm" name="jvm"/>
<element name="customize" optional="true"/>
<sequential>
<java classname="@{classname}" dir="${work.dir}" fork="true">
@ -817,7 +511,6 @@ is divided into following sections:
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
@ -844,9 +537,6 @@ is divided into following sections:
<path path="${run.classpath.without.build.classes.dir}"/>
<chainedmapper>
<flattenmapper/>
<filtermapper>
<replacestring from=" " to="%20"/>
</filtermapper>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
@ -892,7 +582,7 @@ is divided into following sections:
<target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
<property name="ap.cmd.line.internal" value=""/>
</target>
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
<target depends="-pre-init,-init-private,-init-libraries,-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
@ -948,6 +638,13 @@ is divided into following sections:
<param name="call.target" value="jar"/>
<param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-jar.properties}"/>
<param location="${project.EssentialsAntiBuild}" name="call.subproject"/>
<param location="${project.EssentialsAntiBuild}/build.xml" name="call.script"/>
<param name="call.target" value="jar"/>
<param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-jar.properties}"/>
<param location="${project.EssentialsProtect}" name="call.subproject"/>
@ -1164,11 +861,7 @@ is divided into following sections:
PROFILING SECTION
=================
-->
<!--
pre NB7.2 profiler integration
-->
<target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
@ -1176,9 +869,8 @@ is divided into following sections:
</nbprofiledirect>
<profile/>
</target>
<target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
<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="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
@ -1186,8 +878,12 @@ is divided into following sections:
</nbprofiledirect>
<profile classname="${profile.class}"/>
</target>
<target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<!--
=========================
APPLET PROFILING SECTION
=========================
-->
<target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
@ -1199,8 +895,12 @@ is divided into following sections:
</customize>
</profile>
</target>
<target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<!--
=========================
TESTS PROFILING SECTION
=========================
-->
<target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
<nbprofiledirect>
<classpath>
<path path="${run.test.classpath}"/>
@ -1222,42 +922,6 @@ is divided into following sections:
<formatter type="xml"/>
</junit>
</target>
<!--
end of pre NB72 profiling section
-->
<target if="netbeans.home" name="-profile-check">
<condition property="profiler.configured">
<or>
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
</or>
</condition>
</target>
<target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
<startprofiler/>
<antcall target="run"/>
</target>
<target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<startprofiler/>
<antcall target="run-single"/>
</target>
<target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
<target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<startprofiler/>
<antcall target="test-single"/>
</target>
<target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<startprofiler/>
<antcal target="run-test-with-main"/>
</target>
<target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<startprofiler/>
<antcall target="run-applet"/>
</target>
<!--
===============
JAVADOC SECTION
@ -1301,7 +965,7 @@ is divided into following sections:
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
<!--
=========================
TEST COMPILATION SECTION
JUNIT COMPILATION SECTION
=========================
-->
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
@ -1344,14 +1008,14 @@ is divided into following sections:
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
<!--
=======================
TEST EXECUTION SECTION
JUNIT EXECUTION SECTION
=======================
-->
<target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
<j2seproject3:test testincludes="**/*Test.java"/>
<j2seproject3:junit testincludes="**/*Test.java"/>
</target>
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
@ -1364,40 +1028,39 @@ is divided into following sections:
</target>
<target depends="init,compile-test-single,-pre-test-run-single" 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:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
<j2seproject3:junit excludes="" includes="${test.includes}"/>
</target>
<target 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 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" if="have.tests" name="-do-test-run-single-method">
<fail unless="test.class">Must select some files in the IDE or set test.class</fail>
<fail unless="test.method">Must select some method in the IDE or set test.method</fail>
<j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
<!--
=======================
TEST DEBUGGING SECTION
JUNIT DEBUGGING SECTION
=======================
-->
<target depends="init,compile-test-single,-pre-test-run-single" 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>
<j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<fail unless="test.method">Must select some method in the IDE or set test.method</fail>
<j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
<property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
<delete file="${test.report.file}"/>
<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}">
<customize>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<arg value="${test.class}"/>
<arg value="showoutput=true"/>
<arg 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>
</j2seproject3:debug>
</target>
<target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
</target>
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
</target>
@ -1484,6 +1147,13 @@ is divided into following sections:
<param name="call.target" value="clean"/>
<param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-clean.properties}"/>
<param location="${project.EssentialsAntiBuild}" name="call.subproject"/>
<param location="${project.EssentialsAntiBuild}/build.xml" name="call.script"/>
<param name="call.target" value="clean"/>
<param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
</antcall>
<antcall target="-maybe-call-dep">
<param name="call.built.properties" value="${built-clean.properties}"/>
<param location="${project.EssentialsProtect}" name="call.subproject"/>
@ -1518,12 +1188,9 @@ is divided into following sections:
<target name="-check-call-dep">
<property file="${call.built.properties}" prefix="already.built."/>
<condition property="should.call.dep">
<and>
<not>
<isset property="already.built.${call.subproject}"/>
</not>
<available file="${call.script}"/>
</and>
</condition>
</target>
<target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">

View File

@ -1,8 +1,8 @@
build.xml.data.CRC32=51b33957
build.xml.data.CRC32=b4df970c
build.xml.script.CRC32=7a797370
build.xml.stylesheet.CRC32=28e38971@1.44.1.45
build.xml.stylesheet.CRC32=28e38971@1.50.3.46
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=51b33957
nbproject/build-impl.xml.script.CRC32=2a17f1e9
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
nbproject/build-impl.xml.data.CRC32=b4df970c
nbproject/build-impl.xml.script.CRC32=1fd6d3cc
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.3.46

View File

@ -66,6 +66,7 @@ jar.compress=true
javac.classpath=\
${reference.Essentials.jar}:\
${reference.EssentialsChat.jar}:\
${reference.EssentialsAntiBuild.jar}:\
${reference.EssentialsProtect.jar}:\
${reference.EssentialsSpawn.jar}:\
${reference.EssentialsGeoIP.jar}:\
@ -103,6 +104,7 @@ project.EssentialsChat=../EssentialsChat
project.EssentialsGeoIP=../EssentialsGeoIP
project.EssentialsGroupBridge=../EssentialsGroupBridge
project.EssentialsGroupManager=../EssentialsGroupManager
project.EssentialsAntiBuild=../EssentialsAntiBuild
project.EssentialsProtect=../EssentialsProtect
project.EssentialsSpawn=../EssentialsSpawn
project.EssentialsXMPP=../EssentialsXMPP
@ -111,6 +113,7 @@ reference.EssentialsChat.jar=${project.EssentialsChat}/dist/EssentialsChat.jar
reference.EssentialsGeoIP.jar=${project.EssentialsGeoIP}/dist/EssentialsGeoIP.jar
reference.EssentialsGroupBridge.jar=${project.EssentialsGroupBridge}/dist/EssentialsGroupBridge.jar
reference.EssentialsGroupManager.jar=${project.EssentialsGroupManager}/dist/EssentialsGroupManager.jar
reference.EssentialsAntiBuild.jar=${project.EssentialsAntiBuild}/dist/EssentialsAntiBuild.jar
reference.EssentialsProtect.jar=${project.EssentialsProtect}/dist/EssentialsProtect.jar
reference.EssentialsSpawn.jar=${project.EssentialsSpawn}/dist/EssentialsSpawn.jar
reference.EssentialsXMPP.jar=${project.EssentialsXMPP}/dist/EssentialsXMPP.jar

View File

@ -55,6 +55,14 @@
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsAntiBuild</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsProtect</foreign-project>
<artifact-type>jar</artifact-type>

View File

@ -44,7 +44,7 @@ public class BPermissions2Handler extends SuperpermsHandler
@Override
public boolean canBuild(final Player base, final String group)
{
return hasPermission(base, "essentials.build") || hasPermission(base, "bPermissions.build");
return hasPermission(base, "bPermissions.build");
}
@Override

View File

@ -56,7 +56,7 @@ public class BPermissionsHandler extends SuperpermsHandler
@Override
public boolean canBuild(final Player base, final String group)
{
return hasPermission(base, "essentials.build") || hasPermission(base, "bPermissions.build");
return hasPermission(base, "bPermissions.build");
}
@Override

View File

@ -78,6 +78,6 @@ public class PermissionsBukkitHandler extends SuperpermsHandler
@Override
public boolean canBuild(Player base, String group)
{
return hasPermission(base, "essentials.build") || hasPermission(base, "permissions.build");
return hasPermission(base, "permissions.build");
}
}

View File

@ -55,7 +55,7 @@ public class PrivilegesHandler extends SuperpermsHandler
@Override
public boolean canBuild(Player base, String group)
{
return hasPermission(base, "essentials.build") || hasPermission(base, "privileges.build");
return hasPermission(base, "privileges.build");
}
}

View File

@ -21,7 +21,7 @@ public class SuperpermsHandler implements IPermissionsHandler
@Override
public boolean canBuild(final Player base, final String group)
{
return hasPermission(base, "essentials.build");
return false;
}
@Override

View File

@ -450,28 +450,6 @@ protect:
password: 'root'
mysqlDb: 'jdbc:mysql://localhost:3306/minecraft'
# For which block types would you like to be alerted?
# You can find a list of IDs in plugins/Essentials/items.csv after loading Essentials for the first time.
# 10 = lava :: 11 = still lava :: 46 = TNT :: 327 = lava bucket
alert:
on-placement: 10,11,46,327
on-use: 327
on-break:
blacklist:
# Which blocks should people be prevented from placing
placement: 10,11,46,327
# Which items should people be prevented from using
usage: 327
# Which blocks should people be prevented from breaking
break:
# Which blocks should not be pushed by pistons
piston:
# General physics/behavior modifications
prevent:
lava-flow: false
@ -532,10 +510,10 @@ protect:
# Protect various blocks.
protect:
# Protect all signs
signs: true
signs: false
# Prevent users from destroying rails
rails: true
rails: false
# Blocks below rails/signs are also protected if the respective rail/sign is protected.
# This makes it more difficult to circumvent protection, and should be enabled.
@ -577,6 +555,20 @@ protect:
# Should the damage after hit by a lightning be disabled?
lightning: false
# Disable weather options
weather:
storm: false
thunder: false
lightning: false
############################################################
# +------------------------------------------------------+ #
# | EssentialsAntiBuild | #
# +------------------------------------------------------+ #
############################################################
# Disable various default physics and behaviors
# Should people with build: false in permissions be allowed to build
# Set true to disable building for those people
build: true
@ -588,11 +580,27 @@ protect:
# Should we tell people they are not allowed to build
warn-on-build-disallow: true
# Disable weather options
weather:
storm: false
thunder: false
lightning: false
# For which block types would you like to be alerted?
# You can find a list of IDs in plugins/Essentials/items.csv after loading Essentials for the first time.
# 10 = lava :: 11 = still lava :: 46 = TNT :: 327 = lava bucket
alert:
on-placement: 10,11,46,327
on-use: 327
on-break:
blacklist:
# Which blocks should people be prevented from placing
placement: 10,11,46,327
# Which items should people be prevented from using
usage: 327
# Which blocks should people be prevented from breaking
break:
# Which blocks should not be pushed by pistons
piston:
############################################################
# +------------------------------------------------------+ #

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [ <!ENTITY buildinc SYSTEM "../build.inc.xml"> ]>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="EssentialsAntiBuild" default="default" basedir=".">
<description>Builds, tests, and runs the project EssentialsAntiBuild.</description>
<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 and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
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)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="EssentialsProtect-impl.jar">
<exec dir="bin" executable="launcher.exe">
<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.
-->
<target name="-post-jar">
<jar jarfile="${dist.dir}/EssentialsAntiBuild.jar">
<zipfileset src="${dist.jar}" excludes="META-INF/*" />
<manifest>
<attribute name="Classpath" value="EssentialsAntiBuild.jar"/>
</manifest>
</jar>
</target>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
build.xml.data.CRC32=ff207988
build.xml.script.CRC32=1ed11cc3
build.xml.stylesheet.CRC32=28e38971@1.38.3.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=ddb4519c
nbproject/build-impl.xml.script.CRC32=cfb9443d
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.3.46

View File

@ -0,0 +1,123 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=EssentialsAntiBuild
application.vendor=
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader=0
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/original-EssentialsAntiBuild.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.bukkit.jar=../lib/bukkit.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${reference.Essentials.jar}:\
${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.6
javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
jnlp.codebase.type=no.codebase
jnlp.descriptor=application
jnlp.enabled=false
jnlp.mixed.code=defaut
jnlp.offline-allowed=false
jnlp.signed=false
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=true
platform.active=default_platform
project.Essentials=../Essentials
reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>EssentialsAntiBuild</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>../lib/nblibraries.properties</definitions>
</libraries>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>Essentials</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>

View File

@ -0,0 +1,73 @@
package com.earth2me.essentials.antibuild;
public enum AntiBuildConfig
{
disable_build("protect.disable.build", true),
disable_use("protect.disable.use", true),
alert_on_placement("protect.alert.on-placement"),
alert_on_use("protect.alert.on-use"),
alert_on_break("protect.alert.on-break"),
blacklist_placement("protect.blacklist.placement"),
blacklist_usage("protect.blacklist.usage"),
blacklist_break("protect.blacklist.break"),
blacklist_piston("protect.blacklist.piston");
private final String configName;
private final String defValueString;
private final boolean defValueBoolean;
private final boolean isList;
private final boolean isString;
private AntiBuildConfig(final String configName)
{
this(configName, null, false, true, false);
}
private AntiBuildConfig(final String configName, final boolean defValueBoolean)
{
this(configName, null, defValueBoolean, false, false);
}
private AntiBuildConfig(final String configName, final String defValueString, final boolean defValueBoolean, final boolean isList, final boolean isString)
{
this.configName = configName;
this.defValueString = defValueString;
this.defValueBoolean = defValueBoolean;
this.isList = isList;
this.isString = isString;
}
/**
* @return the configName
*/
public String getConfigName()
{
return configName;
}
/**
* @return the default value String
*/
public String getDefaultValueString()
{
return defValueString;
}
/**
* @return the default value boolean
*/
public boolean getDefaultValueBoolean()
{
return defValueBoolean;
}
public boolean isString()
{
return isString;
}
public boolean isList()
{
return isList;
}
}

View File

@ -0,0 +1,65 @@
package com.earth2me.essentials.antibuild;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
public class EssentialsAntiBuild extends JavaPlugin implements IAntiBuild
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private final transient Map<AntiBuildConfig, Boolean> settingsBoolean = new EnumMap<AntiBuildConfig, Boolean>(AntiBuildConfig.class);
private final transient Map<AntiBuildConfig, List<Integer>> settingsList = new EnumMap<AntiBuildConfig, List<Integer>>(AntiBuildConfig.class);
private transient EssentialsConnect ess = null;
@Override
public void onEnable()
{
final PluginManager pm = this.getServer().getPluginManager();
final Plugin essPlugin = pm.getPlugin("Essentials");
if (essPlugin == null || !essPlugin.isEnabled())
{
return;
}
ess = new EssentialsConnect(essPlugin, this);
final EssentialsAntiBuildListener blockListener = new EssentialsAntiBuildListener(this);
pm.registerEvents(blockListener, this);
}
@Override
public boolean checkProtectionItems(final AntiBuildConfig list, final int id)
{
final List<Integer> itemList = settingsList.get(list);
return itemList != null && !itemList.isEmpty() && itemList.contains(id);
}
@Override
public EssentialsConnect getEssentialsConnect()
{
return ess;
}
@Override
public Map<AntiBuildConfig, Boolean> getSettingsBoolean()
{
return settingsBoolean;
}
@Override
public Map<AntiBuildConfig, List<Integer>> getSettingsList()
{
return settingsList;
}
@Override
public boolean getSettingBool(final AntiBuildConfig protectConfig)
{
final Boolean bool = settingsBoolean.get(protectConfig);
return bool == null ? protectConfig.getDefaultValueBoolean() : bool;
}
}

View File

@ -0,0 +1,215 @@
package com.earth2me.essentials.antibuild;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import java.util.logging.Level;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.Event.Result;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.*;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
public class EssentialsAntiBuildListener implements Listener
{
final private transient IAntiBuild prot;
final private transient IEssentials ess;
public EssentialsAntiBuildListener(final IAntiBuild parent)
{
this.prot = parent;
this.ess = prot.getEssentialsConnect().getEssentials();
}
private boolean metaPermCheck(User user, String action, Block block)
{
if (block == null)
{
return false;
}
return metaPermCheck(user, action, block.getTypeId(), block.getData());
}
private boolean metaPermCheck(User user, String action, int blockId, byte data)
{
final String blockPerm = "essentials.build." + action + "." + blockId;
final String dataPerm = blockPerm + ":" + data;
if (user.isPermissionSet(dataPerm))
{
return user.isAuthorized(dataPerm);
}
else
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "abort checking if " + user.getName() + " has " + dataPerm + " - not directly set");
}
}
return user.isAuthorized(blockPerm);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockPlace(final BlockPlaceEvent event)
{
if (event.isCancelled())
{
return;
}
final User user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build")
&& !metaPermCheck(user, "place", event.getBlock()))
{
if (ess.getSettings().warnOnBuildDisallow())
{
user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
}
final Block blockPlaced = event.getBlockPlaced();
final int id = blockPlaced.getTypeId();
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_placement, id) && !user.isAuthorized("essentials.protect.exemptplacement"))
{
event.setCancelled(true);
return;
}
if (!user.isAuthorized("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(AntiBuildConfig.alert_on_placement, id))
{
prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced"));
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockBreak(final BlockBreakEvent event)
{
if (event.isCancelled())
{
return;
}
final User user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build")
&& !metaPermCheck(user, "break", event.getBlock()))
{
if (ess.getSettings().warnOnBuildDisallow())
{
user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
}
final Block block = event.getBlock();
final int typeId = block.getTypeId();
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_break, typeId)
&& !user.isAuthorized("essentials.protect.exemptbreak"))
{
event.setCancelled(true);
return;
}
final Material type = block.getType();
if (!user.isAuthorized("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(AntiBuildConfig.alert_on_break, typeId))
{
prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke"));
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockPistonExtend(BlockPistonExtendEvent event)
{
if (event.isCancelled())
{
return;
}
for (Block block : event.getBlocks())
{
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_piston, block.getTypeId()))
{
event.setCancelled(true);
return;
}
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockPistonRetract(BlockPistonRetractEvent event)
{
if (event.isCancelled() || !event.isSticky())
{
return;
}
final Block block = event.getRetractLocation().getBlock();
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_piston, block.getTypeId()))
{
event.setCancelled(true);
return;
}
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerInteract(final PlayerInteractEvent event)
{
// Do not return if cancelled, because the interact event has 2 cancelled states.
final User user = ess.getUser(event.getPlayer());
if (event.hasItem()
&& (event.getItem().getType() == Material.WATER_BUCKET
|| event.getItem().getType() == Material.LAVA_BUCKET)
&& prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
if (ess.getSettings().warnOnBuildDisallow())
{
user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
}
final ItemStack item = event.getItem();
if (item != null
&& prot.checkProtectionItems(AntiBuildConfig.blacklist_usage, item.getTypeId())
&& !user.isAuthorized("essentials.protect.exemptusage"))
{
event.setCancelled(true);
return;
}
if (item != null
&& !user.isAuthorized("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(AntiBuildConfig.alert_on_use, item.getTypeId()))
{
prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed"));
}
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.interact") && !user.isAuthorized("essentials.build"))
{
if (!metaPermCheck(user, "interact", event.getClickedBlock()))
{
event.setUseInteractedBlock(Result.DENY);
if (ess.getSettings().warnOnBuildDisallow())
{
user.sendMessage(_("buildAlert"));
}
}
if (event.hasItem() && !metaPermCheck(user, "use", event.getItem().getTypeId(), event.getItem().getData().getData()))
{
event.setUseItemInHand(Result.DENY);
}
}
}
}

View File

@ -0,0 +1,80 @@
package com.earth2me.essentials.antibuild;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import static com.earth2me.essentials.I18n._;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class EssentialsConnect
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private final transient IEssentials ess;
private final transient IAntiBuild protect;
public EssentialsConnect(Plugin essPlugin, Plugin essProtect)
{
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
{
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
ess = (IEssentials)essPlugin;
protect = (IAntiBuild)essProtect;
AntiBuildReloader pr = new AntiBuildReloader();
pr.reloadConfig();
ess.addReloadListener(pr);
}
public void onDisable()
{
}
public IEssentials getEssentials()
{
return ess;
}
public void alert(final User user, final String item, final String type)
{
final Location loc = user.getLocation();
final String warnMessage = _("alertFormat", user.getName(), type, item,
loc.getWorld().getName() + "," + loc.getBlockX() + ","
+ loc.getBlockY() + "," + loc.getBlockZ());
LOGGER.log(Level.WARNING, warnMessage);
for (Player p : ess.getServer().getOnlinePlayers())
{
final User alertUser = ess.getUser(p);
if (alertUser.isAuthorized("essentials.protect.alerts"))
{
alertUser.sendMessage(warnMessage);
}
}
}
private class AntiBuildReloader implements IConf
{
@Override
public void reloadConfig()
{
for (AntiBuildConfig protectConfig : AntiBuildConfig.values())
{
if (protectConfig.isList())
{
protect.getSettingsList().put(protectConfig, ess.getSettings().getProtectList(protectConfig.getConfigName()));
}
else
{
protect.getSettingsBoolean().put(protectConfig, ess.getSettings().getProtectBoolean(protectConfig.getConfigName(), protectConfig.getDefaultValueBoolean()));
}
}
}
}
}

View File

@ -0,0 +1,19 @@
package com.earth2me.essentials.antibuild;
import java.util.List;
import java.util.Map;
import org.bukkit.plugin.Plugin;
public interface IAntiBuild extends Plugin
{
boolean checkProtectionItems(final AntiBuildConfig list, final int id);
boolean getSettingBool(final AntiBuildConfig protectConfig);
EssentialsConnect getEssentialsConnect();
Map<AntiBuildConfig, Boolean> getSettingsBoolean();
Map<AntiBuildConfig, List<Integer>> getSettingsList();
}

View File

@ -0,0 +1,9 @@
# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
name: EssentialsAntiBuild
main: com.earth2me.essentials.antibuild.EssentialsAntiBuild
# Note to developers: This next line cannot change, or the automatic versioning system will break.
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides build protection.
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
softdepend: [Essentials]

View File

@ -2,7 +2,6 @@ package com.earth2me.essentials.protect;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.protect.data.ProtectedBlockMemory;
import com.earth2me.essentials.protect.data.ProtectedBlockMySQL;
import com.earth2me.essentials.protect.data.ProtectedBlockSQLite;
@ -10,8 +9,6 @@ import java.beans.PropertyVetoException;
import static com.earth2me.essentials.I18n._;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
@ -43,23 +40,6 @@ public class EssentialsConnect
return ess;
}
public void alert(final User user, final String item, final String type)
{
final Location loc = user.getLocation();
final String warnMessage = _("alertFormat", user.getName(), type, item,
loc.getWorld().getName() + "," + loc.getBlockX() + ","
+ loc.getBlockY() + "," + loc.getBlockZ());
LOGGER.log(Level.WARNING, warnMessage);
for (Player p : ess.getServer().getOnlinePlayers())
{
final User alertUser = ess.getUser(p);
if (alertUser.isAuthorized("essentials.protect.alerts"))
{
alertUser.sendMessage(warnMessage);
}
}
}
private class ProtectReloader implements IConf
{

View File

@ -73,13 +73,6 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now.");
}
@Override
public boolean checkProtectionItems(final ProtectConfig list, final int id)
{
final List<Integer> itemList = settingsList.get(list);
return itemList != null && !itemList.isEmpty() && itemList.contains(id);
}
@Override
public IProtectedBlock getStorage()
{

View File

@ -1,6 +1,5 @@
package com.earth2me.essentials.protect;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.protect.data.IProtectedBlock;
@ -36,26 +35,9 @@ public class EssentialsProtectBlockListener implements Listener
final User user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
{
event.setCancelled(true);
return;
}
final Block blockPlaced = event.getBlockPlaced();
final int id = blockPlaced.getTypeId();
if (prot.checkProtectionItems(ProtectConfig.blacklist_placement, id) && !user.isAuthorized("essentials.protect.exemptplacement"))
{
event.setCancelled(true);
return;
}
if (!user.hasPermission("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(ProtectConfig.alert_on_placement, id))
{
prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced"));
}
final Block below = blockPlaced.getRelative(BlockFace.DOWN);
if ((below.getType() == Material.RAILS || below.getType() == Material.POWERED_RAIL || below.getType() == Material.DETECTOR_RAIL)
@ -234,27 +216,11 @@ public class EssentialsProtectBlockListener implements Listener
}
final User user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
{
event.setCancelled(true);
return;
}
final Block block = event.getBlock();
final int typeId = block.getTypeId();
if (prot.checkProtectionItems(ProtectConfig.blacklist_break, typeId)
&& !user.isAuthorized("essentials.protect.exemptbreak"))
{
event.setCancelled(true);
return;
}
final Material type = block.getType();
if (!user.hasPermission("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(ProtectConfig.alert_on_break, typeId))
{
prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke"));
}
final IProtectedBlock storage = prot.getStorage();
if (user.isAuthorized("essentials.protect.admin"))
@ -333,11 +299,6 @@ public class EssentialsProtectBlockListener implements Listener
}
for (Block block : event.getBlocks())
{
if (prot.checkProtectionItems(ProtectConfig.blacklist_piston, block.getTypeId()))
{
event.setCancelled(true);
return;
}
if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS
|| block.getType() == Material.RAILS
|| block.getRelative(BlockFace.UP).getType() == Material.POWERED_RAIL
@ -385,11 +346,6 @@ public class EssentialsProtectBlockListener implements Listener
return;
}
final Block block = event.getRetractLocation().getBlock();
if (prot.checkProtectionItems(ProtectConfig.blacklist_piston, block.getTypeId()))
{
event.setCancelled(true);
return;
}
if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS
|| block.getType() == Material.RAILS
|| block.getRelative(BlockFace.UP).getType() == Material.POWERED_RAIL

View File

@ -3,14 +3,12 @@ package com.earth2me.essentials.protect;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
public class EssentialsProtectPlayerListener implements Listener
@ -30,38 +28,6 @@ public class EssentialsProtectPlayerListener implements Listener
// Do not return if cancelled, because the interact event has 2 cancelled states.
final User user = ess.getUser(event.getPlayer());
if (event.hasItem()
&& (event.getItem().getType() == Material.WATER_BUCKET
|| event.getItem().getType() == Material.LAVA_BUCKET)
&& prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
{
if (ess.getSettings().warnOnBuildDisallow())
{
user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
}
if (prot.getSettingBool(ProtectConfig.disable_use) && !user.canBuild())
{
if (ess.getSettings().warnOnBuildDisallow())
{
user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
}
final ItemStack item = event.getItem();
if (item != null
&& prot.checkProtectionItems(ProtectConfig.blacklist_usage, item.getTypeId())
&& !user.isAuthorized("essentials.protect.exemptusage"))
{
event.setCancelled(true);
return;
}
if (user.isAuthorized("essentials.protect.ownerinfo") && event.getAction() == Action.RIGHT_CLICK_BLOCK)
{
final StringBuilder stringBuilder = new StringBuilder();
@ -82,11 +48,5 @@ public class EssentialsProtectPlayerListener implements Listener
user.sendMessage(_("protectionOwner", ownerNames));
}
}
if (item != null
&& !user.hasPermission("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(ProtectConfig.alert_on_use, item.getTypeId()))
{
prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed"));
}
}
}

View File

@ -8,8 +8,6 @@ import org.bukkit.plugin.Plugin;
public interface IProtect extends Plugin
{
boolean checkProtectionItems(final ProtectConfig list, final int id);
boolean getSettingBool(final ProtectConfig protectConfig);
String getSettingString(final ProtectConfig protectConfig);

View File

@ -10,8 +10,6 @@ public enum ProtectConfig
memstore("protect.memstore", false),
disable_contactdmg("protect.disable.contactdmg", false),
disable_lavadmg("protect.disable.lavadmg", false),
disable_build("protect.disable.build", true),
disable_use("protect.disable.use", true),
disable_pvp("protect.disable.pvp", false),
disable_projectiles("protect.disable.projectiles", false),
disable_fall("protect.disable.fall", false),
@ -47,14 +45,7 @@ public enum ProtectConfig
protect_below_rails("protect.protect.block-below", true),
protect_signs("protect.protect.signs", true),
protect_against_signs("protect.protect.block-below", true),
enderdragon_fakeexplosions("protect.enderdragon-fakeexplosions", false),
alert_on_placement("protect.alert.on-placement"),
alert_on_use("protect.alert.on-use"),
alert_on_break("protect.alert.on-break"),
blacklist_placement("protect.blacklist.placement"),
blacklist_usage("protect.blacklist.usage"),
blacklist_break("protect.blacklist.break"),
blacklist_piston("protect.blacklist.piston");
enderdragon_fakeexplosions("protect.enderdragon-fakeexplosions", false);
private final String configName;
private final String defValueString;
private final boolean defValueBoolean;

View File

@ -16,6 +16,7 @@
<target name="buildRest" depends="buildEss">
<ant dir="EssentialsChat" antfile="build.xml"/>
<ant dir="EssentialsSpawn" antfile="build.xml"/>
<ant dir="EssentialsAntiBuild" antfile="build.xml"/>
<ant dir="EssentialsProtect" antfile="build.xml"/>
<ant dir="EssentialsGeoIP" antfile="build.xml"/>
<ant dir="EssentialsXMPP" antfile="build.xml"/>