Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runIde or CustomRunIdeTask can't override idea.* properties #1651

Closed
jonathanlermitage opened this issue Jun 11, 2024 · 1 comment
Closed
Assignees
Milestone

Comments

@jonathanlermitage
Copy link

What happened?

I would like to override the idea.log.path when running runIde, using plugin v2.
My build.gradle.kts has:

runIde {
    jvmArgs("-Didea.log.path=custom/logs/")
    jvmArgs("-Pidea.log.path=custom/logs/")
}

then run gradlew runIde.

I also tried

register("myRunIde", CustomRunIdeTask::class) {
    jvmArgs("-Didea.log.path=custom/logs/")
    jvmArgs("-Pidea.log.path=custom/logs/")
}

then run gradlew myRunIde.

The logs are still located in the regular log folder (sandboxed dir / ide version / log). I checked the idea.log.path property with VisualVM, and they are no affected by my changes.
Please note I tried to override both the JVM property and the System property, because when running runIde with no customization, I observed both properties are set.

Relevant log output or stack trace

No response

Steps to reproduce

Gradle IntelliJ Plugin version

2.0.0-beta6

Gradle version

8.8

Operating System

Windows

Link to build, i.e. failing GitHub Action job

No response

@hsz hsz added this to the next milestone Jul 14, 2024
@hsz
Copy link
Member

hsz commented Jul 15, 2024

All runnable tasks are now working on jvmArgumentProviders to respect Providers.
Apparently, values defined that way override regular arguments passed with jvmArgs().

To utilize jvmArgumentProviders in your setup, you can:

jvmArgumentProviders += CommandLineArgumentProvider {
    listOf("-Didea.config.path=custom/config")
}

FTR, with beta9, there's a new way of creating custom tasks introduced:

val myRunIde by intellijPlatformTesting.runIde.registering {
    // ...

    task {
        jvmArgumentProviders += CommandLineArgumentProvider {
            listOf("-Didea.config.path=custom/config")
        }
    }
}

@hsz hsz closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants