Skip to content

Commit

Permalink
Convert gradle build script to be kotlin based
Browse files Browse the repository at this point in the history
  • Loading branch information
bijukunjummen committed Aug 5, 2017
1 parent c2a53e7 commit c37a415
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 3 deletions.
85 changes: 85 additions & 0 deletions build.gradle.kts
@@ -0,0 +1,85 @@
import io.pivotal.services.plugin.CfPluginExtension
import io.pivotal.services.plugin.CfService

buildscript {
repositories {
mavenCentral()
jcenter()
maven { setUrl("https://repo.spring.io/milestone") }
maven { setUrl("https://repo.spring.io/snapshot") }
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap-1.1") }
mavenCentral()
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.4-eap-69")
classpath("com.github.jengelman.gradle.plugins:shadow:2.0.1")
classpath("org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC2")
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.6.RELEASE")
}
}

repositories {
mavenCentral()
maven { setUrl("https://repo.spring.io/milestone") }
maven { setUrl("https://repo.spring.io/snapshot") }
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap-1.1") }
}

plugins {
id("com.github.pivotalservices.cf-app").version("1.0.9")
}

apply {
plugin("kotlin")
plugin("org.springframework.boot")
plugin("java")
}

configure< CfPluginExtension> {
//CF Details
ccHost = "api.local.pcfdev.io"
ccUser = "admin"
ccPassword = "admin"
org = "pcfdev-org"
space = "pcfdev-space"

//App Details
name = "cf-show-env"
hostName = "cf-show-env"
filePath = "build/libs/cf-show-env-1.0.0-M1.jar"
path = ""
domain = "local.pcfdev.io"
instances = 2
memory = 1024
timeout = 180

//Env and services
buildpack = "https://github.com/cloudfoundry/java-buildpack.git"

environment = mapOf(
"JAVA_OPTS" to "-Djava.security.egd=file:/dev/./urandom",
"SPRING_PROFILES_ACTIVE" to "cloud"
)

cfService(closureOf<CfService> {
name = "p-mysql"
plan = "512mb"
instanceName = "test-db"
})

}
dependencies {
val prometheus_client_version = "0.0.21"
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.boot:spring-boot-devtools")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-web")
compile("com.google.guava:guava:19.0")
compile("org.webjars:bootstrap:3.3.7")
compile("org.webjars:jquery:3.1.1")
compile("io.prometheus:simpleclient:${prometheus_client_version}")
compile("io.prometheus:simpleclient_spring_boot:${prometheus_client_version}")
compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
1 change: 0 additions & 1 deletion build.gradle → build.gradle.old
Expand Up @@ -55,7 +55,6 @@ ext {

cfConfig {
//CF Details
// ccHost = "api.run.pez.pivotal.io"
ccHost = "api.local.pcfdev.io"
ccUser = "admin"
ccPassword = "admin"
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
@@ -0,0 +1,2 @@
group=org.bk
version=1.0.0-M1
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Tue Apr 19 12:56:51 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip

0 comments on commit c37a415

Please sign in to comment.