Merge remote-tracking branch 'origin/master'

This commit is contained in:
anna
2013-04-11 15:43:04 +02:00
16 changed files with 138 additions and 25 deletions
@@ -0,0 +1,62 @@
/*
* Copyright 2000-2013 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 com.intellij.compiler;
import com.intellij.internal.statistic.CollectUsagesException;
import com.intellij.internal.statistic.UsagesCollector;
import com.intellij.internal.statistic.beans.GroupDescriptor;
import com.intellij.internal.statistic.beans.UsageDescriptor;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
* @author Eugene Zhuravlev
* Date: 4/11/13
*/
public class CompilerSettingsUsageCollector extends UsagesCollector{
public static final String GROUP_ID = "compiler";
@NotNull
@Override
public Set<UsageDescriptor> getUsages(@Nullable Project project) throws CollectUsagesException {
final CompilerWorkspaceConfiguration wsConfig = CompilerWorkspaceConfiguration.getInstance(project);
if (!wsConfig.useOutOfProcessBuild()) {
return Collections.emptySet();
}
final Set<UsageDescriptor> result = new HashSet<UsageDescriptor>();
result.add(new UsageDescriptor("external_build", 1));
if (wsConfig.MAKE_PROJECT_ON_SAVE) {
result.add(new UsageDescriptor("auto_make", 1));
}
if (wsConfig.PARALLEL_COMPILATION) {
result.add(new UsageDescriptor("compile_parallel", 1));
}
return result;
}
@NotNull
@Override
public GroupDescriptor getGroupId() {
return GroupDescriptor.create(GROUP_ID);
}
}
@@ -85,7 +85,11 @@ public class CompileServerClasspathManager {
else {
//development mode: add directory out/classes/production/<jar-name> to classpath, assuming that jar-name is equal to module name
final String moduleName = FileUtil.getNameWithoutExtension(PathUtil.getFileName(relativePath));
final File dir = new File(baseFile.getParentFile(), moduleName);
File baseOutputDir = baseFile.getParentFile();
if (baseOutputDir.getName().equals("test")) {
baseOutputDir = new File(baseOutputDir.getParentFile(), "production");
}
final File dir = new File(baseOutputDir, moduleName);
if (dir.exists()) {
classpath.add(dir.getPath());
}
@@ -98,12 +102,13 @@ public class CompileServerClasspathManager {
classpath.add(libraryFile.getPath());
}
else {
LOG.error("Cannot add plugin '" + plugin.getName() + "' to external compiler classpath: " +
LOG.error("Cannot add " + relativePath + " from plugin '" + plugin.getName() + "' to external compiler classpath: " +
"library " + libraryFile.getAbsolutePath() + " not found");
}
}
else {
LOG.error("Cannot add plugin '" + plugin.getName() + "' to external compiler classpath: home directory of plugin not found");
LOG.error("Cannot add " + relativePath + " from plugin '" + plugin.getName() +
"' to external compiler classpath: home directory of plugin not found");
}
}
}
@@ -17,6 +17,7 @@
package com.intellij.ide;
import com.intellij.CommonBundle;
import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.PropertyKey;
@@ -39,6 +40,22 @@ public class IdeBundle {
return CommonBundle.message(getBundle(), key, params);
}
public static String settingsTitle() {
return SystemInfo.isMac ? message("title.settings.mac") : message("title.settings");
}
public static String settingsAction() {
return SystemInfo.isMac ? message("action.settings.mac") : message("action.settings");
}
public static String settingsActionDescription() {
return SystemInfo.isMac ? message("action.settings.description.mac") : message("action.settings.description");
}
public static String settingsActionPath() {
return SystemInfo.isMac ? message("action.settings.path.mac") : message("action.settings.path");
}
private static ResourceBundle getBundle() {
ResourceBundle bundle = null;
if (ourBundle != null) bundle = ourBundle.get();
@@ -131,13 +131,13 @@
<border type="none"/>
<children/>
</grid>
<component id="978ed" class="javax.swing.JLabel">
<component id="978ed" class="javax.swing.JLabel" binding="myPreferencesLabel">
<constraints>
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
</constraints>
<properties>
<font size="11"/>
<text value="You can use the Preferences dialog to configure any of these settings later."/>
<text value=""/>
</properties>
</component>
<grid id="90b80" binding="myExtraOptionsPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@@ -20,6 +20,7 @@ import com.intellij.application.options.colors.NewColorAndFontPanel;
import com.intellij.application.options.colors.SimpleEditorPreview;
import com.intellij.icons.AllIcons;
import com.intellij.ide.DataManager;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.actions.CreateDesktopEntryAction;
import com.intellij.ide.actions.CreateLauncherScriptAction;
import com.intellij.ide.todo.TodoConfiguration;
@@ -76,6 +77,7 @@ public class InitialConfigurationDialog extends DialogWrapper {
private JCheckBox myGlobalEntryCheckBox;
private JPanel myCreateEntryPanel;
private ComboBox myAppearanceComboBox;
private JLabel myPreferencesLabel;
private String myColorSettingsPage;
private SimpleEditorPreview myPreviewEditor;
private ColorAndFontOptions myPreviewOptions;
@@ -177,6 +179,8 @@ public class InitialConfigurationDialog extends DialogWrapper {
myGlobalEntryCheckBox.setSelected(!PathManager.getHomePath().startsWith("/home"));
}
myPreferencesLabel.setText("You can use "+ IdeBundle.settingsActionPath() + " to configure any of these settings later.");
Disposer.register(myDisposable, new Disposable() {
@Override
public void dispose() {
@@ -107,9 +107,8 @@ public class ParametersList implements Cloneable {
}
public void prependAll(@NonNls final String... parameter) {
for (int i = parameter.length - 1; i >= 0; i--) {
addAt(0, parameter[i]);
}
addAll(parameter);
Collections.rotate(myParameters, parameter.length);
}
public void addParametersString(final String parameters) {
@@ -226,11 +225,14 @@ public class ParametersList implements Cloneable {
}
public void addAll(final String... parameters) {
ContainerUtil.addAll(myParameters, parameters);
addAll(Arrays.asList(parameters));
}
public void addAll(final List<String> parameters) {
myParameters.addAll(parameters);
// Don't use myParameters.addAll(parameters) , it does not call expandMacros(parameter)
for (String parameter : parameters) {
add(parameter);
}
}
@Override
@@ -51,8 +51,10 @@ import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
@@ -178,7 +180,8 @@ public class BrowserUtil {
String browserPath = getGeneralSettingsInstance().getBrowserPath();
if (StringUtil.isEmptyOrSpaces(browserPath)) {
showErrorMessage(IdeBundle.message("error.please.specify.path.to.web.browser"), IdeBundle.message("title.browser.not.found"));
showErrorMessage(IdeBundle.message("error.please.specify.path.to.web.browser", IdeBundle.settingsActionPath()),
IdeBundle.message("title.browser.not.found"));
return;
}
@@ -15,6 +15,8 @@
*/
package com.intellij.ide.actions;
import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -31,12 +33,19 @@ import com.intellij.openapi.util.SystemInfo;
import javax.swing.*;
public class ShowSettingsAction extends AnAction implements DumbAware {
public ShowSettingsAction() {
super(IdeBundle.settingsAction(), IdeBundle.settingsActionDescription(), AllIcons.General.Settings);
}
@Override
public void update(AnActionEvent e) {
if (SystemInfo.isMac && e.getPlace().equals(ActionPlaces.MAIN_MENU)) {
// It's called from Preferences in App menu.
e.getPresentation().setVisible(false);
}
if (e.getPlace().equals(ActionPlaces.WELCOME_SCREEN)) {
e.getPresentation().setText(IdeBundle.settingsTitle());
}
}
public void actionPerformed(AnActionEvent e) {
@@ -16,6 +16,7 @@
package com.intellij.openapi.options.newEditor;
import com.intellij.CommonBundle;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.ui.search.SearchUtil;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.actionSystem.DataProvider;
@@ -67,7 +68,7 @@ public class OptionsEditorDialog extends DialogWrapper implements DataProvider{
myGroups = groups;
myPreselected = preselected;
setTitle("Settings");
setTitle(IdeBundle.settingsTitle());
init();
}
@@ -247,8 +247,6 @@ group.reopen.mac.text=Open _Recent
group.$LRU.description=List of recently opened projects
action.CloseProject.text=Close Pro_ject
action.CloseProject.description=Close current project
action.ShowSettings.text=Se_ttings...
action.ShowSettings.description=Configure application settings
action.ShowProjectStructureSettings.text=Project Structure...
action.ShowProjectStructureSettings.description=Configure project structure
action.TemplateProjectProperties.text=Def_ault Settings...
@@ -1162,8 +1160,6 @@ action.WelcomeScreen.CreateNewProject.description=Start the \"New Project\" Wiza
action.WelcomeScreen.ImportProject.text=Import Project
action.WelcomeScreen.ImportProject.description=Create {0} project structure for directory with existing sources or convert existing project model.
action.WelcomeScreen.JetBrainsTV.IDEA.text=JetBrains TV
action.WelcomeScreen.Settings.text=Settings
action.WelcomeScreen.Settings.description=Edit Settings
action.WelcomeScreen.Plugins.text=Plugins
action.WelcomeScreen.Plugins.description=Manage installed plugins and download new ones from repository
action.WelcomeScreen.Configure.Import.text=Import Settings
@@ -1,7 +1,16 @@
title.settings=Settings
title.settings.mac=Preferences
action.settings=Se_ttings...
action.settings.mac=Preferences...
action.settings.description=Edit application settings
action.settings.description.mac=Edit application preferences
action.settings.path=File | Settings
action.settings.path.mac=Preferences
title.cannot.start.browser=Cannot start browser
error.malformed.url=Malformed url: {0}
error.cannot.start.browser=Cannot start browser: {0}
error.please.specify.path.to.web.browser=Please specify a path to web browser in File | Settings | Web Browsers
error.please.specify.path.to.web.browser=Please specify a path to web browser in {0} | Web Browsers
title.browser.not.found=Browser Not Found
title.browser.path.not.found=Browser Path Not Found
action.sort.alphabetically=Sort Alphabetically
@@ -153,7 +153,7 @@
</group>
<separator/>
<group id="FileMainSettingsGroup">
<action id="ShowSettings" class="com.intellij.ide.actions.ShowSettingsAction" icon="AllIcons.General.Settings"/>
<action id="ShowSettings" class="com.intellij.ide.actions.ShowSettingsAction"/>
<group id="FileOtherSettingsGroup" class="com.intellij.ide.actions.SmartPopupActionGroup">
<action id="TemplateProjectProperties" class="com.intellij.ide.actions.TemplateProjectPropertiesAction"/>
<group id="FileSettingsGroup"/>
@@ -4,5 +4,5 @@
<description>
This fake plugin descriptor is used to run tests
</description>
<!--<xi:include href="/META-INF/google-app-engine-plugin.xml" xpointer="xpointer(/idea-plugin/*)"/>-->
<xi:include href="/META-INF/google-app-engine-plugin.xml" xpointer="xpointer(/idea-plugin/*)"/>
</idea-plugin>
@@ -60,12 +60,16 @@ public class MavenJUnitPatcher extends JUnitPatcher {
Element systemPropertyVariables = config.getChild("systemPropertyVariables");
if (systemPropertyVariables != null) {
for (Element element : (List<Element>)systemPropertyVariables.getChildren()) {
String propertyName = element.getName();
String value = element.getValue();
List<Element> propertiesDefinitions = (List<Element>)systemPropertyVariables.getChildren();
javaParameters.getVMParametersList().addProperty(propertyName, value);
String[] params = new String[propertiesDefinitions.size()];
int i = 0;
for (Element element : propertiesDefinitions) {
params[i++] = "-D" + element.getName() + "=" + element.getValue();
}
javaParameters.getVMParametersList().prependAll(params);
}
Element environmentVariables = config.getChild("environmentVariables");
@@ -218,7 +218,7 @@ radio.configure.change.auto.15format=1.&5 format
radio.configure.change.auto.16format=1.&6 format
radio.configure.change.auto.17format=1.&7 format
label.where.svn.format.settings.text=To change above setting later, visit 'File | Settings | Version Control'
label.where.svn.format.settings.text=To change above setting later, visit '{0} | Version Control'
label.where.svn.format.can.be.changed.text=''Version Control | Subversion | {0}''
dialog.upgrade.wcopy.format.title=Subversion Working Copy Format
@@ -327,6 +327,7 @@
<moduleConfigurationEditorProvider implementation="com.intellij.openapi.roots.ui.configuration.DefaultModuleEditorsProvider" order="first"/>
<statistics.usagesCollector implementation="com.intellij.openapi.roots.ui.configuration.libraries.impl.LibraryUsageCollector"/>
<statistics.usagesCollector implementation="com.intellij.compiler.CompilerSettingsUsageCollector"/>
<getDataRule key="context.ProjectFileDirectory" implementationClass="com.intellij.ide.impl.dataRules.ProjectFileDirectoryRule"/>