All Projects → jponge → Vertx Gradle Plugin

jponge / Vertx Gradle Plugin

Licence: apache-2.0
An opinionated Gradle plugin for Vert.x projects

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Vertx Gradle Plugin

Gradle Plugins
Gradle Plugin Collection
Stars: ✭ 84 (-14.29%)
Mutual labels:  gradle, gradle-plugin
Gradle Quality Plugin
Gradle quality plugin for Java and Groovy
Stars: ✭ 97 (-1.02%)
Mutual labels:  gradle, gradle-plugin
Plantuml Gradle Plugin
Gradle plugin to build PlantUML diagrams from code (for living and up-to-date documentation)
Stars: ✭ 27 (-72.45%)
Mutual labels:  gradle, gradle-plugin
Androidanimationexercise
Android 动画各种实现,包括帧动画、补间动画和属性动画的总结分享
Stars: ✭ 1,254 (+1179.59%)
Mutual labels:  gradle, gradle-plugin
Gradle S3 Build Cache
An AWS S3 Gradle build cache implementation
Stars: ✭ 54 (-44.9%)
Mutual labels:  gradle, gradle-plugin
Gogradle
A Gradle Plugin Providing Full Support for Go
Stars: ✭ 712 (+626.53%)
Mutual labels:  gradle, gradle-plugin
Gradle Kotlin Aspectj Weaver
A Gradle plugin that allows you to weave your compiled Java and Kotlin files with AspectJ
Stars: ✭ 14 (-85.71%)
Mutual labels:  gradle, gradle-plugin
Gradle Download Task
Adds a download task to Gradle that displays progress information
Stars: ✭ 478 (+387.76%)
Mutual labels:  gradle, gradle-plugin
Auto Manifest
Generates AndroidManifest.xml in simple libraries so that you don't have to
Stars: ✭ 51 (-47.96%)
Mutual labels:  gradle, gradle-plugin
Enigma
Gradle Plugin - Obfuscator String Encryption (Android/Java)
Stars: ✭ 43 (-56.12%)
Mutual labels:  gradle, gradle-plugin
Gradle Git
Git plugin for Gradle
Stars: ✭ 559 (+470.41%)
Mutual labels:  gradle, gradle-plugin
Vertx Gradle Starter
Gradle project template for Vert.x
Stars: ✭ 91 (-7.14%)
Mutual labels:  gradle, vertx
Let
Annotation based simple API flavored with AOP to handle new Android runtime permission model
Stars: ✭ 532 (+442.86%)
Mutual labels:  gradle, gradle-plugin
Ktlint Gradle
A ktlint gradle plugin
Stars: ✭ 713 (+627.55%)
Mutual labels:  gradle, gradle-plugin
Laziertracker
本项目通过Android字节码插桩插件实现Android端无埋点(或自动埋点),并且支持根据配置文件实现业务数据的自动采集。
Stars: ✭ 485 (+394.9%)
Mutual labels:  gradle, gradle-plugin
Gradle Defaults
Plugin providing opinionated defaults for Gradle projects.
Stars: ✭ 7 (-92.86%)
Mutual labels:  gradle, gradle-plugin
Bnd
Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
Stars: ✭ 446 (+355.1%)
Mutual labels:  gradle, gradle-plugin
Gradle Test Logger Plugin
A Gradle plugin for printing beautiful logs on the console while running tests
Stars: ✭ 460 (+369.39%)
Mutual labels:  gradle, gradle-plugin
Hunter
A fast, incremental, concurrent framework to develop compile plugin for android project to manipulate bytecode
Stars: ✭ 999 (+919.39%)
Mutual labels:  gradle, gradle-plugin
Gradle Semantic Build Versioning
Gradle plugin to generate version-numbers and tags using semantic versioning
Stars: ✭ 69 (-29.59%)
Mutual labels:  gradle, gradle-plugin

= Vert.x Gradle Plugin

An opinionated Gradle plugin for Vert.x projects.

image:https://github.com/jponge/vertx-gradle-plugin/workflows/Java%20CI%20with%20Gradle/badge.svg[Java CI with Gradle] image:https://img.shields.io/github/tag/jponge/vertx-gradle-plugin.svg[tag, link=https://plugins.gradle.org/plugin/io.vertx.vertx-plugin] image:https://img.shields.io/github/license/jponge/vertx-gradle-plugin.svg[license, link=https://github.com/jponge/vertx-gradle-plugin/blob/master/LICENSE] image:https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io/vertx/vertx-plugin/io.vertx.vertx-plugin.gradle.plugin/maven-metadata.xml.svg?label=gradlePluginPortal["Maven Central",link="https://plugins.gradle.org/plugin/io.vertx.vertx-plugin"]

== What the plugin does

This https://plugins.gradle.org/plugin/io.vertx.vertx-plugin[plugin] simplifies building and running Vert.x applications with Gradle.

It automatically applies the following plugins:

  • https://docs.gradle.org/current/userguide/java_plugin.html[java]
  • https://docs.gradle.org/current/userguide/application_plugin.html[application] + https://docs.gradle.org/current/userguide/distribution_plugin.html[distribution] for packaging the app for the JVM
  • https://github.com/johnrengelman/shadow[shadow] to generate uber Jars with all dependencies bundled

