Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gradle build #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions step-4/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
buildscript {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could be using the simpler plugins { ... } block since there are no special dependencies.

repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.io.vertx:vertx-gradle-plugin:0.0.8"
}
}


apply plugin: 'java'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Vert.x Gradle plugin already applies it.


group = 'io.vertx'
version = '1.3.0-SNAPSHOT'

description = """"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?


sourceCompatibility = 1.8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already done by the Vert.x plugin.

targetCompatibility = 1.8

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}



repositories {
jcenter()
}

ext {
vertVersion = '3.5.1'
}

dependencies {
compile "io.vertx:vertx-core:$vertVersion"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, see the Vert.x plugin documentation, it simplifies dependencies management.

compile "io.vertx:vertx-jdbc-client:$vertVersion"
compile "io.vertx:vertx-service-proxy:$vertVersion"
compile "io.vertx:vertx-codegen:$vertVersion"
compile "io.vertx:vertx-web:$vertVersion"
compile "io.vertx:vertx-web-client:$vertVersion"
compile "io.vertx:vertx-web-templ-freemarker:$vertVersion"
compile "com.github.rjeschke:txtmark:0.13"
compile "ch.qos.logback:logback-classic:1.2.3"
compile "org.hsqldb:hsqldb:2.3.4"
testCompile 'junit:junit:4.12'
testCompile "io.vertx:vertx-unit:$vertVersion"
}


sourceSets {
generated {
java.srcDir "${projectDir}/src/generated/java"
}
}

task generateProxies(type: JavaCompile) {
group = "build"
description = "Generate Vert.x service proxies"

source = sourceSets.main.java
classpath = configurations.compile
options.compilerArgs = [
"-proc:only",
"-processor", "io.vertx.codegen.CodeGenProcessor",
"-Acodegen.output=${projectDir}/src/main"
]
destinationDir = file("${projectDir}/src/generated/java")
}

compileJava {
dependsOn generateProxies
source += sourceSets.generated.java
}

clean {
delete += sourceSets.generated.java.srcDirs
}