Home | History | Annotate | Download | only in connectivity
      1 #
      2 # Copyright (C) 2016 The Android Open Source Project
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #      http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 #
     16 
     17 LOCAL_PATH := $(call my-dir)
     18 
     19 include $(call all-subdir-makefiles)
     20 
     21 ifeq ($(HOST_OS),linux)
     22 
     23 # general Android Conntectivity Test Suite
     24 ACTS_DISTRO := $(HOST_OUT)/acts-dist/acts.zip
     25 
     26 $(ACTS_DISTRO): $(sort $(shell find $(LOCAL_PATH)/acts/framework))
     27 	@echo "Packaging ACTS into $(ACTS_DISTRO)"
     28 	@mkdir -p $(HOST_OUT)/acts-dist/
     29 	@rm -f $(HOST_OUT)/acts-dist/acts.zip
     30 	$(hide) zip -r $(HOST_OUT)/acts-dist/acts.zip tools/test/connectivity/acts/*
     31 acts: $(ACTS_DISTRO)
     32 
     33 $(call dist-for-goals,tests,$(ACTS_DISTRO))
     34 
     35 # Wear specific Android Connectivity Test Suite
     36 WTS_ACTS_DISTRO_DIR := $(HOST_OUT)/wts-acts-dist
     37 WTS_ACTS_DISTRO := $(WTS_ACTS_DISTRO_DIR)/wts-acts
     38 WTS_ACTS_DISTRO_ARCHIVE := $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip
     39 WTS_LOCAL_ACTS_DIR := tools/test/connectivity/acts/framework/acts/
     40 
     41 $(WTS_ACTS_DISTRO): $(SOONG_ZIP)
     42 	@echo "Packaging WTS-ACTS into $(WTS_ACTS_DISTRO)"
     43 	# clean-up and mkdir for dist
     44 	@rm -Rf $(WTS_ACTS_DISTRO_DIR)
     45 	@mkdir -p $(WTS_ACTS_DISTRO_DIR)
     46 	# grab the files from local acts framework and zip them up
     47 	$(hide) find $(WTS_LOCAL_ACTS_DIR) | sort >$@.list
     48 	$(hide) $(SOONG_ZIP) -d -P acts -o $(WTS_ACTS_DISTRO_ARCHIVE) -C tools/test/connectivity/acts/framework/acts/ -l $@.list
     49 	# add in the local wts py files for use with the prebuilt
     50 	$(hide) zip -r $(WTS_ACTS_DISTRO_ARCHIVE) -j tools/test/connectivity/wts-acts/*.py
     51 	# create executable tool from the archive
     52 	$(hide) echo '#!/usr/bin/env python' | cat - $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip > $(WTS_ACTS_DISTRO_DIR)/wts-acts
     53 	$(hide) chmod 755 $(WTS_ACTS_DISTRO)
     54 
     55 wts-acts: $(WTS_ACTS_DISTRO)
     56 
     57 $(call dist-for-goals,tests,$(WTS_ACTS_DISTRO))
     58 
     59 
     60 
     61 endif
     62