Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8eaf94be authored by Paul Duffin's avatar Paul Duffin
Browse files

Add repackaged legacy-test and android.test.runner

The CtsSignatureTestCases test verifies that the API described in the
api/current.txt file is actually available at runtime. The test class,
SignatureTest, requires junit and android.test classes, some from
legacy-test, some from android.test.runner which makes it impossible
(without classpath scanning) for it to verify that those classes are
accessible at runtime when they should be and inaccessible when they
should not be which is needed for the work to remove JUnit from the
Android API.

This change uses jarjar to repackage the junit and android.test classes
into repackaged.junit and repackaged.android.test packages in the
repackaged-legacy-test and repackaged.android.test.runner modules
respectively. A follow on change will switch SignatureTest over to
using the repackaged classes thus allowing it to work even when junit
and android.test classes are not visible.

Tested by making the modules and manually verifying that they contain
the classes in the repackaged package.

Bug: 35192974
Bug: 30188076
Test: see above
Change-Id: If0355a0d50b7540f416d464fdf7ffae0e4766b1c
parent 3594b9f4
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -31,6 +31,20 @@ LOCAL_JAVA_LIBRARIES := core-oj core-libart framework

include $(BUILD_JAVA_LIBRARY)

# Build the repackaged-legacy-test library
# ========================================
# This contains repackaged versions of the classes from legacy-test.
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_MODULE := repackaged-legacy-test
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt

include $(BUILD_STATIC_JAVA_LIBRARY)

# Generate the stub source files for legacy.test.stubs
# ====================================================
include $(CLEAR_VARS)
+2 −0
Original line number Diff line number Diff line
rule junit.** repackaged.junit.@1
rule android.test.** repackaged.android.test.@1
+14 −0
Original line number Diff line number Diff line
@@ -30,6 +30,20 @@ LOCAL_MODULE:= android.test.runner

include $(BUILD_JAVA_LIBRARY)

# Build the repackaged.android.test.runner library
# ================================================
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_JAVA_LIBRARIES := core-oj core-libart framework legacy-test

LOCAL_JARJAR_RULES := $(LOCAL_PATH)/../legacy-test/jarjar-rules.txt

LOCAL_MODULE:= repackaged.android.test.runner

include $(BUILD_STATIC_JAVA_LIBRARY)

# Generate the stub source files for android.test.runner.stubs
# ============================================================
include $(CLEAR_VARS)