mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 09:47:50 +08:00
tools_intellij_platform_gradle_plugin_recipes.md: added 'Run the IDE with a default argument provided'
This commit is contained in:
parent
6c022469ff
commit
5d06cc63ea
@ -269,3 +269,36 @@ prepareSandbox {
|
|||||||
|
|
||||||
</tab>
|
</tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
|
|
||||||
|
|
||||||
|
## Run the IDE with a default argument provided
|
||||||
|
|
||||||
|
When running the IDE from the command line, you can pass an argument, like a path to the project or file, to open it automatically.
|
||||||
|
This is also possible when using the [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde) task:
|
||||||
|
|
||||||
|
<tabs group="languages">
|
||||||
|
<tab title="Kotlin" group-key="kotlin">
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
tasks {
|
||||||
|
runIde {
|
||||||
|
argumentProviders.add(CommandLineArgumentProvider {
|
||||||
|
listOf("/path/to/the/project")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</tab>
|
||||||
|
<tab title="Groovy" group-key="groovy">
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
runIde {
|
||||||
|
argumentProviders.add {
|
||||||
|
['/path/to/the/project']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</tab>
|
||||||
|
</tabs>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user