Skip to content

Commit 8cf3874

Browse files
authored
convert build to kts (#119)
convert some tests to kotlin and add more assertions
1 parent c671f6d commit 8cf3874

File tree

6 files changed

+284
-182
lines changed

6 files changed

+284
-182
lines changed

build.gradle

Lines changed: 0 additions & 139 deletions
This file was deleted.

build.gradle.kts

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/*
2+
* Copyright 2014-2019 Netflix, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
plugins {
18+
id("com.netflix.nebula.plugin-plugin") version ("25.+")
19+
`kotlin-dsl`
20+
}
21+
22+
tasks.named<GroovyCompile>("compileGroovy", GroovyCompile::class.java) {
23+
groovyOptions.configurationScript = file("src/groovyCompile/groovycConfig.groovy")
24+
}
25+
26+
description = "Gradle plugin collect and provide information about the environment"
27+
28+
contacts {
29+
addPerson("nebula-plugins-oss@netflix.com") {
30+
moniker = "Nebula Plugins Maintainers"
31+
github = "nebula-plugins"
32+
}
33+
}
34+
35+
dependencies {
36+
// TODO, make these optional
37+
implementation("com.perforce:p4java:2015.2.1365273")
38+
implementation("com.netflix.nebula:nebula-gradle-interop:latest.release")
39+
implementation("com.netflix.nebula:gradle-contacts-plugin:latest.release")
40+
implementation("net.java.dev.jna:jna-platform:5.16.0")
41+
testImplementation("com.github.stefanbirkner:system-rules:1.19.0")
42+
testImplementation("org.ajoberstar.grgit:grgit-core:4.1.1") {
43+
exclude(group = "org.codehaus.groovy", module = "groovy")
44+
}
45+
testImplementation("org.spockframework:spock-junit4:2.4-groovy-4.0")
46+
testImplementation("org.eclipse.jgit:org.eclipse.jgit:7.+")
47+
testImplementation(libs.assertj)
48+
}
49+
50+
testing {
51+
suites {
52+
named<JvmTestSuite>("test") {
53+
useJUnitJupiter()
54+
}
55+
}
56+
}
57+
58+
gradlePlugin {
59+
plugins {
60+
create("info") {
61+
id = "com.netflix.nebula.info"
62+
displayName = "Gradle Info plugin"
63+
description = project.description
64+
implementationClass = "nebula.plugin.info.InfoPlugin"
65+
tags.set(listOf("nebula", "info"))
66+
}
67+
create("infoBasic") {
68+
id = "com.netflix.nebula.info-basic"
69+
displayName = "Gradle Info Basic plugin"
70+
description = project.description
71+
implementationClass = "nebula.plugin.info.basic.BasicInfoPlugin"
72+
tags.set(listOf("nebula", "info"))
73+
}
74+
create("infoDependencies") {
75+
id = "com.netflix.nebula.info-dependencies"
76+
displayName = "Gradle Info Dependencies plugin"
77+
description = project.description
78+
implementationClass = "nebula.plugin.info.dependencies.DependenciesInfoPlugin"
79+
tags.set(listOf("nebula", "info"))
80+
}
81+
create("infoBroker") {
82+
id = "com.netflix.nebula.info-broker"
83+
displayName = "Gradle Info Broker plugin"
84+
description = project.description
85+
implementationClass = "nebula.plugin.info.InfoBrokerPlugin"
86+
tags.set(listOf("nebula", "info"))
87+
}
88+
create("infoCI") {
89+
id = "com.netflix.nebula.info-ci"
90+
displayName = "Gradle Info CI plugin"
91+
description = project.description
92+
implementationClass = "nebula.plugin.info.ci.ContinuousIntegrationInfoPlugin"
93+
tags.set(listOf("nebula", "info"))
94+
}
95+
create("infoJAR") {
96+
id = "com.netflix.nebula.info-jar"
97+
displayName = "Gradle Info JAR plugin"
98+
description = project.description
99+
implementationClass = "nebula.plugin.info.reporting.InfoJarManifestPlugin"
100+
tags.set(listOf("nebula", "info"))
101+
}
102+
create("infoJARProperties") {
103+
id = "com.netflix.nebula.info-jar-properties"
104+
displayName = "Gradle Info JAR properties plugin"
105+
description = project.description
106+
implementationClass = "nebula.plugin.info.reporting.InfoJarPropertiesFilePlugin"
107+
tags.set(listOf("nebula", "info"))
108+
}
109+
create("infoJava") {
110+
id = "com.netflix.nebula.info-java"
111+
displayName = "Gradle Info Java plugin"
112+
description = project.description
113+
implementationClass = "nebula.plugin.info.java.InfoJavaPlugin"
114+
tags.set(listOf("nebula", "info"))
115+
}
116+
create("infoOwners") {
117+
id = "com.netflix.nebula.info-owners"
118+
displayName = "Gradle Info Owners plugin"
119+
description = project.description
120+
implementationClass = "nebula.plugin.info.basic.ManifestOwnersPlugin"
121+
tags.set(listOf("nebula", "info"))
122+
}
123+
create("infoProps") {
124+
id = "com.netflix.nebula.info-props"
125+
displayName = "Gradle Info Properties plugin"
126+
description = project.description
127+
implementationClass = "nebula.plugin.info.reporting.InfoPropertiesFilePlugin"
128+
tags.set(listOf("nebula", "info"))
129+
}
130+
create("infoScm") {
131+
id = "com.netflix.nebula.info-scm"
132+
displayName = "Gradle Info SCM plugin"
133+
description = project.description
134+
implementationClass = "nebula.plugin.info.scm.ScmInfoPlugin"
135+
tags.set(listOf("nebula", "info"))
136+
}
137+
}
138+
}

gradle.lockfile

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
# This is a Gradle generated file for dependency locking.
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
4-
cglib:cglib-nodep:3.2.2=integTestRuntimeClasspath,testRuntimeClasspath
5-
com.github.stefanbirkner:system-rules:1.19.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
6-
com.googlecode.javaewah:JavaEWAH:1.2.3=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
7-
com.jcraft:jzlib:1.1.2=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8-
com.netflix.nebula:gradle-contacts-plugin:8.1.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
9-
com.netflix.nebula:nebula-gradle-interop:3.1.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
10-
com.netflix.nebula:nebula-test:11.11.3=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
11-
com.perforce:p4java:2015.2.1365273=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
12-
commons-codec:commons-codec:1.20.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
13-
io.leangen.geantyref:geantyref:1.3.16=integTestRuntimeClasspath,testRuntimeClasspath
14-
junit:junit-dep:4.11=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
15-
junit:junit:4.13.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
16-
net.bytebuddy:byte-buddy:1.17.7=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
17-
net.java.dev.jna:jna-platform:5.16.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
18-
net.java.dev.jna:jna:5.16.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
19-
org.ajoberstar.grgit:grgit-core:4.1.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
20-
org.apache.groovy:groovy-bom:4.0.29=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
21-
org.apache.groovy:groovy:4.0.29=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
22-
org.apiguardian:apiguardian-api:1.1.2=integTestCompileClasspath,testCompileClasspath
23-
org.assertj:assertj-core:3.27.6=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
24-
org.eclipse.jgit:org.eclipse.jgit:7.5.0.202512021534-r=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
25-
org.hamcrest:hamcrest-core:1.3=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
26-
org.hamcrest:hamcrest:3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
27-
org.jetbrains.kotlin:kotlin-stdlib:2.2.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
28-
org.jetbrains:annotations:13.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
29-
org.jspecify:jspecify:1.0.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
30-
org.junit.jupiter:junit-jupiter-api:5.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
31-
org.junit.jupiter:junit-jupiter-engine:5.14.1=integTestRuntimeClasspath,testRuntimeClasspath
32-
org.junit.jupiter:junit-jupiter-params:5.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
33-
org.junit.jupiter:junit-jupiter:5.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
34-
org.junit.platform:junit-platform-commons:1.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
35-
org.junit.platform:junit-platform-engine:1.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
36-
org.junit.platform:junit-platform-launcher:1.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
37-
org.junit:junit-bom:5.14.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
38-
org.objenesis:objenesis:2.4=integTestRuntimeClasspath,testRuntimeClasspath
39-
org.opentest4j:opentest4j:1.3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
40-
org.slf4j:slf4j-api:2.0.17=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
41-
org.spockframework:spock-bom:2.4-groovy-4.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
42-
org.spockframework:spock-core:2.4-groovy-4.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
43-
org.spockframework:spock-junit4:2.4-groovy-4.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
44-
empty=annotationProcessor,integTestAnnotationProcessor,testAnnotationProcessor
4+
cglib:cglib-nodep:3.2.2=testRuntimeClasspath
5+
com.github.stefanbirkner:system-rules:1.19.0=testCompileClasspath,testRuntimeClasspath
6+
com.googlecode.javaewah:JavaEWAH:1.2.3=testCompileClasspath,testRuntimeClasspath
7+
com.jcraft:jzlib:1.1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8+
com.netflix.nebula:gradle-contacts-plugin:8.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
9+
com.netflix.nebula:nebula-gradle-interop:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
10+
com.netflix.nebula:nebula-test:11.11.3=testCompileClasspath,testRuntimeClasspath
11+
com.perforce:p4java:2015.2.1365273=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
12+
commons-codec:commons-codec:1.20.0=testCompileClasspath,testRuntimeClasspath
13+
io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath
14+
junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath
15+
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
16+
net.bytebuddy:byte-buddy:1.18.3=testCompileClasspath,testRuntimeClasspath
17+
net.java.dev.jna:jna-platform:5.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
18+
net.java.dev.jna:jna:5.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
19+
org.ajoberstar.grgit:grgit-core:4.1.1=testCompileClasspath,testRuntimeClasspath
20+
org.apache.groovy:groovy-bom:4.0.29=testCompileClasspath,testRuntimeClasspath
21+
org.apache.groovy:groovy:4.0.29=testCompileClasspath,testRuntimeClasspath
22+
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
23+
org.assertj:assertj-core:3.27.7=testCompileClasspath,testRuntimeClasspath
24+
org.eclipse.jgit:org.eclipse.jgit:7.5.0.202512021534-r=testCompileClasspath,testRuntimeClasspath
25+
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
26+
org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath
27+
org.jetbrains.kotlin:kotlin-reflect:2.2.20=compileClasspath,embeddedKotlin,testCompileClasspath,testRuntimeClasspath
28+
org.jetbrains.kotlin:kotlin-stdlib:2.2.0=runtimeClasspath
29+
org.jetbrains.kotlin:kotlin-stdlib:2.2.20=compileClasspath,embeddedKotlin,testCompileClasspath,testRuntimeClasspath
30+
org.jetbrains:annotations:13.0=compileClasspath,embeddedKotlin,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
31+
org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath
32+
org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath
33+
org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath
34+
org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath
35+
org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath
36+
org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath
37+
org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath
38+
org.junit.platform:junit-platform-launcher:1.14.1=testCompileClasspath,testRuntimeClasspath
39+
org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath
40+
org.objenesis:objenesis:2.4=testRuntimeClasspath
41+
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
42+
org.slf4j:slf4j-api:2.0.17=testCompileClasspath,testRuntimeClasspath
43+
org.spockframework:spock-bom:2.4-groovy-4.0=testCompileClasspath,testRuntimeClasspath
44+
org.spockframework:spock-core:2.4-groovy-4.0=testCompileClasspath,testRuntimeClasspath
45+
org.spockframework:spock-junit4:2.4-groovy-4.0=testCompileClasspath,testRuntimeClasspath
46+
empty=annotationProcessor,testAnnotationProcessor

0 commit comments

Comments
 (0)