Re: [JDBC] ANT fix for jar creation

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [JDBC] ANT fix for jar creation
Дата
Msg-id 200105232054.f4NKsOV16249@candle.pha.pa.us
обсуждение исходный текст
Ответы Re: [JDBC] ANT fix for jar creation  (Ned Wolpert <ned.wolpert@knowledgenet.com>)
Список pgsql-patches
> Doesn't the jarfile need to have the properties? (For error messages)  Unless I
> read the patch wrong, I think it will exclude needed files, like
>   org/postgresql/errors.properties
>
> On 23-May-2001 Bruce Momjian wrote:
> >
> > The following ANT patch prevents the JAR file from containing non-class
> > files.  I was occasionally getting the 'tags' file in the jar file,
> > which clearly is wrong, and made the JAR file 20mb instead of 80k.

I was wondering that myself.  Here is a fix I applied.  Seems to work
fine.  Has only *.class and *.properties files in the jar, doesn't
create 20mb jars, and doesn't force recompile when not needed.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
? build
? jars
? org/postgresql/Driver.java
Index: build.xml
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/build.xml,v
retrieving revision 1.13
diff -c -r1.13 build.xml
*** build.xml    2001/05/23 19:30:35    1.13
--- build.xml    2001/05/23 20:52:46
***************
*** 108,118 ****
        <exclude name="${package}/PostgresqlDataSource.java" unless="jdk1.2e+" />
        <exclude name="${package}/xa/**" unless="jdk1.2e+" />
        <exclude name="${package}/test/**" unless="junit" />
-       <exclude name="${package}/*.properties" />
      </javac>
      <copy todir="${dest}" overwrite="true" filtering="on">
        <fileset dir="${src}">
!         <include name="${package}/*.properties" />
          <exclude name="${dest}/**" />
        </fileset>
      </copy>
--- 108,117 ----
        <exclude name="${package}/PostgresqlDataSource.java" unless="jdk1.2e+" />
        <exclude name="${package}/xa/**" unless="jdk1.2e+" />
        <exclude name="${package}/test/**" unless="junit" />
      </javac>
      <copy todir="${dest}" overwrite="true" filtering="on">
        <fileset dir="${src}">
!         <include name="${package}/**/*.properties" />
          <exclude name="${dest}/**" />
        </fileset>
      </copy>
***************
*** 139,146 ****

    <!-- This builds the jar file containing the driver -->
    <target name="jar" depends="compile,examples">
!     <jar jarfile="${jars}/postgresql.jar" basedir="${dest}" includes="${package}/**/*.class"
excludes="${package}/test/**"/>
!     <jar jarfile="${jars}/postgresql-examples.jar" basedir="${dest}" includes="example/**/*.class" />
    </target>

    <!--
--- 138,145 ----

    <!-- This builds the jar file containing the driver -->
    <target name="jar" depends="compile,examples">
!     <jar jarfile="${jars}/postgresql.jar" basedir="${dest}" includes="${package}/**/*.class,${package}/*.properties"
excludes="${package}/test/**"/>
!     <jar jarfile="${jars}/postgresql-examples.jar" basedir="${dest}"
includes="example/**/*.class,example/*.properties"/> 
    </target>

    <!--

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Remove sort files
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Remove sort files