-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
127 lines (113 loc) · 4.04 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
import org.jetbrains.dokka.gradle.DokkaTask
plugins {
`java-gradle-plugin`
id("com.gradle.plugin-publish")
id("maven-publish")
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.dokka")
id("io.gitlab.arturbosch.detekt")
id("com.jfrog.bintray")
id("net.researchgate.release")
}
defaultTasks("build", "publishToMavenLocal")
group = "com.cognifide.gradle"
repositories {
jcenter()
gradlePluginPortal()
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom:${properties["kotlin.version"]}"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.8.8")
implementation("commons-io:commons-io:2.6")
implementation("com.github.node-gradle:gradle-node-plugin:2.1.1")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
"detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:${properties["detekt.version"]}")
}
val functionalTestSourceSet = sourceSets.create("functionalTest") {}
gradlePlugin.testSourceSets(functionalTestSourceSet)
configurations.getByName("functionalTestImplementation").extendsFrom(configurations.getByName("testImplementation"))
tasks {
register<Test>("functionalTest") {
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
}
named<Task>("check") {
dependsOn("functionalTest")
}
register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
dependsOn("classes")
from(sourceSets["main"].allSource)
}
register<DokkaTask>("dokkaJavadoc") {
outputFormat = "javadoc"
outputDirectory = "$buildDir/javadoc"
}
register<Jar>("javadocJar") {
archiveClassifier.set("javadoc")
dependsOn("dokkaJavadoc")
from("$buildDir/javadoc")
}
withType<Test>().configureEach {
testLogging.showStandardStreams = true
}
named("afterReleaseBuild") {
dependsOn("bintrayUpload", "publishPlugins")
}
named("updateVersion") {
enabled = false
}
}
detekt {
config.from(file("detekt.yml"))
parallel = true
autoCorrect = true
failFast = true
}
gradlePlugin {
plugins {
create("lighthouse") {
id = "com.cognifide.lighthouse"
implementationClass = "com.cognifide.gradle.lighthouse.LighthousePlugin"
displayName = "Lighthouse Plugin"
description = "Runs Lighthouse tests on multiple sites / web pages with checking thresholds (useful on continuous integration, constant performance checking)."
}
}
}
pluginBundle {
website = "https://github.com/wttech/gradle-lighthouse-plugin"
vcsUrl = "https://github.com/wttech/gradle-lighthouse-plugin.git"
description = "Gradle Lighthouse Plugin"
tags = listOf("lighthouse", "performance", "test", "seo", "pwa")
}
bintray {
user = (project.findProperty("bintray.user") ?: System.getenv("BINTRAY_USER"))?.toString()
key = (project.findProperty("bintray.key") ?: System.getenv("BINTRAY_KEY"))?.toString()
setPublications("mavenJava")
with(pkg) {
repo = "maven-public"
name = "gradle-lighthouse-plugin"
userOrg = "cognifide"
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/wttech/gradle-lighthouse-plugin.git"
setLabels("lighthouse", "performance", "test", "seo", "pwa")
with(version) {
name = project.version.toString()
desc = "${project.description} ${project.version}"
vcsTag = project.version.toString()
}
}
publish = (project.findProperty("bintray.publish") ?: "true").toString().toBoolean()
override = (project.findProperty("bintray.override") ?: "false").toString().toBoolean()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
}
}
}