unknown 12 роки тому
джерело
коміт
a70c5fceaf

+ 1
- 1
externals/dmdirc-util

1
-Subproject commit fbd836e534e10f036625cb65cc1f468758a15027
1
+Subproject commit 2fda4cc84251409dac5a32781636f88fb6d8ecbe

+ 94
- 53
nbproject/build-impl.xml Переглянути файл

20
 
20
 
21
         -->
21
         -->
22
 <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="charliebravo-impl">
22
 <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="charliebravo-impl">
23
-    <fail message="Please build using Ant 1.7.1 or higher.">
23
+    <fail message="Please build using Ant 1.8.0 or higher.">
24
         <condition>
24
         <condition>
25
             <not>
25
             <not>
26
-                <antversion atleast="1.7.1"/>
26
+                <antversion atleast="1.8.0"/>
27
             </not>
27
             </not>
28
         </condition>
28
         </condition>
29
     </fail>
29
     </fail>
77
                 <isset property="main.class.available"/>
77
                 <isset property="main.class.available"/>
78
             </and>
78
             </and>
79
         </condition>
79
         </condition>
80
+        <condition property="do.archive">
81
+            <not>
82
+                <istrue value="${jar.archive.disabled}"/>
83
+            </not>
84
+        </condition>
80
         <condition property="do.mkdist">
85
         <condition property="do.mkdist">
81
             <and>
86
             <and>
87
+                <isset property="do.archive"/>
82
                 <isset property="libs.CopyLibs.classpath"/>
88
                 <isset property="libs.CopyLibs.classpath"/>
83
                 <not>
89
                 <not>
84
                     <istrue value="${mkdist.disabled}"/>
90
                     <istrue value="${mkdist.disabled}"/>
91
                 <isset property="do.mkdist"/>
97
                 <isset property="do.mkdist"/>
92
             </and>
98
             </and>
93
         </condition>
99
         </condition>
94
-        <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
95
-            <and>
96
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
97
-                <istrue value="${splashscreen.available}"/>
98
-            </and>
99
-        </condition>
100
-        <condition property="do.archive">
101
-            <not>
102
-                <istrue value="${jar.archive.disabled}"/>
103
-            </not>
104
-        </condition>
105
         <condition property="do.archive+manifest.available">
100
         <condition property="do.archive+manifest.available">
106
             <and>
101
             <and>
107
                 <isset property="manifest.available"/>
102
                 <isset property="manifest.available"/>
108
                 <istrue value="${do.archive}"/>
103
                 <istrue value="${do.archive}"/>
109
             </and>
104
             </and>
110
         </condition>
105
         </condition>
111
-        <condition property="do.archive+manifest.available+main.class">
106
+        <condition property="do.archive+main.class.available">
112
             <and>
107
             <and>
113
-                <istrue value="${manifest.available+main.class}"/>
108
+                <isset property="main.class.available"/>
114
                 <istrue value="${do.archive}"/>
109
                 <istrue value="${do.archive}"/>
115
             </and>
110
             </and>
116
         </condition>
111
         </condition>
117
-        <condition property="do.archive+manifest.available+main.class+mkdist.available">
112
+        <condition property="do.archive+splashscreen.available">
118
             <and>
113
             <and>
119
-                <istrue value="${manifest.available+main.class+mkdist.available}"/>
114
+                <isset property="splashscreen.available"/>
120
                 <istrue value="${do.archive}"/>
115
                 <istrue value="${do.archive}"/>
121
             </and>
116
             </and>
122
         </condition>
117
         </condition>
123
-        <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
118
+        <condition property="do.archive+manifest.available+main.class">
124
             <and>
119
             <and>
125
-                <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
120
+                <istrue value="${manifest.available+main.class}"/>
126
                 <istrue value="${do.archive}"/>
121
                 <istrue value="${do.archive}"/>
127
             </and>
122
             </and>
128
         </condition>
123
         </condition>
