Skip to content

Commit

Permalink
Upgrade to 2018.1 compatibility (#335)
Browse files Browse the repository at this point in the history
Also addresses #327
  • Loading branch information
wisechengyi committed Mar 13, 2018
1 parent d392ed1 commit 59a7e14
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .idea/runConfigurations/Pants.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions 3rdparty/intellij/BUILD
Expand Up @@ -199,10 +199,7 @@ jar_library(
dependencies = [':groovy-plugin'],
jars = [
_intellij_plugin_jar('gradle-plugin', path) for path in _find_jars_blacklist(
_find_plugin_dir('gradle'), blacklist=[
# A workaround to avoid guava version conflicts/shadowing with the one under $IDEA/lib
'guava-jdk5-17.0.jar',
]
_find_plugin_dir('gradle')
)
],
scope='compile test',
Expand Down
2 changes: 1 addition & 1 deletion common/com/twitter/intellij/pants/util/PantsUtil.java
Expand Up @@ -846,7 +846,7 @@ public static Optional<Sdk> getDefaultJavaSdk(@NotNull final String pantsExecuta
if (jdkInfo != null) {
// Using IJ's framework to detect jdk version. so jdkInfo.getVersion() returns `java version "1.8.0_121"`
for (String version : ContainerUtil.newArrayList("1.6", "1.7", "1.8", "1.9")) {
if (jdkInfo.getVersion().contains(version)) {
if (jdkInfo.version.toString().contains(version)) {
jdkName = String.format("%s_from_%s", version, pantsExecutable);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/META-INF/plugin.xml
Expand Up @@ -15,7 +15,7 @@
<version>1.8.1</version>
<vendor>Twitter, Inc.</vendor>

<idea-version since-build="173.0" until-build="173.*"/>
<idea-version since-build="181.0" until-build="181.*"/>

<!--Scala plugin related extensions-->
<depends>org.intellij.scala</depends>
Expand Down
14 changes: 7 additions & 7 deletions scripts/prepare-ci-environment.sh
Expand Up @@ -10,8 +10,8 @@ fi
# Python plugin for Community and Ultimate Edition

export CWD=$(pwd)
export IJ_VERSION="2017.3.4"
export IJ_BUILD_NUMBER="173.4548.28"
export IJ_VERSION="181.4096.5"
export IJ_BUILD_NUMBER="181.4096.5"

get_md5(){
if [[ $OSTYPE == *"darwin"* ]]; then
Expand All @@ -24,20 +24,20 @@ get_md5(){
if [[ "${IJ_ULTIMATE:-false}" == "true" ]]; then
export IJ_BUILD="IU-${IJ_VERSION}"
export FULL_IJ_BUILD_NUMBER="IU-${IJ_BUILD_NUMBER}"
export EXPECTED_IJ_MD5="96beb7f3b0e1f884104aa70cf72a4a2f"
export EXPECTED_IJ_MD5="7ec42187111ed0224bfacac840ec1df5"
export PYTHON_PLUGIN_ID="Pythonid"
export PYTHON_PLUGIN_MD5="c90c79d802cfae67aea616c2127c9657"
export PYTHON_PLUGIN_MD5="a7a89e76f1818370893934ccf32f1e59"
else
export IJ_BUILD="IC-${IJ_VERSION}"
export FULL_IJ_BUILD_NUMBER="IC-${IJ_BUILD_NUMBER}"
export EXPECTED_IJ_MD5="84e7374f7cab5b5e5a9c202fc4f046ca"
export EXPECTED_IJ_MD5="8aede7d661874aa91c226df71cd34c39"
export PYTHON_PLUGIN_ID="PythonCore"
export PYTHON_PLUGIN_MD5="85a5b2addeb195f82379a928d3b3a2fe"
export PYTHON_PLUGIN_MD5="360e88a4725c6cdb174b0e72919aaf97"
fi

# we will use Community ids to download plugins.
export SCALA_PLUGIN_ID="org.intellij.scala"
export SCALA_PLUGIN_MD5="e3446c71e42f1844b1dbc45c207b007b"
export SCALA_PLUGIN_MD5="bc2af0cd2d27bce4652d01b8eb9f7d2e"

export INTELLIJ_PLUGINS_HOME="$CWD/.cache/intellij/$FULL_IJ_BUILD_NUMBER/plugins"
export INTELLIJ_HOME="$CWD/.cache/intellij/$FULL_IJ_BUILD_NUMBER/idea-dist"
Expand Down
Expand Up @@ -25,6 +25,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;

public class AddPantsTargetDependencyFix extends PantsQuickFix {
protected final PantsTargetAddress myAddress;
protected final PantsTargetAddress myAddressToAdd;
Expand Down Expand Up @@ -90,7 +92,7 @@ public void doInsert(
if (dependenciesArgument == null) {
final PyKeywordArgument keywordArgument =
generator.createKeywordArgument(LanguageLevel.forElement(buildFile), "dependencies", "['"+ targetAddressStringToAdd + "']");
targetDefinitionExpression.addArgument(keywordArgument);
Optional.ofNullable(targetDefinitionExpression.getArgumentList()).ifPresent(l -> l.addArgument(keywordArgument));
} else if (dependenciesArgument instanceof PyListLiteralExpression) {
PyExpression position = null;
// we assume all elements are sorted.
Expand Down
Expand Up @@ -3,7 +3,6 @@

package com.twitter.intellij.pants.testFramework;

import com.intellij.execution.ExecutionTarget;
import com.intellij.execution.Executor;
import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.configurations.ConfigurationFactory;
Expand Down Expand Up @@ -103,11 +102,6 @@ public void checkSettings(@Nullable Executor executor) throws RuntimeConfigurati
myRunConfiguration.checkConfiguration();
}

@Override
public boolean canRunOn(@NotNull ExecutionTarget target) {
return true;
}

@Override
public Factory<RunnerAndConfigurationSettings> createFactory() {
return new Factory<RunnerAndConfigurationSettings>() {
Expand Down
Expand Up @@ -4,11 +4,11 @@
package com.twitter.intellij.pants.service.project.model.graph;

import com.google.common.collect.Sets;
import com.intellij.util.containers.HashMap;
import com.twitter.intellij.pants.service.project.model.TargetInfo;
import com.twitter.intellij.pants.service.project.model.TargetInfoTest;
import junit.framework.TestCase;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
Expand Down

0 comments on commit 59a7e14

Please sign in to comment.