mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-284393 '3rd-party.jar' contains Velocity 1.7 which is vulnerable to CVE-2020-13936
GitOrigin-RevId: e5a46a42cefbcb0e7004caf17268333f2c773bed
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d60f57461d
commit
b96b6660ae
Generated
+3
-9
@@ -1,18 +1,12 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Velocity" type="repository">
|
||||
<properties maven-id="org.apache.velocity:velocity:1.7">
|
||||
<exclude>
|
||||
<dependency maven-id="commons-collections:commons-collections" />
|
||||
</exclude>
|
||||
</properties>
|
||||
<properties include-transitive-deps="false" maven-id="org.apache.velocity:velocity-engine-core:2.3" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/velocity/velocity/1.7/velocity-1.7.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/velocity/velocity-engine-core/2.3/velocity-engine-core-2.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/velocity/velocity/1.7/velocity-1.7-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.4/commons-lang-2.4-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apache/velocity/velocity-engine-core/2.3/velocity-engine-core-2.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
<component name="libraryTable">
|
||||
<library name="commons-lang" type="repository">
|
||||
<properties maven-id="commons-lang:commons-lang:2.6" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
+3
-3
@@ -18,11 +18,11 @@ package com.intellij.codeInsight.generation;
|
||||
import org.apache.velocity.exception.ResourceNotFoundException;
|
||||
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
|
||||
public class VelocityIncludesClassLoader extends ClasspathResourceLoader {
|
||||
@Override
|
||||
public InputStream getResourceStream(String name) throws ResourceNotFoundException {
|
||||
return super.getResourceStream("com/intellij/codeInsight/generation/" + name);
|
||||
public Reader getResourceReader(String name, String encoding) throws ResourceNotFoundException {
|
||||
return super.getResourceReader("com/intellij/codeInsight/generation/" + name, encoding);
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ public class BytecodeAnalysisResultsHighlightingTest extends DataFlowInspectionT
|
||||
public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
|
||||
super.configureModule(module, model, contentEntry);
|
||||
PsiTestUtil.addProjectLibrary(model, "velocity", IntelliJProjectConfiguration.getProjectLibraryClassesRootPaths("Velocity"));
|
||||
PsiTestUtil.addProjectLibrary(model, "commons-lang", IntelliJProjectConfiguration.getProjectLibraryClassesRootPaths("commons-lang"));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -250,9 +250,4 @@ internal class FileTemplatesTest : JavaProjectTestCase() {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun testStringUtilsSpecialVariableWorksAndHasRemoveAndHumpMethod() {
|
||||
val template = addTestTemplate("my_class", "prefix \${StringUtils.removeAndHump(\"foo_barBar\")} suffix")
|
||||
assertThat(template.getText(emptyMap<Any?, Any>())).isEqualTo("prefix FooBarBar suffix")
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -570,7 +570,6 @@ object CommunityRepositoryModules {
|
||||
spec.withModuleLibrary("moshi", "intellij.android.core", "")
|
||||
//prebuilts/tools/common/m2:eclipse-layout-kernel <= not recognized
|
||||
spec.withModuleLibrary("juniversalchardet", "android.sdktools.db-compiler", "")
|
||||
spec.withModuleLibrary("commons-lang", "android.sdktools.db-compiler", "")
|
||||
spec.withModuleLibrary("javapoet", "android.sdktools.db-compiler", "")
|
||||
spec.withModuleLibrary("auto-common", "android.sdktools.db-compiler", "")
|
||||
spec.withModuleLibrary("jetifier-core", "android.sdktools.db-compilerCommon", "")
|
||||
@@ -582,6 +581,7 @@ object CommunityRepositoryModules {
|
||||
spec.withProjectLibrary("android-test-plugin-host-device-info-proto")
|
||||
spec.withProjectLibrary("asm-tools")
|
||||
spec.withProjectLibrary("baksmali")
|
||||
spec.withProjectLibrary("commons-lang")
|
||||
spec.withProjectLibrary("dexlib2")
|
||||
spec.withProjectLibrary("emulator-proto")
|
||||
//tools/adt/idea/.idea/libraries:ffmpeg <= FIXME
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
<orderEntry type="library" name="commons-cli" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.util.io.impl" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.diagnostic.telemetry" />
|
||||
<orderEntry type="library" name="opentelemetry" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -65,5 +65,8 @@
|
||||
<orderEntry type="library" name="kotlinx-html-jvm" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.text.matching" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.base" />
|
||||
<orderEntry type="library" name="Slf4j" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="library" name="commons-lang3" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -61,7 +61,7 @@ public final class FileTemplateUtil {
|
||||
private static String @NotNull [] calculateAttributes(@NotNull String templateContent, @NotNull Set<String> propertiesNames, boolean includeDummies, @NotNull Project project) throws ParseException {
|
||||
final Set<String> unsetAttributes = new LinkedHashSet<>();
|
||||
final Set<String> definedAttributes = new HashSet<>();
|
||||
SimpleNode template = VelocityTemplateContext.withContext(project, ()->VelocityWrapper.parse(new StringReader(templateContent), "MyTemplate"));
|
||||
SimpleNode template = VelocityTemplateContext.withContext(project, ()->VelocityWrapper.parse(new StringReader(templateContent)));
|
||||
collectAttributes(unsetAttributes, definedAttributes, template, propertiesNames, includeDummies, new HashSet<>(), project);
|
||||
for (String definedAttribute : definedAttributes) {
|
||||
unsetAttributes.remove(definedAttribute);
|
||||
@@ -106,7 +106,7 @@ public final class FileTemplateUtil {
|
||||
includedTemplate = templateManager.getPattern(s);
|
||||
}
|
||||
if (includedTemplate != null && visitedIncludes.add(s)) {
|
||||
SimpleNode template = VelocityWrapper.parse(new StringReader(includedTemplate.getText()), "MyTemplate");
|
||||
SimpleNode template = VelocityWrapper.parse(new StringReader(includedTemplate.getText()));
|
||||
collectAttributes(referenced, defined, template, propertiesNames, includeDummies, visitedIncludes, project);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,24 +4,24 @@ package com.intellij.ide.fileTemplates;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.apache.commons.collections.ExtendedProperties;
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import org.apache.velocity.context.Context;
|
||||
import org.apache.velocity.exception.MethodInvocationException;
|
||||
import org.apache.velocity.exception.ParseErrorException;
|
||||
import org.apache.velocity.exception.ResourceNotFoundException;
|
||||
import org.apache.velocity.runtime.RuntimeConstants;
|
||||
import org.apache.velocity.runtime.RuntimeServices;
|
||||
import org.apache.velocity.runtime.RuntimeSingleton;
|
||||
import org.apache.velocity.runtime.log.LogSystem;
|
||||
import org.apache.velocity.runtime.parser.ParseException;
|
||||
import org.apache.velocity.runtime.parser.node.SimpleNode;
|
||||
import org.apache.velocity.runtime.resource.Resource;
|
||||
import org.apache.velocity.runtime.resource.ResourceManager;
|
||||
import org.apache.velocity.runtime.resource.ResourceManagerImpl;
|
||||
import org.apache.velocity.runtime.resource.loader.ResourceLoader;
|
||||
import org.apache.velocity.util.ExtProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.helpers.NOPLogger;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@@ -40,17 +40,7 @@ final class VelocityWrapper {
|
||||
", ResourceManagerImpl in " + PathManager.getJarPathForClass(ResourceManagerImpl.class));
|
||||
}
|
||||
|
||||
LogSystem emptyLogSystem = new LogSystem() {
|
||||
@Override
|
||||
public void init(RuntimeServices runtimeServices) throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logVelocityMessage(int i, String s) {
|
||||
//todo[myakovlev] log somethere?
|
||||
}
|
||||
};
|
||||
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, emptyLogSystem);
|
||||
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_INSTANCE, NOPLogger.NOP_LOGGER);
|
||||
Velocity.setProperty(RuntimeConstants.INPUT_ENCODING, FileTemplate.ourEncoding);
|
||||
Velocity.setProperty(RuntimeConstants.PARSER_POOL_SIZE, 3);
|
||||
Velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "includes");
|
||||
@@ -73,11 +63,11 @@ final class VelocityWrapper {
|
||||
|
||||
Velocity.setProperty("includes.resource.loader.instance", new ResourceLoader() {
|
||||
@Override
|
||||
public void init(ExtendedProperties configuration) {
|
||||
public void init(ExtProperties configuration) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getResourceStream(String resourceName) throws ResourceNotFoundException {
|
||||
public Reader getResourceReader(String resourceName, String encoding) throws ResourceNotFoundException {
|
||||
FileTemplateManager templateManager = VelocityTemplateContext.getFromContext();
|
||||
final FileTemplate include = templateManager.getPattern(resourceName);
|
||||
if (include == null) {
|
||||
@@ -85,7 +75,7 @@ final class VelocityWrapper {
|
||||
}
|
||||
final String text = include.getText();
|
||||
try {
|
||||
return new ByteArrayInputStream(text.getBytes(FileTemplate.ourEncoding));
|
||||
return new InputStreamReader(new ByteArrayInputStream(text.getBytes(FileTemplate.ourEncoding)), FileTemplate.ourEncoding);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -111,8 +101,8 @@ final class VelocityWrapper {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static SimpleNode parse(@NotNull Reader reader, @NotNull String templateName) throws ParseException {
|
||||
return RuntimeSingleton.parse(reader, templateName);
|
||||
static SimpleNode parse(@NotNull Reader reader) throws ParseException {
|
||||
return RuntimeSingleton.parse(reader, new Template());
|
||||
}
|
||||
|
||||
static boolean evaluate(@Nullable Project project, Context context, @NotNull Writer writer, String templateContent)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.workspaceModel.storage.tests" scope="TEST" />
|
||||
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="library" scope="TEST" name="Velocity" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="commons-lang" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.workspaceModel.storage.testEntities" scope="TEST" />
|
||||
<orderEntry type="library" scope="TEST" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
|
||||
@@ -10,11 +10,9 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import org.apache.commons.collections.ExtendedProperties;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.runtime.RuntimeConstants;
|
||||
import org.apache.velocity.runtime.log.JdkLogChute;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -96,24 +94,19 @@ public final class VelocityHelper
|
||||
{
|
||||
try
|
||||
{
|
||||
VelocityEngine engine = new VelocityEngine();
|
||||
ExtendedProperties extendedProperties = new ExtendedProperties();
|
||||
VelocityEngine engine = new VelocityEngine();
|
||||
|
||||
extendedProperties.addProperty(RuntimeConstants.RESOURCE_LOADER, "file");
|
||||
extendedProperties.addProperty(RuntimeConstants.PARSER_POOL_SIZE, "1");
|
||||
engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "file");
|
||||
engine.setProperty(RuntimeConstants.PARSER_POOL_SIZE, "1");
|
||||
|
||||
extendedProperties.addProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
|
||||
extendedProperties.addProperty("file.resource.loader.path", PathManager.getPluginsPath() + "/Copyright/resources");
|
||||
engine.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
|
||||
engine.setProperty("file.resource.loader.path", PathManager.getPluginsPath() + "/Copyright/resources");
|
||||
|
||||
extendedProperties.addProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
|
||||
JdkLogChute.class.getName());
|
||||
extendedProperties
|
||||
.addProperty(JdkLogChute.RUNTIME_LOG_JDK_LOGGER, CopyrightManager.class.getName());
|
||||
engine.setProperty(RuntimeConstants.RUNTIME_LOG_NAME, CopyrightManager.class.getName());
|
||||
|
||||
engine.setExtendedProperties(extendedProperties);
|
||||
engine.init();
|
||||
engine.init();
|
||||
|
||||
instance = engine;
|
||||
instance = engine;
|
||||
}
|
||||
catch (Exception ignored)
|
||||
{
|
||||
|
||||
@@ -23,5 +23,6 @@
|
||||
<orderEntry type="module" module-name="intellij.devkit.themes" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.util.io" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.ui" scope="TEST" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="commons-lang" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -25,7 +25,7 @@
|
||||
<orderEntry type="library" name="automaton" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.codeStyle.impl" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Log4J" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
|
||||
<orderEntry type="module" module-name="intellij.platform.statistics" />
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<orderEntry type="library" name="gson" level="project" />
|
||||
<orderEntry type="library" name="commons-codec" level="project" />
|
||||
<orderEntry type="library" name="commons-compress" level="project" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-html-jvm" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
+3
-11
@@ -17,11 +17,8 @@ package org.jetbrains.java.generate.velocity;
|
||||
|
||||
import com.intellij.codeInsight.generation.VelocityIncludesClassLoader;
|
||||
import com.intellij.openapi.util.ClassLoaderUtil;
|
||||
import org.apache.commons.collections.ExtendedProperties;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.runtime.RuntimeConstants;
|
||||
import org.apache.velocity.runtime.log.JdkLogChute;
|
||||
import org.apache.velocity.runtime.log.SimpleLog4JLogSystem;
|
||||
|
||||
/**
|
||||
* Velocity factory.
|
||||
@@ -47,15 +44,10 @@ public final class VelocityFactory {
|
||||
* @return a new velocity engine that is initialized.
|
||||
*/
|
||||
private static VelocityEngine newVelocityEngine() {
|
||||
ExtendedProperties prop = new ExtendedProperties();
|
||||
prop.addProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, JdkLogChute.class.getName());
|
||||
prop.addProperty(JdkLogChute.RUNTIME_LOG_JDK_LOGGER, "GenerateToString");
|
||||
prop.addProperty(RuntimeConstants.RESOURCE_LOADER, "includes");
|
||||
prop.addProperty("includes.resource.loader.class", VelocityIncludesClassLoader.class.getName());
|
||||
prop.addProperty(RuntimeConstants.VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL, "true");
|
||||
|
||||
VelocityEngine velocity = new VelocityEngine();
|
||||
velocity.setExtendedProperties(prop);
|
||||
velocity.addProperty(RuntimeConstants.RESOURCE_LOADER, "includes");
|
||||
velocity.addProperty("includes.resource.loader.class", VelocityIncludesClassLoader.class.getName());
|
||||
velocity.addProperty(RuntimeConstants.VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL, "true");
|
||||
ClassLoaderUtil.runWithClassLoader(VelocityIncludesClassLoader.class.getClassLoader(), () -> velocity.init());
|
||||
return velocity;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-core" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-json" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Velocity" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="commons-lang" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.externalProcessAuthHelper" exported="" />
|
||||
<orderEntry type="module" module-name="intellij.platform.externalProcessAuthHelper.rt" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" scope="TEST" />
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.util.classLoader" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.toolingProxy" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.externalSystem.dependencyUpdater" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.diagnostic.telemetry" />
|
||||
<orderEntry type="library" name="opentelemetry" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -47,7 +47,7 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="module" module-name="intellij.xml.psi" />
|
||||
<orderEntry type="module" module-name="intellij.platform.feedback" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-core" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-serialization-json" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.codeStyle.impl" />
|
||||
<orderEntry type="library" name="jetbrains.markdown" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.java.compiler.impl" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.builtInServer.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.util.io.impl" />
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
<orderEntry type="module" module-name="kotlin.base.plugin" />
|
||||
<orderEntry type="module" module-name="kotlin.base.resources" />
|
||||
<orderEntry type="module" module-name="intellij.platform.editor" />
|
||||
<orderEntry type="library" name="Slf4j" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
+4
-12
@@ -5,8 +5,6 @@ package org.jetbrains.kotlin.tools.projectWizard.core.service
|
||||
import org.apache.velocity.VelocityContext
|
||||
import org.apache.velocity.app.Velocity
|
||||
import org.apache.velocity.runtime.RuntimeConstants
|
||||
import org.apache.velocity.runtime.RuntimeServices
|
||||
import org.apache.velocity.runtime.log.LogChute
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.TaskResult
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.Writer
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.div
|
||||
@@ -14,6 +12,7 @@ import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplate
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplateDescriptor
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.FileTextDescriptor
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.Template
|
||||
import org.slf4j.helpers.NOPLogger
|
||||
import java.io.StringWriter
|
||||
|
||||
abstract class TemplateEngineService : WizardService {
|
||||
@@ -53,18 +52,11 @@ class VelocityTemplateEngineServiceImpl : TemplateEngineService(), IdeaIndepende
|
||||
|
||||
|
||||
private fun runVelocityActionWithoutLogging(action: () -> Unit) {
|
||||
val initialLogger = Velocity.getProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM)
|
||||
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, DoNothingVelocityLogger)
|
||||
val initialLogger = Velocity.getProperty(RuntimeConstants.RUNTIME_LOG_INSTANCE)
|
||||
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_INSTANCE, NOPLogger.NOP_LOGGER)
|
||||
action()
|
||||
if (initialLogger != null) {
|
||||
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, initialLogger)
|
||||
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_INSTANCE, initialLogger)
|
||||
}
|
||||
}
|
||||
|
||||
private object DoNothingVelocityLogger : LogChute {
|
||||
override fun isLevelEnabled(level: Int): Boolean = false
|
||||
override fun init(rs: RuntimeServices?) = Unit
|
||||
override fun log(level: Int, message: String?) = Unit
|
||||
override fun log(level: Int, message: String?, t: Throwable?) = Unit
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
<orderEntry type="library" name="jackson" level="project" />
|
||||
<orderEntry type="library" name="jackson-databind" level="project" />
|
||||
<orderEntry type="library" name="jackson-module-kotlin" level="project" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.collaborationTools.auth" />
|
||||
<orderEntry type="module" module-name="intellij.platform.execution.impl" />
|
||||
<orderEntry type="library" name="miglayout-swing" level="project" />
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<orderEntry type="library" name="fastutil-min" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.idea.community.build.dependencies" />
|
||||
<orderEntry type="module" module-name="intellij.platform.buildScripts.downloader" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<orderEntry type="module" module-name="intellij.markdown" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
<orderEntry type="library" name="jcef" level="project" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="library" name="commons-lang" level="project" />
|
||||
<orderEntry type="library" name="jna" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.toml" />
|
||||
<orderEntry type="module-library">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<orderEntry type="module" module-name="intellij.python.markdown" scope="RUNTIME" />
|
||||
<orderEntry type="module" module-name="intellij.grazie.tests" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.python.grazie" />
|
||||
<orderEntry type="library" scope="TEST" name="Velocity" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="commons-lang" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.jdom" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ml" scope="TEST" />
|
||||
<orderEntry type="library" scope="TEST" name="kotlinx-coroutines-jdk8" level="project" />
|
||||
|
||||
Reference in New Issue
Block a user