Skip to content

Commit

Permalink
Update build for IDEA 2022.1
Browse files Browse the repository at this point in the history
  • Loading branch information
carymrobbins committed Jul 17, 2022
1 parent e97568e commit 5e39660
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 32 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.intellij" version "0.6.5"
id "org.jetbrains.intellij" version "1.7.0"
}

version = file('version.txt').text.trim()
Expand Down Expand Up @@ -29,7 +29,7 @@ allprojects {
apply plugin: 'org.jetbrains.intellij'

intellij {
version = '2021.1'
version = '2022.1'
pluginName = 'HaskForce'
plugins = ['java', 'yaml']
}
Expand Down Expand Up @@ -151,7 +151,7 @@ patchPluginXml {
test.outputs.upToDateWhen { false }

buildPlugin {
archiveName = "haskforce-${patchPluginXml.version}.zip"
archiveFileName = "haskforce-${getPluginVersion()}.zip"
}

test {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Aug 17 09:59:17 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
22 changes: 19 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
22 changes: 9 additions & 13 deletions jps-shared/src/com/haskforce/importWizard/stack/StackYaml.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package com.haskforce.importWizard.stack

import java.io.File
import java.util

import scala.collection.JavaConverters._
import scala.util.control.NonFatal
import com.intellij.openapi.util.io.FileUtil
import scalaz.\/
import scalaz.std.list._
import scalaz.syntax.either._
import scalaz.syntax.traverse._
import scalaz.std.list._

import com.intellij.openapi.util.io.FileUtil
import java.io.File
import java.util
import scala.collection.JavaConverters._

/**
* The parse result of a stack.yaml file.
Expand Down Expand Up @@ -38,7 +36,7 @@ object StackYaml {
def fromString(doc: String): String \/ StackYaml = for {
assoc <- Yaml.parse(doc).flatMap(_.assoc).leftMap(_.message)
packages <- parsePackages(assoc)
} yield StackYaml(packages.map(Package(_)).asJava)
} yield StackYaml(packages.map(Package).asJava)

private def parsePackages(assoc: Map[String, Yaml]): String \/ List[String] = {
assoc.get("packages") match {
Expand Down Expand Up @@ -73,11 +71,9 @@ object Yaml {
final case class Error(message: String)

def parse(doc: String): Error \/ Yaml = {
try {
fromObject(new org.yaml.snakeyaml.Yaml().load(doc))
} catch {
case NonFatal(e) => Error(e.getMessage).left
}
\/.fromTryCatchNonFatal(new org.yaml.snakeyaml.Yaml().load(doc))
.leftMap(e => Error(e.getMessage))
.flatMap(fromObject)
}

def fromObject(o: Any): Error \/ Yaml = o match {
Expand Down
6 changes: 3 additions & 3 deletions src/com/haskforce/HaskellIcons.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.swing.*;

public class HaskellIcons {
public static final Icon FILE = IconLoader.getIcon("/icons/haskell.png");
public static final Icon TEST_FILE = IconLoader.getIcon("/icons/haskell-test.png");
public static final Icon ETA_FILE = IconLoader.getIcon("/icons/eta.png");
public static final Icon FILE = IconLoader.getIcon("/icons/haskell.png", HaskellIcons.class.getClassLoader());
public static final Icon TEST_FILE = IconLoader.getIcon("/icons/haskell-test.png", HaskellIcons.class.getClassLoader());
public static final Icon ETA_FILE = IconLoader.getIcon("/icons/eta.png", HaskellIcons.class.getClassLoader());
}
2 changes: 1 addition & 1 deletion src/com/haskforce/cabal/CabalIcons.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
import javax.swing.*;

public class CabalIcons {
public static final Icon FILE = IconLoader.getIcon("/icons/cabal.png");
public static final Icon FILE = IconLoader.getIcon("/icons/cabal.png", CabalIcons.class.getClassLoader());
}
4 changes: 1 addition & 3 deletions src/com/haskforce/settings/HaskellBuildSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import com.haskforce.jps.model.JpsHaskellBuildOptionsSerializer;
import com.haskforce.utils.ExecUtil;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StorageScheme;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -178,7 +176,7 @@ public String guessStackPath() {

@NotNull
public static HaskellBuildSettings getInstance(@NotNull Project project) {
HaskellBuildSettings settings = ServiceManager.getService(project, HaskellBuildSettings.class);
HaskellBuildSettings settings = project.getService(HaskellBuildSettings.class);
if (settings == null) settings = new HaskellBuildSettings();
settings.updatePaths();
return settings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/** Provides the editors available in Project Structure > Modules. */
public class HaskellModuleConfigurationEditor extends DefaultModuleEditorsProvider {
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
Module module = state.getRootModel().getModule();
Module module = state.getCurrentRootModel().getModule();
if (!(ModuleType.get(module) instanceof HaskellModuleType)) {
return ModuleConfigurationEditor.EMPTY;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.haskforce.tooling.ghcPkg

import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.project.Project

class GhcPkgDumpProjectCacheService {
Expand All @@ -16,6 +15,6 @@ class GhcPkgDumpProjectCacheService {

object GhcPkgDumpProjectCacheService {
def getInstance(project: Project): GhcPkgDumpProjectCacheService = {
ServiceManager.getService(project, classOf[GhcPkgDumpProjectCacheService])
project.getService(classOf[GhcPkgDumpProjectCacheService])
}
}

0 comments on commit 5e39660

Please sign in to comment.