forked from KasperskyLab/Kaspresso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
132 lines (110 loc) · 3.98 KB
/
build.gradle.kts
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
import com.android.build.gradle.internal.tasks.factory.dependsOn
import groovy.lang.GroovyObject
import org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig
import publishing.setup
import publishing.shouldBePublished
import java.util.Date
buildscript {
repositories {
jcenter()
google()
maven { url = uri("https://plugins.gradle.org/m2/") }
}
dependencies {
classpath(Dependencies.Classpath.gradlePlugin)
classpath(Dependencies.Classpath.kotlinGradlePlugin)
classpath(Dependencies.Classpath.dokkaPlugin)
classpath(Dependencies.Classpath.bintrayPlugin)
classpath(Dependencies.Classpath.artifactoryPlugin)
}
}
plugins {
detekt
mavenPublish
bintray
artifactory
dokka
}
subprojects {
apply(plugin = Dependencies.Detect.plugin)
apply(plugin = Dependencies.Dokka.plugin)
dependencies {
detekt(Dependencies.Detect.cli)
detekt(Dependencies.Detect.formatting)
}
tasks.dokkaGfm.configure {
val parentDir = when {
parent != rootProject && parent != null -> "docs" + File.separator + parent?.name
else -> "docs"
}
outputDirectory.set(rootDir.resolve(parentDir))
}
detekt {
failFast = true
autoCorrect = true
config = files("${rootDir}/static-analysis/config/detekt/config.yml")
reports {
html {
enabled = true
destination = file("${rootDir}/static-analysis/reports/detekt_${project.name}.html")
}
}
}
if (shouldBePublished) {
apply(plugin = Dependencies.Publishing.mavenPlugin)
apply(plugin = Dependencies.Publishing.bintrayPlugin)
apply(plugin = Dependencies.Publishing.artifactoryPlugin)
publishing {
setup(this@subprojects)
}
val publicationName = findProperty("publish.publicationName").toString()
bintray {
user = findProperty("bintrayuser").toString()
key = findProperty("bintraykey").toString()
setPublications(publicationName)
pkg.apply {
repo = findProperty("publish.bintrayRepo").toString()
name = publicationName
userOrg = user
vcsUrl = "https://github.com/KasperskyLab/Kaspresso.git"
setLicenses("Apache-2.0")
version.apply {
name = findProperty("stableVersion").toString()
released = Date().toString()
}
}
version = findProperty("stableVersion").toString()
}
artifactory {
publish(delegateClosureOf<PublisherConfig> {
setContextUrl("https://oss.jfrog.org/artifactory")
repository(delegateClosureOf<GroovyObject> {
setProperty("repoKey", "oss-snapshot-local")
setProperty("username", findProperty("bintrayuser").toString())
setProperty("password", findProperty("artifactoryPassword").toString())
setProperty("maven", true)
})
defaults(delegateClosureOf<GroovyObject> {
invokeMethod("publications", "${publicationName}Snapshot")
setProperty("publishArtifacts", true)
setProperty("publishPom", true)
})
})
resolve(delegateClosureOf<GroovyObject> {
setProperty("repoKey", "libs-snapshot")
setProperty("username", findProperty("bintrayuser").toString())
setProperty("password", findProperty("artifactoryPassword").toString())
setProperty("maven", true)
})
}
tasks.artifactoryPublish.dependsOn("assemble")
tasks.bintrayUpload.dependsOn("assemble")
}
}
allprojects {
repositories {
jcenter()
google()
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
}
}