Assorted, minor dev-java/fits cleanups
authorW. Trevor King <wking@drexel.edu>
Sat, 8 Oct 2011 13:39:14 +0000 (09:39 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 8 Oct 2011 13:39:14 +0000 (09:39 -0400)
* Strip trailing whitespace from files/build.xml
* Place the built jar in build/ rather than in the base directory.
* Use ant's `-D=property=value` option to alter the project version
  and junit JAR path, rather than sedding build.xml
* Use `${doc.api}` instead of repeathing `${doc}/api` in build.xml.

dev-java/fits/Manifest
dev-java/fits/files/build.xml
dev-java/fits/fits-1.06.0.ebuild

index e5aa226da470ff8cb034e6ca3ff9ca3b52bc9125..6f710cb038492f55a3aff3379c4a6755cf75459e 100644 (file)
@@ -1,8 +1,8 @@
 AUX 01-Use-getResource-to-access-CompressTest-data-for-unit.patch 4661 RMD160 aaa090107ab67588ad0e13de7c43c2a4588441b4 SHA1 48b310f6e10c1e091b02ef94026f0bf4e31a75b5 SHA256 eb121342dfba55ec3bb7988c0b91074b581e89be87262aee3ced25ffd3d97cff
 AUX 02-Update-ArrayFuncsTest.java-to-JUnit-4.patch 7206 RMD160 96a7f0b30a8f215e5895d9c4c6f7c6ed9ad61602 SHA1 5edfe76d0abb7f91335a953239ad4016c21a1f84 SHA256 3d62e65233b4893b96e806afb6a9141402ffacbd134c9766e80c8a3f5e66d6d3
 AUX README.Gentoo 1872 RMD160 d1dd74e452a146eda2a7cbd2a77ebb56a553306e SHA1 a808f13153d79e45312981bdd1b70db9831cfecf SHA256 eff5ce2b235af399f751566aa395ca7b803b7314e3adb652f7ae395653ac8628
-AUX build.xml 2912 RMD160 ce8ed7ab2d8581c31b55eebbaa770d371ec97682 SHA1 0854c8cd54eca889d590d9daf12eaddcffc80cf4 SHA256 8ecea978246d47b111a364ec1a7d081b15b15b10e717264ae8a433351b9dbf7d
+AUX build.xml 2897 RMD160 fcaaa0650bad44e260c866ad9c7e1dee45880937 SHA1 27a7fb63e437cfbe7ac60e476d0cdbb76785e782 SHA256 f639ce36f9f9d55b61a36915992ef724eb5d3fbf5237eb61f0d43b2cfa33ee26
 DIST fits-1.06.0_src.jar 174797 RMD160 af8bfea7039bc5ab9b3ad32be6d67f9145066005 SHA1 763c81042b8586ddba96e44a94fbd0d9e68217e4 SHA256 924c39f98114720917f2914e886d9f87050632a48769c289b0dffbbb646b7fcf
-EBUILD fits-1.06.0.ebuild 1405 RMD160 da88ce48b3925f3fd32760addae381e2ceee05c7 SHA1 af8792b81ce9be49c215f99d7f3239884aa7b756 SHA256 ea6ab865055812b3a5db462d2e218221e697004df7165de1daf3dc83780c5fa4
+EBUILD fits-1.06.0.ebuild 1372 RMD160 e4f037e82ca1ef3cdfc4d94dd4caaa58a48f229f SHA1 8974e740d68e0bf032f3e86f6a908fc69f622b8d SHA256 911f53381382ecda73f7667583ff0d41401c9f5b2c4dc68b399baf6ebdc0c6c3
 MISC ChangeLog 418 RMD160 97fe025c39bcfc9da3c7a4697fc241ffa2135fc8 SHA1 12b1fa785671ced034b7107bc61da6861f665e4f SHA256 0246d12afba4f365370399c6d360fa1344a73dd20c1ef03dbf15395b32a053a6
 MISC metadata.xml 247 RMD160 6735f3a5dd2d7a2b70589d1693f35d54291b7147 SHA1 c015969fe50967340dd050a44cb9f8a30b5e34a5 SHA256 9e65060e5f9d0a50d28c7a69d9c27fed6c3037fdd3e420cc276627fde2794f72
index b38e8d29a17da93320673de0c22e7a5cd12270d4..2b9ea5fbe17c511d46f62f06b9d4c342bbb0d092 100644 (file)
@@ -1,13 +1,20 @@
 <?xml version="1.0"?>
 <project name="fits" default="all" basedir=".">
   <target name="init" description="Sets build properties">
+    <!-- package configuration -->
+    <property name="package.version" value="devel"/>
+    <!-- directory locations -->
     <property name="src" value="${basedir}/src"/>
     <property name="build" value="${basedir}/build"/>
     <property name="doc" value="${basedir}/doc"/>
+    <property name="doc.api" value="${doc}/api"/>
+    <!-- external dependencies -->
+    <property name="junit.jar" value="junit.jar"/>
+    <!-- classpaths -->
     <path id="project.class.path">
     </path>
     <path id="build.class.path">
-      <pathelement location="JUNIT.JAR"/>
+      <pathelement location="${junit.jar}"/>
     </path>
     <path id="test.class.path">
       <pathelement location="${build}"/>
       <classpath refid="test.class.path"/>
       <formatter type="brief" usefile="false" />
       <batchtest>
-        <fileset dir="${build}">                                               
-          <include name="**/test/*.class" />                                    
-          <exclude name="**/*$*.class" />                                       
-        </fileset>                                                              
+        <fileset dir="${build}">
+          <include name="**/test/*.class" />
+          <exclude name="**/*$*.class" />
+        </fileset>
       </batchtest>
     </junit>
   </target>
   <target name="javadoc" depends="init"
           description="Generates Javadoc API documentation">
-    <mkdir dir="${doc}/api"/>
+    <mkdir dir="${doc.api}"/>
     <javadoc packagenames="*"
-             sourcepath="${src}" destdir="${doc}/api"
+             sourcepath="${src}" destdir="${doc.api}"
              author="true"       version="true"
              use="true"          private="true"/>
   </target>
   <target name="jar" depends="build"
           description="Builds a project JAR file">
-    <jar basedir="${build}" jarfile="${basedir}/fits.jar">
+    <jar basedir="${build}" jarfile="${build}/fits.jar">
       <manifest>
-        <attribute name="Version" value="VERSION"/>
-        <attribute name="Main-Class"
-                   value="fits"/>
+        <attribute name="Version" value="${package.version}"/>
       </manifest>
     </jar>
   </target>
@@ -68,7 +73,6 @@
     <delete dir="${build}" verbose="true"/>
     <delete dir="${doc}/api" verbose="true"/>
     <delete verbose="true">
-        <fileset dir="${basedir}" includes="*.jar"/>
         <fileset dir="${basedir}" includes="*.fits"/>
         <fileset dir="${basedir}" includes="*.fil"/>
         <fileset dir="${basedir}" includes="*.hdr"/>
index 491c1ec617914f6d01b84682894f80ba57d01f10..984b67ad3c0ec283317f24c03316d9daff15cde6 100644 (file)
@@ -27,6 +27,9 @@ DEPEND=">=virtual/jdk-1.5
        )
        ${COMMON_DEP}"
 
