[java-frontend] IDEA-366600 Get rid of additional "Java for JetBrains Client" plugin

- extract copyright

GitOrigin-RevId: 19b066c5a28c526411898b1aff56d957c98b6965
This commit is contained in:
Mikhail Pyltsin
2025-12-29 11:57:33 +01:00
committed by intellij-monorepo-bot
parent 9cf0c2e699
commit 403b7a886f
21 changed files with 155 additions and 59 deletions

2
.idea/modules.xml generated
View File

@@ -485,6 +485,7 @@
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/ant/intellij.groovy.ant.iml" filepath="$PROJECT_DIR$/plugins/groovy/ant/intellij.groovy.ant.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/byteCodeViewer/intellij.groovy.byteCodeViewer.iml" filepath="$PROJECT_DIR$/plugins/groovy/byteCodeViewer/intellij.groovy.byteCodeViewer.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/rt-constants/intellij.groovy.constants.rt.iml" filepath="$PROJECT_DIR$/plugins/groovy/rt-constants/intellij.groovy.constants.rt.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/intellij.groovy.copyright/intellij.groovy.copyright.iml" filepath="$PROJECT_DIR$/plugins/groovy/intellij.groovy.copyright/intellij.groovy.copyright.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/dev/intellij.groovy.dev/intellij.groovy.dev.iml" filepath="$PROJECT_DIR$/plugins/dev/intellij.groovy.dev/intellij.groovy.dev.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/git/intellij.groovy.git.iml" filepath="$PROJECT_DIR$/plugins/groovy/git/intellij.groovy.git.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/groovy/jps-plugin/intellij.groovy.jps.iml" filepath="$PROJECT_DIR$/plugins/groovy/jps-plugin/intellij.groovy.jps.iml" />
@@ -524,6 +525,7 @@
<module fileurl="file://$PROJECT_DIR$/java/compiler/instrumentation-util/intellij.java.compiler.instrumentationUtil.iml" filepath="$PROJECT_DIR$/java/compiler/instrumentation-util/intellij.java.compiler.instrumentationUtil.iml" />
<module fileurl="file://$PROJECT_DIR$/java/compiler/instrumentation-util-8/intellij.java.compiler.instrumentationUtil.java8.iml" filepath="$PROJECT_DIR$/java/compiler/instrumentation-util-8/intellij.java.compiler.instrumentationUtil.java8.iml" />
<module fileurl="file://$PROJECT_DIR$/java/compiler/intellij.java.compiler.tests.iml" filepath="$PROJECT_DIR$/java/compiler/intellij.java.compiler.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/java/java-copyright/intellij.java.copyright.iml" filepath="$PROJECT_DIR$/java/java-copyright/intellij.java.copyright.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/coverage/intellij.java.coverage.iml" filepath="$PROJECT_DIR$/plugins/coverage/intellij.java.coverage.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/coverage/coverage_rt/intellij.java.coverage.rt.iml" filepath="$PROJECT_DIR$/plugins/coverage/coverage_rt/intellij.java.coverage.rt.iml" />
<module fileurl="file://$PROJECT_DIR$/java/debugger/openapi/intellij.java.debugger.iml" filepath="$PROJECT_DIR$/java/debugger/openapi/intellij.java.debugger.iml" />

View File

@@ -303,6 +303,7 @@ java/ide-resources
java/idea-ui
java/java-analysis-api
java/java-analysis-impl
java/java-copyright
java/java-features-trainer
java/java-frontback-impl
java/java-frontback-psi-api
@@ -1001,6 +1002,7 @@ plugins/groovy/byteCodeViewer
plugins/groovy/git
plugins/groovy/groovy-psi
plugins/groovy/groovy-uast-tests
plugins/groovy/intellij.groovy.copyright
plugins/groovy/jps-plugin
plugins/groovy/rt
plugins/groovy/rt-constants

View File

@@ -0,0 +1,24 @@
### auto-generated section `build intellij.java.copyright` start
load("@rules_jvm//:jvm.bzl", "jvm_library", "resourcegroup")
resourcegroup(
name = "copyright_resources",
srcs = glob(["resources/**/*"]),
strip_prefix = "resources"
)
jvm_library(
name = "copyright",
module_name = "intellij.java.copyright",
visibility = ["//visibility:public"],
srcs = glob(["src/**/*.kt", "src/**/*.java", "src/**/*.form"], allow_empty = True),
resources = [":copyright_resources"],
deps = [
"@lib//:jetbrains-annotations",
"//plugins/copyright",
"//platform/core-api:core",
"//java/java-psi-api:psi",
"//platform/util",
]
)
### auto-generated section `build intellij.java.copyright` end

