From 60fd4e8b0990fde9e2fe7a7f1c9ea5d9d85abb81 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Wed, 23 Mar 2022 12:38:07 +0100 Subject: [PATCH] add missing Kotlin/Groovy snippets for Gradle build scripts --- topics/basics/testing_plugins/testing_faq.md | 23 +++++++++++++++++-- topics/products/goland/goland.md | 16 +++++++++++++ .../custom_language_support/annotator.md | 2 +- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/topics/basics/testing_plugins/testing_faq.md b/topics/basics/testing_plugins/testing_faq.md index c459855cb..65ba0bc21 100644 --- a/topics/basics/testing_plugins/testing_faq.md +++ b/topics/basics/testing_plugins/testing_faq.md @@ -93,12 +93,29 @@ These JAR files are not available in plugin project dependencies, so the Intelli It's done by setting the `idea.home.path` system property to the absolute path of the checked out sources. In projects using Gradle it can be done by providing system property in the `test` task configuration: + + + + ```kotlin test { systemProperty("idea.home.path", "/path/to/intellij-community-sources") } ``` + + + +```groovy +test { + systemProperty "idea.home.path", "/path/to/intellij-community-sources" +} +``` + + + + + The default JDK version used by the test framework depends on the target platform version and is the latest supported version. The easiest way to change the JDK version to the custom is overriding the `LightJavaCodeInsightFixtureTestCase.getProjectDescriptor()` method and using one of the project descriptors predefined in `LightJavaCodeInsightFixtureTestCase`. If a project descriptor requires more customizations, its `getSdk()` method can use one of the [`IdeaTestUtil.getMockJdk*()`](upsource:///java/testFramework/src/com/intellij/testFramework/IdeaTestUtil.java) methods. @@ -107,13 +124,15 @@ Sometimes testing a JVM language requires adding standard or other libraries to If a required library is available in the Maven repository, use [`MavenDependencyUtil`](upsource:///java/testFramework/src/com/intellij/testFramework/fixtures/MavenDependencyUtil.java), e.g.: ```java -MavenDependencyUtil.addFromMaven(model,"org.jetbrains.kotlin:kotlin-stdlib:1.6.10"); +MavenDependencyUtil.addFromMaven(model, + "org.jetbrains.kotlin:kotlin-stdlib:1.6.10"); ``` If a required library is an unpublished JAR file, use [`PsiTestUtil.addLibrary()`](upsource:///platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java) or `addProjectLibrary()` method and the JAR file path, e.g.: ```java -PsiTestUtil.addLibrary(model,"kotlin-stdlib",getTestDataPath(),"kotlin-stdlib.jar"); +PsiTestUtil.addLibrary(model, + "kotlin-stdlib", getTestDataPath(), "kotlin-stdlib.jar"); ``` > If a topic you are interested in is not covered in the above sections, let us know via the "**Was this page helpful?**" feedback form below or [other channels](getting_help.md#problems-with-the-guide). diff --git a/topics/products/goland/goland.md b/topics/products/goland/goland.md index 814feede4..3e7bd3054 100644 --- a/topics/products/goland/goland.md +++ b/topics/products/goland/goland.md @@ -19,6 +19,18 @@ The configuration of targeting GoLand IDE follows the methods described in [Conf Starting with 2020.2, it's possible to configure `GO` for `intellij.type` in the Gradle build script. + + + +```kotlin +intellij { + version.set("2020.3") + type.set("GO") +} +``` + + + ```groovy intellij { @@ -27,6 +39,10 @@ intellij { } ``` + + + + diff --git a/topics/tutorials/custom_language_support/annotator.md b/topics/tutorials/custom_language_support/annotator.md index 1550029e3..2fb00acc7 100644 --- a/topics/tutorials/custom_language_support/annotator.md +++ b/topics/tutorials/custom_language_support/annotator.md @@ -29,7 +29,7 @@ intellij { -```kotlin +```groovy intellij { plugins = ['com.intellij.java'] }