-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
96 lines (84 loc) · 2.62 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
import groovy.json.JsonSlurper
import groovy.json.JsonBuilder
apply plugin: 'kotlin'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
jcenter()
}
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.16"
}
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'com.github.kittinunf.fuel:fuel:1.12.1'
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: "$jackson_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile("org.junit.jupiter:junit-jupiter-api:5.1.0")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.1.0")
testCompile "org.mockito:mockito-core:2.+"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
junitPlatform { }
task wrapper(type: Wrapper) {
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
version = '0.1.1'
task generateBintrayDescriptor {
doLast {
def templateJson = file('scripts/descriptor-template.json')
def json = new JsonSlurper().parseText(templateJson.text)
json.version.name = project.version
json.version.released = new Date().format('yyyy-MM-dd')
json.files[0].uploadPattern = "co/helmethair/${project.name}/${project.version}/\$1"
def outputJson = file('descriptor.json')
outputJson.createNewFile()
outputJson.write(new JsonBuilder(json).toPrettyString())
}
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}
publishing {
publications {
maven(MavenPublication) {
groupId 'co.helmethair'
from components.java
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
model {
tasks.generatePomFileForMavenPublication {
destination = file("$buildDir/libs/${project.name}-${project.version}.pom")
}
}