gordon icon indicating copy to clipboard operation
gordon copied to clipboard

The build.gradle file isn't useful outside of gordon

Open spullara opened this issue 9 years ago • 2 comments

Both the gradle command line tool and IDEs should be able to work with it, but it references target which must be something include outside of the file.

$ gradle build

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/sam/Projects/gordon/nfstest/connect/build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'connect'.
> Could not find property 'target' on task ':buildLambda'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.978 secs

spullara avatar Jun 07 '16 22:06 spullara

Hello @spullara I need to be honest about the fact that my knowledge about gradle is.. let's say... "limited" :D so I would love to hear about specific use cases where the current approach might feel "wrong" to a Java developer, because I have total no idea!

When gordon calls gradle it does something like... $ gordon build -Ptarget={target} but for what I get from your message, IDEs don't like that target parameter and (perhaps) making it optional... or have a default value might be a good idea?

Assuming the target is not a "fixed" value, and that gordon needs to have the possibility to change it's value between builds... which would be your suggestion?

jorgebastida avatar Jun 07 '16 23:06 jorgebastida

I added a gradle.properties file that sets target=dev and that seems to satisfy the command line client and the IDE. Your command line setting will override that so it may be a general solution. Personally, I don't use gradle for Java development at all — have always used Maven but I'm willing to deal with it to use your project :)

spullara avatar Jun 08 '16 00:06 spullara