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

Commit fea51feb authored by Deepanshu Gupta's avatar Deepanshu Gupta
Browse files

Fix Tests after cherry picks. [DO NOT MERGE]

1. Updated the intelliJ run configuration for the layoutlib_create tool.
2. Updated the code to search for the platform.dir.
3. Update tests to use AppTheme and Target SDK 19

Change-Id: I6f1cc6ff2a53e4474c746537029c7f89c6dd6dc1
(cherry picked from commit 8592eeafd01370d1a17e34602290becf7f611c75)
parent 98a03e77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
    <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
    <option name="MAIN_CLASS_NAME" value="com.android.tools.layoutlib.create.Main" />
    <option name="VM_PARAMETERS" value="" />
    <option name="PROGRAM_PARAMETERS" value="out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar" />
    <option name="PROGRAM_PARAMETERS" value="out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar" />
    <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../../../../" />
    <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
    <option name="ALTERNATIVE_JRE_PATH" value="1.6" />
+4 −4
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ public class Main {
        if (!out.isDirectory()) {
            return null;
        }
        File sdkDir = new File(out, "sdk" + File.separator + "sdk");
        File sdkDir = new File(out, "sdk");
        if (!sdkDir.isDirectory()) {
            // The directory we thought that should contain the sdk is not a directory.
            return null;
@@ -283,14 +283,14 @@ public class Main {
    }

    /**
     * Uses Theme.Material and Target sdk version as 21.
     * Uses AppTheme and Target sdk version as 19.
     */
    private SessionParams getSessionParams(LayoutPullParser layoutParser,
            ConfigGenerator configGenerator, LayoutLibTestCallback layoutLibCallback) {
        FolderConfiguration config = configGenerator.getFolderConfig();
        ResourceResolver resourceResolver =
                ResourceResolver.create(mProjectResources.getConfiguredResources(config),
                        mFrameworkRepo.getConfiguredResources(config), "Theme.Material", false);
                        mFrameworkRepo.getConfiguredResources(config), "AppTheme", true);

        return new SessionParams(
                layoutParser,
@@ -300,7 +300,7 @@ public class Main {
                resourceResolver,
                layoutLibCallback,
                0,
                21, // TODO: Make it more configurable to run tests for various versions.
                19, // TODO: Make it more configurable to run tests for various versions.
                getLayoutLog());
    }