intellij.platform.images.copyright as a product module

GitOrigin-RevId: a4042fb1fc45ea773af78be3657e3efe974722a5
This commit is contained in:
Vladimir Krivosheev
2021-12-23 20:37:15 +00:00
committed by intellij-monorepo-bot
parent 024f70dad2
commit 059beaf723
16 changed files with 63 additions and 41 deletions
+1
View File
@@ -737,6 +737,7 @@
<module fileurl="file://$PROJECT_DIR$/platform/platform-util-netty/intellij.platform.ide.util.netty.iml" filepath="$PROJECT_DIR$/platform/platform-util-netty/intellij.platform.ide.util.netty.iml" />
<module fileurl="file://$PROJECT_DIR$/images/intellij.platform.images.iml" filepath="$PROJECT_DIR$/images/intellij.platform.images.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/build-scripts/icons/intellij.platform.images.build.iml" filepath="$PROJECT_DIR$/platform/build-scripts/icons/intellij.platform.images.build.iml" />
<module fileurl="file://$PROJECT_DIR$/images/intellij.platform.images.copyright/intellij.platform.images.copyright.iml" filepath="$PROJECT_DIR$/images/intellij.platform.images.copyright/intellij.platform.images.copyright.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/indexing-api/intellij.platform.indexing.iml" filepath="$PROJECT_DIR$/platform/indexing-api/intellij.platform.indexing.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/indexing-impl/intellij.platform.indexing.impl.iml" filepath="$PROJECT_DIR$/platform/indexing-impl/intellij.platform.indexing.impl.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/inspect/intellij.platform.inspect.iml" filepath="$PROJECT_DIR$/platform/inspect/intellij.platform.inspect.iml" />
@@ -25,5 +25,6 @@
<content>
<module name="intellij.notebooks.visualization"/>
<module name="intellij.platform.feedback"/>
<module name="intellij.platform.images.copyright"/>
</content>
</idea-plugin>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.platform.images" />
<orderEntry type="module" module-name="intellij.copyright" />
<orderEntry type="module" module-name="intellij.platform.core" />
<orderEntry type="module" module-name="intellij.xml.psi.impl" />
</component>
</module>
@@ -1,5 +1,6 @@
<idea-plugin package="org.intellij.images.copyright">
<dependencies>
<plugin id="com.intellij.platform.images"/>
<plugin id="com.intellij.copyright"/>
</dependencies>
-1
View File
@@ -16,6 +16,5 @@
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
<orderEntry type="module" module-name="intellij.copyright" />
</component>
</module>
+7 -8
View File
@@ -1,20 +1,19 @@
<idea-plugin implementation-detail="true">
<idea-plugin implementation-detail="true" package="org.intellij.images">
<vendor>JetBrains</vendor>
<name>Images</name>
<id>com.intellij.platform.images</id>
<description>Adds support for image file type preview, SVG file type contents language</description>
<content>
<module name="intellij.platform.images/copyright"/>
</content>
<extensionPoints>
<extensionPoint qualifiedName="com.intellij.images.themeFilter" interface="org.intellij.images.thumbnail.actions.ThemeFilter" dynamic="true"/>
</extensionPoints>
<resource-bundle>messages.ImagesBundle</resource-bundle>
<depends>com.intellij.modules.lang</depends>
<depends>com.intellij.modules.xml</depends>
<dependencies>
<plugin id="com.intellij.modules.lang"/>
<plugin id="com.intellij.modules.xml"/>
</dependencies>
<extensions defaultExtensionNs="com.intellij">
<fileEditorProvider implementation="org.intellij.images.editor.impl.ImageFileEditorProvider"/>
@@ -67,7 +66,7 @@
<group id="Images.ImageViewActions">
<action class="org.intellij.images.actions.ToggleTransparencyChessboardAction"
id="Images.ToggleTransparencyChessboard"
icon="ImagesIcons.ToggleTransparencyChessboard">
icon="org.intellij.images.ImagesIcons.ToggleTransparencyChessboard">
</action>
<action class="org.intellij.images.editor.actions.SetBackgroundImageAction"
id="Images.SetBackgroundImage">
@@ -1,5 +1,5 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package icons;
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.images;
import com.intellij.ui.IconManager;
import org.jetbrains.annotations.NotNull;
@@ -1,9 +1,9 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.images.fileTypes.impl;
import com.intellij.openapi.fileTypes.UserBinaryFileType;
import icons.ImagesIcons;
import org.intellij.images.ImagesBundle;
import org.intellij.images.ImagesIcons;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
@@ -1,24 +1,10 @@
/*
* Copyright 2000-2017 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.images.fileTypes.impl;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.highlighter.XmlLikeFileType;
import com.intellij.openapi.fileTypes.UIBasedFileType;
import icons.ImagesIcons;
import org.intellij.images.ImagesIcons;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -1,4 +1,4 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.images.thumbnail.impl;
@@ -8,8 +8,8 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowAnchor;
import com.intellij.openapi.wm.ToolWindowManager;
import icons.ImagesIcons;
import org.intellij.images.ImagesBundle;
import org.intellij.images.ImagesIcons;
import org.intellij.images.editor.ImageZoomModel;
import org.intellij.images.editor.actionSystem.ImageEditorActions;
import org.intellij.images.search.TagFilter;
@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.images.ui;
import com.intellij.ide.ui.UISettings;
@@ -6,8 +6,8 @@ import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.JBColor;
import com.intellij.util.ui.StartupUiUtil;
import icons.ImagesIcons;
import org.intellij.images.ImagesBundle;
import org.intellij.images.ImagesIcons;
import org.intellij.images.editor.ImageDocument;
import org.jetbrains.annotations.NonNls;
@@ -1,6 +1,7 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.plugins
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.util.createNonCoalescingXmlStreamReader
import com.intellij.util.lang.UrlClassLoader
import org.codehaus.stax2.XMLStreamReader2
@@ -60,13 +61,24 @@ internal class ClassPathXmlPathResolver(private val classLoader: ClassLoader, va
return descriptor
}
if (isRunningFromSources && path.startsWith("intellij.") && dataLoader is LocalFsDataLoader) {
try {
resource = Files.readAllBytes(dataLoader.basePath.parent.resolve("${path.substring(0, path.length - 4)}/$path"))
if (isRunningFromSources && path.startsWith("intellij.")) {
if (dataLoader is LocalFsDataLoader) {
try {
resource = Files.readAllBytes(dataLoader.basePath.parent.resolve("${path.substring(0, path.length - 4)}/$path"))
}
catch (e: Exception) {
throw RuntimeException("Cannot resolve $path (dataLoader=$dataLoader, classLoader=$classLoader). " +
"Please ensure that project is built (Build -> Build Project).", e)
}
}
catch (e: Exception) {
throw RuntimeException("Cannot resolve $path (dataLoader=$dataLoader, classLoader=$classLoader). " +
"Please ensure that project is built (Build -> Build Project).", e)
else if (dataLoader.emptyDescriptorIfCannotResolve) {
Logger.getInstance(ClassPathXmlPathResolver::class.java).warn(
"Cannot resolve $path (dataLoader=$dataLoader, classLoader=$classLoader). " +
"Please ensure that project is built (Build -> Build Project)."
)
val descriptor = RawPluginDescriptor()
descriptor.`package` = "unresolved.${path.removeSuffix(".xml")}"
return descriptor
}
}
@@ -465,6 +465,9 @@ private fun loadCoreProductPlugin(reader: XMLStreamReader2,
override val pool: ZipFilePool
get() = throw IllegalStateException("must be not called")
override val emptyDescriptorIfCannotResolve: Boolean
get() = true
override fun load(path: String) = throw IllegalStateException("must be not called")
override fun toString() = "product classpath"
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.plugins
import com.intellij.util.lang.ZipFilePool
@@ -12,6 +12,9 @@ import java.nio.file.Path
interface DataLoader {
val pool: ZipFilePool?
val emptyDescriptorIfCannotResolve: Boolean
get() = false
fun isExcludedFromSubSearch(jarFile: Path): Boolean = false
fun load(path: String): InputStream?
@@ -5,6 +5,7 @@
<content>
<module name="intellij.notebooks.visualization"/>
<module name="intellij.platform.images.copyright"/>
</content>
<xi:include href="/META-INF/pycharm-core.xml" xpointer="xpointer(/idea-plugin/*)"/>