forked from KasperskyLab/Kaspresso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
118 lines (97 loc) · 3.33 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
import groovy.lang.GroovyObject
import org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig
import publishing.setup
import publishing.shouldBePublished
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
}
subprojects {
apply(plugin = Dependencies.Detect.plugin)
dependencies {
detekt(Dependencies.Detect.cli)
detekt(Dependencies.Detect.formatting)
}
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 = "Kaspresso"
name = publicationName
userOrg = user
vcsUrl = "https://github.com/KasperskyLab/Kaspresso.git"
setLicenses("Apache-2.0")
}
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.named("artifactoryPublish") {
dependsOn("assemble")
}
}
}
allprojects {
repositories {
jcenter()
google()
}
}