View File

@@ -0,0 +1,17 @@
<?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="library" name="jetbrains-annotations" level="project" />
<orderEntry type="module" module-name="intellij.copyright" />
<orderEntry type="module" module-name="intellij.platform.core" />
<orderEntry type="module" module-name="intellij.java.psi" />
<orderEntry type="module" module-name="intellij.platform.util" />
</component>
</module>

View File

@@ -1,4 +1,11 @@
<idea-plugin>
<idea-plugin visibility="public">
<dependencies>
<plugin id="com.intellij.copyright"/>
<module name="intellij.java.psi"/>
<module name="intellij.platform.backend"/>
</dependencies>
<extensions defaultExtensionNs="com.intellij.copyright">
<updater filetype="JAVA" implementationClass="com.intellij.copyright.UpdateJavaFileCopyright$UpdateJavaCopyrightsProvider"/>
<updater filetype="SPI" implementationClass="com.intellij.copyright.UpdateSPIFileCopyright"/>

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.copyright;
import com.intellij.openapi.module.Module;

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.copyright;
import com.intellij.openapi.diagnostic.Logger;

View File

@@ -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-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.copyright;
import com.intellij.lang.spi.SPILanguage;

View File

@@ -82,7 +82,6 @@ jvm_library(
"//platform/diff-impl",
"@lib//:java-impl-completion-ranking-java",
"//platform/util/jdom",
"//plugins/copyright",
"//libraries/stream",
"//platform/statistics",
"//libraries/fastutil",
@@ -190,8 +189,6 @@ jvm_library(
"//platform/diff-impl",
"@lib//:java-impl-completion-ranking-java",
"//platform/util/jdom",
"//plugins/copyright",
"//plugins/copyright:copyright_test_lib",
"//libraries/stream",
"//platform/statistics",
"//platform/statistics:statistics_test_lib",

View File

@@ -105,7 +105,6 @@
</library>
</orderEntry>
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
<orderEntry type="module" module-name="intellij.copyright" />
<orderEntry type="module" module-name="intellij.libraries.stream" />
<orderEntry type="module" module-name="intellij.platform.statistics" exported="" />
<orderEntry type="module" module-name="intellij.libraries.fastutil" />

View File

@@ -108,6 +108,9 @@
files:
- name: $MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-metadata-jvm/2/kotlin-metadata-jvm-2.jar
reason: withProjectLibrary
- name: lib/modules/intellij.java.copyright.jar
contentModules:
- name: intellij.java.copyright
- name: lib/modules/intellij.java.debugger.impl.frontend.jar
contentModules:
- name: intellij.java.debugger.impl.frontend

View File

@@ -22,8 +22,6 @@
<module name="intellij.regexp"/>
</dependencies>
<depends optional="true" config-file="java-copyright.xml">com.intellij.copyright</depends>
<xi:include href="/META-INF/JavaPlugin.xml"/>
<content namespace="jetbrains">
@@ -55,6 +53,8 @@
<module name="intellij.java.jam.impl"/>
<module name="intellij.profiler.ultimate"/>
<module name="intellij.jvm.dfa.analysis.ui"/>
<module name="intellij.java.copyright"/>
</content>
<depends optional="true" config-file="intellij.java.remoteServers.impl.xml">com.intellij.modules.remoteServers</depends>

View File

@@ -0,0 +1,27 @@
### auto-generated section `build intellij.groovy.copyright` start
load("@rules_jvm//:jvm.bzl", "jvm_library", "resourcegroup")
resourcegroup(
name = "copyright_resources",
srcs = glob(["resources/**/*"]),
strip_prefix = "resources"
)
jvm_library(
name = "copyright",
module_name = "intellij.groovy.copyright",
visibility = ["//visibility:public"],
srcs = glob(["src/**/*.kt", "src/**/*.java", "src/**/*.form"], allow_empty = True),
resources = [":copyright_resources"],
deps = [
"//plugins/copyright",
"//plugins/groovy/groovy-psi:psi",
"//platform/core-api:core",
"//java/java-copyright:copyright",
"//java/java-psi-api:psi",
"//platform/util",
"@lib//:kotlin-stdlib",
"//platform/core-impl",
]
)
### auto-generated section `build intellij.groovy.copyright` end

View File

@@ -0,0 +1,20 @@
<?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.copyright" />
<orderEntry type="module" module-name="intellij.groovy.psi" />
<orderEntry type="module" module-name="intellij.platform.core" />
<orderEntry type="module" module-name="intellij.java.copyright" />
<orderEntry type="module" module-name="intellij.java.psi" />
<orderEntry type="module" module-name="intellij.platform.util" />
<orderEntry type="library" name="kotlin-stdlib" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.impl" />
</component>
</module>

View File

@@ -0,0 +1,12 @@
<idea-plugin visibility="public">
<dependencies>
<module name="intellij.java.copyright"/>
<plugin id="com.intellij.copyright"/>
<plugin id="org.intellij.groovy"/>
</dependencies>
<extensions defaultExtensionNs="com.intellij.copyright">
<updater filetype="Groovy" implementationClass="org.intellij.groovy.copyright.UpdateGroovyCopyrightsProvider"/>
<variablesProvider filetype="Groovy" implementationClass="org.intellij.groovy.copyright.GroovyCopyrightVariablesProvider"/>
</extensions>
</idea-plugin>

View File

@@ -0,0 +1,29 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.groovy.copyright
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import com.maddyhome.idea.copyright.pattern.CopyrightVariablesProvider
import com.maddyhome.idea.copyright.pattern.FileInfo
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile
class GroovyCopyrightVariablesProvider : CopyrightVariablesProvider() {
override fun collectVariables(
context: MutableMap<String?, Any?>,
project: Project?,
module: com.intellij.openapi.module.Module?,
file: PsiFile,
) {
if (file !is GroovyFile) return
context["file"] = object : FileInfo(file) {
override fun getQualifiedClassName() = getClazz()?.qualifiedName ?: super.getQualifiedClassName()
override fun getClassName(): String = getClazz()?.name ?: super.getClassName()
private fun getClazz() = if (file.isScript) file.scriptClass else file.classes.firstOrNull()
}
}
}

View File

@@ -1,6 +1,6 @@
// 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-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.plugins.groovy.copyright;
package org.intellij.groovy.copyright;
import com.intellij.copyright.UpdateJavaFileCopyright;
import com.intellij.openapi.fileTypes.FileType;

View File

@@ -22,6 +22,9 @@
- name: lib/groovy-spock-rt.jar
modules:
- name: intellij.groovy.spock.rt
- name: lib/modules/intellij.groovy.copyright.jar
contentModules:
- name: intellij.groovy.copyright
- name: lib/modules/intellij.groovy.ant.jar
contentModules:
- name: intellij.groovy.ant

View File

@@ -1,6 +0,0 @@
<idea-plugin package="org.jetbrains.plugins.groovy.copyright">
<extensions defaultExtensionNs="com.intellij.copyright">
<updater filetype="Groovy" implementationClass="org.jetbrains.plugins.groovy.copyright.UpdateGroovyCopyrightsProvider"/>
<variablesProvider filetype="Groovy" implementationClass="org.jetbrains.plugins.groovy.copyright.GroovyCopyrightVariablesProvider"/>
</extensions>
</idea-plugin>

View File

@@ -18,6 +18,7 @@
<module name="intellij.groovy.duplicatesDetection"/>
<module name="intellij.groovy.git"/>
<module name="intellij.groovy.ant"/>
<module name="intellij.groovy.copyright"/>
<module name="intellij.groovy.byteCodeViewer"/>
</content>
<dependencies>
@@ -30,7 +31,6 @@
<module name="intellij.regexp"/>
</dependencies>
<depends optional="true" config-file="groovy-copyright.xml">com.intellij.copyright</depends>
<depends optional="true" config-file="intellilang-groovy-support.xml">org.intellij.intelliLang</depends>
<!--suppress PluginXmlValidity -->
<depends optional="true" config-file="groovy-structural-search.xml">com.intellij.modules.structuralsearch</depends>

View File

@@ -1,40 +0,0 @@
/*
* Copyright 2000-2016 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.
*/
package org.jetbrains.plugins.groovy.copyright
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import com.maddyhome.idea.copyright.pattern.CopyrightVariablesProvider
import com.maddyhome.idea.copyright.pattern.FileInfo
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile
class GroovyCopyrightVariablesProvider : CopyrightVariablesProvider() {
override fun collectVariables(context: MutableMap<String, Any>, project: Project, module: Module, file: PsiFile) {
if (file !is GroovyFile) return
context.put("file", object : FileInfo(file) {
override fun getQualifiedClassName() = getClazz()?.qualifiedName ?: super.getQualifiedClassName()
override fun getClassName(): String = getClazz()?.name ?: super.getClassName()
private fun getClazz() = if (file.isScript) file.scriptClass else file.classes.firstOrNull()
})
}
}