Repository for utilities to create and test IntelliJ plugins.
The project consists of several modules:
kotlin-utilities-plugin
- internal module for different plugins runners to show some examples of using this tool;kotlin-utilities-core
- common utilities for IntelliJ plugins (e.g. base classes for runners);kotlin-utilities-test
- utilities to test IntelliJ plugins;kotlin-utilities-python
- utilities for IntelliJ plugins that work with Python projects;
repositories {
maven("https://packages.jetbrains.team/maven/p/big-code/bigcode")
}
val utilitiesProjectVersion = "1.0"
val utilitiesProjectId = "org.jetbrains.research"
dependencies {
implementation("$utilitiesProjectId:plugin-utilities-core:$utilitiesProjectVersion")
implementation("$utilitiesProjectId:plugin-utilities-test:$utilitiesProjectVersion")
implementation("$utilitiesProjectId:plugin-utilities-python:$utilitiesProjectVersion")
}
You can use this plugin as a library in your plugin by importing it in settings.gradle.kts
and build.gradle.kts files
:
- File
settings.gradle.kts
(in this example we add two modules, but you can import others):
val utilitiesRepo = "https://github.com/JetBrains-Research/plugin-utilities.git"
val utilitiesProjectName = "org.jetbrains.research.pluginUtilities"
sourceControl {
gitRepository(URI.create(utilitiesRepo)) {
producesModule("$utilitiesProjectName:plugin-utilities-core")
producesModule("$utilitiesProjectName:plugin-utilities-test")
}
}
- File
build.gradle.kts
in thedependencies
section (in this example we add two modules from the main branch, but you can import others):
val utilitiesProjectName = "org.jetbrains.research.pluginUtilities"
dependencies {
implementation("$utilitiesProjectName:plugin-utilities-core") {
version {
branch = "main"
}
}
implementation("$utilitiesProjectName:plugin-utilities-test") {
version {
branch = "main"
}
}
}
Before opening repositories they should be preprocessed. Preprocessing
- removes all
.idea
folders - adds
local.properties
files withsdk.dir=<path to Android Sdk>
where it detects a Gradle build system (Gradle Kotlin DSL included).
Preprocessing DOES NOT mutate the original dataset but copies it to the output folder.
Suppose you have a dataset with 3 repositories
path/to/dataset/
repo1/
repo2/
repo3/
You can run preprocessing with
./gradlew preprocessKotlinJava -Pinput="path/to/dataset" -Poutput="path/to/output" -PandroidSdk="path/to/androidSdk"
which will store preprocessed repositories in the output folder:
path/to/output/
repo1/
repo2/
repo3/
- There are 2 ways to get our Docker image:
- Download it from DockerHub
sudo docker pull furetur/plugin-utilities
- Or build it locally
sudo docker build --tag furetur/plugin-utilities .
- Download it from DockerHub
- Run the tests
sudo docker run -v $(pwd):/repo furetur/plugin-utilities
- Clone this repository somewhere. We will call that folder
<mockdata>
. - Set the environment variable
JAVA_MOCK_PROJECTS=<mockdata>/java_mock_projects
. - Now you can build plugin-utilities by running
./gradlew build
.
gradle plugin-utilities-core:publish
gradle plugin-utilities-python:publish
gradle plugin-utilities-test:publish