6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts

Thu, 17 Jun 2010 17:19:58 -0700

author
ohair
date
Thu, 17 Jun 2010 17:19:58 -0700
changeset 124
48872561d4b1
parent 123
38fd32b8e990
child 125
db63f482182d
child 129
2dd6394ddec2

6955292: Workaround ant 1.7.1 package-info.java issue in ant scripts
6940241: Change jaxp/jaxws so that the http downloads are not done by default
6960333: Add make level ALLOW_DOWNLOADS=true option
Reviewed-by: darcy, ramap

build-defs.xml file | annotate | diff | comparison | revisions
build-drop-template.xml file | annotate | diff | comparison | revisions
build.properties file | annotate | diff | comparison | revisions
build.xml file | annotate | diff | comparison | revisions
make/Makefile file | annotate | diff | comparison | revisions
     1.1 --- a/build-defs.xml	Thu Jun 17 17:18:55 2010 -0700
     1.2 +++ b/build-defs.xml	Thu Jun 17 17:19:58 2010 -0700
     1.3 @@ -55,9 +55,36 @@
     1.4      <drop-import name="jaxws_src"/>
     1.5      <drop-import name="jaf_src"/>
     1.6      <!-- <drop-import name="jaxws_tests"/> -->
     1.7 +    
     1.8 +    <!-- Fail and print helpful messages if source does not exist. -->
     1.9 +    <target name="-src-help">
    1.10 +      <fail message="${failed.url.src.message}">
    1.11 +	<condition>
    1.12 +	    <and>
    1.13 +                <not>
    1.14 +                    <and>
    1.15 +	                <available file="${jaxws_src.src.dir}" type="dir"/>
    1.16 +                        <available file="${jaf_src.src.dir}" type="dir"/>
    1.17 +	            </and>
    1.18 +	        </not>
    1.19 +	        <istrue value="${allow.downloads}"/>
    1.20 +	    </and>
    1.21 +	</condition>
    1.22 +      </fail>
    1.23 +      <fail message="${failed.nourl.src.message}">
    1.24 +	<condition>
    1.25 +            <not>
    1.26 +                <and>
    1.27 +	            <available file="${jaxws_src.src.dir}" type="dir"/>
    1.28 +                    <available file="${jaf_src.src.dir}" type="dir"/>
    1.29 +	        </and>
    1.30 +	    </not>
    1.31 +	</condition>
    1.32 +      </fail>
    1.33 +    </target>
    1.34  
    1.35 -    <!-- Special build area preparation. -->
    1.36 -    <target name="-drop-build-prep" depends="init, -init-src-dirs">
    1.37 +    <!-- Special build area setup. -->
    1.38 +    <target name="-drop-build-setup" depends="init, -init-src-dirs">
    1.39          <mkdir dir="${build.classes.dir}"/>
    1.40          <copy todir="${build.classes.dir}">
    1.41              <fileset dir="${primary.src.dir}"
    1.42 @@ -99,7 +126,7 @@
    1.43  
    1.44      <!-- Source directory selection. -->
    1.45      <target name="-init-src-dirs"
    1.46 -	    depends="init, -use-drop">
    1.47 +	    depends="init, -use-drop,-src-help">
    1.48          <echo message="Using primary.src.dir=${primary.src.dir}"/>
    1.49          <pathconvert property="src.list.id" refid="src.dir.id"/>
    1.50          <echo message="Using src.dir.id=${src.list.id}"/>
     2.1 --- a/build-drop-template.xml	Thu Jun 17 17:18:55 2010 -0700
     2.2 +++ b/build-drop-template.xml	Thu Jun 17 17:19:58 2010 -0700
     2.3 @@ -75,6 +75,7 @@
     2.4      <target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
     2.5          <condition property="@DROP@.url.should.be.used">
     2.6              <and>
     2.7 +                <istrue value="${allow.downloads}"/>
     2.8                  <not>
     2.9                      <isset property="@DROP@.master.bundle.copy.exists"/>
    2.10                  </not>
     3.1 --- a/build.properties	Thu Jun 17 17:18:55 2010 -0700
     3.2 +++ b/build.properties	Thu Jun 17 17:19:58 2010 -0700
     3.3 @@ -104,4 +104,24 @@
     3.4    drops.dir=${drops.dir}${line.separator}\
     3.5  ${line.separator}
     3.6  
     3.7 +# Failure messages when source cannot be found on the file system
     3.8 +failed.nourl.src.message=\
     3.9 +ERROR: Cannot find source for project ${ant.project.name}.\
    3.10 +${line.separator}${line.separator}\
    3.11 +HINT: Try setting drops.dir to indicate where the bundles can be found, \
    3.12 +or try setting the ant property allow.downloads=true to download the bundle from the URL.\
    3.13 +${line.separator}\
    3.14 +e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory \
    3.15 +${line.separator}
    3.16 +
    3.17 +# Failure message when source cannot be downloaded
    3.18 +failed.url.src.message=\
    3.19 +ERROR: Cannot find source for project ${ant.project.name}.\
    3.20 +${line.separator}${line.separator}\
    3.21 +HINT: Try setting drops.dir to indicate where the bundles can be found, \
    3.22 +or try checking the URL with your browser.\
    3.23 +${line.separator}\
    3.24 +e.g. ant -Ddrops.dir=some_directory \
    3.25 +${line.separator}
    3.26 +
    3.27  #------------------------------------------------------------
     4.1 --- a/build.xml	Thu Jun 17 17:18:55 2010 -0700
     4.2 +++ b/build.xml	Thu Jun 17 17:19:58 2010 -0700
     4.3 @@ -36,6 +36,11 @@
     4.4        javac.debug          - true or false for debug classfiles
     4.5        javac.target         - classfile version target
     4.6        javac.source         - source version
     4.7 +      drops.dir            - directory that holds source drop bundles
     4.8 +      allow.download       - permit downloads from public url (default is false)
     4.9 +                             (used if bundles not found in drops.dir)
    4.10 +
    4.11 +      Run 'make help' for help using the Makefile.
    4.12      </description>
    4.13  
    4.14      <!-- Mac is special, need to downgrade these before build.properties. -->
    4.15 @@ -106,13 +111,17 @@
    4.16          <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
    4.17      </target>
    4.18  
    4.19 -    <target name="-build-prep"
    4.20 -	    depends="init, -init-src-dirs, -drop-build-prep">
    4.21 +    <target name="-build-setup"
    4.22 +	    depends="init, -init-src-dirs, -drop-build-setup">
    4.23      </target>
    4.24  
    4.25      <!-- Build (compilation) of sources to class files. -->
    4.26      <target name="build"
    4.27 -	    depends="init, -init-src-dirs, -build-prep">
    4.28 +	    depends="compile, -build-setup">
    4.29 +    </target>
    4.30 +    <target name="compile"
    4.31 +	    depends="init, -init-src-dirs">
    4.32 +        <mkdir dir="${build.classes.dir}"/>
    4.33          <javac 
    4.34  	     includeAntRuntime="false" 
    4.35  	     classpath="${build.classes.dir}:${tools.jar}"
     5.1 --- a/make/Makefile	Thu Jun 17 17:18:55 2010 -0700
     5.2 +++ b/make/Makefile	Thu Jun 17 17:19:58 2010 -0700
     5.3 @@ -65,6 +65,11 @@
     5.4    endif
     5.5  endif 
     5.6  
     5.7 +# If downloads are allowed
     5.8 +ifeq ($(ALLOW_DOWNLOADS),true)
     5.9 +  ANT_OPTIONS += -Dallow.downloads=true
    5.10 +endif
    5.11 +
    5.12  # Figure out the platform we are using
    5.13  _SYSTEM_UNAME := $(shell uname)
    5.14  _PLATFORM_KIND = unix
    5.15 @@ -159,6 +164,8 @@
    5.16  	@echo "    $(ANT_TARGETS)"
    5.17  	@echo " "
    5.18  	@echo "  Environment or command line variables (all optional):"
    5.19 +	$(call helpenvline, ALT_DROPS_DIR,\
    5.20 +	       "Directory that contains the drop source bundles i.e. drops.dir")
    5.21  	$(call helpenvline, ALT_BOOTDIR,\
    5.22  	       "JAVA_HOME to use when running ant")
    5.23  	$(call helpenvline, ALT_LANGTOOLS_DIST,\

mercurial