This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
147 lines (129 loc) · 5.41 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import java.net.URL
buildscript {
// needs to be defined in here because otherwise tutteli-publish plugin does not have this information when applied
rootProject.group = "ch.tutteli.spek"
rootProject.version = "1.3.0-SNAPSHOT"
rootProject.description = "A set of Spek extensions"
}
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.dokka") version "1.6.10"
val tutteliGradleVersion = "4.2.1"
id("ch.tutteli.gradle.plugins.dokka") version tutteliGradleVersion
id("ch.tutteli.gradle.plugins.kotlin.module.info") version tutteliGradleVersion
id("ch.tutteli.gradle.plugins.publish") version tutteliGradleVersion
id("ch.tutteli.gradle.plugins.spek") version tutteliGradleVersion
id("io.gitlab.arturbosch.detekt") version "1.19.0"
id("org.sonarqube") version "3.3"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
// necessary because spek is an unnamed module, drop again in case https://github.com/spekframework/spek/issues/981 is resolved
id("de.jjohannes.extra-java-module-info") version "0.11"
}
val atriumVersion by extra("0.17.0-RC1")
val niokVersion by extra("1.4.7")
val spekVersion by extra("2.0.16")
repositories {
mavenCentral()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
//TODO change to jdk11 with 2.0.0
jvmTarget = "1.6"
// so that consumers of this library using 1.3 are still happy, we don't use specific features of 1.5
//TODO change to 1.5 with 2.0.0
apiVersion = "1.4"
languageVersion = "1.4"
}
}
dependencies {
api("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:$atriumVersion")
testImplementation("ch.tutteli.niok:niok:$niokVersion")
}
// add module information for all direct and transitive dependencies that are not modules
extraJavaModuleInfo {
failOnMissingModuleInfo.set(false)
automaticModule("spek-dsl-jvm-$spekVersion.jar", "spek.dsl.jvm")
}
detekt {
allRules = true
config = files("${rootProject.projectDir}/gradle/scripts/detekt.yml")
reports {
xml.enabled = true
html.enabled = false
sarif.enabled = false
txt.enabled = false
}
}
sonarqube {
properties {
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.organization", "robstoll-github")
property("sonar.projectKey", "robstoll_${rootProject.name}")
property("sonar.projectVersion", rootProject.version)
property("sonar.kotlin", "detekt.reportPaths=build/reports/detekt/detekt.xml")
property("sonar.sources", "src/main/kotlin")
property("sonar.tests", "src/test/kotlin")
property("sonar.coverage", "jacoco.xmlReportPaths=build/reports/jacoco/report.xml")
property("sonar.verbose", "true")
}
}
tasks.named("sonarqube").configure {
dependsOn(tasks.named("detekt"))
}
nexusPublishing {
repositories {
sonatype()
}
}
/*
Release & deploy a commit
--------------------------------
export SPEK_EXTENSION_PREVIOUS_VERSION=1.2.1
export SPEK_EXTENSION_VERSION=1.3.0
find ./ -name "*.md" | xargs perl -0777 -i \
-pe "s@$SPEK_EXTENSION_PREVIOUS_VERSION@$SPEK_EXTENSION_VERSION@g;" \
-pe "s@tree/master@tree/v$SPEK_EXTENSION_VERSION@g;";
perl -0777 -i \
-pe "s@$SPEK_EXTENSION_PREVIOUS_VERSION@$SPEK_EXTENSION_VERSION@g;" \
-pe "s/rootProject.version = '$SPEK_EXTENSION_VERSION-SNAPSHOT'/rootProject.version = '$SPEK_EXTENSION_VERSION'/;" \
./build.gradle
perl -0777 -i \
-pe "s@$SPEK_EXTENSION_PREVIOUS_VERSION@$SPEK_EXTENSION_VERSION@g;" \
-pe 's/(<!-- for master -->\n)\n([\S\s]*?)(\n<!-- for a specific release -->\n)<!--\n([\S\s]*?)-->\n(\n# Tutteli spek extension)/$1<!--\n$2-->$3\n$4\n$5/;' \
./README.md
git commit -a -m "v$SPEK_EXTENSION_VERSION"
1. change search for X.Y.Z-SNAPSHOT and change to X.Y.Z
2. search for current version and replace with new
3. update master:
a) point to the tag
1) update badge versions
2) search for `tree/master` and replace it with `tree/vX.Y.Z` (README.md)
b) commit (modified build.gradle, README.md) c) git tag vX.Y.Z
d) git push origin vX.Y.Z
4. deploy to bintray:
a) java -version 2>&1 | grep "version \"11" && CI=true gr clean publishToBintray
b) Log in to bintray, check that there are 10 artifacts and publish new jars
5. create release on github
Prepare next dev cycle
-----------------------
export SPEK_EXTENSION_VERSION=1.2.1
export SPEK_EXTENSION_NEXT_VERSION=1.3.0
find ./ -name "*.md" | xargs perl -0777 -i \
-pe "s@tree/v$SPEK_EXTENSION_VERSION@tree/master@g;";
perl -0777 -i \
-pe "s/rootProject.version = '$SPEK_EXTENSION_VERSION'/rootProject.version = '$SPEK_EXTENSION_NEXT_VERSION-SNAPSHOT'/;" \
-pe "s/SPEK_EXTENSION_VERSION=$SPEK_EXTENSION_VERSION/SPEK_EXTENSION_VERSION=$SPEK_EXTENSION_NEXT_VERSION/;" \
./build.gradle
perl -0777 -i \
-pe 's/(<!-- for master -->\n)<!--\n([\S\s]*?)-->(\n<!-- for a specific release -->)\n([\S\s]*?)\n(\n# Tutteli spek extension)/$1\n$2$3\n<!--$4-->\n$5/;' \
./README.md
git commit -a -m "prepare dev cycle of $SPEK_EXTENSION_NEXT_VERSION"
1. change version in build.gradle to X.Y.Z-SNAPSHOT
2. point to master
a) search for `tag=vX.Y.Z` and replace it with `branch=master`
b) search for `tree/vX.Y.Z` and replace it with `tree/master`
3. commit & push changes
*/