124
+        <condition property="manifest.available-mkdist.available">
125
+            <or>
126
+                <istrue value="${manifest.available}"/>
127
+                <isset property="do.mkdist"/>
128
+            </or>
129
+        </condition>
130
+        <condition property="manifest.available+main.class-mkdist.available">
131
+            <or>
132
+                <istrue value="${manifest.available+main.class}"/>
133
+                <isset property="do.mkdist"/>
134
+            </or>
135
+        </condition>
129
         <condition property="have.tests">
136
         <condition property="have.tests">
130
             <or>
137
             <or>
131
                 <available file="${test.src.dir}"/>
138
                 <available file="${test.src.dir}"/>
185
         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
192
         <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
186
             <length length="0" string="${endorsed.classpath}" when="greater"/>
193
             <length length="0" string="${endorsed.classpath}" when="greater"/>
187
         </condition>
194
         </condition>
188
-        <property name="javac.fork" value="false"/>
195
+        <condition else="false" property="jdkBug6558476">
196
+            <and>
197
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
198
+                <not>
199
+                    <os family="unix"/>
200
+                </not>
201
+            </and>
202
+        </condition>
203
+        <property name="javac.fork" value="${jdkBug6558476}"/>
189
         <property name="jar.index" value="false"/>
204
         <property name="jar.index" value="false"/>
205
+        <property name="jar.index.metainf" value="${jar.index}"/>
206
+        <property name="copylibs.rebase" value="true"/>
190
         <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
207
         <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
191
     </target>
208
     </target>
192
     <target name="-post-init">
209
     <target name="-post-init">
319
                 <delete>
336
                 <delete>
320
                     <files includesfile="${javac.includesfile.binary}"/>
337
                     <files includesfile="${javac.includesfile.binary}"/>
321
                 </delete>
338
                 </delete>
322
-                <delete file="${javac.includesfile.binary}"/>
339
+                <delete>
340
+                    <fileset file="${javac.includesfile.binary}"/>
341
+                </delete>
323
             </sequential>
342
             </sequential>
324
         </macrodef>
343
         </macrodef>
325
     </target>
344
     </target>
346
                     <formatter type="brief" usefile="false"/>
365
                     <formatter type="brief" usefile="false"/>
347
                     <formatter type="xml"/>
366
                     <formatter type="xml"/>
348
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
367
                     <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
368
+                    <jvmarg value="-ea"/>
349
                     <jvmarg line="${run.jvmargs}"/>
369
                     <jvmarg line="${run.jvmargs}"/>
350
                 </junit>
370
                 </junit>
351
             </sequential>
371
             </sequential>
375
                 <property environment="env"/>
395
                 <property environment="env"/>
376
                 <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
396
                 <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
377
                 <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
397
                 <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
398
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
378
                     <jvmarg value="${profiler.info.jvmargs.agent}"/>
399
                     <jvmarg value="${profiler.info.jvmargs.agent}"/>
379
                     <jvmarg line="${profiler.info.jvmargs}"/>
400
                     <jvmarg line="${profiler.info.jvmargs}"/>
380
                     <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
401
                     <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
489
     </target>
510
     </target>
490
     <target name="-init-macrodef-copylibs">
511
     <target name="-init-macrodef-copylibs">
491
         <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
512
         <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
513
+            <attribute default="${manifest.file}" name="manifest"/>
492
             <element name="customize" optional="true"/>
514
             <element name="customize" optional="true"/>
493
             <sequential>
515
             <sequential>
494
                 <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
516
                 <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
504
                     </chainedmapper>
526
                     </chainedmapper>
505
                 </pathconvert>
527
                 </pathconvert>
506
                 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
528
                 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
507
-                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
529
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
508
                     <fileset dir="${build.classes.dir}"/>
530
                     <fileset dir="${build.classes.dir}"/>
509
                     <manifest>
531
                     <manifest>
510
                         <attribute name="Class-Path" value="${jar.classpath}"/>
532
                         <attribute name="Class-Path" value="${jar.classpath}"/>
638
         <!-- Empty placeholder for easier customization. -->
660
         <!-- Empty placeholder for easier customization. -->
639
         <!-- You can override this target in the ../build.xml file. -->
