mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
deduplication
This commit is contained in:
+2
-2
@@ -16,9 +16,9 @@
|
||||
package org.jetbrains.jps.incremental.artifacts.instructions;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.PathUtilRt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.JpsPathUtil;
|
||||
import org.jetbrains.jps.indices.IgnoredFileIndex;
|
||||
import org.jetbrains.jps.indices.ModuleExcludeIndex;
|
||||
import org.jetbrains.jps.incremental.artifacts.JarPathUtil;
|
||||
@@ -118,7 +118,7 @@ public abstract class ArtifactCompilerInstructionCreatorBase implements Artifact
|
||||
public boolean accept(@NotNull String fullFilePath, BuildDataManager dataManager) throws IOException {
|
||||
if (myBaseFilter != null && !myBaseFilter.accept(fullFilePath, dataManager)) return false;
|
||||
|
||||
if (myIgnoredFileIndex.isIgnored(JpsPathUtil.getFileName(fullFilePath))) {
|
||||
if (myIgnoredFileIndex.isIgnored(PathUtilRt.getFileName(fullFilePath))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,31 +49,6 @@ public class JpsPathUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
// todo copied from PathUtil
|
||||
@NotNull
|
||||
public static String getFileName(@NotNull String path) {
|
||||
if (path.length() == 0) {
|
||||
return "";
|
||||
}
|
||||
final char c = path.charAt(path.length() - 1);
|
||||
int end = c == '/' || c == '\\' ? path.length() - 1 : path.length();
|
||||
int start = Math.max(path.lastIndexOf('/', end - 1), path.lastIndexOf('\\', end - 1)) + 1;
|
||||
return path.substring(start, end);
|
||||
}
|
||||
|
||||
// todo copied from PathUtil
|
||||
@NotNull
|
||||
public static String getParentPath(@NotNull String path) {
|
||||
if (path.length() == 0) {
|
||||
return "";
|
||||
}
|
||||
int end = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
|
||||
if (end == path.length() - 1) {
|
||||
end = Math.max(path.lastIndexOf('/', end - 1), path.lastIndexOf('\\', end - 1));
|
||||
}
|
||||
return end == -1 ? "" : path.substring(0, end);
|
||||
}
|
||||
|
||||
public static File urlToFile(String url) {
|
||||
return new File(FileUtilRt.toSystemDependentName(urlToPath(url)));
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,6 +4,7 @@ import com.android.sdklib.IAndroidTarget;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.PathUtilRt;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import org.jetbrains.android.compiler.tools.AndroidApkBuilder;
|
||||
@@ -14,7 +15,6 @@ import org.jetbrains.android.util.AndroidNativeLibData;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.JpsPathUtil;
|
||||
import org.jetbrains.jps.ProjectPaths;
|
||||
import org.jetbrains.jps.android.builder.AndroidProjectBuildTarget;
|
||||
import org.jetbrains.jps.android.model.JpsAndroidModuleExtension;
|
||||
@@ -534,7 +534,7 @@ public class AndroidPackagingBuilder extends TargetBuilder<AndroidProjectBuildTa
|
||||
!releasePackage, 0, new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File pathname) {
|
||||
return !ignoredFileIndex.isIgnored(JpsPathUtil.getFileName(pathname.getPath()));
|
||||
return !ignoredFileIndex.isIgnored(PathUtilRt.getFileName(pathname.getPath()));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user