Merge branch 'develop'

This commit is contained in:
yummylau
2019-12-09 09:38:33 +08:00
2 changed files with 15 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ public class ComponentTransform extends Transform {
@Override
public boolean isIncremental() {
return true;
return CacheDiskUtils.getInstance(project.getBuildDir()).existsStrCache(Constants.PLUGIN_CACHE);
}

View File

@@ -199,6 +199,20 @@ public final class CacheDiskUtils {
return DiskCacheHelper.getDataWithoutDueTime(data);
}
/**
* 判断是否存在 String 文件缓存
* @param key key
* @return true / false
*/
public boolean existsStrCache(String key) {
DiskCacheManager diskCacheManager = getDiskCacheManager();
if (diskCacheManager == null) {
return false;
}
final File file = diskCacheManager.getFileIfExists(TYPE_STRING + key);
return file != null;
}
///////////////////////////////////////////////////////////////////////////
// about String
///////////////////////////////////////////////////////////////////////////