Merge branch 'master' into vsoroka/gradle_native
authorVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Tue, 17 Apr 2018 16:34:09 +0000 (19:34 +0300)
committerVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Tue, 17 Apr 2018 16:34:09 +0000 (19:34 +0300)
# Conflicts:
# platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfiguration.java
# plugins/gradle/plugin-resources/META-INF/gradle-groovy-integration.xml
# plugins/gradle/plugin-resources/META-INF/plugin.xml

1  2 
.idea/modules.xml
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfiguration.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java
plugins/gradle/plugin-resources/META-INF/plugin.xml

Simple merge
index fba213bb6be947751bfecd02bc7438b5ec172e72,369d9fe0e87477b44f180f6d9af93f9b25d811c6..134f8140fabcd8d8d96767ed49d727f4e2103fe4
@@@ -432,38 -468,6 +447,42 @@@ public class ExternalSystemRunConfigura
        return executionResult;
      }
  
-         jvmAgentSetup = "-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=" + myDebugPort;
 +    @Nullable
 +    private String getJvmAgentSetup() throws ExecutionException {
 +      // todo [Vlad, IDEA-187832]: extract to `external-system-java` module
 +      if(!PlatformUtils.isIntelliJ()) return null;
 +
 +      final JavaParameters extensionsJP = new JavaParameters();
 +      final RunConfigurationExtension[] extensions = Extensions.getExtensions(RunConfigurationExtension.EP_NAME);
 +      for (RunConfigurationExtension ext : extensions) {
 +        ext.updateJavaParameters(myConfiguration, extensionsJP, myEnv.getRunnerSettings());
 +      }
 +
 +      String jvmAgentSetup;
++
 +      if (myDebugPort > 0) {
++        jvmAgentSetup = DEBUG_SETUP_PREFIX + myDebugPort;
++        if (getForkSocket() != null) {
++          jvmAgentSetup += " -forkSocket" + getForkSocket().getLocalPort();
++        }
 +      }
 +      else {
 +        ParametersList parametersList = extensionsJP.getVMParametersList();
 +        final ParametersList data = myEnv.getUserData(ExternalSystemTaskExecutionSettings.JVM_AGENT_SETUP_KEY);
 +        if (data != null) {
 +          parametersList.addAll(data.getList());
 +        }
 +        for (String parameter : parametersList.getList()) {
 +          if (parameter.startsWith("-agentlib:")) continue;
 +          if (parameter.startsWith("-agentpath:")) continue;
 +          if (parameter.startsWith("-javaagent:")) continue;
 +          throw new ExecutionException(ExternalSystemBundle.message("run.invalid.jvm.agent.configuration", parameter));
 +        }
 +        jvmAgentSetup = parametersList.getParametersString();
 +      }
 +      return jvmAgentSetup;
 +    }
 +
      private BuildProgressListener createBuildView(ExternalSystemTaskId id,
                                                    String executionName,
                                                    String workingDir,
index ad855af13337eda79c1fce26395014a15ff547a4,b46a0ca82e99b0123835b7f082b767039fb3036c..2c9c05c06b005b20ffe0c06bf4b30ed37533e9a9
    </description>
  
    <depends>com.intellij.modules.lang</depends>
-   <depends optional="true" config-file="gradle-java-integration.xml">com.intellij.modules.java</depends>
-   <depends optional="true" config-file="gradle-groovy-integration.xml">org.intellij.groovy</depends>
 +  <xi:include href="/META-INF/ExternalBuildSystemsSupport.xml" xpointer="xpointer(/idea-plugin/*)">
 +    <xi:fallback/>
 +  </xi:include>
+   <xi:include href="/META-INF/gradle-java-integration.xml" xpointer="xpointer(/idea-plugin/*)">
+     <xi:fallback/>
+   </xi:include>
  
    <resource-bundle>i18n.GradleBundle</resource-bundle>