Skip to content

Commit bfbe1fe

Browse files
[autofix.ci] apply automated fixes
1 parent f7cd2cf commit bfbe1fe

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

libs/groovylib/api/src/mill/groovylib/worker/api/GroovyWorker.scala

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ trait GroovyWorker {
1717
/**
1818
* In a mixed setup this will compile the Groovy sources to Java stubs.
1919
*/
20-
def compileGroovyStubs(sourceFiles: Seq[os.Path], classpath: Seq[os.Path], outputDir: os.Path)
21-
(implicit ctx: TaskCtx)
22-
: Result[CompilationResult]
20+
def compileGroovyStubs(
21+
sourceFiles: Seq[os.Path],
22+
classpath: Seq[os.Path],
23+
outputDir: os.Path
24+
)(implicit
25+
ctx: TaskCtx
26+
)
27+
: Result[CompilationResult]
2328

2429
/**
2530
* Compiles the Groovy sources. In a mixed setup this method assumes that the Java stubs
2631
* are already present in the outputDir.
2732
*/
28-
def compile(sourceFiles: Seq[os.Path], classpath: Seq[os.Path], outputDir: os.Path)
29-
(implicit ctx: TaskCtx)
30-
: Result[CompilationResult]
33+
def compile(sourceFiles: Seq[os.Path], classpath: Seq[os.Path], outputDir: os.Path)(implicit
34+
ctx: TaskCtx
35+
)
36+
: Result[CompilationResult]
3137
}

libs/groovylib/src/mill/groovylib/GroovyModule.scala

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import mill.javalib.api.internal.{JavaCompilerOptions, JvmWorkerApi, ZincCompile
1313

1414
/**
1515
* Core configuration required to compile a single Groovy module.
16-
*
17-
* Resolves
16+
*
17+
* Resolves
1818
*/
1919
trait GroovyModule extends JavaModule with GroovyModuleApi { outer =>
2020

@@ -133,8 +133,8 @@ trait GroovyModule extends JavaModule with GroovyModuleApi { outer =>
133133
reportOldProblems = zincReportCachedProblems()
134134
)
135135
}
136-
137-
if(isMixed){
136+
137+
if (isMixed) {
138138
ctx.log.info("Compiling Groovy stubs for mixed compilation")
139139

140140
val workerStubResult =
@@ -146,12 +146,12 @@ trait GroovyModule extends JavaModule with GroovyModuleApi { outer =>
146146
case Result.Failure(reason) => Result.Failure(reason)
147147
}
148148
}
149-
150-
if(isMixed || isGroovy){
149+
150+
if (isMixed || isGroovy) {
151151
ctx.log.info(
152152
s"Compiling ${groovySourceFiles.size} Groovy sources to $classes ..."
153153
)
154-
154+
155155
val workerGroovyResult =
156156
GroovyWorkerManager.groovyWorker().withValue(groovyCompilerClasspath()) {
157157
_.compile(groovySourceFiles, compileCp, classes)
@@ -166,12 +166,11 @@ trait GroovyModule extends JavaModule with GroovyModuleApi { outer =>
166166
CompilationResult(analysisFile, PathRef(classes))
167167
case Result.Failure(reason) => Result.Failure(reason)
168168
}
169-
}else {
169+
} else {
170170
compileJava
171171
}
172172
}
173173

174-
175174
private[groovylib] def internalCompileJavaFiles(
176175
worker: JvmWorkerApi,
177176
upstreamCompileOutput: Seq[CompilationResult],

libs/groovylib/test/src/mill/groovylib/HelloGroovyTests.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package mill
22
package groovylib
33

44
import mill.javalib.{JavaModule, TestModule}
5-
import mill.api.{ Task}
5+
import mill.api.{Task}
66
import mill.api.Discover
77
import mill.testkit.{TestRootModule, UnitTester}
88
import utest.*
@@ -22,7 +22,7 @@ object HelloGroovyTests extends TestSuite {
2222
object `test` extends GroovyMavenTests with TestModule.Junit5 {
2323

2424
override def moduleDeps: Seq[JavaModule] = Seq(
25-
HelloGroovy.`groovy-tests`,
25+
HelloGroovy.`groovy-tests`
2626
)
2727

2828
override def groovyVersion = groovy4Version
@@ -142,7 +142,6 @@ object HelloGroovyTests extends TestSuite {
142142
}
143143
}
144144

145-
146145
test("compile & test module (only test uses Groovy)") {
147146
testEval().scoped { eval =>
148147

libs/groovylib/worker/src/mill/groovylib/worker/impl/GroovyWorkerImpl.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import scala.util.Try
1414

1515
class GroovyWorkerImpl extends GroovyWorker {
1616

17-
18-
override def compileGroovyStubs(sourceFiles: Seq[Path], classpath: Seq[Path], outputDir: Path)
19-
(implicit ctx: TaskCtx): Result[CompilationResult] = {
17+
override def compileGroovyStubs(
18+
sourceFiles: Seq[Path],
19+
classpath: Seq[Path],
20+
outputDir: Path
21+
)(implicit ctx: TaskCtx): Result[CompilationResult] = {
2022
val config = new CompilerConfiguration()
2123
config.setTargetDirectory(outputDir.toIO)
2224
config.setClasspathList(classpath.map(_.toIO.getAbsolutePath).asJava)
@@ -84,7 +86,6 @@ class GroovyWorkerImpl extends GroovyWorker {
8486
)
8587
}
8688

87-
8889
private def removeAllJavaFiles(outputDir: os.Path): Unit = {
8990
if (os.exists(outputDir)) {
9091
os.walk(outputDir)

0 commit comments

Comments
 (0)