This repository was archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
107 lines (91 loc) · 2.58 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
buildscript {
ext.kotlinVersion = '1.1.4-3'
ext.dokkaVersion = '0.9.15'
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}"
}
}
apply plugin: 'kotlin'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'org.jetbrains.dokka'
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
repositories {
mavenLocal()
jcenter()
// maven {
// url "https://jitpack.io"
// }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:${kotlinVersion}"
compile 'com.beust:klaxon:0.32'
testCompile 'org.testng:testng:6.10'
testCompile "org.jetbrains.kotlin:kotlin-test:${kotlinVersion}"
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
test {
useTestNG()
}
//Workaround for 'Cannot configure the 'publishing' extension after it has been accessed.' error
Properties publishProperties = new Properties()
publishProperties.load(file('publish.properties').newInputStream())
def publish = [
group: publishProperties.get('publish.group'),
name: publishProperties.get('publish.name'),
version: publishProperties.get('publish.version'),
]
task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
JCenterPublication(MavenPublication) {
from components.java
artifact sourceJar
groupId = publish.group
artifactId = publish.name
version = publish.version
}
}
}
bintray {
user = project.properties.get('jcenter.personal.user')
key = project.properties.get('jcenter.personal.api_key')
publications = ['JCenterPublication']
pkg {
repo = 'maven'
group = publish.group
name = publish.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/fboldog/ext4klaxon.git'
labels = ['kotlin']
version {
name = publish.version
desc = 'Type Extensions for Klaxon'
released = new Date()
vcsTag = publish.version
}
}
}
dokka {
linkMapping {
dir = "src/main/kotlin"
url = "https://github.com/fboldog/ext4klaxon/blob/master/src/main/kotlin"
suffix = "#L"
}
}
task install(dependsOn: publishToMavenLocal)
task wrapper(type: Wrapper) {
gradleVersion = '4.2'
}