IDEA project configuration: protobuf converted to repository library

This commit is contained in:
nik
2017-10-12 15:57:55 +03:00
parent 72dfa72d48
commit 91b7b3e720
5 changed files with 15 additions and 11 deletions
+6 -3
View File
@@ -1,9 +1,12 @@
<component name="libraryTable">
<library name="protobuf">
<library name="protobuf" type="repository">
<properties maven-id="com.google.protobuf:protobuf-java:2.5.0" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/protobuf-2.5.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0-sources.jar!/" />
</SOURCES>
</library>
</component>
@@ -24,6 +24,7 @@ configurations {
dependencies {
buildScriptsDeps loadLibraryMavenId("Groovy")
buildScriptsDeps loadLibraryMavenId("cli-parser")
buildScriptsDeps loadLibraryMavenId("protobuf")
}
/**
-1
View File
@@ -40,7 +40,6 @@
<include name="jdom.jar"/>
<include name="log4j.jar"/>
<include name="trove4j.jar"/>
<include name="protobuf*.jar"/>
<include name="netty*.jar"/>
<include name="asm-all.jar"/>
<include name="jgoodies-forms.jar"/>
@@ -15,11 +15,13 @@
*/
package com.intellij.java.psi.resolve
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.application.ex.PathManagerEx
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.vfs.JarFileSystem
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.project.IntelliJProjectConfiguration
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiClassType
@@ -32,7 +34,6 @@ import com.intellij.psi.search.searches.OverridingMethodsSearch
import com.intellij.psi.stubs.StubTreeLoader
import com.intellij.testFramework.PsiTestUtil
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
/**
* @author peter
*/
@@ -62,13 +63,13 @@ class ResolveInLibrariesTest extends JavaCodeInsightFixtureTestCase {
}
void "test inheritance transitivity"() {
def lib = LocalFileSystem.getInstance().refreshAndFindFileByPath(PathManagerEx.getTestDataPath() + "/../../../lib")
def protoJar = lib.children.find { it.name.startsWith("protobuf") }
def protobufJar = IntelliJProjectConfiguration.getJarFromSingleJarProjectLibrary("protobuf")
VirtualFile jarCopy = WriteAction.compute {
JarFileSystem.instance.getLocalVirtualFileFor(protobufJar).copy(this, myFixture.getTempDirFixture().findOrCreateDir("lib"), "protoJar.jar")
}
def jarCopy = myFixture.copyFileToProject(protoJar.path, 'lib/protoJar.jar')
PsiTestUtil.addLibrary(myModule, 'proto1', lib.path, ["/$protoJar.name!/"] as String[], [] as String[])
PsiTestUtil.addLibrary(myModule, 'proto2', jarCopy.parent.path, ["/$jarCopy.name!/"] as String[], [] as String[])
PsiTestUtil.addProjectLibrary(myModule, 'proto1', [protobufJar], [])
PsiTestUtil.addProjectLibrary(myModule, 'proto2', [JarFileSystem.instance.getJarRootForLocalFile(jarCopy)], [])
def scope = GlobalSearchScope.allScope(project)
Binary file not shown.