-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
b5e04d6
commit 554a649
Showing
11 changed files
with
126 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 | ||
} |
51 changes: 51 additions & 0 deletions
51
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,51 @@ | ||
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)) | ||
// Seems this one is created nonetheless, but is empty | ||
assert(!os.exists(defaultOutDir) || os.list(defaultOutDir).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