Skip to content

Commit ce19a26

Browse files
committed
improve test-only-groovy to not rely on an existing outer module
1 parent b8b520c commit ce19a26

File tree

5 files changed

+20
-30
lines changed

5 files changed

+20
-30
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package mill.groovylib
2+
3+
import mill.*
4+
import mill.javalib.{JavaModule, MavenModule}
5+
6+
/**
7+
* Convenience trait for projects using Java for production and Groovy for tests in a Maven setup
8+
*/
9+
trait JavaMavenModuleWithGroovyTests extends JavaModule with MavenModule {
10+
11+
trait GroovyMavenTests extends JavaTests with MavenTests with GroovyModule {
12+
private def groovyTestSources = Task.Sources(moduleDir / "src" / testModuleName / "groovy")
13+
override def sources: T[Seq[PathRef]] = super[MavenTests].sources() ++ groovyTestSources()
14+
override def resources: T[Seq[PathRef]] = super[MavenTests].resources()
15+
}
16+
}

libs/groovylib/src/mill/groovylib/TestGroovyMavenModule.scala

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

libs/groovylib/src/mill/groovylib/exports.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ export mill.javalib.DepSyntax
44

55
export mill.javalib.Dep
66

7+
export mill.javalib.JavaModule
8+
9+
export mill.javalib.MavenModule
10+
711
export mill.javalib.TestModule
812

913
export mill.javalib.PublishModule

libs/groovylib/test/resources/hello-groovy/joint-compile/src/GroovyGreeter.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package jointcompile
22

3-
import jointCompile.JavaPrinter
4-
53
class GroovyGreeter{
64

75
private final String toGreet;

libs/groovylib/test/resources/hello-groovy/joint-compile/src/JavaMain.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package jointcompile;
22

3-
import jointcompile.GroovyGreeter;
4-
5-
63
public class JavaMain {
74

85
public static void main(String[] args) {

0 commit comments

Comments
 (0)