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

Provide gradle build with Kotlin script #31

Closed
vietj opened this issue Oct 25, 2017 · 2 comments · Fixed by #128
Closed

Provide gradle build with Kotlin script #31

vietj opened this issue Oct 25, 2017 · 2 comments · Fixed by #128
Assignees
Milestone

Comments

@vietj
Copy link
Contributor

vietj commented Oct 25, 2017

No description provided.

@brokenthorn
Copy link

My conversion of the default Gradle build script for a fresh Vert.x project, to Kotlin (tested only to pass build):

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
  java
  kotlin("jvm") version "1.3.11"
  application
  id("com.github.johnrengelman.shadow") version "4.0.3"
}

group = "ro.minifarm"
version = "1.0.0-SNAPSHOT"

repositories {
  mavenLocal()
  jcenter()
}

dependencies {
  compile(kotlin("stdlib-jdk8"))

  implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11")

  implementation("io.vertx:vertx-core:3.6.0")
  implementation("io.vertx:vertx-jdbc-client:3.6.0")
  implementation("io.vertx:vertx-config:3.6.0")
  implementation("io.vertx:vertx-sql-common:3.6.0")
  implementation("io.vertx:vertx-auth-jwt:3.6.0")
  implementation("io.vertx:vertx-health-check:3.6.0")
  implementation("io.vertx:vertx-web:3.6.0")
  implementation("io.vertx:vertx-mail-client:3.6.0")
  implementation("io.vertx:vertx-redis-client:3.6.0")

  testImplementation("io.vertx:vertx-junit5:3.6.0")
  testRuntime("org.junit.jupiter:junit-jupiter-engine:5.2.0")
}

configure<JavaPluginConvention> {
  sourceCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<KotlinCompile> {
  kotlinOptions.jvmTarget = "1.8"
}

tasks.withType<Test> {
  useJUnitPlatform()
  testLogging {
    events("passed", "skipped", "failed")
  }
}

val mainVerticleName = "ro.minifarm.requester.MainVerticle"

tasks.withType<ShadowJar> {
  baseName = "app"
  classifier = "shadow"

  manifest {
    attributes["Main-Verticle"] = mainVerticleName
  }

  mergeServiceFiles {
    include("META-INF/services/io.vertx.core.spi.VerticleFactory")
  }
}

val watchForChange = "src/**/*"
val doOnChange = "./gradlew classes"
val mainClass = "io.vertx.core.Launcher"

application {
  mainClassName = mainClass
  applicationDefaultJvmArgs = listOf(mainVerticleName, "--redeploy=$watchForChange", "--launcher-class=$mainClassName", "--on-redeploy=$doOnChange")
}

tasks.withType<Wrapper> {
  gradleVersion = "5.0"
}

@tsegismont
Copy link
Collaborator

@jponge assigned it to you. Again, if you can it before EOW, please set the 2.0.0 milestone.

@tsegismont tsegismont assigned tsegismont and unassigned jponge Jun 22, 2020
@tsegismont tsegismont added this to the 2.0.9 milestone Jun 22, 2020
tsegismont referenced this issue in tsegismont/vertx-starter Jun 23, 2020
tsegismont referenced this issue in tsegismont/vertx-starter Jun 23, 2020
tsegismont referenced this issue in tsegismont/vertx-starter Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants