This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/flex-flexunit.git
commit bd20b2aa5db1ff2737d88836d826050682c00cb2 Author: Josh Tynjala <joshtynj...@bowlerhat.dev> AuthorDate: Mon Mar 4 14:49:35 2024 -0800 optional env.properties file And fix FLEX_HOME population --- .gitignore | 1 + FlexUnit4/build.xml | 15 ++++++------ FlexUnit4AirCIListener/build.xml | 15 ++++++------ FlexUnit4CIListener/build.xml | 15 ++++++------ FlexUnit4FlexCoverListener/build.xml | 15 ++++++------ FlexUnit4FluintExtensions/build.xml | 15 ++++++------ FlexUnit4Test/build.xml | 15 ++++++------ FlexUnit4UIListener/build.xml | 15 ++++++------ build.xml | 1 + env-template.properties | 46 ++++++++++++++++++++++++++++++++++++ 10 files changed, 97 insertions(+), 56 deletions(-) diff --git a/.gitignore b/.gitignore index 18916aa..0f04cd1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ FlexUnit4UIListener/target/* *.iml */.settings /lib/ +env.properties \ No newline at end of file diff --git a/FlexUnit4/build.xml b/FlexUnit4/build.xml index 72dffd9..d64ec0e 100644 --- a/FlexUnit4/build.xml +++ b/FlexUnit4/build.xml @@ -17,6 +17,7 @@ --> <project name="FlexUnit4Core" basedir="." default="package"> <import file="${basedir}/../utils.xml" /> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -41,14 +42,12 @@ <property name="doc.loc" location="${basedir}/target/docs" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <property name="FLEX_COVER_HOME" location="${env.FLEX_COVER_HOME}" /> <taskdef resource="flexTasks.tasks" > <classpath> diff --git a/FlexUnit4AirCIListener/build.xml b/FlexUnit4AirCIListener/build.xml index bd5796c..16bb35c 100644 --- a/FlexUnit4AirCIListener/build.xml +++ b/FlexUnit4AirCIListener/build.xml @@ -17,6 +17,7 @@ --> <project name="FlexUnit4AirCIListener" basedir="." default="package"> <import file="${basedir}/../utils.xml" /> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -37,14 +38,12 @@ <property name="doc.loc" location="${basedir}/target/docs" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <taskdef resource="flexTasks.tasks" > <classpath> <pathelement location="${FLEX_HOME}/ant/lib/flexTasks.jar"/> diff --git a/FlexUnit4CIListener/build.xml b/FlexUnit4CIListener/build.xml index 8141add..c245343 100644 --- a/FlexUnit4CIListener/build.xml +++ b/FlexUnit4CIListener/build.xml @@ -17,6 +17,7 @@ --> <project name="FlexUnit4CIListener" basedir="." default="package"> <import file="${basedir}/../utils.xml" /> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -37,14 +38,12 @@ <property name="doc.loc" location="${basedir}/target/docs" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <taskdef resource="flexTasks.tasks" > <classpath> <pathelement location="${FLEX_HOME}/ant/lib/flexTasks.jar"/> diff --git a/FlexUnit4FlexCoverListener/build.xml b/FlexUnit4FlexCoverListener/build.xml index 2c4fe7c..255a319 100644 --- a/FlexUnit4FlexCoverListener/build.xml +++ b/FlexUnit4FlexCoverListener/build.xml @@ -17,6 +17,7 @@ --> <project name="FlexUnit4FlexCoverListener" basedir="." default="package"> <import file="${basedir}/../utils.xml" /> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -37,14 +38,12 @@ <property name="doc.loc" location="${basedir}/target/docs" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <taskdef resource="flexTasks.tasks" > <classpath> <pathelement location="${FLEX_HOME}/ant/lib/flexTasks.jar"/> diff --git a/FlexUnit4FluintExtensions/build.xml b/FlexUnit4FluintExtensions/build.xml index 1e82d5d..eb4da5c 100644 --- a/FlexUnit4FluintExtensions/build.xml +++ b/FlexUnit4FluintExtensions/build.xml @@ -17,6 +17,7 @@ --> <project name="FlexUnit4CIListener" basedir="." default="package"> <import file="${basedir}/../utils.xml" /> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -37,14 +38,12 @@ <property name="doc.loc" location="${basedir}/target/docs" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <taskdef resource="flexTasks.tasks" > <classpath> <pathelement location="${FLEX_HOME}/ant/lib/flexTasks.jar"/> diff --git a/FlexUnit4Test/build.xml b/FlexUnit4Test/build.xml index b825ce1..f932de3 100644 --- a/FlexUnit4Test/build.xml +++ b/FlexUnit4Test/build.xml @@ -21,6 +21,7 @@ dependency which would be more difficult to manage from a build perspective. --> <project name="FlexUnit4Test" basedir="." default="test"> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -42,14 +43,12 @@ <property name="report.flexcover.loc" location="${basedir}/target/report/flexcover" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <property name="FLEX_COVER_VIEWER" location="${env.FLEX_COVER_VIEWER}" /> <taskdef resource="flexTasks.tasks" > <classpath> diff --git a/FlexUnit4UIListener/build.xml b/FlexUnit4UIListener/build.xml index 1da63a7..f21822a 100644 --- a/FlexUnit4UIListener/build.xml +++ b/FlexUnit4UIListener/build.xml @@ -17,6 +17,7 @@ --> <project name="FlexUnit4UIListener" basedir="." default="package"> <import file="${basedir}/../utils.xml" /> + <property file="${basedir}/../env.properties"/> <property environment="env" /> <!-- Configuration --> @@ -38,14 +39,12 @@ <property name="doc.loc" location="${basedir}/target/docs" /> <!-- Setup Flex Ant Resources --> - <available file="${env.FLEX_HOME}/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${env.FLEX_HOME}"/> - <available file="${basedir}/../../flex-sdk/lib/compc.jar" - type="file" - property="FLEX_HOME" - value="${basedir}/../../flex-sdk"/> + <condition property="FLEX_HOME" value="${env.FLEX_HOME}"> + <available file="${env.FLEX_HOME}/lib/compc.jar" type="file" /> + </condition> + <condition property="FLEX_HOME" value="${basedir}/../../flex-sdk"> + <available file="${basedir}/../../flex-sdk/lib/compc.jar" type="file" /> + </condition> <taskdef resource="flexTasks.tasks" > <classpath> <pathelement location="${FLEX_HOME}/ant/lib/flexTasks.jar"/> diff --git a/build.xml b/build.xml index dc997fd..76eac85 100644 --- a/build.xml +++ b/build.xml @@ -29,6 +29,7 @@ Reporting is something each project implements which we then have hooked into Hu to contribute to our CI process. --> <project name="FlexUnit4" basedir="." default="main"> + <property file="${basedir}/env.properties"/> <property environment="env" /> <!-- Version info --> diff --git a/env-template.properties b/env-template.properties new file mode 100644 index 0000000..21afe58 --- /dev/null +++ b/env-template.properties @@ -0,0 +1,46 @@ +################################################################################ +## +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +################################################################################ + +# If you choose to use this file, rename it to env.properties and uncomment the +# properties you wish to set. + +# For each of +# +# FLEX_HOME +# +# you need to set an environment variable with that name or set the property here +# prefixed with "env.". If a property is set in this file, and the corresponding +# environment variable is also set, the property set here takes precedence over the +# corresponding environment variable. +# +# Use absolute file paths. +# +# This is a Java property file. On Windows if you use the '\' file +# separator you must use "\\", but not escape spaces, for example, +# +# env.FLEX_HOME=z:\\tools\\flex\\apache-flex-sdk-4.16.1 +# or +# env.FLEX_HOME=C:\\Program Files (x86)\\Adobe\\Adobe Flash Builder 4\\sdks\\4.1.0 +# +# See the README file for more information about the different variables. + +# +# Set this to the directory that contains the Apache Flex SDK. +# +#env.FLEX_HOME=