Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 102 lines (80 sloc) 2.354 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
def buildDir = 'build'
def workDir = "${buildDir}/work"
def appZip = 'vertx-vtoons.zip'

repositories {
  mavenCentral()
  mavenRepo url:'http://repo.springsource.org/libs-snapshot'
  add(new org.apache.ivy.plugins.resolver.URLResolver()) {
    name = 'vertx.io'
    addArtifactPattern 'http://[organisation]/downloads/[module]-[revision].[ext]'
  }
}

configurations {
  framework
  jars
}

dependencies {
  framework "vertx.io:vert.x:${vertxVersion}@zip"
  jars "org.cloudfoundry:cloudfoundry-runtime:0.8.2"
}

task runtime(type: Copy) {
  destinationDir file("${workDir}")

  from configurations.framework
  doLast {
    ant.unzip(src: "${workDir}/vert.x-${vertxVersion}.zip", dest: "${workDir}")
    ant.delete(file: "${workDir}/vert.x-${vertxVersion}.zip")
  }
}

task build(type: Copy, dependsOn: 'runtime') {
  destinationDir file("${workDir}")

  from(configurations.jars) {
      into 'mods/vtoons/lib'
  }
  from('src') {
      into 'mods/vtoons'
  }
}

task assemble(type: Zip, dependsOn: 'build') {
  destinationDir = file("${buildDir}")
  outputs.dir destinationDir
  archiveName = "${appZip}"
  from file("${workDir}")
}

task clean(type: Delete) {
  delete "${buildDir}"
}

task wrapper(type: Wrapper) { gradleVersion = "1.1" }

/*
Gradle CloudFoundry plugin configuration.

Set your credentials with the -P option when you run gradle cf- commands like this:

./gradlew cf-push -PcfUser=username@email.com -PcfPasswd=secret

NOTE: You need to pick a different uri for the app since they have to be unique
and the current one is already taken.
*/

buildscript {
  repositories {
    mavenCentral()
    mavenRepo url:'http://repo.springsource.org/libs-snapshot'
  }
  dependencies {
    classpath group: 'org.gradle.api.plugins', name: 'gradle-cf-plugin', version: '0.2.0'
  }
}

apply plugin: 'cloudfoundry'

cloudfoundry {
  username = rootProject.hasProperty('cfUser') ? rootProject.cfUser : ''
  password = rootProject.hasProperty('cfPasswd') ? rootProject.cfPasswd : ''

  application = 'vtoons'
  framework = 'standalone'
  runtime = 'java7'
  memory = 256
  uris = ['vtoons.cloudfoundry.com']

  services = ['mongodb-vtoons']

  file = file("${buildDir}/${appZip}")
  command = "vert.x-${vertxVersion}/bin/vertx runmod vtoons"
}

cloudfoundryService {
  serviceName = 'mongodb-vtoons'
  vendor = 'mongodb'
  version = '2.0'
}
Something went wrong with that request. Please try again.