Bloop: Gradle applicationDefaultJvmArgs doesn't get exported

Created on 26 Sep 2020  路  3Comments  路  Source: scalacenter/bloop

I have Gradle project that I export to Bloop, which uses the Gradle application plugin. One of the config options for that plugin is applicationDefaultJvmArgs. This lets you specify Jvm arguments to use when running the app.

These jvm args don't get exported to the .bloop config json files (the MainClass config does however)

Example:

application {
    mainClass = 'com.myorg.MyAppMain'
    applicationDefaultJvmArgs = ['-Dgreeting.language=en, -Xmx16g']
}

Results in the following .bloop/my_app.json config

        "platform": {
            "name": "jvm",
            "config": {
                "home": "/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home",
                "options": [
                    "-Xmx1024mb"
                ]
            },
            "mainClass": [
                "com.myorg.MyAppMain"
            ],
bug gradle

Most helpful comment

Though I am not sure why we are only getting information from the test task there 馃

Probably because I didn't know applicationDefaultJvmArgs existed :smiley:

I'm just waiting on this to hopefully get some info on the recommended way to properly extract the mainClass and then I'll add applicationDefaultJvmArgs in too

All 3 comments

Thanks for reporting! I think this might be fixable around here: https://github.com/scalacenter/bloop/blob/master/integrations/gradle-bloop/src/main/scala/bloop/integrations/gradle/model/BloopConverter.scala#L410

If the test task is empty we should try to get applicationDefaultJvmArgs - should not be too hard I think. Though I am not sure why we are only getting information from the test task there :thinking:

Though I am not sure why we are only getting information from the test task there 馃

Probably because I didn't know applicationDefaultJvmArgs existed :smiley:

I'm just waiting on this to hopefully get some info on the recommended way to properly extract the mainClass and then I'll add applicationDefaultJvmArgs in too

Thanks for looking at this @Arthurm1! Looking forward to supporting default jvm args, I've seen them be used often in OSS builds.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tindzk picture tindzk  路  8Comments

tpasternak picture tpasternak  路  7Comments

jvican picture jvican  路  3Comments

kai-ming-91 picture kai-ming-91  路  5Comments

olafurpg picture olafurpg  路  8Comments