aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-04-28 18:14:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-28 18:14:21 +0000
commit0e4b5f43d3e7a24db632d69cbb304da6d4613b66 (patch)
tree1ec84bf6beedd692a352cee70b96285f29df74f4
parent304588e7132964532337484a7041e583affe358a (diff)
parent68af8b89b22020ae4463a2c77003bde4133650cb (diff)
downloadcontrib-0e4b5f43d3e7a24db632d69cbb304da6d4613b66.tar.gz
Merge "Seed aosp tf contrib project."
-rw-r--r--.gitignore3
-rw-r--r--Android.mk67
-rw-r--r--MANIFEST.mf2
-rw-r--r--README.txt5
-rw-r--r--prod-tests/Android.mk45
-rw-r--r--prod-tests/MANIFEST.mf2
-rw-r--r--prod-tests/res/config/example/example.xml28
-rw-r--r--prod-tests/src/com/android/example_test/ExampleTest.java32
-rw-r--r--src/com/android/tradefed/targetprep/ExampleTargetPreparer.java35
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");
+ }
+}