-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
126 lines (107 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
buildscript {
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
}
}
plugins {
id 'java'
id 'idea'
id 'maven'
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "1.1.51"
id "com.jfrog.bintray" version "1.7.3"
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC4-3"
}
apply plugin: 'org.junit.platform.gradle.plugin'
group 'com.gregwoodfill.assert'
version '0.1.0'
ext.jsonassert_version = '1.5.+'
task wrapper(type: Wrapper) {
version = "4.2.1"
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publications = ['PublishKotlinJsonAssert']
configurations = ['archives']
pkg {
repo = 'maven'
name = 'kotlin-json-assert'
licenses = ['MIT']
vcsUrl = 'https://github.com/gregwoodfill/kotlin-json-assert.git'
}
}
junitPlatform {
filters {
engines {
include 'spek'
}
}
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
dependencies {
compile "org.skyscreamer:jsonassert:$jsonassert_version"
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile "org.jetbrains.kotlin:kotlin-reflect"
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'org.amshove.kluent:kluent:1.+'
testCompile 'org.jetbrains.spek:spek-api:1.1.5'
testRuntime ('org.jetbrains.spek:spek-junit-platform-engine:1.1.5') {
exclude group: 'org.junit.platform'
exclude group: 'org.jetbrains.kotlin'
}
testRuntime('org.junit.jupiter:junit-jupiter-api:5.0.1')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.0.1')
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
build.dependsOn(sourcesJar)
bintrayUpload.dependsOn install
publishing {
publications {
PublishKotlinJsonAssert(MavenPublication) {
from components.java
artifact sourcesJar
groupId 'com.gregwoodfill.assert'
artifactId 'kotlin-json-assert'
version project.version
// http://stackoverflow.com/a/32353697/6556970
pom.withXml {
Map resolvedVersionMap = [:]
Set<ResolvedArtifact> resolvedArtifacts = configurations.compile.getResolvedConfiguration().getResolvedArtifacts()
resolvedArtifacts.addAll(configurations.testCompile.getResolvedConfiguration().getResolvedArtifacts())
resolvedArtifacts.each {
ModuleVersionIdentifier mvi = it.getModuleVersion().getId();
resolvedVersionMap.put("${mvi.getGroup()}:${mvi.getName()}", mvi.getVersion())
}
asNode().dependencies.first().each {
def groupId = it.get("groupId").first().value().first()
def artifactId = it.get("artifactId").first().value().first()
it.get("version").first().value = resolvedVersionMap.get("${groupId}:${artifactId}")
}
}
}
}
}
detekt {
version = "1.0.0.RC4-3"
profile("main") {
input = "$projectDir/src/main/kotlin"
config = "$projectDir/detekt.yml"
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
}
}
compileJava.dependsOn(detektCheck)