Merge remote-tracking branch 'origin/master'

This commit is contained in:
Konstantin Bulenkov
2016-04-07 18:43:59 +03:00
26 changed files with 323 additions and 316 deletions
+9 -11
View File
@@ -884,23 +884,21 @@ binding.setVariable("bundledJDK64s"){
private bundledJDK(boolean win64) {
requireProperty("artifact.linux.no.jdk", "true")
requireProperty("artifact.mac.no.jdk", "true")
requireProperty("jdk.win", "jdk1.8")
requireProperty("jdk.custom.win", "false")
requireProperty("jdk.mac", "openjdk.1.8")
requireProperty("jdk.oracle.win", "jdk1.8")
requireProperty("jdk.win", "openjdk.1.8")
requireProperty("jdk.mac", "openjdk.1.8")
requireProperty("jdk.linux", "openjdk.1.8")
if (new File("${home}/build/jdk").exists()) {
def jdkDir = new File("${home}/build/jdk/win")
if (p("jdk.win") != "false") {
setProperty("winJDK", getPathToBundledJDK(jdkDir, p("jdk.win"), (win64 ? "x64.zip": "x32.zip") ))
extractRedistJre(winJDK, "${paths.sandbox}/jdk.win/jre")
if (p("jdk.oracle.win") != "false" && (jdkDir.exists() && jdkDir.isDirectory())) {
setProperty("winJDK", getPathToBundledJDK(jdkDir, p("jdk.oracle.win"), (win64 ? "x64.zip": "x32.zip")))
extractRedistJre(winJDK, "${paths.sandbox}/jdk.oracle.win/jre")
}
jdkDir = new File("${home}/build/jdk/win/custom")
if (p("jdk.custom.win") != "false" && (jdkDir.exists() && jdkDir.isDirectory())) {
setProperty("winCustomJDKx32", getPathToBundledJDK(jdkDir, p("jdk.custom.win"), "x32.tar.gz"))
extractRedistJre(winCustomJDKx32, "${paths.sandbox}/jdk.custom.win.x32")
setProperty("winCustomJDKx64", getPathToBundledJDK(jdkDir, p("jdk.custom.win"), "x64.tar.gz"))
extractRedistJre(winCustomJDKx64, "${paths.sandbox}/jdk.custom.win.x64")
if (p("jdk.win") != "false" && (jdkDir.exists() && jdkDir.isDirectory())) {
setProperty("winCustomJDKx32", getPathToBundledJDK(jdkDir, p("jdk.win"), (win64 ? "x64.tar.gz": "x32.tar.gz")))
extractRedistJre(winCustomJDKx32, "${paths.sandbox}/jdk.win")
}
jdkDir = new File("${home}/build/jdk/mac/custom")
if (p("jdk.mac") != "false" && (jdkDir.exists() && jdkDir.isDirectory())) {
@@ -60,10 +60,9 @@ private class DefaultWebServerRootsProvider : WebServerRootsProvider() {
runReadAction { ModuleManager.getInstance(project).modules }
.computeOrNull { module ->
if (!module.isDisposed) {
val result = findByRelativePath(path, rootProvider.getRoots(ModuleRootManager.getInstance(module)), resolver, null)
if (result != null) {
result.moduleName = getModuleNameQualifier(project, module)
return result
findByRelativePath(path, rootProvider.getRoots(ModuleRootManager.getInstance(module)), resolver, null)?.let {
it.moduleName = getModuleNameQualifier(project, module)
return it
}
}
null
@@ -11,9 +11,9 @@ import com.intellij.util.writeChild
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
private class BuiltInWebServerTest : BuiltInServerTestCase() {
internal class BuiltInWebServerTest : BuiltInServerTestCase() {
override val urlPathPrefix: String
get() = "/${BuiltInServerTestCase.projectRule.project.name}"
get() = "/${projectRule.project.name}"
@Test
@TestManager.TestDescriptor(filePath = "foo/index.html", doNotCreate = true, status = 200)
@@ -34,7 +34,7 @@ private class BuiltInWebServerTest : BuiltInServerTestCase() {
}
private fun testIndex(vararg paths: String) {
val project = BuiltInServerTestCase.projectRule.project
val project = projectRule.project
val newPath = tempDirManager.newPath()
newPath.writeChild(manager.filePath!!, "hello")
newPath.refreshVfs()
@@ -8,7 +8,7 @@ import org.junit.Test
import java.net.HttpURLConnection
import java.net.URL
private class RestApiTest : BuiltInServerTestCase() {
internal class RestApiTest : BuiltInServerTestCase() {
override val urlPathPrefix = "/api/file"
@Test
@@ -36,7 +36,6 @@ import com.intellij.openapi.application.TransactionId;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Key;
@@ -178,22 +177,14 @@ public class AutoPopupController implements Disposable {
}
final PsiFile file1 = file;
final Runnable request = new Runnable(){
@Override
public void run(){
if (myProject.isDisposed() || DumbService.isDumb(myProject)) return;
documentManager.commitAllDocuments();
if (editor.isDisposed() || !editor.getComponent().isShowing()) return;
Runnable request = () -> {
if (!myProject.isDisposed() && !DumbService.isDumb(myProject) && !editor.isDisposed() && editor.getComponent().isShowing()) {
int lbraceOffset = editor.getCaretModel().getOffset() - 1;
try {
ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false);
}
catch (IndexNotReadyException ignored) { //anything can happen on alarm
}
ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false);
}
};
addRequest(request, settings.PARAMETER_INFO_DELAY);
addRequest(() -> documentManager.performLaterWhenAllCommitted(request), settings.PARAMETER_INFO_DELAY);
}
}
@@ -15,8 +15,6 @@
*/
package com.intellij.idea;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.PrivacyPolicy;
import com.intellij.ide.customize.CustomizeIDEWizardDialog;
import com.intellij.ide.customize.CustomizeIDEWizardStepsProvider;
import com.intellij.ide.plugins.PluginManagerCore;
@@ -25,14 +23,9 @@ import com.intellij.openapi.application.ApplicationInfo;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.application.ConfigImportHelper;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.application.impl.ApplicationImpl;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.ShutDownTracker;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.SystemInfoRt;
@@ -40,15 +33,10 @@ import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.io.win32.IdeaWin32;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.AppUIUtil;
import com.intellij.ui.HyperlinkAdapter;
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.Consumer;
import com.intellij.util.EnvironmentUtil;
import com.intellij.util.PlatformUtils;
import com.intellij.util.lang.UrlClassLoader;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.SwingHelper;
import com.sun.jna.Native;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
@@ -58,15 +46,10 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.io.BuiltInServer;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.StyleSheet;
import java.awt.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
@@ -137,7 +120,12 @@ public class StartupUtil {
if (!checkSystemFolders()) {
System.exit(Main.DIR_CHECK_FAILED);
}
if (!lockSystemFolders(args)) {
ActivationResult result = lockSystemFolders(args);
if (result == ActivationResult.ACTIVATED) {
System.exit(0);
}
else if (result != ActivationResult.STARTED) {
System.exit(Main.INSTANCE_CHECK_FAILED);
}
@@ -154,20 +142,7 @@ public class StartupUtil {
if (!Main.isHeadless()) {
AppUIUtil.updateWindowIcon(JOptionPane.getRootFrame());
AppUIUtil.registerBundledFonts();
final Pair<PrivacyPolicy.Version, String> policy = PrivacyPolicy.getContent();
if (!PrivacyPolicy.isVersionAccepted(policy.getFirst())) {
try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
showPrivacyPolicyAgreement(policy.getSecond());
}
});
PrivacyPolicy.setVersionAccepted(policy.getFirst());
}
catch (Exception ignored) {
}
}
AppUIUtil.showPrivacyPolicy();
}
appStarter.start(newConfigFolder);
@@ -305,7 +280,9 @@ public class StartupUtil {
}
}
private synchronized static boolean lockSystemFolders(String[] args) {
private enum ActivationResult { STARTED, ACTIVATED, FAILED }
private synchronized static @NotNull ActivationResult lockSystemFolders(String[] args) {
if (ourSocketLock != null) {
throw new AssertionError();
}
@@ -318,33 +295,30 @@ public class StartupUtil {
}
catch (Exception e) {
Main.showMessage("Cannot Lock System Folders", e);
return false;
return ActivationResult.FAILED;
}
if (status == SocketLock.ActivateStatus.NO_INSTANCE) {
ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
@SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod")
@Override
public void run() {
synchronized (StartupUtil.class) {
ourSocketLock.dispose();
ourSocketLock = null;
}
ShutDownTracker.getInstance().registerShutdownTask(() -> {
//noinspection SynchronizeOnThis
synchronized (StartupUtil.class) {
ourSocketLock.dispose();
ourSocketLock = null;
}
});
return true;
return ActivationResult.STARTED;
}
else if (status == SocketLock.ActivateStatus.ACTIVATED) {
//noinspection UseOfSystemOutOrSystemErr
System.out.println("Already running");
return ActivationResult.ACTIVATED;
}
else if (Main.isHeadless() || status == SocketLock.ActivateStatus.CANNOT_ACTIVATE) {
String message = "Only one instance of " + ApplicationNamesInfo.getInstance().getFullProductName() + " can be run at a time.";
Main.showMessage("Too Many Instances", message, true);
}
if (status == SocketLock.ActivateStatus.ACTIVATED) {
System.out.println("Already running");
System.exit(0);
}
return false;
return ActivationResult.FAILED;
}
private static void fixProcessEnvironment(Logger log) {
@@ -438,76 +412,6 @@ public class StartupUtil {
log.info("JNU charset: " + System.getProperty("sun.jnu.encoding"));
}
/**
* @param htmlText Updated version of Privacy Policy text if any.
* If it's <code>null</code> the standard text from bundled resources would be used.
*/
public static void showPrivacyPolicyAgreement(@NotNull String htmlText) {
DialogWrapper dialog = new DialogWrapper(true) {
@Nullable
@Override
protected JComponent createCenterPanel() {
JPanel centerPanel = new JPanel(new BorderLayout(JBUI.scale(5), JBUI.scale(5)));
JEditorPane viewer = SwingHelper.createHtmlViewer(true, null, JBColor.WHITE, JBColor.BLACK);
viewer.setFocusable(true);
viewer.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
URL url = e.getURL();
if (url != null) {
BrowserUtil.browse(url);
}
else {
SwingHelper.scrollToReference(viewer, e.getDescription());
}
}
});
viewer.setText(htmlText);
StyleSheet styleSheet = ((HTMLDocument)viewer.getDocument()).getStyleSheet();
styleSheet.addRule("body {font-family: \"Segoe UI\", Tahoma, sans-serif;}");
styleSheet.addRule("body {margin-top:0;padding-top:0;}");
styleSheet.addRule("body {font-size:" + JBUI.scaleFontSize(13) + "pt;}");
styleSheet.addRule("h2, em {margin-top:" + JBUI.scaleFontSize(20) + "pt;}");
styleSheet.addRule("h1, h2, h3, p, h4, em {margin-bottom:0;padding-bottom:0;}");
styleSheet.addRule("p, h1 {margin-top:0;padding-top:"+JBUI.scaleFontSize(6)+"pt;}");
styleSheet.addRule("li {margin-bottom:" + JBUI.scaleFontSize(6) + "pt;}");
styleSheet.addRule("h2 {margin-top:0;padding-top:"+JBUI.scaleFontSize(13)+"pt;}");
viewer.setCaretPosition(0);
viewer.setBorder(JBUI.Borders.empty(0, 5, 5, 5));
centerPanel.add(new JLabel("Please read and accept these terms and conditions:"), BorderLayout.NORTH);
centerPanel
.add(new JBScrollPane(viewer, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER),
BorderLayout.CENTER);
return centerPanel;
}
@Override
protected void createDefaultActions() {
super.createDefaultActions();
init();
setOKButtonText("Accept");
setCancelButtonText("Reject and Exit");
setAutoAdjustable(false);
}
@Override
public void doCancelAction() {
super.doCancelAction();
ApplicationEx application = ApplicationManagerEx.getApplicationEx();
if (application == null) {
System.exit(Main.PRIVACY_POLICY_REJECTION);
}
else {
((ApplicationImpl)application).exit(true, true, false, false);
}
}
};
dialog.setModal(true);
dialog.setTitle(ApplicationNamesInfo.getInstance().getFullProductName() + " Privacy Policy Agreement");
dialog.setSize(JBUI.scale(509), JBUI.scale(395));
dialog.show();
}
static void runStartupWizard() {
ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
@@ -535,4 +439,4 @@ public class StartupUtil {
PluginManagerCore.invalidatePlugins();
}
}
}
}
@@ -20,6 +20,7 @@ import com.intellij.ide.actions.DeleteAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.fileChooser.FileSystemTree;
import com.intellij.openapi.fileChooser.ex.FileChooserKeys;
public class FileDeleteAction extends DeleteAction {
@@ -34,13 +35,19 @@ public class FileDeleteAction extends DeleteAction {
@Override
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
final Boolean available = event.getData(FileChooserKeys.DELETE_ACTION_AVAILABLE);
if (available != null && !available) {
presentation.setEnabled(false);
presentation.setVisible(false);
FileSystemTree tree = event.getData(FileSystemTree.DATA_KEY);
if (tree == null) {
presentation.setEnabledAndVisible(false);
return;
}
final Boolean available = event.getData(FileChooserKeys.DELETE_ACTION_AVAILABLE);
if (available != null && !available) {
presentation.setEnabledAndVisible(false);
return;
}
presentation.setEnabledAndVisible(true);
super.update(event);
}
}
@@ -19,11 +19,18 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.fileChooser.FileSystemTree;
import com.intellij.openapi.project.DumbAware;
import org.jetbrains.annotations.NotNull;
/**
* @author Vladimir Kondratyev
*/
public final class ShowHiddensAction extends ToggleAction implements DumbAware {
@Override
public void update(AnActionEvent e) {
FileSystemTree tree = e.getData(FileSystemTree.DATA_KEY);
e.getPresentation().setEnabled(tree != null);
}
public boolean isSelected(AnActionEvent e) {
final FileSystemTree fileSystemTree = e.getData(FileSystemTree.DATA_KEY);
return fileSystemTree != null && fileSystemTree.areHiddensShown();
@@ -411,25 +411,16 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
@Override
public void smartInvokeLater(@NotNull final Runnable runnable) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
runWhenSmart(runnable);
}
@Override
public String toString() {
return runnable.toString();
}
}, myProject.getDisposed());
smartInvokeLater(runnable, ModalityState.defaultModalityState());
}
@Override
public void smartInvokeLater(@NotNull final Runnable runnable, @NotNull ModalityState modalityState) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
runWhenSmart(runnable);
ApplicationManager.getApplication().invokeLater(() -> {
if (isDumb()) {
runWhenSmart(() -> smartInvokeLater(runnable, modalityState));
} else {
runnable.run();
}
}, modalityState, myProject.getDisposed());
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* 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.
@@ -15,27 +15,39 @@
*/
package com.intellij.ui;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.PrivacyPolicy;
import com.intellij.idea.Main;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.application.impl.ApplicationImpl;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.util.PlatformUtils;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.SystemProperties;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.*;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.SwingHelper;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.StyleSheet;
import java.awt.*;
import java.io.File;
import java.io.InputStream;
@@ -43,6 +55,9 @@ import java.net.URL;
import java.util.List;
import java.util.Locale;
import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
/**
* @author yole
*/
@@ -71,18 +86,13 @@ public class AppUIUtil {
return images;
}
public static void invokeLaterIfProjectAlive(@NotNull final Project project, @NotNull final Runnable runnable) {
public static void invokeLaterIfProjectAlive(@NotNull Project project, @NotNull Runnable runnable) {
final Application application = ApplicationManager.getApplication();
if (application.isDispatchThread()) {
runnable.run();
}
else {
application.invokeLater(runnable, new Condition() {
@Override
public boolean value(Object o) {
return !project.isOpen() || project.isDisposed();
}
});
application.invokeLater(runnable, o -> !project.isOpen() || project.isDisposed());
}
}
@@ -158,14 +168,11 @@ public class AppUIUtil {
}
}
public static void hideToolWindowBalloon(@NotNull final String id, @NotNull final Project project) {
invokeLaterIfProjectAlive(project, new Runnable() {
@Override
public void run() {
Balloon balloon = ToolWindowManager.getInstance(project).getToolWindowBalloon(id);
if (balloon != null) {
balloon.hide();
}
public static void hideToolWindowBalloon(@NotNull String id, @NotNull Project project) {
invokeLaterIfProjectAlive(project, () -> {
Balloon balloon = ToolWindowManager.getInstance(project).getToolWindowBalloon(id);
if (balloon != null) {
balloon.hide();
}
});
}
@@ -173,30 +180,112 @@ public class AppUIUtil {
private static final int MIN_ICON_SIZE = 32;
@Nullable
public static String findIcon(final String iconsPath) {
final File iconsDir = new File(iconsPath);
public static String findIcon(@NotNull String iconsPath) {
String[] childFiles = ObjectUtils.notNull(new File(iconsPath).list(), ArrayUtil.EMPTY_STRING_ARRAY);
// 1. look for .svg icon
for (String child : iconsDir.list()) {
for (String child : childFiles) {
if (child.endsWith(".svg")) {
return iconsPath + '/' + child;
}
}
// 2. look for .png icon of max size
int max = 0;
int best = MIN_ICON_SIZE - 1;
String iconPath = null;
for (String child : iconsDir.list()) {
if (!child.endsWith(".png")) continue;
final String path = iconsPath + '/' + child;
final Icon icon = new ImageIcon(path);
final int size = icon.getIconHeight();
if (size >= MIN_ICON_SIZE && size > max && size == icon.getIconWidth()) {
max = size;
iconPath = path;
for (String child : childFiles) {
if (child.endsWith(".png")) {
String path = iconsPath + '/' + child;
Icon icon = new ImageIcon(path);
int size = icon.getIconHeight();
if (size > best && size == icon.getIconWidth()) {
best = size;
iconPath = path;
}
}
}
return iconPath;
}
}
public static void showPrivacyPolicy() {
Pair<PrivacyPolicy.Version, String> policy = PrivacyPolicy.getContent();
if (!PrivacyPolicy.isVersionAccepted(policy.getFirst())) {
try {
SwingUtilities.invokeAndWait(() -> showPrivacyPolicyAgreement(policy.getSecond()));
PrivacyPolicy.setVersionAccepted(policy.getFirst());
}
catch (Exception e) {
Logger.getInstance(AppUIUtil.class).warn(e);
}
}
}
/**
* @param htmlText Updated version of Privacy Policy text if any.
* If it's {@code null}, the standard text from bundled resources would be used.
*/
public static void showPrivacyPolicyAgreement(@NotNull String htmlText) {
DialogWrapper dialog = new DialogWrapper(true) {
@Nullable
@Override
protected JComponent createCenterPanel() {
JPanel centerPanel = new JPanel(new BorderLayout(JBUI.scale(5), JBUI.scale(5)));
JEditorPane viewer = SwingHelper.createHtmlViewer(true, null, JBColor.WHITE, JBColor.BLACK);
viewer.setFocusable(true);
viewer.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
URL url = e.getURL();
if (url != null) {
BrowserUtil.browse(url);
}
else {
SwingHelper.scrollToReference(viewer, e.getDescription());
}
}
});
viewer.setText(htmlText);
StyleSheet styleSheet = ((HTMLDocument)viewer.getDocument()).getStyleSheet();
styleSheet.addRule("body {font-family: \"Segoe UI\", Tahoma, sans-serif;}");
styleSheet.addRule("body {margin-top:0;padding-top:0;}");
styleSheet.addRule("body {font-size:" + JBUI.scaleFontSize(13) + "pt;}");
styleSheet.addRule("h2, em {margin-top:" + JBUI.scaleFontSize(20) + "pt;}");
styleSheet.addRule("h1, h2, h3, p, h4, em {margin-bottom:0;padding-bottom:0;}");
styleSheet.addRule("p, h1 {margin-top:0;padding-top:"+JBUI.scaleFontSize(6)+"pt;}");
styleSheet.addRule("li {margin-bottom:" + JBUI.scaleFontSize(6) + "pt;}");
styleSheet.addRule("h2 {margin-top:0;padding-top:"+JBUI.scaleFontSize(13)+"pt;}");
viewer.setCaretPosition(0);
viewer.setBorder(JBUI.Borders.empty(0, 5, 5, 5));
centerPanel.add(new JLabel("Please read and accept these terms and conditions:"), BorderLayout.NORTH);
centerPanel.add(new JBScrollPane(viewer, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER);
return centerPanel;
}
@Override
protected void createDefaultActions() {
super.createDefaultActions();
init();
setOKButtonText("Accept");
setCancelButtonText("Reject and Exit");
setAutoAdjustable(false);
}
@Override
public void doCancelAction() {
super.doCancelAction();
ApplicationEx application = ApplicationManagerEx.getApplicationEx();
if (application == null) {
System.exit(Main.PRIVACY_POLICY_REJECTION);
}
else {
((ApplicationImpl)application).exit(true, true, false, false);
}
}
};
dialog.setModal(true);
dialog.setTitle(ApplicationNamesInfo.getInstance().getFullProductName() + " Privacy Policy Agreement");
dialog.setSize(JBUI.scale(509), JBUI.scale(395));
dialog.show();
}
}
@@ -141,7 +141,7 @@ fun Path.refreshVfs() {
inline fun <R> Path.directoryStreamIfExists(task: (stream: DirectoryStream<Path>) -> R): R? {
try {
Files.newDirectoryStream(this).use(task)
return Files.newDirectoryStream(this).use(task)
}
catch (ignored: NoSuchFileException) {
}
@@ -150,7 +150,7 @@ inline fun <R> Path.directoryStreamIfExists(task: (stream: DirectoryStream<Path>
inline fun <R> Path.directoryStreamIfExists(noinline filter: ((path: Path) -> Boolean), task: (stream: DirectoryStream<Path>) -> R): R? {
try {
Files.newDirectoryStream(this, { filter.invoke(it) }).use(task)
return Files.newDirectoryStream(this, { filter.invoke(it) }).use(task)
}
catch (ignored: NoSuchFileException) {
}
@@ -33,6 +33,22 @@ import static com.intellij.openapi.util.Conditions.not;
*/
public class TreeTraverserTest extends TestCase {
/**
* <pre>
* --- 5
* --- 2 --- 6
* / --- 7
* /
* / --- 8
* 1 --- 3 --- 9
* \ --- 10
* \
* \ --- 11
* --- 4 --- 12
* --- 13
* </pre>
*/
private static Map<Integer, Collection<Integer>> numbers() {
return ContainerUtil.<Integer, Collection<Integer>>immutableMapBuilder().
put(1, Arrays.asList(2, 3, 4)).
@@ -455,7 +471,17 @@ public class TreeTraverserTest extends TestCase {
assertEquals(Arrays.asList(5, 6, 3, 11, 12, 13), t.withRoot(1).regard(not(inRange(7, 10))).traverse(TreeTraversal.LEAVES_DFS).toList());
}
public void testSkipExpandedBfs() {
public void testHideOneNodeDfs() {
JBTreeTraverser<Integer> t = filteredTraverser();
assertEquals(Arrays.asList(1, 2, 5, 6, 7, 4, 11, 12, 13), t.withRoot(1).expandAndFilter(x -> x != 3).traverse(TreeTraversal.PRE_ORDER_DFS).toList());
}
public void testHideOneNodeCompletelyBfs() {
JBTreeTraverser<Integer> t = filteredTraverser();
assertEquals(Arrays.asList(1, 2, 4, 5, 6, 7, 11, 12, 13), t.withRoot(1).expandAndFilter(x -> x != 3).traverse(TreeTraversal.PLAIN_BFS).toList());
}
public void testSkipExpandedCompletelyBfs() {
JBTreeTraverser<Integer> t = filteredTraverser();
assertEquals(Arrays.asList(2, 4, 8, 9, 10), t.withRoot(1).expand(IS_ODD).traverse(TreeTraversal.LEAVES_BFS).toList());
}
@@ -30,7 +30,6 @@ import com.intellij.openapi.project.ex.ProjectEx
import com.intellij.openapi.project.ex.ProjectManagerEx
import com.intellij.openapi.project.impl.ProjectManagerImpl
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl
@@ -132,7 +131,6 @@ class ProjectRule() : ApplicationRule() {
val module: Module
get() {
var project = project
var result = sharedModule
if (result == null) {
runInEdtAndWait {
@@ -141,9 +139,6 @@ class ProjectRule() : ApplicationRule() {
result = module
sharedModule = module
}
override fun sourceRootCreated(sourceRoot: VirtualFile) {
}
})
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* 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.
@@ -15,7 +15,6 @@
*/
package com.intellij.testFramework;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.EmptyModuleType;
import com.intellij.openapi.module.Module;
@@ -34,7 +33,6 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.VirtualFileVisitor;
import com.intellij.openapi.vfs.ex.temp.TempFileSystem;
import com.intellij.util.Consumer;
import com.intellij.util.indexing.FileBasedIndex;
import com.intellij.util.indexing.IndexableFileSet;
import org.jetbrains.annotations.NotNull;
@@ -50,33 +48,27 @@ public class LightProjectDescriptor {
public static final LightProjectDescriptor EMPTY_PROJECT_DESCRIPTOR = new LightProjectDescriptor();
public void setUpProject(@NotNull final Project project, @NotNull final SetupHandler handler) throws Exception {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
Module module = createMainModule(project);
handler.moduleCreated(module);
VirtualFile sourceRoot = createSourcesRoot(module);
if (sourceRoot != null) {
handler.sourceRootCreated(sourceRoot);
createContentEntry(module, sourceRoot);
}
ApplicationManager.getApplication().runWriteAction(() -> {
Module module = createMainModule(project);
handler.moduleCreated(module);
VirtualFile sourceRoot = createSourcesRoot(module);
if (sourceRoot != null) {
handler.sourceRootCreated(sourceRoot);
createContentEntry(module, sourceRoot);
}
});
}
@NotNull
public Module createMainModule(@NotNull final Project project) {
return ApplicationManager.getApplication().runWriteAction(new Computable<Module>() {
@Override
public Module compute() {
String moduleFilePath = "light_idea_test_case.iml";
File imlFile = new File(moduleFilePath);
if (imlFile.exists()) {
//temporary workaround for IDEA-147530: otherwise if someone saved module with this name before the created module will get its settings
FileUtil.delete(imlFile);
}
return ModuleManager.getInstance(project).newModule(moduleFilePath, getModuleType().getId());
return ApplicationManager.getApplication().runWriteAction((Computable<Module>)() -> {
String moduleFilePath = "light_idea_test_case.iml";
File imlFile = new File(moduleFilePath);
if (imlFile.exists()) {
//temporary workaround for IDEA-147530: otherwise if someone saved module with this name before the created module will get its settings
FileUtil.delete(imlFile);
}
return ModuleManager.getInstance(project).newModule(moduleFilePath, getModuleType().getId());
});
}
@@ -119,30 +111,22 @@ public class LightProjectDescriptor {
}
};
FileBasedIndex.getInstance().registerIndexableSet(indexableFileSet, null);
Disposer.register(module.getProject(), new Disposable() {
@Override
public void dispose() {
FileBasedIndex.getInstance().removeIndexableSet(indexableFileSet);
}
});
Disposer.register(module.getProject(), () -> FileBasedIndex.getInstance().removeIndexableSet(indexableFileSet));
return srcRoot;
}
protected void createContentEntry(@NotNull final Module module, @NotNull final VirtualFile srcRoot) {
updateModel(module, new Consumer<ModifiableRootModel>() {
@Override
public void consume(ModifiableRootModel model) {
Sdk sdk = getSdk();
if (sdk != null) {
model.setSdk(sdk);
}
ContentEntry contentEntry = model.addContentEntry(srcRoot);
contentEntry.addSourceFolder(srcRoot, false);
configureModule(module, model, contentEntry);
updateModel(module, model -> {
Sdk sdk = getSdk();
if (sdk != null) {
model.setSdk(sdk);
}
ContentEntry contentEntry = model.addContentEntry(srcRoot);
contentEntry.addSourceFolder(srcRoot, false);
configureModule(module, model, contentEntry);
});
}
@@ -163,9 +147,12 @@ public class LightProjectDescriptor {
protected void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
}
public interface SetupHandler {
void moduleCreated(@NotNull Module module);
void sourceRootCreated(@NotNull VirtualFile sourceRoot);
}
default void moduleCreated(@NotNull Module module) {
}
default void sourceRootCreated(@NotNull VirtualFile sourceRoot) {
}
}
}
@@ -53,6 +53,7 @@ public class EnvironmentUtil {
private static final String LC_CTYPE = "LC_CTYPE";
private static final Future<Map<String, String>> ourEnvGetter;
static {
if (SystemInfo.isMac && "unlocked".equals(System.getProperty("__idea.mac.env.lock")) && Registry.is("idea.fix.mac.env")) {
ourEnvGetter = AppExecutorUtil.getAppExecutorService().submit(new Callable<Map<String, String>>() {
@@ -149,6 +150,8 @@ public class EnvironmentUtil {
return array;
}
private static final String DISABLE_OMZ_AUTO_UPDATE = "DISABLE_AUTO_UPDATE";
private static Map<String, String> getShellEnv() throws Exception {
String shell = System.getenv("SHELL");
if (shell == null || !new File(shell).canExecute()) {
@@ -168,15 +171,16 @@ public class EnvironmentUtil {
String[] command = {shell, "-l", "-i", "-c", "'" + reader.getAbsolutePath() + "' '" + envFile.getAbsolutePath() + "'"};
LOG.info("loading shell env: " + StringUtil.join(command, " "));
Process process = new ProcessBuilder(command).redirectErrorStream(true).start();
ProcessBuilder builder = new ProcessBuilder(command).redirectErrorStream(true);
builder.environment().put(DISABLE_OMZ_AUTO_UPDATE, "true");
Process process = builder.start();
StreamGobbler gobbler = new StreamGobbler(process.getInputStream());
int rv = waitAndTerminateAfter(process, SHELL_ENV_READING_TIMEOUT);
gobbler.stop();
String lines = FileUtil.loadFile(envFile);
if (rv != 0 || lines.isEmpty()) {
LOG.info("shell process output: " + StringUtil.trimEnd(gobbler.getText(), '\n'));
throw new Exception("rv:" + rv + " text:" + lines.length());
throw new Exception("rv:" + rv + " text:" + lines.length() + " out:" + StringUtil.trimEnd(gobbler.getText(), '\n'));
}
return parseEnv(lines);
}
@@ -186,7 +190,7 @@ public class EnvironmentUtil {
}
private static Map<String, String> parseEnv(String text) throws Exception {
Set<String> toIgnore = new HashSet<String>(Arrays.asList("_", "PWD", "SHLVL"));
Set<String> toIgnore = new HashSet<String>(Arrays.asList("_", "PWD", "SHLVL", DISABLE_OMZ_AUTO_UPDATE));
Map<String, String> env = System.getenv();
Map<String, String> newEnv = new HashMap<String, String>();
@@ -299,7 +303,6 @@ public class EnvironmentUtil {
}
private static class StreamGobbler extends BaseOutputReader {
private final StringBuffer myBuffer;
public StreamGobbler(@NotNull InputStream stream) {
@@ -324,4 +327,4 @@ public class EnvironmentUtil {
return myBuffer.toString();
}
}
}
}
@@ -103,9 +103,9 @@ public abstract class BaseOutputReader extends BaseDataReader {
processLine(myInputBuffer, myLineBuffer, n);
}
boolean isReady = availableUnsupported || myReader.ready();
boolean isReady = myReader.ready();
if (!isReady) {
if (!availableUnsupported && !isReady) {
TimeoutUtil.sleep(mySleepingPolicy.getTimeToSleep(n > 0));
isReady = myReader.ready();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* 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.
@@ -63,4 +63,4 @@ public class EnvironmentUtilTest {
Map<String, String> env = EnvironmentUtil.testLoader();
assertTrue(env.size() >= System.getenv().size() / 2);
}
}
}
@@ -49,7 +49,6 @@ import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
public class ShelvedChange {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.shelf.ShelvedChange");
@@ -58,7 +57,6 @@ public class ShelvedChange {
private final String myBeforePath;
private final String myAfterPath;
private final FileStatus myFileStatus;
private final AtomicReference<Boolean> myIsConflicting;
private Change myChange;
public ShelvedChange(final String patchPath, final String beforePath, final String afterPath, final FileStatus fileStatus) {
@@ -67,25 +65,19 @@ public class ShelvedChange {
// optimisation: memory
myAfterPath = Comparing.equal(beforePath, afterPath) ? beforePath : afterPath;
myFileStatus = fileStatus;
myIsConflicting = new AtomicReference<Boolean>();
}
public boolean isConflictingChange(final Project project) {
Boolean isConflicting = myIsConflicting.get();
if (isConflicting != null) return isConflicting;
ContentRevision afterRevision = getChange(project).getAfterRevision();
if (afterRevision == null) return false;
try {
afterRevision.getContent();
}
catch(VcsException e) {
catch (VcsException e) {
if (e.getCause() instanceof ApplyPatchException) {
myIsConflicting.set(true);
return true;
}
}
myIsConflicting.set(false);
return false;
}
@@ -204,7 +196,6 @@ public class ShelvedChange {
private final Project myProject;
private final FilePath myBeforeFilePath;
private final FilePath myAfterFilePath;
private String myContent;
public PatchedContentRevision(Project project, final FilePath beforeFilePath, final FilePath afterFilePath) {
myProject = project;
@@ -215,16 +206,13 @@ public class ShelvedChange {
@Override
@Nullable
public String getContent() throws VcsException {
if (myContent == null) {
try {
myContent = loadContent();
}
catch (Exception e) {
throw new VcsException(e);
}
try {
// content based on local shouldn't be cached because local file may be changed (during show diff also)
return loadContent();
}
catch (Exception e) {
throw new VcsException(e);
}
return myContent;
}
@Nullable
@@ -93,7 +93,10 @@ public class FxmlReferencesContributor extends PsiReferenceContributor {
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withValue(string().startsWith("@")).and(attributeValueInFxml),
new JavaFxLocationReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withValue(string().startsWith("$")).and(attributeValueInFxml),
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withValue(string().startsWith("$"))
.withParent(XmlPatterns.xmlAttribute()
.andNot(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_VALUE)))
.and(attributeValueInFxml),
new JavaFxComponentIdReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName("url")).and(attributeValueInFxml),
@@ -49,10 +49,6 @@ class JavaFxComponentIdReferenceProvider extends PsiReferenceProvider {
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element,
@NotNull ProcessingContext context) {
final PsiElement parent = element.getParent();
if (parent instanceof XmlAttribute && FxmlConstants.FX_VALUE.equals(((XmlAttribute)parent).getName())) {
return PsiReference.EMPTY_ARRAY;
}
final XmlAttributeValue xmlAttributeValue = (XmlAttributeValue)element;
final String value = xmlAttributeValue.getValue();
if (JavaFxPsiUtil.isIncorrectExpressionBinding(value)) {
@@ -160,17 +160,27 @@ public class MavenPlugin implements Serializable {
private final List<String> myGoals;
private final Element myConfiguration;
private final String myExecutionId;
private final String myPhase;
public Execution(String executionId, List<String> goals, Element configuration) {
this(executionId, null, goals, configuration);
}
public Execution(String executionId, String phase, List<String> goals, Element configuration) {
myGoals = goals;
myConfiguration = configuration;
myExecutionId = executionId;
myPhase = phase;
}
public String getExecutionId() {
return myExecutionId;
}
public String getPhase() {
return myPhase;
}
public List<String> getGoals() {
return myGoals;
}
@@ -189,6 +199,7 @@ public class MavenPlugin implements Serializable {
if (myGoals != null ? !myGoals.equals(that.myGoals) : that.myGoals != null) return false;
if (myExecutionId != null ? !myExecutionId.equals(that.myExecutionId) : that.myExecutionId != null) return false;
if (myPhase != null ? !myPhase.equals(that.myPhase) : that.myPhase != null) return false;
if (!JDOMUtil.areElementsEqual(myConfiguration, that.myConfiguration)) return false;
return true;
@@ -200,6 +211,9 @@ public class MavenPlugin implements Serializable {
if (myExecutionId != null) {
result = 31 * result + myExecutionId.hashCode();
}
if (myPhase != null) {
result = 31 * result + myPhase.hashCode();
}
return result;
}
@@ -273,7 +273,7 @@ public class Maven2ModelConverter {
}
public static MavenPlugin.Execution convertExecution(PluginExecution execution) throws RemoteException {
return new MavenPlugin.Execution(execution.getId(), execution.getGoals(), convertConfiguration(execution.getConfiguration()));
return new MavenPlugin.Execution(execution.getId(), execution.getPhase(), execution.getGoals(), convertConfiguration(execution.getConfiguration()));
}
private static Element convertConfiguration(Object config) throws RemoteException {
@@ -264,7 +264,7 @@ public class MavenModelConverter {
}
public static MavenPlugin.Execution convertExecution(PluginExecution execution) throws RemoteException {
return new MavenPlugin.Execution(execution.getId(), execution.getGoals(), convertConfiguration(execution.getConfiguration()));
return new MavenPlugin.Execution(execution.getId(), execution.getPhase(), execution.getGoals(), convertConfiguration(execution.getConfiguration()));
}
private static Element convertConfiguration(Object config) throws RemoteException {
@@ -11,74 +11,74 @@
<display-name>"SQL select/delete/insert/update/create"</display-name>
<!-- template for SQL statements -->
<!-- \/ matches SQL comments \/ \/ start statement regexp here -->
<!-- <place><![CDATA[pyStringLiteralMatches("^\\s*((((- -|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*")]]></place> -->
<!-- \/ matches SQL comments \/ \/ start statement regexp here -->
<!-- <place><![CDATA[pyStringLiteralMatches("^\\s*((((- -|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*")]]></place> -->
<!-- /\ don't forget to remove this space -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(SELECT\\s.+?\\sFROM\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(SELECT\\s.+?\\sFROM\\s.+)")]]></place>
<!-- SELECT smth FROM smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(INSERT\\s+INTO\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(INSERT\\s+INTO\\s.+)")]]></place>
<!-- INSERT INTO smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(UPDATE\\s.+?\\sSET\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(UPDATE\\s.+?\\sSET\\s.+)")]]></place>
<!-- UPDATE smth SET smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(DELETE\\s+(\\*\\s+)?FROM\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(DELETE\\s+(\\*\\s+)?FROM\\s.+)")]]></place>
<!-- DELETE *? FROM smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*((CREATE|DROP)\\s+DATABASE\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*((CREATE|DROP)\\s+DATABASE\\s.+)")]]></place>
<!-- CREATE|DROP DATABASE smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(CREATE\\s+TABLE\\s.+?\\(.+?\\))")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(CREATE\\s+TABLE\\s.+?\\(.+?\\))")]]></place>
<!-- CREATE TABLE smth (...) -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*((ALTER|TRUNCATE)\\s+TABLE\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*((ALTER|TRUNCATE)\\s+TABLE\\s.+)")]]></place>
<!-- ALTER|TRUNCATE TABLE smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(DROP\\s+TABLE\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(DROP\\s+TABLE\\s.+)")]]></place>
<!-- DROP TABLE smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(CREATE\\s+(UNIQUE\\s+)?INDEX\\s.+?\\sON\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(CREATE\\s+(UNIQUE\\s+)?INDEX\\s.+?\\sON\\s.+)")]]></place>
<!-- CREATE UNIQUE? INDEX smth ON smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*((ALTER|DROP)\\s+INDEX\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*((ALTER|DROP)\\s+INDEX\\s.+)")]]></place>
<!-- ALTER|DROP INDEX smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?VIEW\\s.+?\\sAS\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?VIEW\\s.+?\\sAS\\s.+)")]]></place>
<!-- CREATE (OR REPLACE)? VIEW smth AS smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*((ALTER|DROP)\\s+VIEW\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*((ALTER|DROP)\\s+VIEW\\s.+)")]]></place>
<!-- ALTER|DROP VIEW smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(REPLACE\\s+INTO\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(REPLACE\\s+INTO\\s.+)")]]></place>
<!-- REPLACE INTO smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(WITH\\s.+?\\sAS\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(WITH\\s.+?\\sAS\\s.+)")]]></place>
<!-- WITH smth AS smth-->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(COPY\\s.+?\\s(FROM|TO)\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(COPY\\s.+?\\s(FROM|TO)\\s.+)")]]></place>
<!-- COPY smth (FROM|TO) smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?TRIGGER\\s.+?\\sON\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?TRIGGER\\s.+?\\sON\\s.+)")]]></place>
<!-- CREATE (OR REPLACE)? TRIGGER smth ON smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?FUNCTION\\s.+?\\sRETURNS?\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?FUNCTION\\s.+?\\sRETURNS?\\s.+)")]]></place>
<!-- CREATE (OR REPLACE)? FUNCTION smth RETURNS? smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?PROC(EDURE)?\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(CREATE\\s+(OR\\s+REPLACE\\s+)?PROC(EDURE)?\\s.+)")]]></place>
<!-- CREATE (OR REPLACE)? PROC(EDURE)? smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(ALTER\\s+SEQUENCE\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(ALTER\\s+SEQUENCE\\s.+)")]]></place>
<!-- ALTER SEQUENCE smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(BEGIN\\s.+\\sEND;?\$)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(BEGIN\\s.+\\sEND;?\$)")]]></place>
<!-- Oracle transaction: BEGIN smth END;?$ -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*(BEGIN\\s+TRAN(SACTION)?\\s.+)")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*(BEGIN\\s+TRAN(SACTION)?\\s.+)")]]></place>
<!-- TSQL transaction: BEGIN TRAN(SACTION)? smth -->
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*.*?\\*/))(\r\n|\n|\r))*\\s*((BEGIN)|(START TRANSACTION))(\\s[^\n\r]+)?;")]]></place>
<place><![CDATA[pyStringLiteralMatches("^\\s*((((--|#)[^\n\r]*)|(/\\*([^*]|\\*[^/])*\\*+/))(\r\n|\n|\r))*\\s*((BEGIN)|(START TRANSACTION))(\\s[^\n\r]+)?;")]]></place>
<!-- MySQL/PostgreSQL transaction: ((BEGIN)|(START TRANSACTION))( smth)?; -->
</injection>
</component>
@@ -175,6 +175,11 @@ public layoutCommunity(String classesPath, Set usedJars) {
List pathsDist = new File("${home}/out/pycharm/jdk.win/jre").exists() ? [paths.distAll, paths.distWin, "${home}/out/pycharm/jdk.win"] : [paths.distAll, paths.distWin]
buildWinZip("${paths.artifacts}/pycharmPC-${buildNumber}.zip", pathsDist)
//win oracle jdk
if (new File("${home}/out/pycharm/jdk.oracle.win/jre").exists()) {
buildWinZip("${paths.artifacts}/pycharmPC-${buildNumber}-oracle-win.zip", [paths.distAll, paths.distWin, "${home}/out/pycharm/jdk.oracle.win"])
}
String tarRoot = isEap() ? "pycharm-community-$buildNumber" : "pycharm-community-${p("component.version.major")}.${p("component.version.minor")}"
buildTarGz(tarRoot, "$paths.artifacts/pycharmPC-${buildNumber}-no-jdk.tar", [paths.distAll, paths.distUnix])
requireProperty("jdk.linux", "false")
@@ -210,6 +210,10 @@ public layoutEducational(String classesPath, Set usedJars) {
buildNSIS([paths.distAll, paths.distWin],
"$pythonEduHome/build/strings.nsi", "$pythonEduHome/build/paths.nsi",
"pycharmEDU-", false, true, system_selector)
//win oracle jdk
if (new File("${home}/out/pycharm/jdk.oracle.win/jre").exists()) {
buildWinZip("${paths.artifacts}/pycharm${buildName}-oracle-win.zip", [paths.distAll, paths.distWin, "${home}/out/pycharm/jdk.oracle.win"])
}
String tarRoot = isEap() ? "pycharm-edu-$buildNumber" : "pycharm-edu-${p("component.version.major")}.${p("component.version.minor")}"
buildTarGz(tarRoot, "$paths.artifacts/pycharm${buildName}-no-jdk.tar", [paths.distAll, paths.distUnix])