@@ -39,35 +39,30 @@ repositories {
3939 mavenCentral()
4040}
4141
42- allprojects {
43- extra.set(" dokka.outputDirectory" , rootDir.resolve(" docs" ))
44- group = property(" projects.group" ).toString()
45- version = property(" projects.version" ).toString()
46- setupDetekt()
47-
48- java {
49- sourceCompatibility = VERSION_1_8
50- targetCompatibility = VERSION_1_8
42+ group = property(" projects.group" ).toString()
43+
44+ java {
45+ sourceCompatibility = VERSION_1_8
46+ targetCompatibility = VERSION_1_8
47+ }
48+
49+ tasks {
50+ withType<KotlinCompile >().configureEach {
51+ kotlinOptions.jvmTarget = " 1.8"
5152 }
52-
53- tasks {
54- withType<KotlinCompile >().configureEach {
55- kotlinOptions.jvmTarget = " 1.8"
56- }
5753
58- withType<Test >().configureEach {
59- maxParallelForks = Runtime .getRuntime().availableProcessors()
60- useJUnitPlatform()
61- testLogging {
62- exceptionFormat = TestExceptionFormat .FULL
63- events = setOf (PASSED , SKIPPED , FAILED , STANDARD_OUT , STANDARD_ERROR )
64- }
54+ withType<Test >().configureEach {
55+ maxParallelForks = Runtime .getRuntime().availableProcessors()
56+ useJUnitPlatform()
57+ testLogging {
58+ exceptionFormat = TestExceptionFormat .FULL
59+ events = setOf (PASSED , SKIPPED , FAILED , STANDARD_OUT , STANDARD_ERROR )
6560 }
6661 }
67- }
6862
69- tasks.test {
70- useJUnitPlatform()
63+ test {
64+ useJUnitPlatform()
65+ }
7166}
7267
7368kotlin {
@@ -101,6 +96,12 @@ configure<KnitPluginExtension> {
10196 siteRoot = " https://nomisrev.github.io/kotlinx-serialization-jsonpath/"
10297}
10398
99+ configure<DetektExtension > {
100+ parallel = true
101+ buildUponDefaultConfig = true
102+ allRules = true
103+ }
104+
104105tasks {
105106 withType<DokkaTask >().configureEach {
106107 outputDirectory.set(rootDir.resolve(" docs" ))
@@ -123,39 +124,27 @@ tasks {
123124 }
124125
125126 getByName(" knitPrepare" ).dependsOn(getTasksByName(" dokka" , true ))
126-
127+
127128 register<Delete >(" cleanDocs" ) {
128129 val folder = file(" docs" ).also { it.mkdir() }
129130 val docsContent = folder.listFiles().filter { it != folder }
130131 delete(docsContent)
131132 }
132- }
133133
134- fun Project.setupDetekt () {
135- plugins.apply (" io.gitlab.arturbosch.detekt" )
134+ withType<Detekt >().configureEach {
135+ reports {
136+ html.required by true
137+ sarif.required by true
138+ txt.required by false
139+ xml.required by false
140+ }
136141
137- configure<DetektExtension > {
138- parallel = true
139- buildUponDefaultConfig = true
140- allRules = true
142+ exclude(" **/example/**" )
143+ exclude(" **/ReadMeSpec.kt" )
141144 }
142145
143- tasks {
144- withType<Detekt >().configureEach {
145- reports {
146- html.required by true
147- sarif.required by true
148- txt.required by false
149- xml.required by false
150- }
151-
152- exclude(" **/example/**" )
153- exclude(" **/ReadMeSpec.kt" )
154- }
155-
156- configureEach {
157- if (name == " build" ) dependsOn(withType<Detekt >())
158- }
146+ configureEach {
147+ if (name == " build" ) dependsOn(withType<Detekt >())
159148 }
160149}
161150
0 commit comments