commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <...@spaceroots.org>
Subject Re: [math] Fixed ant build.
Date Sat, 02 Jan 2016 18:47:27 GMT
Le 02/01/2016 19:23, Phil Steitz a écrit :
> On 1/2/16 11:04 AM, Luc Maisonobe wrote:
>> Hi Phil,
>>
>>
>> Le 02/01/2016 18:26, psteitz@apache.org a écrit :
>>> Repository: commons-math
>>> Updated Branches:
>>>   refs/heads/MATH_3_X c5e6ccb81 -> 68194a3bf
>>>
>>>
>>> Fixed ant build.
>> Do you want me to run another RC?
> 
> I was about to say no, and  you can see I just voted, but after
> finding an old 1.5 JDK, I just ran into this:
> 
> java/org/apache/commons/math3/random/BitsStreamGenerator.java:190:
> method does not override a method from its superclass
>     [javac]     @Override
>     [javac]      ^
> 
> I think this snuck in after Thomas fixed these 1.5 compilation issues.
> 
> I am not sure if this is a blocker.  It means you can't build the
> code using a way end of life JDK.  But the (slightly fixed)
> test-jar.xml run under JDK 1.5 runs clean (so people just using the
> jar with 1.5 should not have a problem).
> 
>  There is one spurious test failure when the tests are run against
> the release jar under 1.5:
> 
> Testcase:
> testCreateFromIntegers(org.apache.commons.math3.distribution.EnumeratedIntegerDistributionTest):
  
> FAILED
> expected:<0.5> but was:<0.5000000000000001>
> junit.framework.AssertionFailedError: expected:<0.5> but
> was:<0.5000000000000001>
> 
> The test case uses 0 as the tolerance.  Newer JDKs get this exactly,
> but the 1.5 I have at least fails as above.

OK. I'll cut another RC.

best regards,
Luc

> 
> Phi
>>
>> best regards,
>> Luc
>>
>>>
>>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/68194a3b
>>> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/68194a3b
>>> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/68194a3b
>>>
>>> Branch: refs/heads/MATH_3_X
>>> Commit: 68194a3bf5496966ecfdfe1161ae91744782f670
>>> Parents: c5e6ccb
>>> Author: Phil Steitz <phil.steitz@gmail.com>
>>> Authored: Sat Jan 2 10:25:49 2016 -0700
>>> Committer: Phil Steitz <phil.steitz@gmail.com>
>>> Committed: Sat Jan 2 10:25:49 2016 -0700
>>>
>>> ----------------------------------------------------------------------
>>>  build.xml    | 23 +++++++++++++++++------
>>>  test-jar.xml | 50 ++++++++++++++++----------------------------------
>>>  2 files changed, 33 insertions(+), 40 deletions(-)
>>> ----------------------------------------------------------------------
>>>
>>>
>>> http://git-wip-us.apache.org/repos/asf/commons-math/blob/68194a3b/build.xml
>>> ----------------------------------------------------------------------
>>> diff --git a/build.xml b/build.xml
>>> index 89cc433..3e97317 100644
>>> --- a/build.xml
>>> +++ b/build.xml
>>> @@ -30,12 +30,12 @@
>>>  
>>>  <!-- ========== External Dependencies =====================================
-->
>>>  
>>> +  <property name="repository"              value = "${user.home}/.m2/repository"/>
>>>  
>>>    <!-- Junit -->
>>> -  <property name="junit.version"           value="4.8.2"/>
>>> -  <property name="junit.home"              value="/usr/share/junit"/>
>>> -  <property name="junit.jar"               value="${junit.home}/junit-${junit.version}.jar"/>
>>> -
>>> +  <property name="junit.version"           value="4.11"/>
>>> +  <property name="junit.jar"               value="$junit-{junit.version}.jar"/>
>>> +  <property name="hamcrest.jar"            value="hamcrest-core-1.3.jar"/>
>>>  
>>>  <!-- ========== Component Declarations ====================================
-->
>>>  
>>> @@ -50,7 +50,7 @@
>>>    <property name="component.title"         value="Commons MATH"/>
>>>  
>>>    <!-- The current version number of this component -->
>>> -  <property name="component.version"       value="3.5"/>
>>> +  <property name="component.version"       value="3.6"/>
>>>  
>>>    <!-- The base directory for component sources -->
>>>    <property name="source.home"             value="src/main/java"/>
>>> @@ -111,6 +111,7 @@
>>>    <!-- External dependency classpath -->
>>>    <path id="downloaded.lib.classpath">
>>>      <pathelement location="${download.lib.dir}/junit-${junit.version}.jar"/>
>>> +	<pathelement location="${download.lib.dir}/${hamcrest.jar}"/>
>>>    </path>
>>>  
>>>  <!-- ========== Test Execution Defaults ===================================
-->
>>> @@ -121,6 +122,7 @@
>>>      <pathelement location="${build.home}/classes"/>
>>>      <pathelement location="${build.home}/test-classes"/>
>>>      <pathelement location="${junit.jar}"/>
>>> +	<pathelement location="${hamcrest.jar}"/>
>>>      <path refid="downloaded.lib.classpath"/>
>>>    </path>
>>>  
>>> @@ -343,9 +345,10 @@
>>>  <!-- ========== Download Dependencies ===========================================
-->
>>>  
>>>      <target name="download-dependencies" 
>>> -           depends="check-availability" unless="skip.download">
>>> +         depends="check-availability" unless="skip.download">
>>>          <echo message="doing download-dependencies..." />
>>>          <antcall target="download-junit" />
>>> +        <antcall target="download-hamcrest" />
>>>      </target>
>>>  
>>>      <target name="check-availability">
>>> @@ -360,6 +363,14 @@
>>>              usetimestamp="true" ignoreerrors="true"
>>>              src="http://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
>>>      </target>
>>> +
>>> +	<target name="download-hamcrest" unless="hamcrest.found">
>>> +	        <echo message="Downloading hamcrest..."/>
>>> +	        <mkdir dir="${download.lib.dir}" />
>>> +	        <get dest="${download.lib.dir}/${hamcrest.jar}"
>>> +	            usetimestamp="true" ignoreerrors="true"
>>> +	            src="http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
>>> +	</target>
>>>        
>>>  </project>
>>>  
>>>
>>> http://git-wip-us.apache.org/repos/asf/commons-math/blob/68194a3b/test-jar.xml
>>> ----------------------------------------------------------------------
>>> diff --git a/test-jar.xml b/test-jar.xml
>>> index c6e12ec..e5a20a5 100644
>>> --- a/test-jar.xml
>>> +++ b/test-jar.xml
>>> @@ -21,25 +21,23 @@
>>>     Compiles and runs unit tests against distribution jar(s).  Use .antrc or
the 
>>>     command line to control the jdk used to execute this build file.  
>>>     
>>> -   Assumes that the distribution jar to be tested is in the base directory.

>>> -   Use the "jardir" property to specify the path to the directory containing
>>> -   the jar. Any other jars in this directory will also be added to the
>>> -   classpath.  
>>> +   Assumes that the distribution jar to be tested is in the basedir/lib, along
>>> +   with any dependent jars (junit, hamcrest). Use the "libdir" property to specify
>>> +   the path to the directory containing these jars. 
>>>     
>>>     The default target, "test," executes clean as a dependency.
>>>  -->
>>>    
>>>  <project default="test" name="commons-math" basedir=".">
>>> -  <property name="defaulttargetdir" value="target"/>
>>> -  <property name="libdir" value="target/lib"/>
>>> +  <property name="libdir" value="lib"/>
>>>    <property name="testclassesdir" value="target/test-classes"/>
>>>    <property name="testreportdir" value="target/test-reports"/>
>>>    <property name="defaulttargetdir" value="target"/>
>>> -  <property name="jardir" value="${basedir}"/>
>>> -   <path id="build.classpath">
>>> +  <property name="test.resources" value="src/test/resources"/>
>>> +  <property name="build.home" value="target"/>
>>> +  <path id="build.classpath">
>>>      <fileset dir="${libdir}">
>>> -      <include name="**/*.jar">
>>> -      </include>
>>> +      <include name="*.jar" />
>>>      </fileset>
>>>    </path>
>>>    <target name="clean" description="o Clean up the generated directories">
>>> @@ -58,24 +56,17 @@
>>>      Java library path: ${java.library.path}
>>>      ===========================================================================
>>>      </echo>
>>> -    <mkdir dir="${libdir}" />
>>> -    <condition property="noget">
>>> -      <equals arg2="only" arg1="${build.sysclasspath}">
>>> -      </equals>
>>> -    </condition>
>>> -    <!--Test if JUNIT is present in ANT classpath-->
>>> -    <available property="Junit.present" classname="org.junit.Test">
>>> -    </available>
>>>    </target>
>>>    <target name="test" description="o Run the test cases" if="test.failure"
depends="internal-test">
>>>      <fail message="There were test failures.">
>>>      </fail>
>>>    </target>
>>> -  <target name="internal-test" if="Junit.present" depends="clean, junit-present,compile-tests">
>>> +  <target name="internal-test" depends="clean,compile-tests">
>>>      <mkdir dir="${testreportdir}"/>
>>> -    <junit dir="./" failureproperty="test.failure" printSummary="yes" fork="true"
haltonerror="true">
>>> +    <junit dir="./" failureproperty="test.failure" printSummary="yes"
>>> +           fork="true" haltonerror="true" showOutput="true">
>>>        <sysproperty key="basedir" value="."/>
>>> -      <formatter usefile="false" type="plain"/>
>>> +      <formatter type="brief"/>
>>>        <classpath>
>>>          <path refid="build.classpath"/>
>>>          <pathelement path="${testclassesdir}"/>
>>> @@ -88,14 +79,7 @@
>>>        </batchtest>
>>>      </junit>
>>>    </target>
>>> -  <target name="junit-present" unless="Junit.present" depends="init">
>>> -  <echo>
>>> -    ================================= WARNING ================================
>>> -    Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed.
>>> -    ==========================================================================
>>> -  </echo>
>>> -  </target>
>>> -  <target name="compile-tests" if="Junit.present" depends="junit-present">
>>> +  <target name="compile-tests" >
>>>      <mkdir dir="${testclassesdir}"/>
>>>      <javac destdir="${testclassesdir}" deprecation="true" debug="true"
>>>              optimize="false" excludes="**/package.html">
>>> @@ -106,12 +90,10 @@
>>>          <path refid="build.classpath"/>
>>>        </classpath>
>>>      </javac>
>>> -    <copy todir="${testclassesdir}">
>>> -      <fileset dir="src/test/resources">
>>> -        <include name="**/*.xml"/>
>>> -        <include name="**/*.txt"/>
>>> +	<copy todir="${build.home}/test-classes">
>>> +	  <fileset dir="${test.resources}">
>>>        </fileset>
>>> -    </copy>
>>> +	</copy>
>>>    </target>
>>>  </project>
>>>  
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message