661
         <!-- You can override this target in the ../build.xml file. -->
640
     </target>
662
     </target>
641
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
663
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
642
         <j2seproject1:jar/>
664
         <j2seproject1:jar/>
643
     </target>
665
     </target>
644
-    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
666
+    <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">
645
         <j2seproject1:jar manifest="${manifest.file}"/>
667
         <j2seproject1:jar manifest="${manifest.file}"/>
646
     </target>
668
     </target>
647
     <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">
669
     <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">
650
                 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
672
                 <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
651
             </j2seproject1:manifest>
673
             </j2seproject1:manifest>
652
         </j2seproject1:jar>
674
         </j2seproject1:jar>
653
-        <echo>To run this application from the command line without Ant, try:</echo>
675
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
654
         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
676
         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
655
         <property location="${dist.jar}" name="dist.jar.resolved"/>
677
         <property location="${dist.jar}" name="dist.jar.resolved"/>
656
         <pathconvert property="run.classpath.with.dist.jar">
678
         <pathconvert property="run.classpath.with.dist.jar">
657
             <path path="${run.classpath}"/>
679
             <path path="${run.classpath}"/>
658
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
680
             <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
659
         </pathconvert>
681
         </pathconvert>
660
-        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
682
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
661
     </target>
683
     </target>
662
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
684
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
685
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
686
+        <touch file="${tmp.manifest.file}" verbose="false"/>
687
+    </target>
688
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
689
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
690
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
691
+    </target>
692
+    <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">
693
+        <manifest file="${tmp.manifest.file}" mode="update">
694
+            <attribute name="Main-Class" value="${main.class}"/>
695
+        </manifest>
696
+    </target>
697
+    <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">
663
         <basename file="${application.splash}" property="splashscreen.basename"/>
698
         <basename file="${application.splash}" property="splashscreen.basename"/>
664
         <mkdir dir="${build.classes.dir}/META-INF"/>
699
         <mkdir dir="${build.classes.dir}/META-INF"/>
665
         <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
700
         <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
666
-        <j2seproject3:copylibs>
667
-            <customize>
668
-                <attribute name="Main-Class" value="${main.class}"/>
669
-                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
670
-            </customize>
671
-        </j2seproject3:copylibs>
672
-        <echo>To run this application from the command line without Ant, try:</echo>
673
-        <property location="${dist.jar}" name="dist.jar.resolved"/>
674
-        <echo>java -jar "${dist.jar.resolved}"</echo>
701
+        <manifest file="${tmp.manifest.file}" mode="update">
702
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
703
+        </manifest>
675
     </target>
704
     </target>
676
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
677
-        <j2seproject3:copylibs>
678
-            <customize>
679
-                <attribute name="Main-Class" value="${main.class}"/>
680
-            </customize>
681
-        </j2seproject3:copylibs>
682
-        <echo>To run this application from the command line without Ant, try:</echo>
705
+    <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">
706
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
707
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
683
         <property location="${dist.jar}" name="dist.jar.resolved"/>
708
         <property location="${dist.jar}" name="dist.jar.resolved"/>
684
-        <echo>java -jar "${dist.jar.resolved}"</echo>
709
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
710
+    </target>
711
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
712
+        <delete>
713
+            <fileset file="${tmp.manifest.file}"/>
714
+        </delete>
685
     </target>
715
     </target>
716
+    <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"/>
686
     <target name="-post-jar">
717
     <target name="-post-jar">
687
         <!-- Empty placeholder for easier customization. -->
718
         <!-- Empty placeholder for easier customization. -->
688
         <!-- You can override this target in the ../build.xml file. -->
719
         <!-- You can override this target in the ../build.xml file. -->
689
     </target>
720
     </target>
690
-    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
721
+    <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"/>
691
     <!--
722
     <!--
692
                 =================
723
                 =================
693
                 EXECUTION SECTION
724
                 EXECUTION SECTION
825
             -->
856
             -->
826
     <target depends="init" if="have.sources" name="-javadoc-build">
857
     <target depends="init" if="have.sources" name="-javadoc-build">
