Search in sources :

Example 1 with FolderWrapper

use of com.android.io.FolderWrapper in project android_frameworks_base by DirtyUnicorns.

the class Main method setUp.

/**
     * Initialize the bridge and the resource maps.
     */
@BeforeClass
public static void setUp() {
    File data_dir = new File(PLATFORM_DIR, "data");
    File res = new File(data_dir, "res");
    sFrameworkRepo = new FrameworkResources(new FolderWrapper(res));
    sFrameworkRepo.loadResources();
    sFrameworkRepo.loadPublicResources(getLogger());
    sProjectResources = new ResourceRepository(new FolderWrapper(TEST_RES_DIR + APP_TEST_RES), false) {

        @NonNull
        @Override
        protected ResourceItem createResourceItem(@NonNull String name) {
            return new ResourceItem(name);
        }
    };
    sProjectResources.loadResources();
    File fontLocation = new File(data_dir, "fonts");
    File buildProp = new File(PLATFORM_DIR, "build.prop");
    File attrs = new File(res, "values" + File.separator + "attrs.xml");
    sBridge = new Bridge();
    sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, ConfigGenerator.getEnumMap(attrs), getLayoutLog());
}
Also used : FrameworkResources(com.android.ide.common.resources.FrameworkResources) NonNull(android.annotation.NonNull) FolderWrapper(com.android.io.FolderWrapper) ResourceRepository(com.android.ide.common.resources.ResourceRepository) ResourceItem(com.android.ide.common.resources.ResourceItem) File(java.io.File) Bridge(com.android.layoutlib.bridge.Bridge) BeforeClass(org.junit.BeforeClass)

Example 2 with FolderWrapper

use of com.android.io.FolderWrapper in project android_frameworks_base by AOSPA.

the class Main method setUp.

/**
     * Initialize the bridge and the resource maps.
     */
@BeforeClass
public static void setUp() {
    File data_dir = new File(PLATFORM_DIR, "data");
    File res = new File(data_dir, "res");
    sFrameworkRepo = new FrameworkResources(new FolderWrapper(res));
    sFrameworkRepo.loadResources();
    sFrameworkRepo.loadPublicResources(getLogger());
    sProjectResources = new ResourceRepository(new FolderWrapper(TEST_RES_DIR + APP_TEST_RES), false) {

        @NonNull
        @Override
        protected ResourceItem createResourceItem(@NonNull String name) {
            return new ResourceItem(name);
        }
    };
    sProjectResources.loadResources();
    File fontLocation = new File(data_dir, "fonts");
    File buildProp = new File(PLATFORM_DIR, "build.prop");
    File attrs = new File(res, "values" + File.separator + "attrs.xml");
    sBridge = new Bridge();
    sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, ConfigGenerator.getEnumMap(attrs), getLayoutLog());
}
Also used : FrameworkResources(com.android.ide.common.resources.FrameworkResources) NonNull(android.annotation.NonNull) FolderWrapper(com.android.io.FolderWrapper) ResourceRepository(com.android.ide.common.resources.ResourceRepository) ResourceItem(com.android.ide.common.resources.ResourceItem) File(java.io.File) Bridge(com.android.layoutlib.bridge.Bridge) BeforeClass(org.junit.BeforeClass)

Example 3 with FolderWrapper

use of com.android.io.FolderWrapper in project android_frameworks_base by ResurrectionRemix.

the class Main method setUp.

/**
     * Initialize the bridge and the resource maps.
     */
@BeforeClass
public static void setUp() {
    File data_dir = new File(PLATFORM_DIR, "data");
    File res = new File(data_dir, "res");
    sFrameworkRepo = new FrameworkResources(new FolderWrapper(res));
    sFrameworkRepo.loadResources();
    sFrameworkRepo.loadPublicResources(getLogger());
    sProjectResources = new ResourceRepository(new FolderWrapper(TEST_RES_DIR + APP_TEST_RES), false) {

        @NonNull
        @Override
        protected ResourceItem createResourceItem(@NonNull String name) {
            return new ResourceItem(name);
        }
    };
    sProjectResources.loadResources();
    File fontLocation = new File(data_dir, "fonts");
    File buildProp = new File(PLATFORM_DIR, "build.prop");
    File attrs = new File(res, "values" + File.separator + "attrs.xml");
    sBridge = new Bridge();
    sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, ConfigGenerator.getEnumMap(attrs), getLayoutLog());
}
Also used : FrameworkResources(com.android.ide.common.resources.FrameworkResources) NonNull(android.annotation.NonNull) FolderWrapper(com.android.io.FolderWrapper) ResourceRepository(com.android.ide.common.resources.ResourceRepository) ResourceItem(com.android.ide.common.resources.ResourceItem) File(java.io.File) Bridge(com.android.layoutlib.bridge.Bridge) BeforeClass(org.junit.BeforeClass)

