Gradle user experience

601 views
Skip to first unread message

Tim Fox

unread,
Feb 22, 2013, 1:13:58 PM2/22/13
to ve...@googlegroups.com
I've made some updates to the Vert.x Gradle template https://github.com/vert-x/vertx-gradle-template

If you're already using it _please resync_! Hopefully there won't be too many more changes.

I have to say, the experience is getting pretty slick now :)

You can do everything you need from the command line, but I've also got in container tests to seamlessly run in IntelliJ IDEA without any custom test run configurations. Just right click and run tests. It just works.

Debugging also works on in container tests. Just set your breakpoint on some code in a verticle and right click. debug. Again it just works.

I'm thinking now there isn't really any need for an IntelliJ IDEA plugin, unless there is something I have missed. It seems to me that all the things you'd want to do as a Vert.x developer in an IDE are there now.

(Eclipse should work too but I haven't tried).

Daryl Teo

unread,
Feb 22, 2013, 10:07:49 PM2/22/13
to ve...@googlegroups.com
Hi,  yes tests are working in Eclipse for me.

Just a question: I know my setup is an edge case, but I'm wondering what is the reason for jars to be disabled? Subprojects with dependencies on other subprojects cannot compile unless I turn jar.enabled to true. I'm assuming that Gradle would compile the project into a jar and then add that as a dependency to the other projects.

If there is a specific reason why jar is disabled then I will try and figure something else out.

Daryl

Daryl Teo

unread,
Feb 22, 2013, 10:37:38 PM2/22/13
to ve...@googlegroups.com
Disregard... just saw the "produceJar" property.

I'll see if this works.

Daryl

Daryl Teo

unread,
Feb 23, 2013, 1:44:57 AM2/23/13
to ve...@googlegroups.com
So I just started looking into publishing modules on Sonatype Nexus. Just in case anyone else was looking for instructions, look here[1] for how to get started (user accounts, tickets for repos etc.). 

Then you'll (probably, haven't tested since I haven't gotten everything set up yet) put sonatypeUsername and sonatypePassword in global gradle config as per the build.gradle readme.

Tim: FYI there is still "configurePom" task in maven.gradle that is configured with your details.

Daryl

Tim Fox

unread,
Feb 23, 2013, 2:45:56 AM2/23/13
to ve...@googlegroups.com
On 23/02/13 06:44, Daryl Teo wrote:
So I just started looking into publishing modules on Sonatype Nexus. Just in case anyone else was looking for instructions, look here[1] for how to get started (user accounts, tickets for repos etc.). 

Then you'll (probably, haven't tested since I haven't gotten everything set up yet) put sonatypeUsername and sonatypePassword in global gradle config as per the build.gradle readme.

Thanks Daryl.

Vert.x also supports bintray if you don't want to use a Maven repo. But bintray (like Maven central) is not designed for snapshots do you'll still have to use something like oss sonatype for that.


Tim: FYI there is still "configurePom" task in maven.gradle that is configured with your details.

Thanks.

Daryl


On Saturday, 23 February 2013 11:37:38 UTC+8, Daryl Teo wrote:
Disregard... just saw the "produceJar" property.

I'll see if this works.

Daryl

On Saturday, 23 February 2013 11:07:49 UTC+8, Daryl Teo wrote:
Hi,  yes tests are working in Eclipse for me.

Just a question: I know my setup is an edge case, but I'm wondering what is the reason for jars to be disabled? Subprojects with dependencies on other subprojects cannot compile unless I turn jar.enabled to true. I'm assuming that Gradle would compile the project into a jar and then add that as a dependency to the other projects.

If there is a specific reason why jar is disabled then I will try and figure something else out.

Daryl

On Saturday, 23 February 2013 02:13:58 UTC+8, Tim Fox wrote:
I've made some updates to the Vert.x Gradle template https://github.com/vert-x/vertx-gradle-template

If you're already using it _please resync_! Hopefully there won't be too many more changes.

I have to say, the experience is getting pretty slick now :)

