Skip to content

Commit 6a498a8

Browse files
GooolerCopilot
andauthored
Update docs and tests for groovy and scala plugins (#1831)
* Remove tests for groovy and scala plugins * Update `docs/groovy-and-scala-plugins/README.md` * Update src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/BasePluginTest.kt Co-authored-by: Copilot <[email protected]> * Update desc --------- Co-authored-by: Copilot <[email protected]>
1 parent f5fbd4c commit 6a498a8

File tree

5 files changed

+3
-124
lines changed

5 files changed

+3
-124
lines changed

docs/groovy-and-scala-plugins/README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ For Groovy:
1212
id("com.gradleup.shadow")
1313
}
1414

15-
dependencies {
16-
// If you don't want the Groovy standard library to be shadowed, please replace `implementation` with `api`.
17-
implementation(localGroovy())
18-
}
19-
2015
tasks.shadowJar {
2116
manifest {
2217
// Optionally, set the main class for the shadowed JAR.
@@ -33,11 +28,6 @@ For Groovy:
3328
id 'com.gradleup.shadow'
3429
}
3530

36-
dependencies {
37-
// If you don't want the Groovy standard library to be shadowed, please replace `implementation` with `api`.
38-
implementation localGroovy()
39-
}
40-
4131
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
4232
manifest {
4333
// Optionally, set the main class for the shadowed JAR.
@@ -56,11 +46,6 @@ For Scala:
5646
id("com.gradleup.shadow")
5747
}
5848

59-
dependencies {
60-
// If you don't want the Scala standard library to be shadowed, please replace `implementation` with `api`.
61-
implementation("org.scala-lang:scala-library:2.13.16")
62-
}
63-
6449
tasks.shadowJar {
6550
manifest {
6651
// Optionally, set the main class for the shadowed JAR.
@@ -77,15 +62,12 @@ For Scala:
7762
id 'com.gradleup.shadow'
7863
}
7964

80-
dependencies {
81-
// If you don't want the Scala standard library to be shadowed, please replace `implementation` with `api`.
82-
implementation 'org.scala-lang:scala-library:2.13.16'
83-
}
84-
8565
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
8666
manifest {
8767
// Optionally, set the main class for the shadowed JAR.
8868
attributes 'Main-Class': 'com.example.Main'
8969
}
9070
}
9171
```
72+
73+
You can customize the other configurations of the `shadowJar` task as needed, just like with Java projects.

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/BasePluginTest.kt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ abstract class BasePluginTest {
226226
jvmLang: JvmLang = JvmLang.Java,
227227
content: () -> String = {
228228
when (jvmLang) {
229-
JvmLang.Groovy,
230-
JvmLang.Java,
231-
-> {
229+
JvmLang.Java -> {
232230
val imports = if (withImports) "import junit.framework.Test;" else ""
233231
val classRef = if (withImports) "\"Refs: \" + Test.class.getName()" else "\"Refs: null\""
234232
"""
@@ -259,22 +257,6 @@ abstract class BasePluginTest {
259257
}
260258
""".trimIndent()
261259
}
262-
JvmLang.Scala -> {
263-
val imports = if (withImports) "import junit.framework.Test" else ""
264-
val classRef = if (withImports) "\"Refs: \" + classOf[Test].getName" else "\"Refs: null\""
265-
"""
266-
package $packageName
267-
$imports
268-
object $className {
269-
def main(args: Array[String]): Unit = {
270-
if (args.isEmpty) throw new IllegalArgumentException("No arguments provided.")
271-
val content = s"Hello, World! (%s) from $className".format(args: _*)
272-
println(content)
273-
println($classRef)
274-
}
275-
}
276-
""".trimIndent()
277-
}
278260
}
279261
},
280262
): String {

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/GroovyPluginTest.kt

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

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ScalaPluginTest.kt

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

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/util/JvmLang.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ package com.github.jengelman.gradle.plugins.shadow.util
33
enum class JvmLang(
44
val suffix: String,
55
) {
6-
Groovy("groovy"),
76
Java("java"),
87
Kotlin("kt"),
9-
Scala("scala"),
108
;
119

1210
override fun toString(): String = name.lowercase()

0 commit comments

Comments
 (0)