|
328 | 328 | printProperty from anywhere, but seems best to centralize the function. -->
|
329 | 329 | <antcall target="printProductionProperties" />
|
330 | 330 |
|
331 |
| - <!-- The PHP properties are useful to display (directly or indirectly) |
332 |
| - on "test results" page (such as "testPlatform" headings). --> |
333 |
| - <antcall target="printMainPropertiesAsPHP" /> |
| 331 | + <echo message="DEBUG ant.version: ${ant.version}" /> |
334 | 332 |
|
335 | 333 | <!-- following are all required by "runtests" ... used to be part of it,
|
336 | 334 | but wanted these variables to print out, even if merely testing scripts,
|
|
395 | 393 | <printProperty property="testExecutable" />
|
396 | 394 | <printProperty property="testScript" />
|
397 | 395 | <printProperty property="jvm" />
|
398 |
| - <printProperty property="javaversionEscaped" /> |
| 396 | + <printProperty property="java.version" /> |
399 | 397 | <printProperty property="javaMajorVersion" />
|
400 | 398 | <printProperty property="testedPlatform" />
|
401 | 399 | <printProperty property="testedPlatformConfig" />
|
|
836 | 834 | </exec>
|
837 | 835 | </target>
|
838 | 836 |
|
839 |
| - <!-- Prints properties in "PHP form" to use on test results summary, to |
840 |
| - be sure accurate and meaningful. --> |
841 |
| - <target |
842 |
| - name="printMainPropertiesAsPHP" |
843 |
| - depends="init" |
844 |
| - unless="printedMainPHPProperties"> |
845 |
| - |
846 |
| - <property |
847 |
| - name="EOL" |
848 |
| - value="${line.separator}" /> |
849 |
| - |
850 |
| - |
851 |
| - <property |
852 |
| - name="phpPropertyFile" |
853 |
| - value="${junit-report-output}/testProperties.php" /> |
854 |
| - |
855 |
| - <!-- on first write to php file, don't append --> |
856 |
| - <echo |
857 |
| - message="<?php${EOL}" |
858 |
| - append="false" |
859 |
| - file="${phpPropertyFile}" /> |
860 |
| - <escapeProperty property="ant.version" /> |
861 |
| - <printPHPProperty |
862 |
| - phpvar="ANT_VERSION" |
863 |
| - value="ant.versionEscaped" /> |
864 |
| - <printPHPProperty |
865 |
| - phpvar="ANT_JAVA_VERSION" |
866 |
| - value="ant.java.versionEscaped" /> |
867 |
| - <printPHPProperty |
868 |
| - phpvar="INVOKED_JAVA_VERSION" |
869 |
| - value="javaversionEscaped" /> |
870 |
| - <!-- Note: there might be times, the java.runtime.version at this point |
871 |
| - in time, may not be quite right ... such as if invoked with some other VM |
872 |
| - with the intent of using 'jvm' on "eclipse" command line ... which we currently |
873 |
| - do not do. --> |
874 |
| - <printPHPProperty |
875 |
| - phpvar="JAVA_VERSION" |
876 |
| - value="java.version" /> |
877 |
| - <printPHPProperty |
878 |
| - phpvar="JAVA_MAJOR_VERSION" |
879 |
| - value="javaMajorVersion" /> |
880 |
| - <printPHPProperty |
881 |
| - phpvar="JAVA_RUNTIME_VERSION" |
882 |
| - value="java.runtime.version" /> |
883 |
| - <printPHPProperty |
884 |
| - phpvar="JAVA_VM_INFO" |
885 |
| - value="java.vm.info" /> |
886 |
| - <printPHPProperty |
887 |
| - phpvar="JAVA_SPECIFICATION_VERSION" |
888 |
| - value="java.specification.version" /> |
889 |
| - <printPHPProperty |
890 |
| - phpvar="JAVA_VENDOR" |
891 |
| - value="java.vendor" /> |
892 |
| - <printPHPProperty |
893 |
| - phpvar="OSGI_OS" |
894 |
| - value="osgi.os" /> |
895 |
| - <printPHPProperty |
896 |
| - phpvar="OSGI_WS" |
897 |
| - value="osgi.ws" /> |
898 |
| - <printPHPProperty |
899 |
| - phpvar="OSGI_ARCH" |
900 |
| - value="osgi.arch" /> |
901 |
| - <!-- NODE_NAME will be empty string, if on master --> |
902 |
| - <condition |
903 |
| - property="hudsonSlave" |
904 |
| - value="master"> |
905 |
| - <or> |
906 |
| - <not> |
907 |
| - <isset property="env.NODE_NAME" /> |
908 |
| - </not> |
909 |
| - <equals |
910 |
| - arg1="${env.NODE_NAME}" |
911 |
| - arg2="" /> |
912 |
| - <equals |
913 |
| - arg1="${env.NODE_NAME}" |
914 |
| - arg2=" " /> |
915 |
| - </or> |
916 |
| - </condition> |
917 |
| - <!-- if not set above, we'll set to the non blank NODE_NAME --> |
918 |
| - <property |
919 |
| - name="hudsonSlave" |
920 |
| - value="${env.NODE_NAME}" /> |
921 |
| - |
922 |
| - <printPHPProperty |
923 |
| - phpvar="HUDSON_NODE_NAME" |
924 |
| - value="hudsonSlave" /> |
925 |
| - <!-- I believe all (common) platforms have env variable for HOSTNAME. If |
926 |
| - not, user might want to set/export to be meaningful. (Surprisingly, it doesn't |
927 |
| - seem obvious that Hudson makes this available in its process environment). --> |
928 |
| - <printPHPProperty |
929 |
| - phpvar="HOSTNAME" |
930 |
| - value="env.HOSTNAME" /> |
931 |
| - <printPHPProperty |
932 |
| - phpvar="HUDSON_JOB_NAME" |
933 |
| - value="env.JOB_BASE_NAME" /> |
934 |
| - <printPHPProperty |
935 |
| - phpvar="HUDSON_BUILD_NUMBER" |
936 |
| - value="env.BUILD_NUMBER" /> |
937 |
| - <printPHPProperty |
938 |
| - phpvar="HUDSON_BUILD_URL" |
939 |
| - value="env.BUILD_URL" /> |
940 |
| - <!-- With HUDSON_URL and WORKSPACE_PATH should be able to figure out URL |
941 |
| - to WORKSPACE, though only temporarily available (until next job is ran). --> |
942 |
| - <printPHPProperty |
943 |
| - phpvar="HUDSON_URL" |
944 |
| - value="env.HUDSON_URL" /> |
945 |
| - <printPHPProperty |
946 |
| - phpvar="HUDSON_WORKSPACE" |
947 |
| - value="env.WORKSPACE" /> |
948 |
| - <printPHPProperty |
949 |
| - phpvar="TESTED_RUNTIME_ID" |
950 |
| - value="buildIdToUse" /> |
951 |
| - <printPHPProperty |
952 |
| - phpvar="TEST_TARGET" |
953 |
| - value="test.target" /> |
954 |
| - <printPHPProperty |
955 |
| - phpvar="ECLIPSE_PERF_SAMPLES_OUT" |
956 |
| - value="eclipse.perf.samples.out" /> |
957 |
| - <printPHPProperty |
958 |
| - phpvar="ECLIPSE_PERF_DBLOC" |
959 |
| - value="eclipse.perf.dbloc" /> |
960 |
| - |
961 |
| - <printPHPProperty |
962 |
| - phpvar="ECLIPSE_PERF_CONFIG" |
963 |
| - value="eclipse.perf.config" /> |
964 |
| - <printPHPProperty |
965 |
| - phpvar="ECLIPSE_PERF_ASSERTAGAINST" |
966 |
| - value="eclipse.perf.assertAgainst" /> |
967 |
| - |
968 |
| - <!-- We end with an empty line, but it is recommended to not end included |
969 |
| - PHP files with "end PHP" marker. --> |
970 |
| - <echo |
971 |
| - message="${EOL}" |
972 |
| - append="true" |
973 |
| - file="${phpPropertyFile}" /> |
974 |
| - |
975 |
| - <!-- set property so we only print these variables once --> |
976 |
| - <property |
977 |
| - name="printedMainPHPProperties" |
978 |
| - value="true" /> |
979 |
| - |
980 |
| - </target> |
981 | 837 | <target
|
982 | 838 | name="setJVMProperties"
|
983 | 839 | depends="initPlatformSpecificProperties,setJVMfromUserSpecified"
|
|
986 | 842 | name="VMSource"
|
987 | 843 | value="VM used for tests, is same that invoked Ant: '${java.home}/bin/java' (that is, 'jvm' not specified by caller)." />
|
988 | 844 | <echo message="VMSource: ${VMSource}" />
|
989 |
| - <!-- Remember, we don't want J2SE-X.0 set at all, if there is nothing that |
990 |
| - can run tests that require that level. --> |
991 | 845 | <property
|
992 | 846 | name="jvm"
|
993 | 847 | value="${java.home}/bin/java" />
|
994 | 848 |
|
| 849 | + <echo message="full output from 'java -version' of ${jvm} is" /> |
995 | 850 | <exec
|
996 |
| - executable="${jvm}" |
997 |
| - outputproperty="javaversion"> |
| 851 | + executable="${jvm}"> |
998 | 852 | <arg line="-version" />
|
999 | 853 | </exec>
|
1000 |
| - <echo message="full output from 'java -version' of ${jvm} is " /> |
1001 |
| - <echo message="${javaversion}" /> |
1002 |
| - <escapeProperty property="javaversion" /> |
1003 | 854 | </target>
|
1004 | 855 | <target
|
1005 | 856 | name="setJVMfromUserSpecified"
|
1006 |
| - if="jvm" |
1007 |
| - unless="javaversionEscaped"> |
| 857 | + if="jvm"> |
1008 | 858 |
|
1009 | 859 | <property
|
1010 | 860 | name="VMSource"
|
1011 | 861 | value="VM used for tests, specified by caller: 'jvm'=${jvm}" />
|
1012 | 862 | <echo message="VMSource: ${VMSource}" />
|
1013 |
| - <!-- Remember, we don't want J2SE-X.0 set at all, if there is nothing that |
1014 |
| - can run tests that require that level. --> |
| 863 | + <echo message="full output from 'java -version' of ${jvm} is" /> |
1015 | 864 | <exec
|
1016 |
| - executable="${jvm}" |
1017 |
| - outputproperty="javaversion"> |
| 865 | + executable="${jvm}"> |
1018 | 866 | <arg line="-version" />
|
1019 | 867 | </exec>
|
1020 |
| - <echo message="full output from 'java -version' of ${jvm} is " /> |
1021 |
| - <echo message="${javaversion}" /> |
1022 |
| - <escapeProperty property="javaversion" /> |
1023 | 868 | </target>
|
| 869 | + |
1024 | 870 | <!-- function to centralize how we get (that is, set) the value of 'javaMajorVersion'.
|
1025 | 871 | (expected to be integer, such as 5,6,7,8,9, or will be "0" if the version
|
1026 | 872 | could not be determined, for some reason. -->
|
1027 |
| - |
1028 | 873 | <target
|
1029 | 874 | name="setJavaMajorVersion"
|
1030 | 875 | depends="setJVMProperties"
|
1031 | 876 | unless="javaMajorVersion">
|
1032 | 877 |
|
1033 |
| - <echo message="javaversion in setJavaMajorVersion: ${javaversionEscaped}" /> |
| 878 | + <echo message="javaversion in setJavaMajorVersion: ${java.version}" /> |
1034 | 879 |
|
1035 | 880 | <loadresource property="javaMajorVersion">
|
1036 | 881 | <string value="${java.version}"/>
|
|
1043 | 888 | <echo message="javaMajorVersion: ${javaMajorVersion}"/>
|
1044 | 889 | </target>
|
1045 | 890 |
|
1046 |
| - <macrodef name="printPHPProperty"> |
1047 |
| - <attribute name="phpvar" /> |
1048 |
| - <attribute name="value" /> |
1049 |
| - <sequential> |
1050 |
| - <!-- DEBUG <echo message="@{value}" /> --> |
1051 |
| - <condition |
1052 |
| - property="printValue@{value}" |
1053 |
| - value="${@{value}}" |
1054 |
| - else="NotSet"> |
1055 |
| - <isset property="@{value}" /> |
1056 |
| - </condition> |
1057 |
| - <echo |
1058 |
| - message="$@{phpvar}="${printValue@{value}}";${EOL}" |
1059 |
| - file="${phpPropertyFile}" |
1060 |
| - append="true" /> |
1061 |
| - </sequential> |
1062 |
| - </macrodef> |
1063 |
| - <macrodef name="escapeProperty"> |
1064 |
| - <!-- the use of propertyfile and local require at least Ant 1.8 --> |
1065 |
| - <attribute name="property" /> |
1066 |
| - <sequential> |
1067 |
| - <echo message="DEBUG @{property}: ${@{property}}" /> |
1068 |
| - <loadresource property="@{property}Escaped"> |
1069 |
| - <propertyresource name="@{property}" /> |
1070 |
| - <filterchain> |
1071 |
| - <tokenfilter> |
1072 |
| - <filetokenizer /> |
1073 |
| - <replacestring |
1074 |
| - from='"' |
1075 |
| - to='\"' /> |
1076 |
| - </tokenfilter> |
1077 |
| - </filterchain> |
1078 |
| - </loadresource> |
1079 |
| - </sequential> |
1080 |
| - </macrodef> |
1081 | 891 | </project>
|
0 commit comments