You can do everything you need from the command line, but I've also got in container tests to seamlessly run in IntelliJ IDEA without any custom test run configurations. Just right click and run tests. It just works.

Debugging also works on in container tests. Just set your breakpoint on some code in a verticle and right click. debug. Again it just works.

I'm thinking now there isn't really any need for an IntelliJ IDEA plugin, unless there is something I have missed. It seems to me that all the things you'd want to do as a Vert.x developer in an IDE are there now.

(Eclipse should work too but I haven't tried).
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Paulo Lopes

unread,
Feb 27, 2013, 3:17:50 PM2/27/13
to ve...@googlegroups.com
Which version of IDEA are you using?

I tried to import the build.gradle on 12.0.4 Community (Linux) and it fails with an error:

Caused by: org.jetbrains.plugins.gradle.remote.GradleApiException: Could not fetch model of type 'BasicIdeaProject' using Gradle installation '/home/paulo/gradle-1.4'.
The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch: 
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=/usr/lib/jvm/java-7-oracle/jre,daemonRegistryDir=/home/paulo/.gradle/daemon,pid=9497,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8]
Actual: DefaultDaemonContext[uid=71a994ce-6dea-4172-a2bf-387db8ca98df,javaHome=/usr/lib/jvm/java-7-oracle,daemonRegistryDir=/home/paulo/.gradle/daemon,pid=9537,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8]

The error does not make sense since the home is the same...

If i generate idea projects with gradlew idea it works however the libraries are not binded to the module and all code is marked with red as errors and i cannot run test at all...

Tim Fox

unread,
Feb 28, 2013, 1:54:27 AM2/28/13
to ve...@googlegroups.com
It's not recommended to create an IDEA project from a Gradle build by importing it into IDEA - apparently the IDEA Gradle plugin is not  worth using at the moment (it needs a lot of wortk). The best way to create an IDEA project is to use the 'idea' task from the Gradle.


On 27/02/13 20:17, Paulo Lopes wrote:
Which version of IDEA are you using?

I tried to import the build.gradle on 12.0.4 Community (Linux) and it fails with an error:

Caused by: org.jetbrains.plugins.gradle.remote.GradleApiException: Could not fetch model of type 'BasicIdeaProject' using Gradle installation '/home/paulo/gradle-1.4'.
The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch: 
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=/usr/lib/jvm/java-7-oracle/jre,daemonRegistryDir=/home/paulo/.gradle/daemon,pid=9497,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8]
Actual: DefaultDaemonContext[uid=71a994ce-6dea-4172-a2bf-387db8ca98df,javaHome=/usr/lib/jvm/java-7-oracle,daemonRegistryDir=/home/paulo/.gradle/daemon,pid=9537,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8]

The error does not make sense since the home is the same...

If i generate idea projects with gradlew idea it works however the libraries are not binded to the module and all code is marked with red as errors and i cannot run test at all...

Yes I have noticed this issue too. You need to manually add the libraries (browse to .gradle/caches/... or .m2/repository/...). The 'idea' task is a built in Gradle task, not something we created - I suggest adding a Gradle bug or asking on the Gradle forum about this.


On Friday, February 22, 2013 7:13:58 PM UTC+1, Tim Fox wrote:
I've made some updates to the Vert.x Gradle template https://github.com/vert-x/vertx-gradle-template

If you're already using it _please resync_! Hopefully there won't be too many more changes.

I have to say, the experience is getting pretty slick now :)

You can do everything you need from the command line, but I've also got in container tests to seamlessly run in IntelliJ IDEA without any custom test run configurations. Just right click and run tests. It just works.

Debugging also works on in container tests. Just set your breakpoint on some code in a verticle and right click. debug. Again it just works.

I'm thinking now there isn't really any need for an IntelliJ IDEA plugin, unless there is something I have missed. It seems to me that all the things you'd want to do as a Vert.x developer in an IDE are there now.

(Eclipse should work too but I haven't tried).
--
Reply all
Reply to author
Forward
0 new messages