Search in sources :

Example 1 with LogWrapper

use of com.android.tools.idea.rendering.LogWrapper in project android by JetBrains.

the class FrameworkResourceLoader method load.

@Nullable
public static FrameworkResources load(@NotNull IAndroidTarget myTarget, boolean withLocale) throws IOException {
    final ILogger logger = new LogWrapper(LOG);
    final File resFolder = myTarget.getFile(IAndroidTarget.RESOURCES);
    if (!resFolder.isDirectory()) {
        LOG.error(AndroidBundle.message("android.directory.cannot.be.found.error", resFolder.getPath()));
        return null;
    }
    return loadPlatformResources(resFolder, logger, withLocale);
}
Also used : ILogger(com.android.utils.ILogger) LogWrapper(com.android.tools.idea.rendering.LogWrapper) IAbstractFile(com.android.io.IAbstractFile) File(java.io.File) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with LogWrapper

use of com.android.tools.idea.rendering.LogWrapper in project android by JetBrains.

the class FileResourceRepository method createResourceMerger.

private static ResourceMerger createResourceMerger(File file, String libraryName) {
    ILogger logger = new LogWrapper(LOG);
    ResourceMerger merger = new ResourceMerger(0);
    ResourceSet resourceSet = new ResourceSet(file.getName(), libraryName, false);
    resourceSet.addSource(file);
    resourceSet.setTrackSourcePositions(false);
    try {
        resourceSet.loadFromFiles(logger);
    } catch (DuplicateDataException e) {
        // This should not happen; resourceSet validation is disabled.
        assert false;
    } catch (MergingException e) {
        LOG.warn(e);
    }
    merger.addDataSet(resourceSet);
    return merger;
}
Also used : ILogger(com.android.utils.ILogger) LogWrapper(com.android.tools.idea.rendering.LogWrapper)

Aggregations

LogWrapper (com.android.tools.idea.rendering.LogWrapper)2 ILogger (com.android.utils.ILogger)2 IAbstractFile (com.android.io.IAbstractFile)1 File (java.io.File)1 Nullable (org.jetbrains.annotations.Nullable)1