- update image downloader for sdk manual

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10673 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 652c3e9cca
commit 583c46d36d
  1. 23
      sdk/ant-jme/nbproject/build-impl.xml
  2. 4
      sdk/ant-jme/nbproject/genfiles.properties
  3. 40
      sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java
  4. BIN
      sdk/ant-lib/ant-jme.jar

@ -392,6 +392,11 @@ is divided into following sections:
</and>
</condition>
</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}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
@ -415,7 +420,7 @@ is divided into following sections:
</sequential>
</macrodef>
</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">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
@ -425,7 +430,11 @@ is divided into following sections:
<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}"/>
<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>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
@ -548,7 +557,7 @@ is divided into following sections:
</sequential>
</macrodef>
</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">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
@ -558,7 +567,11 @@ is divided into following sections:
<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}"/>
<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>
<propertyref prefix="test-sys-prop."/>
<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">
<mkdir dir="${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>
</target>
<target name="-post-compile">

@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.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=dd1578ef
nbproject/build-impl.xml.script.CRC32=a6e22d49
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
nbproject/build-impl.xml.script.CRC32=53d14a5f
nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46

@ -48,21 +48,33 @@ public class LoadWikiImages extends Task {
}
name = name.replaceAll(":", "/");
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=([^>]*)\"", "");
int markIdx = name.indexOf("?");
if (markIdx >= 0) {

Binary file not shown.
Loading…
Cancel
Save