diff options
author | Kevin Cheng <kevcheng@google.com> | 2017-05-05 16:00:52 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 16:00:52 +0000 |
commit | 6df0cdf68f3fb2b0fd8fb3f3689d88e9435a3372 (patch) | |
tree | 1ec84bf6beedd692a352cee70b96285f29df74f4 | |
parent | b850921fbd64eb76348cba393ba5e72a4a715775 (diff) | |
parent | 0b0e7d254039081f40461b4d8a4ddb0910c3be59 (diff) | |
download | contrib-6df0cdf68f3fb2b0fd8fb3f3689d88e9435a3372.tar.gz |
Seed aosp tf contrib project.
am: 0b0e7d2540
Change-Id: I996d0cb9bbcef50c160a35267c4520491f067270
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Android.mk | 67 | ||||
-rw-r--r-- | MANIFEST.mf | 2 | ||||
-rw-r--r-- | README.txt | 5 | ||||
-rw-r--r-- | prod-tests/Android.mk | 45 | ||||
-rw-r--r-- | prod-tests/MANIFEST.mf | 2 | ||||
-rw-r--r-- | prod-tests/res/config/example/example.xml | 28 | ||||
-rw-r--r-- | prod-tests/src/com/android/example_test/ExampleTest.java | 32 | ||||
-rw-r--r-- | src/com/android/tradefed/targetprep/ExampleTargetPreparer.java | 35 |
9 files changed, 219 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..382f14b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.class +*.uml~ +bin diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..79446a1 --- /dev/null +++ b/Android.mk @@ -0,0 +1,67 @@ +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed 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. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +# Only compile source java files in this lib. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +# LOCAL_JAVA_RESOURCE_DIRS := res + +LOCAL_JAVACFLAGS += -g -Xlint + +LOCAL_MODULE := tradefed-contrib + +LOCAL_MODULE_TAGS := optional +LOCAL_JAVA_LIBRARIES := tradefed tools-common-prebuilt + +LOCAL_JAR_MANIFEST := MANIFEST.mf + +include $(BUILD_HOST_JAVA_LIBRARY) + +# makefile rules to copy jars to HOST_OUT/tradefed +# so tradefed.sh can automatically add to classpath +DEST_JAR := $(HOST_OUT)/tradefed/$(LOCAL_MODULE).jar +$(DEST_JAR): $(LOCAL_BUILT_MODULE) + $(copy-file-to-new-target) + +# this dependency ensure the above rule will be executed if jar is built +$(LOCAL_INSTALLED_MODULE) : $(DEST_JAR) + +####################################################### +# intentionally skipping CLEAR_VARS + +# Enable the build process to generate javadoc +# We need to reference symbols in the jar built above. +LOCAL_JAVA_LIBRARIES += tradefed +LOCAL_IS_HOST_MODULE:=true +LOCAL_MODULE_CLASS := JAVA_LIBRARIES +LOCAL_ADDITIONAL_DEPENDENCIES := tradefed +LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sac +LOCAL_DROIDDOC_OPTIONS:= \ + -package \ + -toroot / \ + -hdf android.whichdoc online \ + -hdf sac true \ + -hdf devices true \ + -showAnnotationOverridesVisibility \ + -showAnnotation com.android.tradefed.config.OptionClass \ + -showAnnotation com.android.tradefed.config.Option \ + +include $(BUILD_DROIDDOC) + +# Build all sub-directories +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/MANIFEST.mf b/MANIFEST.mf new file mode 100644 index 0000000..4bd2094 --- /dev/null +++ b/MANIFEST.mf @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Implementation-Version: %BUILD_NUMBER% diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..b92469d --- /dev/null +++ b/README.txt @@ -0,0 +1,5 @@ +This is the home for non-core src that belongs in the aosp extensions to Trade Federation. + +Non-core is defined as code that makes use of the Trade Federation framework +like tests, configs, preparers and etc. They are non-critical to the +functionality of the framework itself. diff --git a/prod-tests/Android.mk b/prod-tests/Android.mk new file mode 100644 index 0000000..c43b285 --- /dev/null +++ b/prod-tests/Android.mk @@ -0,0 +1,45 @@ +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed 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. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +# Only compile source java files in this lib. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_JAVA_RESOURCE_DIRS := res + +LOCAL_JAVACFLAGS += -g -Xlint -Werror + +LOCAL_MODULE := tf-contrib-prod-tests + +LOCAL_MODULE_TAGS := optional +LOCAL_JAVA_LIBRARIES := tradefed tf-prod-tests + +LOCAL_JAR_MANIFEST := MANIFEST.mf + +include $(BUILD_HOST_JAVA_LIBRARY) + +# makefile rules to copy jars to HOST_OUT/tradefed +# so tradefed.sh can automatically add to classpath +DEST_JAR := $(HOST_OUT)/tradefed/$(LOCAL_MODULE).jar +$(DEST_JAR): $(LOCAL_BUILT_MODULE) + $(copy-file-to-new-target) + +# this dependency ensure the above rule will be executed if jar is built +$(LOCAL_INSTALLED_MODULE) : $(DEST_JAR) + +# Build all sub-directories +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/prod-tests/MANIFEST.mf b/prod-tests/MANIFEST.mf new file mode 100644 index 0000000..4bd2094 --- /dev/null +++ b/prod-tests/MANIFEST.mf @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Implementation-Version: %BUILD_NUMBER% diff --git a/prod-tests/res/config/example/example.xml b/prod-tests/res/config/example/example.xml new file mode 100644 index 0000000..14d3378 --- /dev/null +++ b/prod-tests/res/config/example/example.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2017 The Android Open Source Project + + Licensed 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. +--> +<!-- TODO: Delete when real configs make it here. --> +<configuration description="Example test config."> + <!-- Some option for the whole configuration. --> + <option name="test-tag" value="example-test" /> + + <!-- Example test that will be ran. --> + <test class="com.android.tradefed.ExampleTest" /> + + <!-- Example target preparer used. --> + <target_preparer class="com.android.tradefed.targetprep.ExampleTargetPreparer" /> + +</configuration> + diff --git a/prod-tests/src/com/android/example_test/ExampleTest.java b/prod-tests/src/com/android/example_test/ExampleTest.java new file mode 100644 index 0000000..dd73be2 --- /dev/null +++ b/prod-tests/src/com/android/example_test/ExampleTest.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed 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. + */ +package com.android.tradefed; + +import com.android.tradefed.device.DeviceNotAvailableException; +import com.android.tradefed.log.LogUtil.CLog; +import com.android.tradefed.result.ITestInvocationListener; +import com.android.tradefed.testtype.IRemoteTest; + +/** + * Example test to seed Trade Federation Contrib project. + */ +// TODO: Delete when real tests make it here. +public class ExampleTest implements IRemoteTest { + @Override + public void run(ITestInvocationListener listener) throws DeviceNotAvailableException { + CLog.i("AOSP example test says Hello!"); + } +} diff --git a/src/com/android/tradefed/targetprep/ExampleTargetPreparer.java b/src/com/android/tradefed/targetprep/ExampleTargetPreparer.java new file mode 100644 index 0000000..0aa6343 --- /dev/null +++ b/src/com/android/tradefed/targetprep/ExampleTargetPreparer.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed 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. + */ +package com.android.tradefed.targetprep; + +import com.android.ddmlib.Log; +import com.android.tradefed.build.IBuildInfo; +import com.android.tradefed.device.ITestDevice; + +/** + * Placeholder empty implementation of a {@link ITargetPreparer}. + */ +// TODO: Delete when real target preparers live here. +public class ExampleTargetPreparer implements ITargetPreparer { + + /** + * {@inheritDoc} + */ + @Override + public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError { + Log.d("TargetPreparer", "Not doing anything because I'm just an example"); + } +} |