mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +00:00 
			
		
		
		
	Update ant build scripts for existing workloads
This commit is contained in:
		| @@ -1,12 +1,39 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
|  |  | ||||||
|  | # CD into build dir if possible - allows building from any directory | ||||||
|  | script_path='.' | ||||||
|  | if `readlink -f $0 &>/dev/null`; then | ||||||
|  |     script_path=`readlink -f $0 2>/dev/null` | ||||||
|  | fi | ||||||
|  | script_dir=`dirname $script_path` | ||||||
|  | cd $script_dir | ||||||
|  |  | ||||||
|  | # Ensure build.xml exists before starting | ||||||
|  | if [[ ! -f build.xml ]]; then | ||||||
|  |     echo 'Ant build.xml file not found! Check that you are in the right directory.' | ||||||
|  |     exit 9 | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Copy base classes from wlauto dist | ||||||
| class_dir=bin/classes/com/arm/wlauto/uiauto | class_dir=bin/classes/com/arm/wlauto/uiauto | ||||||
| base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | ||||||
| mkdir -p $class_dir | mkdir -p $class_dir | ||||||
| cp $base_classes $class_dir | cp $base_classes $class_dir | ||||||
|  |  | ||||||
|  | # Build and return appropriate exit code if failed | ||||||
| ant build | ant build | ||||||
|  | exit_code=$? | ||||||
| if [[ -f bin/com.arm.wlauto.uiauto.gmail.jar ]]; then | if [[ $exit_code -ne 0 ]]; then | ||||||
|     cp bin/com.arm.wlauto.uiauto.gmail.jar .. |     echo "ERROR: 'ant build' exited with code $exit_code" | ||||||
|  |     exit $exit_code | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # If successful move JAR file to workload folder (overwrite previous) | ||||||
|  | package=com.arm.wlauto.uiauto.gmail.jar | ||||||
|  | rm -f ../$package | ||||||
|  | if [[ -f bin/$package ]]; then | ||||||
|  |     cp bin/$package .. | ||||||
|  | else | ||||||
|  |     echo 'ERROR: UiAutomator JAR could not be found!' | ||||||
|  |     exit 9 | ||||||
| fi | fi | ||||||
|   | |||||||
| @@ -1,12 +1,39 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
|  |  | ||||||
|  | # CD into build dir if possible - allows building from any directory | ||||||
|  | script_path='.' | ||||||
|  | if `readlink -f $0 &>/dev/null`; then | ||||||
|  |     script_path=`readlink -f $0 2>/dev/null` | ||||||
|  | fi | ||||||
|  | script_dir=`dirname $script_path` | ||||||
|  | cd $script_dir | ||||||
|  |  | ||||||
|  | # Ensure build.xml exists before starting | ||||||
|  | if [[ ! -f build.xml ]]; then | ||||||
|  |     echo 'Ant build.xml file not found! Check that you are in the right directory.' | ||||||
|  |     exit 9 | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Copy base classes from wlauto dist | ||||||
| class_dir=bin/classes/com/arm/wlauto/uiauto | class_dir=bin/classes/com/arm/wlauto/uiauto | ||||||
| base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | ||||||
| mkdir -p $class_dir | mkdir -p $class_dir | ||||||
| cp $base_classes $class_dir | cp $base_classes $class_dir | ||||||
|  |  | ||||||
|  | # Build and return appropriate exit code if failed | ||||||
| ant build | ant build | ||||||
|  | exit_code=$? | ||||||
| if [[ -f bin/com.arm.wlauto.uiauto.googlephotos.jar ]]; then | if [[ $exit_code -ne 0 ]]; then | ||||||
|     cp bin/com.arm.wlauto.uiauto.googlephotos.jar .. |     echo "ERROR: 'ant build' exited with code $exit_code" | ||||||
|  |     exit $exit_code | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # If successful move JAR file to workload folder (overwrite previous) | ||||||
|  | package=com.arm.wlauto.uiauto.googlephotos.jar | ||||||
|  | rm -f ../$package | ||||||
|  | if [[ -f bin/$package ]]; then | ||||||
|  |     cp bin/$package .. | ||||||
|  | else | ||||||
|  |     echo 'ERROR: UiAutomator JAR could not be found!' | ||||||
|  |     exit 9 | ||||||
| fi | fi | ||||||
|   | |||||||
| @@ -1,12 +1,39 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
|  |  | ||||||
|  | # CD into build dir if possible - allows building from any directory | ||||||
|  | script_path='.' | ||||||
|  | if `readlink -f $0 &>/dev/null`; then | ||||||
|  |     script_path=`readlink -f $0 2>/dev/null` | ||||||
|  | fi | ||||||
|  | script_dir=`dirname $script_path` | ||||||
|  | cd $script_dir | ||||||
|  |  | ||||||
|  | # Ensure build.xml exists before starting | ||||||
|  | if [[ ! -f build.xml ]]; then | ||||||
|  |     echo 'Ant build.xml file not found! Check that you are in the right directory.' | ||||||
|  |     exit 9 | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Copy base classes from wlauto dist | ||||||
| class_dir=bin/classes/com/arm/wlauto/uiauto | class_dir=bin/classes/com/arm/wlauto/uiauto | ||||||
| base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | ||||||
| mkdir -p $class_dir | mkdir -p $class_dir | ||||||
| cp $base_classes $class_dir | cp $base_classes $class_dir | ||||||
|  |  | ||||||
|  | # Build and return appropriate exit code if failed | ||||||
| ant build | ant build | ||||||
|  | exit_code=$? | ||||||
| if [[ -f bin/com.arm.wlauto.uiauto.reader.jar ]]; then | if [[ $exit_code -ne 0 ]]; then | ||||||
|     cp bin/com.arm.wlauto.uiauto.reader.jar .. |     echo "ERROR: 'ant build' exited with code $exit_code" | ||||||
|  |     exit $exit_code | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # If successful move JAR file to workload folder (overwrite previous) | ||||||
|  | package=com.arm.wlauto.uiauto.reader.jar | ||||||
|  | rm -f ../$package | ||||||
|  | if [[ -f bin/$package ]]; then | ||||||
|  |     cp bin/$package .. | ||||||
|  | else | ||||||
|  |     echo 'ERROR: UiAutomator JAR could not be found!' | ||||||
|  |     exit 9 | ||||||
| fi | fi | ||||||
|   | |||||||
| @@ -1,17 +1,39 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
|  |  | ||||||
|  | # CD into build dir if possible - allows building from any directory | ||||||
|  | script_path='.' | ||||||
|  | if `readlink -f $0 &>/dev/null`; then | ||||||
|  |     script_path=`readlink -f $0 2>/dev/null` | ||||||
|  | fi | ||||||
|  | script_dir=`dirname $script_path` | ||||||
|  | cd $script_dir | ||||||
|  |  | ||||||
|  | # Ensure build.xml exists before starting | ||||||
|  | if [[ ! -f build.xml ]]; then | ||||||
|  |     echo 'Ant build.xml file not found! Check that you are in the right directory.' | ||||||
|  |     exit 9 | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Copy base classes from wlauto dist | ||||||
| class_dir=bin/classes/com/arm/wlauto/uiauto | class_dir=bin/classes/com/arm/wlauto/uiauto | ||||||
| base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | base_classes=`python -c "import os, wlauto; print os.path.join(os.path.dirname(wlauto.__file__), 'common', 'android', '*.class')"` | ||||||
| mkdir -p $class_dir | mkdir -p $class_dir | ||||||
| cp $base_classes $class_dir | cp $base_classes $class_dir | ||||||
|  |  | ||||||
|  | # Build and return appropriate exit code if failed | ||||||
| ant build | ant build | ||||||
|  |  | ||||||
| exit_code=$? | exit_code=$? | ||||||
| if [[ $exit_code -ne 0 ]]; then | if [[ $exit_code -ne 0 ]]; then | ||||||
|     echo "ERROR: ant build exited with code $exit_code" && exit $exit_code |     echo "ERROR: 'ant build' exited with code $exit_code" | ||||||
|  |     exit $exit_code | ||||||
| fi | fi | ||||||
|  |  | ||||||
| if [[ -f bin/com.arm.wlauto.uiauto.skype.jar ]]; then | # If successful move JAR file to workload folder (overwrite previous) | ||||||
|     cp bin/com.arm.wlauto.uiauto.skype.jar .. | package=com.arm.wlauto.uiauto.skype.jar | ||||||
|  | rm -f ../$package | ||||||
|  | if [[ -f bin/$package ]]; then | ||||||
|  |     cp bin/$package .. | ||||||
|  | else | ||||||
|  |     echo 'ERROR: UiAutomator JAR could not be found!' | ||||||
|  |     exit 9 | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user