827
         <mkdir dir="${dist.javadoc.dir}"/>
858
         <mkdir dir="${dist.javadoc.dir}"/>
859
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
860
+            <and>
861
+                <isset property="endorsed.classpath.cmd.line.arg"/>
862
+                <not>
863
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
864
+                </not>
865
+            </and>
866
+        </condition>
828
         <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}">
867
         <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}">
829
             <classpath>
868
             <classpath>
830
                 <path path="${javac.classpath}"/>
869
                 <path path="${javac.classpath}"/>
831
             </classpath>
870
             </classpath>
832
-            <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
871
+            <fileset dir="${src.src.dir}" excludes="*.java,${excludes}" includes="${includes}">
833
                 <filename name="**/*.java"/>
872
                 <filename name="**/*.java"/>
834
             </fileset>
873
             </fileset>
835
-            <fileset dir="${src.src5.dir}" excludes="${excludes}" includes="${includes}">
874
+            <fileset dir="${src.src5.dir}" excludes="*.java,${excludes}" includes="${includes}">
836
                 <filename name="**/*.java"/>
875
                 <filename name="**/*.java"/>
837
             </fileset>
876
             </fileset>
838
-            <fileset dir="${src.src4.dir}" excludes="${excludes}" includes="${includes}">
877
+            <fileset dir="${src.src4.dir}" excludes="*.java,${excludes}" includes="${includes}">
839
                 <filename name="**/*.java"/>
878
                 <filename name="**/*.java"/>
840
             </fileset>
879
             </fileset>
841
-            <fileset dir="${src.src2.dir}" excludes="${excludes}" includes="${includes}">
880
+            <fileset dir="${src.src2.dir}" excludes="*.java,${excludes}" includes="${includes}">
842
                 <filename name="**/*.java"/>
881
                 <filename name="**/*.java"/>
843
             </fileset>
882
             </fileset>
844
-            <fileset dir="${src.src3.dir}" excludes="${excludes}" includes="${includes}">
883
+            <fileset dir="${src.src3.dir}" excludes="*.java,${excludes}" includes="${includes}">
845
                 <filename name="**/*.java"/>
884
                 <filename name="**/*.java"/>
846
             </fileset>
885
             </fileset>
847
-            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
886
+            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
848
                 <filename name="**/*.java"/>
887
                 <filename name="**/*.java"/>
849
             </fileset>
888
             </fileset>
850
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
889
             <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
851
                 <include name="**/*.java"/>
890
                 <include name="**/*.java"/>
891
+                <exclude name="*.java"/>
852
             </fileset>
892
             </fileset>
893
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
853
         </javadoc>
894
         </javadoc>
854
         <copy todir="${dist.javadoc.dir}">
895
         <copy todir="${dist.javadoc.dir}">
855
             <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
896
             <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
894
     <target if="do.depend.true" name="-compile-test-depend">
935
     <target if="do.depend.true" name="-compile-test-depend">
895
         <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
936
         <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
896
     </target>
937
     </target>
897
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
938
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
898
         <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}"/>
939
         <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}"/>
899
         <copy todir="${build.test.classes.dir}">
940
         <copy todir="${build.test.classes.dir}">
900
             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
941
             <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
909
         <!-- Empty placeholder for easier customization. -->
950
         <!-- Empty placeholder for easier customization. -->
910
         <!-- You can override this target in the ../build.xml file. -->
951
         <!-- You can override this target in the ../build.xml file. -->
911
     </target>
952
     </target>
912
-    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
953
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
913
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
954
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
914
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
955
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
915
         <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}"/>
956
         <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}"/>

+ 2
- 2
nbproject/genfiles.properties Переглянути файл

4
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
4
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
5
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
 nbproject/build-impl.xml.data.CRC32=3df6429b
6
 nbproject/build-impl.xml.data.CRC32=3df6429b
7
-nbproject/build-impl.xml.script.CRC32=292a7a81
8
-nbproject/build-impl.xml.stylesheet.CRC32=fce8b508@1.40.0.45
7
+nbproject/build-impl.xml.script.CRC32=f0bc9380
8
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46

