mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IJPL-797 intellij.platform.runtime.repository review internal API
Constructor is replaced by a factory method in RawRuntimeModuleDescriptor. GitOrigin-RevId: d6538ac3444867271aa81900d14143677ccaa538
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cd8348e73b
commit
cebbe13031
@@ -117,7 +117,7 @@ internal fun generateCrossPlatformRepository(distAllPath: Path, osSpecificDistPa
|
||||
context.messages.error("Cannot generate runtime module repository for cross-platform distribution: different dependencies for module '$moduleId', ${descriptor.dependencies} and $commonDependencies")
|
||||
}
|
||||
}
|
||||
commonDescriptors.add(RawRuntimeModuleDescriptor(moduleId, commonResourcePaths.toList(), commonDependencies))
|
||||
commonDescriptors.add(RawRuntimeModuleDescriptor.create(moduleId, commonResourcePaths.toList(), commonDependencies))
|
||||
}
|
||||
val targetFile = context.paths.tempDir.resolve("cross-platform-module-repository").resolve(JAR_REPOSITORY_FILE_NAME)
|
||||
saveModuleRepository(commonDescriptors, targetFile, context)
|
||||
@@ -171,7 +171,7 @@ private fun generateRepositoryForDistribution(
|
||||
val actualResourcePaths = resourcePaths.mapTo(ArrayList()) {
|
||||
if (it.startsWith("$MODULES_DIR_NAME/")) it.removePrefix("$MODULES_DIR_NAME/") else "../$it"
|
||||
}
|
||||
distDescriptors.add(RawRuntimeModuleDescriptor(moduleId.stringId, actualResourcePaths, actualDependencies))
|
||||
distDescriptors.add(RawRuntimeModuleDescriptor.create(moduleId.stringId, actualResourcePaths, actualDependencies))
|
||||
}
|
||||
|
||||
/* include descriptors of aggregating modules which don't have own resources (and therefore don't have DistributionFileEntry),
|
||||
|
||||
@@ -22,7 +22,7 @@ class PluginXmlReaderTest {
|
||||
fun `single module`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("plugin.main", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin.main", listOf("plugin"), emptyList()),
|
||||
)
|
||||
writePluginXml(tempDirectory.rootPath / "plugin",
|
||||
"""
|
||||
@@ -41,8 +41,8 @@ class PluginXmlReaderTest {
|
||||
fun `multiple modules`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("plugin.main", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin.optional", emptyList(), listOf("plugin.main")),
|
||||
RawRuntimeModuleDescriptor.create("plugin.main", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin.optional", emptyList(), listOf("plugin.main")),
|
||||
)
|
||||
@Suppress("XmlUnusedNamespaceDeclaration")
|
||||
writePluginXml(tempDirectory.rootPath / "plugin",
|
||||
|
||||
@@ -26,9 +26,9 @@ class ProductModulesLoaderTest {
|
||||
@Test
|
||||
fun simple() {
|
||||
val repository = createRepository(tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("util", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("root", emptyList(), listOf("util")),
|
||||
RawRuntimeModuleDescriptor("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("util", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("root", emptyList(), listOf("util")),
|
||||
RawRuntimeModuleDescriptor.create("plugin", listOf("plugin"), emptyList()),
|
||||
)
|
||||
writePluginXmlWithModules(tempDirectory.rootPath / "plugin", "<idea-plugin><id>plugin</id></idea-plugin>")
|
||||
val xml = generateProductModulesWithPlugin()
|
||||
@@ -49,9 +49,9 @@ class ProductModulesLoaderTest {
|
||||
@Test
|
||||
fun `optional modules in main module group`() {
|
||||
val repository = createRepository(tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("util", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("root", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("optional", emptyList(), listOf("root")),
|
||||
RawRuntimeModuleDescriptor.create("util", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("root", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("optional", emptyList(), listOf("root")),
|
||||
)
|
||||
val xml = directoryContent {
|
||||
xml(FILE_NAME, """
|
||||
@@ -79,9 +79,9 @@ class ProductModulesLoaderTest {
|
||||
fun `multiple modules in plugin module group`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("root", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("optional", emptyList(), listOf("plugin")),
|
||||
RawRuntimeModuleDescriptor.create("root", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("optional", emptyList(), listOf("plugin")),
|
||||
)
|
||||
writePluginXmlWithModules(tempDirectory.rootPath / "plugin", "plugin", "optional", "unknown")
|
||||
|
||||
@@ -102,13 +102,13 @@ class ProductModulesLoaderTest {
|
||||
fun `enable plugin modules in relevant modes`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("root", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("intellij.platform.frontend", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("intellij.platform.localIde", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin.common", emptyList(), listOf("plugin")),
|
||||
RawRuntimeModuleDescriptor("plugin.frontend", emptyList(), listOf("plugin", "intellij.platform.frontend")),
|
||||
RawRuntimeModuleDescriptor("plugin.localIde", emptyList(), listOf("plugin", "intellij.platform.localIde")),
|
||||
RawRuntimeModuleDescriptor.create("root", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("intellij.platform.frontend", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("intellij.platform.localIde", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin.common", emptyList(), listOf("plugin")),
|
||||
RawRuntimeModuleDescriptor.create("plugin.frontend", emptyList(), listOf("plugin", "intellij.platform.frontend")),
|
||||
RawRuntimeModuleDescriptor.create("plugin.localIde", emptyList(), listOf("plugin", "intellij.platform.localIde")),
|
||||
)
|
||||
writePluginXmlWithModules(tempDirectory.rootPath / "plugin", "plugin", "plugin.common", "plugin.frontend", "plugin.localIde")
|
||||
|
||||
@@ -131,10 +131,10 @@ class ProductModulesLoaderTest {
|
||||
fun inclusion() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("root", listOf("root"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("common.plugin", listOf("common.plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("additional", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("root", listOf("root"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("common.plugin", listOf("common.plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("additional", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin", listOf("plugin"), emptyList()),
|
||||
)
|
||||
writePluginXmlWithModules(tempDirectory.rootPath.resolve("common.plugin"), "common")
|
||||
writePluginXmlWithModules(tempDirectory.rootPath.resolve("plugin"), "plugin")
|
||||
@@ -167,10 +167,10 @@ class ProductModulesLoaderTest {
|
||||
fun `inclusion without some modules`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("root", listOf("root"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("additional", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("plugin2", listOf("plugin2"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("root", listOf("root"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("additional", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin", listOf("plugin"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("plugin2", listOf("plugin2"), emptyList()),
|
||||
)
|
||||
writePluginXmlWithModules(tempDirectory.rootPath.resolve("plugin"), "plugin")
|
||||
writePluginXmlWithModules(tempDirectory.rootPath.resolve("plugin2"), "plugin2")
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
*f:com.intellij.platform.runtime.repository.MalformedRepositoryException
|
||||
- java.lang.RuntimeException
|
||||
- <init>(java.lang.String):V
|
||||
- <init>(java.lang.String,java.lang.Throwable):V
|
||||
*:com.intellij.platform.runtime.repository.RuntimeModuleDescriptor
|
||||
- a:getDependencies():java.util.List
|
||||
- a:getModuleClasspath():java.util.List
|
||||
@@ -28,6 +26,7 @@
|
||||
- a:getResolvedModule():com.intellij.platform.runtime.repository.RuntimeModuleDescriptor
|
||||
*f:com.intellij.platform.runtime.repository.serialization.RawRuntimeModuleDescriptor
|
||||
- <init>(java.lang.String,java.util.List,java.util.List):V
|
||||
- s:create(java.lang.String,java.util.List,java.util.List):com.intellij.platform.runtime.repository.serialization.RawRuntimeModuleDescriptor
|
||||
- equals(java.lang.Object):Z
|
||||
- getDependencies():java.util.List
|
||||
- getId():java.lang.String
|
||||
@@ -35,7 +34,6 @@
|
||||
- hashCode():I
|
||||
- toString():java.lang.String
|
||||
*f:com.intellij.platform.runtime.repository.serialization.RawRuntimeModuleRepositoryData
|
||||
- <init>(java.util.Map,java.nio.file.Path,java.lang.String):V
|
||||
- findDescriptor(java.lang.String):com.intellij.platform.runtime.repository.serialization.RawRuntimeModuleDescriptor
|
||||
- getAllIds():java.util.Set
|
||||
- getBasePath():java.nio.file.Path
|
||||
@@ -1,13 +1,16 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.runtime.repository;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class MalformedRepositoryException extends RuntimeException {
|
||||
@ApiStatus.Internal
|
||||
public MalformedRepositoryException(@NotNull String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
public MalformedRepositoryException(@NotNull String message, @NotNull Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ public final class RawRuntimeModuleDescriptor {
|
||||
private final List<String> myResourcePaths;
|
||||
private final List<String> myDependencies;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #create(String, List, List)} instead
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public RawRuntimeModuleDescriptor(@NotNull String id, @NotNull List<String> resourcePaths, @NotNull List<String> dependencies) {
|
||||
myId = id;
|
||||
myResourcePaths = resourcePaths;
|
||||
@@ -62,4 +66,8 @@ public final class RawRuntimeModuleDescriptor {
|
||||
result = 31 * result + myDependencies.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static @NotNull RawRuntimeModuleDescriptor create(@NotNull String id, @NotNull List<String> resourcePaths, @NotNull List<String> dependencies) {
|
||||
return new RawRuntimeModuleDescriptor(id, resourcePaths, dependencies);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.runtime.repository.serialization;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -20,6 +21,7 @@ public final class RawRuntimeModuleRepositoryData {
|
||||
/**
|
||||
* Use {@link RuntimeModuleRepositorySerialization#loadFromJar(Path)} to create an instance in production code.
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public RawRuntimeModuleRepositoryData(@NotNull Map<String, RawRuntimeModuleDescriptor> descriptors, @NotNull Path basePath, @Nullable String mainPluginModuleId) {
|
||||
myDescriptors = descriptors;
|
||||
myBasePath = basePath;
|
||||
|
||||
@@ -93,6 +93,6 @@ final class ModuleXmlSerializer {
|
||||
if (moduleName == null) {
|
||||
throw new XMLStreamException("Required attribute 'module' is not specified");
|
||||
}
|
||||
return new RawRuntimeModuleDescriptor(moduleName, resources, dependencies);
|
||||
return RawRuntimeModuleDescriptor.create(moduleName, resources, dependencies);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class RepositoryTest {
|
||||
fun `resolved dependencies`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.bar", emptyList(), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", emptyList(), listOf("ij.foo")),
|
||||
)
|
||||
val bar = repository.getModule(RuntimeModuleId.raw("ij.bar"))
|
||||
val foo = repository.getModule(RuntimeModuleId.raw("ij.foo"))
|
||||
@@ -37,9 +37,9 @@ class RepositoryTest {
|
||||
fun `unresolved dependency`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.bar", emptyList(), listOf("ij.foo", "unresolved")),
|
||||
RawRuntimeModuleDescriptor("ij.baz", emptyList(), listOf("ij.bar")),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", emptyList(), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", emptyList(), listOf("ij.foo", "unresolved")),
|
||||
RawRuntimeModuleDescriptor.create("ij.baz", emptyList(), listOf("ij.bar")),
|
||||
)
|
||||
fun RuntimeModuleId.assertUnresolved(vararg pathToFailed: RuntimeModuleId) {
|
||||
val result = repository.resolveModule(this)
|
||||
@@ -63,9 +63,9 @@ class RepositoryTest {
|
||||
fun `circular dependency`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", emptyList(), listOf("ij.bar")),
|
||||
RawRuntimeModuleDescriptor("ij.bar", emptyList(), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor("ij.baz", emptyList(), listOf("ij.bar")),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", emptyList(), listOf("ij.bar")),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", emptyList(), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor.create("ij.baz", emptyList(), listOf("ij.bar")),
|
||||
)
|
||||
val baz = repository.getModule(RuntimeModuleId.raw("ij.baz"))
|
||||
val bar = repository.getModule(RuntimeModuleId.raw("ij.bar"))
|
||||
@@ -79,8 +79,8 @@ class RepositoryTest {
|
||||
fun `relative path`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.bar", listOf("../bar/bar.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", listOf("../bar/bar.jar"), emptyList()),
|
||||
)
|
||||
val foo = repository.getModule(RuntimeModuleId.raw("ij.foo"))
|
||||
assertEquals(listOf(tempDirectory.rootPath.resolve("foo.jar")), foo.resourceRootPaths)
|
||||
@@ -92,7 +92,7 @@ class RepositoryTest {
|
||||
fun `compute resource paths without resolving`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf("foo.jar"), listOf("unresolved")),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf("foo.jar"), listOf("unresolved")),
|
||||
)
|
||||
assertEquals(listOf(tempDirectory.rootPath.resolve("foo.jar")),
|
||||
repository.getModuleResourcePaths(RuntimeModuleId.raw("ij.foo")))
|
||||
@@ -102,8 +102,8 @@ class RepositoryTest {
|
||||
fun `resource path macros`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf("\$PROJECT_DIR$/foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.bar", listOf("\$MAVEN_REPOSITORY$/bar/bar.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf("\$PROJECT_DIR$/foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", listOf("\$MAVEN_REPOSITORY$/bar/bar.jar"), emptyList()),
|
||||
)
|
||||
|
||||
//ensure that tempDirectory will be treated as the project root if 'idea.home.path' isn't specified explicitly
|
||||
@@ -133,7 +133,7 @@ class RepositoryTest {
|
||||
for (path in incorrectPaths) {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf(path), emptyList())
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf(path), emptyList())
|
||||
)
|
||||
val module = repository.getModule(RuntimeModuleId.raw("ij.foo"))
|
||||
assertThrows(MalformedRepositoryException::class.java, { module.resourceRootPaths }, "Path $path is incorrect")
|
||||
@@ -144,10 +144,10 @@ class RepositoryTest {
|
||||
fun `module classpath`() {
|
||||
val repository = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.bar", listOf("bar.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor("ij.baz", listOf("baz.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor("ij.main", emptyList(), listOf("ij.bar", "ij.baz")),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", listOf("bar.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor.create("ij.baz", listOf("baz.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor.create("ij.main", emptyList(), listOf("ij.bar", "ij.baz")),
|
||||
)
|
||||
val classpath = repository.getModule(RuntimeModuleId.raw("ij.main")).moduleClasspath
|
||||
assertEquals(listOf("bar.jar", "foo.jar", "baz.jar").map { tempDirectory.rootPath.resolve(it) }, classpath)
|
||||
@@ -157,8 +157,8 @@ class RepositoryTest {
|
||||
@ValueSource(strings = ["", "ij.foo", "ij.bar"])
|
||||
fun `bootstrap classpath`(storedBootstrapModule: String) {
|
||||
val descriptors = arrayOf(
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.bar", listOf("bar.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.bar", listOf("bar.jar"), listOf("ij.foo")),
|
||||
)
|
||||
val basePath = tempDirectory.rootPath
|
||||
val moduleDescriptorsJarPath = basePath.resolve("module-descriptors.jar")
|
||||
@@ -172,18 +172,18 @@ class RepositoryTest {
|
||||
fun `additional repositories`() {
|
||||
val main = createRepository(
|
||||
tempDirectory.rootPath,
|
||||
RawRuntimeModuleDescriptor("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.foo", listOf("foo.jar"), emptyList()),
|
||||
) as RuntimeModuleRepositoryImpl
|
||||
val additional1Path = tempDirectory.rootPath.resolve("additional1")
|
||||
val additional1 = createRawRepository(
|
||||
additional1Path,
|
||||
RawRuntimeModuleDescriptor("custom1.foo", listOf("custom1-foo.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor("custom1.bar", listOf("custom1-bar.jar"), listOf("custom1.foo")),
|
||||
RawRuntimeModuleDescriptor.create("custom1.foo", listOf("custom1-foo.jar"), listOf("ij.foo")),
|
||||
RawRuntimeModuleDescriptor.create("custom1.bar", listOf("custom1-bar.jar"), listOf("custom1.foo")),
|
||||
)
|
||||
val additional2Path = tempDirectory.rootPath.resolve("additional2")
|
||||
val additional2 = createRawRepository(
|
||||
additional2Path,
|
||||
RawRuntimeModuleDescriptor("custom2", listOf("custom2.jar"), listOf("custom1.bar")),
|
||||
RawRuntimeModuleDescriptor.create("custom2", listOf("custom2.jar"), listOf("custom1.bar")),
|
||||
)
|
||||
main.loadAdditionalRepositories(listOf(additional1, additional2))
|
||||
val moduleId = RuntimeModuleId.raw("custom2")
|
||||
|
||||
@@ -19,7 +19,7 @@ class JarRepositorySerializationTest {
|
||||
|
||||
@Test
|
||||
fun `empty module`() {
|
||||
check(listOf(RawRuntimeModuleDescriptor("ij.platform.util", emptyList(), emptyList()))) {
|
||||
check(listOf(RawRuntimeModuleDescriptor.create("ij.platform.util", emptyList(), emptyList()))) {
|
||||
xml("ij.platform.util.xml", """
|
||||
<module name="ij.platform.util">
|
||||
</module>
|
||||
@@ -29,7 +29,7 @@ class JarRepositorySerializationTest {
|
||||
|
||||
@Test
|
||||
fun `single module`() {
|
||||
check(listOf(RawRuntimeModuleDescriptor("ij.platform.util", listOf("ij-util.jar"), emptyList()))) {
|
||||
check(listOf(RawRuntimeModuleDescriptor.create("ij.platform.util", listOf("ij-util.jar"), emptyList()))) {
|
||||
xml("ij.platform.util.xml", """
|
||||
<module name="ij.platform.util">
|
||||
<resources>
|
||||
@@ -43,8 +43,8 @@ class JarRepositorySerializationTest {
|
||||
@Test
|
||||
fun `two modules`() {
|
||||
check(listOf(
|
||||
RawRuntimeModuleDescriptor("ij.platform.util.rt", listOf("ij-util-rt.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("ij.platform.util", emptyList(), listOf("ij.platform.util.rt")),
|
||||
RawRuntimeModuleDescriptor.create("ij.platform.util.rt", listOf("ij-util-rt.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("ij.platform.util", emptyList(), listOf("ij.platform.util.rt")),
|
||||
)) {
|
||||
xml("ij.platform.util.xml", """
|
||||
<module name="ij.platform.util">
|
||||
@@ -66,8 +66,8 @@ class JarRepositorySerializationTest {
|
||||
@Test
|
||||
fun `bootstrap module classpath`() {
|
||||
check(listOf(
|
||||
RawRuntimeModuleDescriptor("foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor("bar", listOf("bar.jar"), listOf("foo")),
|
||||
RawRuntimeModuleDescriptor.create("foo", listOf("foo.jar"), emptyList()),
|
||||
RawRuntimeModuleDescriptor.create("bar", listOf("bar.jar"), listOf("foo")),
|
||||
), "bar", "bar.jar foo.jar") {
|
||||
xml("foo.xml", """
|
||||
<module name="foo">
|
||||
|
||||
@@ -103,7 +103,7 @@ internal class RuntimeModuleRepositoryBuilder
|
||||
for (library in libraries) {
|
||||
val moduleId = getLibraryId(library)
|
||||
val files = library.getFiles(JpsOrderRootType.COMPILED)
|
||||
descriptors.add(RawRuntimeModuleDescriptor(moduleId.stringId, files.map { relativizer.toRelative(it.absolutePath) }, emptyList()))
|
||||
descriptors.add(RawRuntimeModuleDescriptor.create(moduleId.stringId, files.map { relativizer.toRelative(it.absolutePath) }, emptyList()))
|
||||
}
|
||||
return descriptors
|
||||
}
|
||||
@@ -174,7 +174,7 @@ internal class RuntimeModuleRepositoryBuilder
|
||||
{ dependencies.add(getLibraryId(it).stringId) }
|
||||
)
|
||||
val resourcePaths = if (module.hasProductionSources) listOf("production/${module.name}") else emptyList()
|
||||
return RawRuntimeModuleDescriptor(runtimeModuleNameGenerator(module, false), resourcePaths, dependencies.toList())
|
||||
return RawRuntimeModuleDescriptor.create(runtimeModuleNameGenerator(module, false), resourcePaths, dependencies.toList())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,7 +222,7 @@ internal class RuntimeModuleRepositoryBuilder
|
||||
{ dependencies.add(getLibraryId(it).stringId) }
|
||||
)
|
||||
val resourcePaths = if (module.hasTestSources) listOf("test/${module.name}") else emptyList()
|
||||
return RawRuntimeModuleDescriptor(runtimeModuleNameGenerator(module, true), resourcePaths, dependencies.toList())
|
||||
return RawRuntimeModuleDescriptor.create(runtimeModuleNameGenerator(module, true), resourcePaths, dependencies.toList())
|
||||
}
|
||||
|
||||
private fun addTestDependency(result: MutableCollection<String>,
|
||||
|
||||
@@ -37,7 +37,7 @@ class RawDescriptorListBuilder {
|
||||
}
|
||||
|
||||
fun descriptor(id: String, resources: List<String>, dependencies: List<String>) {
|
||||
descriptors.add(RawRuntimeModuleDescriptor(id, resources, dependencies))
|
||||
descriptors.add(RawRuntimeModuleDescriptor.create(id, resources, dependencies))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user