Przeglądaj źródła

SDK:
- update image downloader for sdk manual

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10673 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

nor..67 12 lat temu
rodzic
commit
a62c3c5a58

+ 18 - 5
ant-jme/nbproject/build-impl.xml

@@ -392,6 +392,11 @@ is divided into following sections:
             </and>
             </and>
         </condition>
         </condition>
     </target>
     </target>
+    <target name="-init-test-properties">
+        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+        <property name="test.binarytestincludes" value=""/>
+        <property name="test.binaryexcludes" value=""/>
+    </target>
     <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
     <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
         <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
         <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
             <attribute default="${includes}" name="includes"/>
             <attribute default="${includes}" name="includes"/>
@@ -415,7 +420,7 @@ is divided into following sections:
             </sequential>
             </sequential>
         </macrodef>
         </macrodef>
     </target>
     </target>
-    <target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+    <target depends="-init-test-properties" 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">
         <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
             <attribute default="${includes}" name="includes"/>
             <attribute default="${includes}" name="includes"/>
             <attribute default="${excludes}" name="excludes"/>
             <attribute default="${excludes}" name="excludes"/>
@@ -425,7 +430,11 @@ is divided into following sections:
             <sequential>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
                 <property name="junit.forkmode" value="perTest"/>
                 <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
                 <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
-                    <batchtest todir="${build.test.results.dir}"/>
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
                     <syspropertyset>
                     <syspropertyset>
                         <propertyref prefix="test-sys-prop."/>
                         <propertyref prefix="test-sys-prop."/>
                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
@@ -548,7 +557,7 @@ is divided into following sections:
             </sequential>
             </sequential>
         </macrodef>
         </macrodef>
     </target>
     </target>
-    <target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
         <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
         <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
             <attribute default="${includes}" name="includes"/>
             <attribute default="${includes}" name="includes"/>
             <attribute default="${excludes}" name="excludes"/>
             <attribute default="${excludes}" name="excludes"/>
@@ -558,7 +567,11 @@ is divided into following sections:
             <sequential>
             <sequential>
                 <property name="junit.forkmode" value="perTest"/>
                 <property name="junit.forkmode" value="perTest"/>
                 <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
                 <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
-                    <batchtest todir="${build.test.results.dir}"/>
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
                     <syspropertyset>
                     <syspropertyset>
                         <propertyref prefix="test-sys-prop."/>
                         <propertyref prefix="test-sys-prop."/>
                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
                         <mapper from="test-sys-prop.*" to="*" type="glob"/>
@@ -930,7 +943,7 @@ is divided into following sections:
     <target if="has.persistence.xml" name="-copy-persistence-xml">
     <target if="has.persistence.xml" name="-copy-persistence-xml">
         <mkdir dir="${build.classes.dir}/META-INF"/>
         <mkdir dir="${build.classes.dir}/META-INF"/>
         <copy todir="${build.classes.dir}/META-INF">
         <copy todir="${build.classes.dir}/META-INF">
-            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
         </copy>
         </copy>
     </target>
     </target>
     <target name="-post-compile">
     <target name="-post-compile">

+ 2 - 2
ant-jme/nbproject/genfiles.properties

@@ -4,5 +4,5 @@ [email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # 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.
 # 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=dd1578ef
 nbproject/build-impl.xml.data.CRC32=dd1578ef
-nbproject/build-impl.xml.script.CRC32=a6e22d49
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected].1.46
+nbproject/build-impl.xml.script.CRC32=53d14a5f
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected].1.46

+ 26 - 14
ant-jme/src/com/jme/ant/LoadWikiImages.java

@@ -48,21 +48,33 @@ public class LoadWikiImages extends Task {
                             }
                             }
                             name = name.replaceAll(":", "/");
                             name = name.replaceAll(":", "/");
                             URL url = new URL(host + link);
                             URL url = new URL(host + link);
-                            InputStream in = url.openStream();
-                            File file = new File(getLocation().getFileName().replaceAll("build.xml", "") + File.separator + targetFolder + File.separator + name.replaceAll("/", File.separator));
-                            log("Getting image: " + host + link);
-                            log("To: " + file);
-                            File parent = file.getParentFile();
-                            parent.mkdirs();
-                            FileOutputStream out = new FileOutputStream(file);
-                            int byte_ = in.read();
-                            while (byte_ != -1) {
-                                out.write(byte_);
-                                byte_ = in.read();
+                            InputStream in = null;
+                            FileOutputStream out = null;
+                            try {
+
+                                in = url.openStream();
+                                File file = new File(getLocation().getFileName().replaceAll("build.xml", "") + File.separator + targetFolder + File.separator + name.replaceAll("/", File.separator));
+                                log("Getting image: " + host + link);
+                                log("To: " + file);
+                                File parent = file.getParentFile();
+                                parent.mkdirs();
+                                out = new FileOutputStream(file);
+                                int byte_ = in.read();
+                                while (byte_ != -1) {
+                                    out.write(byte_);
+                                    byte_ = in.read();
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            } finally {
+                                if (in != null) {
+                                    in.close();
+                                }
+                                if (out != null) {
+                                    out.close();
+                                }
                             }
                             }
-                            in.close();
-                            out.close();
-                        }else if(extidx >= 0){
+                        } else if (extidx >= 0) {
                             String name = link.replaceAll("/wiki/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", "");
                             String name = link.replaceAll("/wiki/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", "");
                             int markIdx = name.indexOf("?");
                             int markIdx = name.indexOf("?");
                             if (markIdx >= 0) {
                             if (markIdx >= 0) {

BIN
ant-lib/ant-jme.jar