+ 2
- 0
nbproject/project.properties Переглянути файл

1
 annotation.processing.enabled=true
1
 annotation.processing.enabled=true
2
 annotation.processing.enabled.in.editor=false
2
 annotation.processing.enabled.in.editor=false
3
+annotation.processing.processors.list=
3
 annotation.processing.run.all.processors=true
4
 annotation.processing.run.all.processors=true
4
 application.title=charliebravo
5
 application.title=charliebravo
5
 application.vendor=chris
6
 application.vendor=chris
86
 main.class=com.md87.charliebravo.CharlieBravo
87
 main.class=com.md87.charliebravo.CharlieBravo
87
 manifest.file=manifest.mf
88
 manifest.file=manifest.mf
88
 meta.inf.dir=${src.dir}/META-INF
89
 meta.inf.dir=${src.dir}/META-INF
90
+mkdist.disabled=false
89
 platform.active=default_platform
91
 platform.active=default_platform
90
 run.classpath=\
92
 run.classpath=\
91
     ${javac.classpath}:\
93
     ${javac.classpath}:\

+ 0
- 51
src/com/md87/charliebravo/CharlieBravo.java Переглянути файл

97
     public void onDataOut(final Parser tParser, final Date date, final String sData, final boolean bFromParser) {
97
     public void onDataOut(final Parser tParser, final Date date, final String sData, final boolean bFromParser) {
98
         System.out.println(">>> " + sData);
98
         System.out.println(">>> " + sData);
99
     }
99
     }
100
-    
101
-    /**
102
-     * Tests for and adds one component of the duration format.
103
-     *
104
-     * @param builder The string builder to append text to
105
-     * @param current The number of seconds in the duration
106
-     * @param duration The number of seconds in this component
107
-     * @param name The name of this component
108
-     * @return The number of seconds used by this component
109
-     */
110
-    private static int doDuration(final StringBuilder builder, final int current,
111
-            final int duration, final String name) {
112
-        int res = 0;
113
-
114
-        if (current >= duration) {
115
-            final int units = current / duration;
116
-            res = units * duration;
117
-
118
-            if (builder.length() > 0) {
119
-                builder.append(", ");
120
-            }
121
-
122
-            builder.append(units);
123
-            builder.append(' ');
124
-            builder.append(name + (units != 1 ? 's' : ""));
125
-        }
126
-
127
-        return res;
128
-    }
129
-
130
-    
131
-    /**
132
-     * Formats the specified number of seconds as a string containing the
133
-     * number of days, hours, minutes and seconds.
134
-     *
135
-     * @param duration The duration in seconds to be formatted
136
-     * @return A textual version of the duration
137
-     */
138
-    public static String formatDuration(final int duration) {
139
-        final StringBuilder buff = new StringBuilder();
140
-
141
-        int seconds = duration;
142
-
143
-        seconds -= doDuration(buff, seconds, 60*60*24, "day");
144
-        seconds -= doDuration(buff, seconds, 60*60, "hour");
145
-        seconds -= doDuration(buff, seconds, 60, "minute");
146
-        seconds -= doDuration(buff, seconds, 1, "second");
147
-
148
-        return buff.length() == 0 ? "0 seconds" : buff.toString();
149
-    }
150
-
151
 }
100
 }

+ 4
- 4
src/com/md87/charliebravo/commands/SkillCommand.java Переглянути файл

22
 
22
 
23
 package com.md87.charliebravo.commands;
23
 package com.md87.charliebravo.commands;
24
 
24
 
25
-import com.md87.charliebravo.CharlieBravo;
25
+import com.dmdirc.util.DateUtils;
26
 import com.md87.charliebravo.Command;
26
 import com.md87.charliebravo.Command;
27
 import com.md87.charliebravo.CommandOptions;
27
 import com.md87.charliebravo.CommandOptions;
28
 import com.md87.charliebravo.ConfigCache;
28
 import com.md87.charliebravo.ConfigCache;
