[Fiware-middleware] Links and template-project to start with gradle

Marti Christof (mach) mach at zhaw.ch
Tue Nov 11 20:32:13 CET 2014


Hi everybody

I put together some starter links about gradle and created a template project for kiara, which adds some plugins and configuration to support and integrate with antlr4, maven, eclipse and IntelliJ Idea.

Gradle-UserGuide & References: http://www.gradle.org/docs/current/userguide/userguide.html
(you'll find almost everything there)
Gradle-Plugins registry: http://plugins.gradle.org
(e.g. the antlr4 plugin entry is here: http://plugins.gradle.org/plugin/me.champeau.gradle.antlr4)

Good-Intro about why and how (compared to Ant/Maven) from the creator Hans Dockter (if you have time: 85’):
https://www.youtube.com/watch?v=5a91dBLX8Qc

Here you’ll find the kiara-gradle-template project:
https://github.com/christofmarti/kiara-gradle-template
(it does not contain any KIARA specific files yet; only a typical project hierarchy and configuration for the plugins)

If you clone it, you can use "./gradlew” (resp. gradlew.bat) to call the correct version of gradle, without preinstalling gradle. (e.g. change to project dir and execute "./gradlew tasks" to list all available tasks)
The main advantage of the wrapper is, that always the correct version of the tool is used. If not available it will be downloaded and installed locally from the path defined in ./gradle/wrapper/gradle-wrapper.properties.

To create eclipse project files type "./gradlew eclipse"
To create IntelliJ IDEA project files type "./gradlew idea"
"./gradlew build" builds and assembles the whole project (incl. processing antlr4 files)
“./gradlew clean” removes all generated files (but not eclipse or idea configs; use cleanEclipse or cleanIdea for this).

I included a community plugin for antlr4. Sources have to be in src/main/antlr4/ (configureable).
I had to add some Java version fixes, because the annotation processor of antlr only supports Java 7&8 from version 4.4.1 which is not yet in the repositories (see: https://github.com/antlr/antlr4/issues/487)


@Dmitry: 
If you have a maven (pom) project, you can create an initial gradle configuration using: 
"gradle init --type pom” 
This needs a full gradle installation, not the wrapper 
(see http://www.gradle.org/docs/current/userguide/build_init_plugin.html#N14BBA for details)


Best regards
Christof
----
InIT Cloud Computing Lab - ICCLab http://blog.zhaw.ch/icclab
Institut of Applied Information Technology - InIT
Zurich University of Applied Sciences - ZHAW
School of Engineering 
Phone: +41 58 934 70 63
Skype: christof-marti




More information about the Fiware-middleware mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy