mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not create empty jars
This commit is contained in:
+6
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,6 +34,7 @@ import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.util.PathsList;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.idea.maven.MavenImportingTestCase;
|
||||
import org.jetbrains.idea.maven.importing.ArtifactsDownloadingTestCase;
|
||||
import org.jetbrains.idea.maven.importing.MavenModuleImporter;
|
||||
|
||||
import java.io.File;
|
||||
@@ -1123,7 +1124,10 @@ public class MavenClasspathsAndSearchScopesTest extends MavenImportingTestCase {
|
||||
}
|
||||
|
||||
private void createRepositoryFile(String filePath) throws IOException {
|
||||
createProjectSubFile("repo/" + filePath);
|
||||
File f = new File(getProjectPath(), "repo/" + filePath);
|
||||
f.getParentFile().mkdirs();
|
||||
|
||||
ArtifactsDownloadingTestCase.createEmptyJar(f.getParent(), f.getName());
|
||||
setRepositoryPath(createProjectSubDir("repo").getPath());
|
||||
}
|
||||
|
||||
|
||||
+7
-2
@@ -18,6 +18,7 @@ package org.jetbrains.idea.maven.importing;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.maven.MavenCustomRepositoryHelper;
|
||||
import org.jetbrains.idea.maven.MavenImportingTestCase;
|
||||
|
||||
@@ -34,8 +35,12 @@ public abstract class ArtifactsDownloadingTestCase extends MavenImportingTestCas
|
||||
}
|
||||
|
||||
protected void createDummyArtifact(String remoteRepo, String name) throws IOException {
|
||||
FileUtil.writeToFile(new File(remoteRepo, name), PlatformTestUtil.EMPTY_JAR_BYTES);
|
||||
createEmptyJar(remoteRepo, name);
|
||||
}
|
||||
|
||||
FileUtil.writeToFile(new File(remoteRepo, name + ".sha1"), ("b04f3ee8f5e43fa3b162981b50bb72fe1acabb33 " + name).getBytes(CharsetToolkit.UTF8_CHARSET));
|
||||
public static void createEmptyJar(@NotNull String dir, @NotNull String name) throws IOException {
|
||||
FileUtil.writeToFile(new File(dir, name), PlatformTestUtil.EMPTY_JAR_BYTES);
|
||||
|
||||
FileUtil.writeToFile(new File(dir, name + ".sha1"), ("b04f3ee8f5e43fa3b162981b50bb72fe1acabb33 " + name).getBytes(CharsetToolkit.UTF8_CHARSET));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user