67
                         response.sendMessage("you are currently training "
67
                         response.sendMessage("you are currently training "
68
                                 + skill.getSkill().getName() + " to level "
68
                                 + skill.getSkill().getName() + " to level "
69
                                 + skill.getTargetLevel() + ". It will finish in "
69
                                 + skill.getTargetLevel() + ". It will finish in "
70
-                                + CharlieBravo.formatDuration((int) (skill.getEndTime()
70
+                                + DateUtils.formatDuration((int) (skill.getEndTime()
71
                                 .getTime() - System.currentTimeMillis()) / 1000));
71
                                 .getTime() - System.currentTimeMillis()) / 1000));
72
                     } else {
72
                     } else {
73
                         response.sendMessage("You are not training anything", true);
73
                         response.sendMessage("You are not training anything", true);
102
         public void execute(InputHandler handler, Response response, String line) throws Exception {
102
         public void execute(InputHandler handler, Response response, String line) throws Exception {
103
             response.setInheritFollows(true);
103
             response.setInheritFollows(true);
104
             response.sendMessage("the result has been cached for " +
104
             response.sendMessage("the result has been cached for " +
105
-                    CharlieBravo.formatDuration((int) (System.currentTimeMillis()
105
+                    DateUtils.formatDuration((int) (System.currentTimeMillis()
106
                     - apiresponse.getApiResult().getCachedSince().getTime()) / 1000)
106
                     - apiresponse.getApiResult().getCachedSince().getTime()) / 1000)
107
                     + ", and will expire in " +
107
                     + ", and will expire in " +
108
-                    CharlieBravo.formatDuration((int) (apiresponse.getApiResult()
108
+                    DateUtils.formatDuration((int) (apiresponse.getApiResult()
109
                     .getCachedUntil().getTime() - System.currentTimeMillis()) / 1000));
109
                     .getCachedUntil().getTime() - System.currentTimeMillis()) / 1000));
110
         }
110
         }
111
 
111
 

+ 3
- 3
src/com/md87/charliebravo/commands/WhoisCommand.java Переглянути файл

23
 package com.md87.charliebravo.commands;
23
 package com.md87.charliebravo.commands;
24
 
24
 
25
 import com.dmdirc.parser.interfaces.ClientInfo;
25
 import com.dmdirc.parser.interfaces.ClientInfo;
26
-import com.md87.charliebravo.CharlieBravo;
26
+import com.dmdirc.util.DateUtils;
27
 import com.md87.charliebravo.Command;
27
 import com.md87.charliebravo.Command;
28
 import com.md87.charliebravo.InputHandler;
28
 import com.md87.charliebravo.InputHandler;
29
 import com.md87.charliebravo.Response;
29
 import com.md87.charliebravo.Response;
51
                     }
51
                     }
52
 
52
 
53
                     response.sendMessage(line + " last authenticated with me "
53
                     response.sendMessage(line + " last authenticated with me "
54
-                            + CharlieBravo.formatDuration((int)
54
+                            + DateUtils.formatDuration((int)
55
                             (System.currentTimeMillis() -
55
                             (System.currentTimeMillis() -
56
                             Long.valueOf(handler.getConfig().getOption(line, "internal.lastseen")))
56
                             Long.valueOf(handler.getConfig().getOption(line, "internal.lastseen")))
57
                             / 1000)
57
                             / 1000)
70
                     final StringBuilder extra = new StringBuilder();
70
                     final StringBuilder extra = new StringBuilder();
71
 
71
 
72
                     if (handler.getConfig().hasOption(openid, "admin.level")) {
72
                     if (handler.getConfig().hasOption(openid, "admin.level")) {
73
-                        extra.append(", and " + (you ? "have" : "has") + " access level ");
73
+                        extra.append(", and ").append(you ? "have" : "has").append(" access level ");
74
                         extra.append(handler.getConfig().getOption(openid, "admin.level"));
74
                         extra.append(handler.getConfig().getOption(openid, "admin.level"));
75
                     }
75
                     }
76
 
76
 

Завантаження…
Відмінити
Зберегти