Feature gradlew runshadow use preferred location for root.

fronobulax

Developer
Staff member
I run gradlew tasks from C:\KoLmafia since that is where all of the gradle files and the root of the source tree are.

When I run a jar file I run it from C:\KoLmafia\dist which is where the jar ends up after it is built.

gradlew runshadow uses C:\KoLmafia instead of C:\KoLmafia\dist for mafia's root. I would like it to use C:\KoLmafia\dist.

Similar issue may exist with the task run.

Windows, obviously.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I feel like I would always want gradle's cwd to be the project root - what's your use case otherwise?
 

fronobulax

Developer
Staff member
I feel like I would always want gradle's cwd to be the project root - what's your use case otherwise?

I build on one machine but run on multiple machines. The dist directory is mirrored but the source is not and doesn't need to be. It worked that way for over a decade :)

I will note that ant daily left the jar in dist and AFAIK the ant task exec used dist as the CWD. If we call in the archeologists it may be that this is a Bug because Gradle is not configured to do what Ant did :)

It only came up since someone wanted me to use runshadow instead of shadowjar. I can address that by saying "no".

Also this is only about the CWD when Gradle is being used to run mafia. The CWD when doing other Gradle tasks and running tests is fine and as it should be.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Oh I see this is a windows thing, I forgot that mafia uses CWD on windows for the session etc files, right?
 

fronobulax

Developer
Staff member
Oh I see this is a windows thing, I forgot that mafia uses CWD on windows for the session etc files, right?

"normal" mafia behavior for me is that the CWD is where the jar file is. Could be a Windows thing. It has been like that for so long I haven't asked why.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Yeah that's exclusively a windows thing!
 
Top