-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (109 loc) · 3.46 KB
/
build.gradle
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import jodd.http.HttpRequest
import java.text.SimpleDateFormat
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.ratpack:ratpack-gradle:0.9.19"
classpath "org.jodd:jodd-http:3.6.6"
}
}
plugins {
id "com.jfrog.bintray" version "1.2"
}
apply plugin: "io.ratpack.ratpack-groovy"
apply plugin: "idea"
apply plugin: 'maven-publish'
apply from: "gradle/idea/idea.gradle"
apply from: "gradle/dependencyRules.gradle"
apply from: "gradle/browserTest.gradle"
apply from: "gradle/heroku.gradle"
apply from: "gradle/codenarc/codenarc.gradle"
mainClassName = "ratpack.rest.Main"
repositories {
mavenCentral()
}
ext {
versions = [
logback: "1.1.3",
jodd: "3.6.6",
spock: "1.0-groovy-2.4"
]
bintrayApiKey = '<no-key>'
bintrayUser = '<no-user>'
releaseVersion = calculateVersion('0.1-SNAPSHOT')
}
version = '0.1-SNAPSHOT'
dependencies {
compile ratpack.dependency("session")
compile ratpack.dependency("jackson-guice")
compile "com.stormpath.sdk:stormpath-sdk-httpclient:1.0.RC4.5"
compile "ch.qos.logback:logback-classic:${versions.logback}"
compile "org.hibernate:hibernate-validator:5.2.1.Final"
compile "javax.el:javax.el-api:2.2.4"
compile 'org.neo4j:neo4j:2.2.3'
testCompile("org.spockframework:spock-core:${versions.spock}")
testCompile("org.jodd:jodd-http:${versions.jodd}")
testCompile 'org.codehaus.gpars:gpars:1.2.1'
browserTestCompile "org.gebish:geb-spock:0.12.0"
browserTestCompile "org.seleniumhq.selenium:selenium-firefox-driver:2.46.0"
browserTestCompile("org.spockframework:spock-guice:${versions.spock}")
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.energizedwork'
artifactId 'ratpack-rest'
version releaseVersion
from components.java
}
}
}
bintray {
dryRun = false
publish = true
key = bintrayApiKey
user = bintrayUser
pkg {
repo = 'maven'
name = 'ratpack-rest'
desc = 'Ratpack module for quickly creating REST endpoints.'
licenses = ['Apache-2.0']
websiteUrl = 'https://github.com/guspower/ratpack-rest'
issueTrackerUrl = 'https://github.com/guspower/ratpack-rest/issues'
vcsUrl = 'https://github.com/guspower/ratpack-rest.git'
labels = ['ratpack', 'rest', 'groovy']
publicDownloadNumbers = true
version {
name = releaseVersion
mavenCentralSync {
sync = false
}
}
}
}
test.doFirst {
test.jvmArgs += ["-Dtest.report.dir=${testReportDir.absolutePath}"]
}
String calculateVersion(String version) {
String result = version
if(version.endsWith('SNAPSHOT')) {
def format = new SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
String date = format.format(new Date())
result = version.replace('SNAPSHOT', date)
}
result
}
task travis << {
def xml = HttpRequest.get('https://api.travis-ci.org/repos/guspower/ratpack-rest/cc.xml').send().body()
def data = new XmlSlurper().parseText(xml)
String status = data.Project.'@lastBuildStatus'.text()
if(!status.toLowerCase().contains('success')) {
throw new Exception("Travis build failure - [$status]")
}
}