You can omit versions from elements in the https://github.com/vert-x3/vertx-stack[the Vert.x stack as the plugin references the corresponding Maven BOM.

NOTE: From version 0.9.0 the plugin no longer sets the sourceCompatibility to Java 8. You can set it manually like in other https://docs.gradle.org/current/userguide/building_java_projects.html#introduction[Java projects].

The plugin automatically adds io.vertx:vertx-core as a compile dependency, so you don't need to do it.

The plugin provides a vertxRun task that can take advantage of the Vert.x auto-reloading capabilities, so you can just run it then have you code being automatically compiled and reloaded as you make changes.

NOTE: If you encounter issues with your application still being running in the background due to how the Gradle caching works, then you may try running the vertxRun task with gradle --no-daemon vertxRun.

The plugin provides a vertxDebug task enabling to debug your code.

NOTE: Reloading is disabled while debugging. Moreover in order to prevent warnings while in debug mode, Vert.x options maxEventLoopExecuteTime and maxWorkerExecuteTime are set to java.lang.Long.MAX_VALUE

=== Minimal example

[source,groovy]


plugins { id 'io.vertx.vertx-plugin' version 'x.y.z' // <1> }

repositories { jcenter() }

vertx { mainVerticle = 'sample.App' }

image:https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io/vertx/vertx-plugin/io.vertx.vertx-plugin.gradle.plugin/maven-metadata.xml.svg?label=gradlePluginPortal["Maven Central",link="https://plugins.gradle.org/plugin/io.vertx.vertx-plugin"] Replace x.y.z with a version available on the https://plugins.gradle.org/plugin/io.vertx.vertx-plugin[Gradle Plugin Portal]

Provided sample.App is a Vert.x verticle, then:

  • gradle shadowJar builds an executable Jar with all dependencies: java -jar build/libs/simple-project-all.jar
  • gradle vertxRun starts the application and automatically recompiles (gradle classes) and reloads the code when any file under src/ is being added, modified or deleted.

=== A slightly more elaborated example

A project using vertx-web and logback would use a build.gradle definition like the following one:

[source,groovy]

plugins { id 'io.vertx.vertx-plugin' version 'x.y.z' }

repositories { jcenter() }

dependencies { compile "io.vertx:vertx-web" // <1> compile "ch.qos.logback:logback-classic:1.2.3" // <2> }

vertx { mainVerticle = "sample.App" vertxVersion = "3.9.3" // <3> }

<1> Part of the Vert.x stack, so the version can be omitted. <2> Logback needs a version. <3> You can override to point to any specific release of Vert.x.

=== Kotlin projects

This plugin works with Kotlin projects too:

[source,groovy]

plugins { id 'io.vertx.vertx-plugin' version 'x.y.z' id 'org.jetbrains.kotlin.jvm' version 'a.b.c' }

repositories { jcenter() }

dependencies { compile 'io.vertx:vertx-lang-kotlin' compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' // <1> }

vertx { mainVerticle = "sample.MainVerticle" // <2> }

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { // <3> kotlinOptions { jvmTarget = "1.8" } }

<1> This pulls all the Kotlin standard library dependencies for JDK 8+. <2> This verticle can be written in Kotlin (or Java). <3> By default Kotlin compiles to Java 6 bytecode, so it is worth changing all compilation tasks to match Java 8 bytecode.

=== Using Kotlin DSL

[source,kotlin]

plugins { id("io.vertx.vertx-plugin") version "x.y.z" }

repositories { jcenter() }

vertx { // <1> mainVerticle = "sample.App" }

<1> Extension method on org.gradle.api.Project.

== Configuration

The configuration happens through the vertx Gradle extension.

The following configuration can be applied, and matches the vertx run command-line interface when possible:

[cols=3,options="header"] |=== | Option | Description | Default value

|vertxVersion |the Vert.x version to use |"3.9.3"

|launcher |the main class name | io.vertx.core.Launcher

|mainVerticle |the main verticle | ""

|args |a list of command-line arguments to pass |[]

|config |either a file or direct JSON data to provide configuration |""

|workDirectory |the working directory |project.projectDir

|jvmArgs |extra JVM arguments |[]

|redeploy |whether automatic redeployment shall happen or not |true

|watch |Ant-style matchers for files to watch for modifications |[src/\**/*]

|onRedeploy |the Gradle tasks to run before redeploying |["classes"]

|redeployScanPeriod / redeployGracePeriod / redeployTerminationPeriod |tuning for the redeployment watch timers |1000L (1 second each)

|debugPort | The debugger port |5005L

|debugSuspend | Whether or not the application must wait until a debugger is attached to start |false

|===

The default values are listed in src/main/kotlin/io/vertx/gradle/VertxExtension.kt.

By default redeployment is enabled, running gradle classes to recompile, and watching all files under src/.

== Licensing


Copyright 2017-2019 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

== Credits

The plugin was originally created by https://julien.ponge.org/[Julien Ponge].

Thanks to the folks at Gradle for their guidance and technical discussions:

  • Cédric Champeau
  • Stefan Oheme
  • Rodrigo B. de Oliveira
  • Eric Wendelin
  • Benjamin Muschko

Thanks also to https://github.com/jponge/vertx-gradle-plugin/graphs/contributors[all the contributors to this project].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].