+EANT_EXTRA_ARGS="-Dpacakge.version=${PV}
+       -Djunit.jar=$(java-pkg_getjar junit-4 junit.jar)"
+
 src_unpack() {
        mkdir -p "${P}/src"
        cd "${P}/src"
@@ -34,14 +37,12 @@ src_unpack() {
 }
 
 java_prepare() {
-       local junit="$(java-pkg_getjar junit-4 junit.jar)"
        cd "${WORKDIR}/${P}" || die
        cp "${FILESDIR}"/README.Gentoo . || die
        cp "${FILESDIR}"/build.xml . || die
-       sed -i "s/VERSION/${PV}/" build.xml || die
-       sed -i "s:JUNIT.JAR:${junit}:" build.xml || die
        epatch "${FILESDIR}"/01-Use-getResource-to-access-CompressTest-data-for-unit.patch
        epatch "${FILESDIR}"/02-Update-ArrayFuncsTest.java-to-JUnit-4.patch
+       #rm -rf lib
 }
 
 src_test() {
@@ -49,7 +50,7 @@ src_test() {
 }
 
 src_install() {
-       java-pkg_newjar ${PN}.jar ${PN}.jar
+       java-pkg_newjar ${PN}.jar build/${PN}.jar
        use doc && java-pkg_dojavadoc doc/api
        use source && java-pkg_dosrc src/*
        #use examples && java-pkg_doexamples src/java/examples