Skip to content

Commit

Permalink
Update to current intellij
Browse files Browse the repository at this point in the history
  • Loading branch information
nexoscp committed Oct 26, 2023
1 parent 06afb47 commit 5dbc2e5
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 275 deletions.
31 changes: 14 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ buildscript {
repositories {
mavenCentral()
}
//dependencies { classpath(kotlin("gradle-plugin", "1.4.10")) }
}

repositories {
Expand All @@ -16,31 +15,28 @@ repositories {
}

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.7.0")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.7.0")
runtimeOnly("org.jetbrains.kotlin","kotlin-reflect", "1.5.10")
// implementation(kotlin("stdlib-jdk8"))
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.10.0")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.10.0")
runtimeOnly("org.jetbrains.kotlin","kotlin-reflect", "1.9.10")
}

plugins {
java
id("org.jetbrains.kotlin.jvm") version "1.5.10"
id("org.jetbrains.intellij") version "1.1.2"
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.9.10"
id("org.jetbrains.intellij") version "1.16.0"
}

//val pluginVersion: String by project
val pluginVersion: String by project

tasks.withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
sourceCompatibility = "17"
targetCompatibility = "17"
}

// compile bytecode to java 11 (default is java 6)
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
// freeCompilerArgs = listOf("-XXLanguage:+InlineClasses")
jvmTarget = "17"
}
}

Expand All @@ -51,7 +47,8 @@ tasks.withType<Test> {
intellij {
updateSinceUntilBuild.set(false)
downloadSources.set(true)
plugins.set(listOf("java", "org.jetbrains.plugins.gradle"))
plugins.set(listOf("java", "org.jetbrains.plugins.gradle", "com.intellij.java"))
version.set("2023.2.4")
}

tasks.publishPlugin {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
Expand Down Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
22 changes: 8 additions & 14 deletions src/main/java/org/xmolecules/ide/intellij/Concept.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,34 @@
import java.util.function.Predicate;

import com.intellij.psi.PsiJavaFile;
import org.jetbrains.annotations.NotNull;

class Concept implements Predicate<PsiJavaFile>, Comparable<Concept> {

private final String name, plural;
private final Predicate<PsiJavaFile> condition;

Concept(String name, String plural, Predicate<PsiJavaFile> condition) {

Concept(
@NotNull final String name,
@NotNull final String plural,
@NotNull final Predicate<PsiJavaFile> condition) {
this.name = name;
this.plural = plural;
this.condition = condition;
}

String getName() {
@NotNull String getName() {
return name;
}

String getPlural() {
@NotNull String getPlural() {
return plural;
}

/*
* (non-Javadoc)
* @see java.util.function.Predicate#test(java.lang.Object)
*/
@Override
public boolean test(PsiJavaFile psiJavaFile) {
public boolean test(@NotNull final PsiJavaFile psiJavaFile) {
return condition.test(psiJavaFile);
}

/*
* (non-Javadoc)
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
@Override
public int compareTo(Concept o) {
return getName().compareTo(o.getName());
Expand Down
Loading

0 comments on commit 5dbc2e5

Please sign in to comment.