Skip to content

Commit

Permalink
Syntax sugar for settings system properties
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
zolotov committed Nov 30, 2015
1 parent 92d9cfa commit 3d80749
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helpful while developing plugins for IntelliJ platform.

```groovy
plugins {
id "org.jetbrains.intellij" version "0.0.31"
id "org.jetbrains.intellij" version "0.0.32"
}
apply plugin: 'org.jetbrains.intellij'
Expand All @@ -27,7 +27,7 @@ buildscript {
}
}
dependencies {
classpath 'gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.0.31'
classpath 'gradle.plugin.org.jetbrains:gradle-intellij-plugin:0.0.32'
}
}
Expand Down Expand Up @@ -71,6 +71,12 @@ initializing gradle build. Since sources are not really needed while testing on
it to `false` for particular environment.<br/><br/>
**Default value**: `true`

- `intellij.systemProperties` defines the map of system properties which will be passed to IDEA instance on
executing `runIdea` task and tests.<br/>
Also you can use `intellij.systemProperty(name, value)` method in order to set single system property.
<br/><br/>
**Default value**: `[]`

#### Publishing plugin

- `intellij.publish.pluginId` defines plugin id at JetBrains plugin repository, you can find it in url of you plugin page there.
Expand All @@ -93,7 +99,7 @@ Plugin introduces following build steps
### build.gradle
```groovy
plugins {
id "org.jetbrains.intellij" version "0.0.31"
id "org.jetbrains.intellij" version "0.0.32"
}
apply plugin: 'org.jetbrains.intellij'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
}
}

version = '0.0.31'
version = '0.0.32'
group = 'org.jetbrains'

pluginBundle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class IntelliJPluginExtension {
File ideaSourcesFile
private final Set<File> intellijFiles = new HashSet<>();
private final Set<File> runClasspath = new HashSet<>();
private final Map<String, Object> systemProperties = new HashMap<>();

String getType() {
return version.startsWith("IU-") || "IU".equals(type) ? "IU" : "IC"
Expand Down Expand Up @@ -65,4 +66,22 @@ class IntelliJPluginExtension {
}
}

Map<String, Object> getSystemProperties() {
systemProperties
}

void setSystemProperties(Map<String, ?> properties) {
systemProperties.clear()
systemProperties.putAll(properties)
}

IntelliJPluginExtension systemProperties(Map<String, ?> properties) {
systemProperties.putAll(properties)
this
}

IntelliJPluginExtension systemProperty(String name, Object value) {
systemProperties.put(name, value)
this
}
}
1 change: 1 addition & 0 deletions src/main/groovy/org/jetbrains/intellij/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Utils {
boolean inTests) {
def properties = new HashMap<String, Object>()
properties.putAll(originalProperties)
properties.putAll(extension.systemProperties)
properties.put("idea.config.path", configDir(extension, inTests))
properties.put("idea.system.path", systemDir(extension, inTests))
properties.put("idea.plugins.path", "$extension.sandboxDirectory/plugins")
Expand Down

0 comments on commit 3d80749

Please sign in to comment.