Example 4 with FolderWrapper

use of com.android.io.FolderWrapper in project android_frameworks_base by crdroidandroid.

the class Main method setUp.

/**
     * Initialize the bridge and the resource maps.
     */
@BeforeClass
public static void setUp() {
    File data_dir = new File(PLATFORM_DIR, "data");
    File res = new File(data_dir, "res");
    sFrameworkRepo = new FrameworkResources(new FolderWrapper(res));
    sFrameworkRepo.loadResources();
    sFrameworkRepo.loadPublicResources(getLogger());
    sProjectResources = new ResourceRepository(new FolderWrapper(TEST_RES_DIR + APP_TEST_RES), false) {

        @NonNull
        @Override
        protected ResourceItem createResourceItem(@NonNull String name) {
            return new ResourceItem(name);
        }
    };
    sProjectResources.loadResources();
    File fontLocation = new File(data_dir, "fonts");
    File buildProp = new File(PLATFORM_DIR, "build.prop");
    File attrs = new File(res, "values" + File.separator + "attrs.xml");
    sBridge = new Bridge();
    sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, ConfigGenerator.getEnumMap(attrs), getLayoutLog());
}
Also used : FrameworkResources(com.android.ide.common.resources.FrameworkResources) NonNull(android.annotation.NonNull) FolderWrapper(com.android.io.FolderWrapper) ResourceRepository(com.android.ide.common.resources.ResourceRepository) ResourceItem(com.android.ide.common.resources.ResourceItem) File(java.io.File) Bridge(com.android.layoutlib.bridge.Bridge) BeforeClass(org.junit.BeforeClass)

Example 5 with FolderWrapper

use of com.android.io.FolderWrapper in project platform_frameworks_base by android.

the class Main method setUp.

/**
     * Initialize the bridge and the resource maps.
     */
@BeforeClass
public static void setUp() {
    File data_dir = new File(PLATFORM_DIR, "data");
    File res = new File(data_dir, "res");
    sFrameworkRepo = new FrameworkResources(new FolderWrapper(res));
    sFrameworkRepo.loadResources();
    sFrameworkRepo.loadPublicResources(getLogger());
    sProjectResources = new ResourceRepository(new FolderWrapper(TEST_RES_DIR + APP_TEST_RES), false) {

        @NonNull
        @Override
        protected ResourceItem createResourceItem(@NonNull String name) {
            return new ResourceItem(name);
        }
    };
    sProjectResources.loadResources();
    File fontLocation = new File(data_dir, "fonts");
    File buildProp = new File(PLATFORM_DIR, "build.prop");
    File attrs = new File(res, "values" + File.separator + "attrs.xml");
    sBridge = new Bridge();
    sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, ConfigGenerator.getEnumMap(attrs), getLayoutLog());
}
Also used : FrameworkResources(com.android.ide.common.resources.FrameworkResources) NonNull(android.annotation.NonNull) FolderWrapper(com.android.io.FolderWrapper) ResourceRepository(com.android.ide.common.resources.ResourceRepository) ResourceItem(com.android.ide.common.resources.ResourceItem) File(java.io.File) Bridge(com.android.layoutlib.bridge.Bridge) BeforeClass(org.junit.BeforeClass)

Aggregations

NonNull (android.annotation.NonNull)5 FrameworkResources (com.android.ide.common.resources.FrameworkResources)5 ResourceItem (com.android.ide.common.resources.ResourceItem)5 ResourceRepository (com.android.ide.common.resources.ResourceRepository)5 FolderWrapper (com.android.io.FolderWrapper)5 Bridge (com.android.layoutlib.bridge.Bridge)5 File (java.io.File)5 BeforeClass (org.junit.BeforeClass)5