-
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to pass a custom output dir on the command-line
- Loading branch information
1 parent
b06486c
commit 365dede
Showing
11 changed files
with
135 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package build | ||
|
||
import mill._ | ||
import mill.scalalib._ | ||
|
||
object `package` extends RootModule with ScalaModule { | ||
def scalaVersion = scala.util.Properties.versionNumberString | ||
} |
60 changes: 60 additions & 0 deletions
60
integration/feature/output-directory/src/OutputDirectoryTests.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package mill.integration | ||
|
||
import mill.main.client.OutFiles | ||
import mill.testkit.UtestIntegrationTestSuite | ||
import utest._ | ||
|
||
object OutputDirectoryTests extends UtestIntegrationTestSuite { | ||
|
||
def tests: Tests = Tests { | ||
test("Output directory sanity check") - integrationTest { tester => | ||
import tester._ | ||
eval("__.compile").isSuccess ==> true | ||
val defaultOutDir = workspacePath / OutFiles.defaultOut | ||
assert(os.isDir(defaultOutDir)) | ||
} | ||
|
||
test("Output directory elsewhere in workspace") - integrationTest { tester => | ||
import tester._ | ||
eval( | ||
"__.compile", | ||
env = millTestSuiteEnv + ("MILL_OUTPUT" -> "testing/test-out") | ||
).isSuccess ==> true | ||
val expectedOutDir = workspacePath / "testing/test-out" | ||
val defaultOutDir = workspacePath / OutFiles.defaultOut | ||
assert(os.isDir(expectedOutDir)) | ||
assert(!os.exists(defaultOutDir)) | ||
} | ||
|
||
test("Output directory elsewhere in workspace via CLI") - integrationTest { tester => | ||
import tester._ | ||
eval(("--output", "testing/test-out", "__.compile")).isSuccess ==> true | ||
val expectedOutDir = workspacePath / "testing/test-out" | ||
val defaultOutDir = workspacePath / OutFiles.defaultOut | ||
assert(os.isDir(expectedOutDir)) | ||
val unrecognizedFiles = | ||
if (os.exists(defaultOutDir)) | ||
os.list(defaultOutDir).filter(!_.last.startsWith(OutFiles.millWorker)) | ||
else | ||
Nil | ||
if (unrecognizedFiles.nonEmpty) | ||
pprint.err.log( | ||
os.walk(defaultOutDir).map(_.relativeTo(defaultOutDir)).map(_.toString).sorted | ||
) | ||
// Seems this one is created nonetheless, but is empty | ||
assert(unrecognizedFiles.isEmpty) | ||
} | ||
|
||
test("Output directory outside workspace") - integrationTest { tester => | ||
import tester._ | ||
val outDir = os.temp.dir() / "tmp-out" | ||
eval( | ||
"__.compile", | ||
env = millTestSuiteEnv + ("MILL_OUTPUT" -> outDir.toString) | ||
).isSuccess ==> true | ||
val defaultOutDir = workspacePath / OutFiles.defaultOut | ||
assert(os.isDir(outDir)) | ||
assert(!os.exists(defaultOutDir)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters