Skip to content

Commit 72db1f3

Browse files
committed
Revert "Allow running standalone single-file scripts using Mill (#5820)"
This reverts commit baf1b7d.
1 parent 17c6b78 commit 72db1f3

File tree

79 files changed

+171
-1083
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+171
-1083
lines changed

.editorconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ indent_size = 2
1818
ktlint_code_style = intellij_idea
1919
ktlint_standard_no-wildcard-imports = disabled
2020

21-
[example/kotlinlib/basic/5-single-file/**/*]
22-
ktlint = disabled
23-
24-
[example/kotlinlib/module/1-single-file/**/*]
25-
ktlint = disabled
26-
2721
[example/kotlinlib/linting/**/*]
2822
ktlint = disabled
2923

build.mill

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//| mill-version: 1.0.4-38-cbb9e8
1+
//| mill-version: 1.0.4-26-a6e4c1
22
//| mill-jvm-opts: ["-XX:NonProfiledCodeHeapSize=250m", "-XX:ReservedCodeCacheSize=500m"]
33
//| mill-opts: ["--jobs=0.5C"]
44

core/constants/src/mill/constants/Util.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import java.lang.reflect.InvocationTargetException;
66
import java.lang.reflect.Method;
77
import java.nio.charset.StandardCharsets;
8-
import java.nio.file.Files;
9-
import java.nio.file.Path;
108
import java.security.MessageDigest;
119
import java.security.NoSuchAlgorithmException;
1210
import java.util.ArrayList;
@@ -86,20 +84,15 @@ private static String throwBuildHeaderError(
8684
+ ": " + line + "\n" + msg);
8785
}
8886

89-
public static String readBuildHeader(Path buildFile, String errorFileName) {
90-
return readBuildHeader(buildFile, errorFileName, false);
91-
}
92-
93-
public static String readBuildHeader(
94-
Path buildFile, String errorFileName, boolean allowNonBuild) {
87+
public static String readBuildHeader(java.nio.file.Path buildFile, String errorFileName) {
9588
try {
96-
java.util.List<String> lines = Files.readAllLines(buildFile);
89+
java.util.List<String> lines = java.nio.file.Files.readAllLines(buildFile);
9790
boolean readingBuildHeader = true;
9891
java.util.List<String> output = new ArrayList<>();
9992
for (int i = 0; i < lines.size(); i++) {
10093
String line = lines.get(i);
10194
if (!line.startsWith("//|")) readingBuildHeader = false;
102-
else if (!allowNonBuild && !buildFile.getFileName().toString().startsWith("build.")) {
95+
else if (!buildFile.getFileName().toString().startsWith("build.")) {
10396
throwBuildHeaderError(
10497
errorFileName,
10598
i,

core/internal/cli/package.mill

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ import millbuild.*
99
object `package` extends MillPublishScalaModule {
1010
def moduleDeps = Seq(build.libs.util)
1111

12-
def mvnDeps = Seq(Deps.mainargs)
12+
def mvnDeps = Seq(
13+
Deps.millModuledefs,
14+
Deps.mainargs
15+
)
1316
}

core/internal/cli/src/mill/internal/MillCliConfig.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ case class MillCliConfig(
128128
doc = """Runs Mill in tab-completion mode"""
129129
)
130130
tabComplete: Flag = Flag(),
131-
@arg(
132-
short = 'f',
133-
doc = """Select the build.mill file or Java/Scala/Kotlin script file to run"""
134-
)
135-
file: Option[os.Path] = None,
136131

137132
// ==================== DEPRECATED CLI FLAGS ====================
138133
@arg(hidden = true, short = 'h', doc = "Unsupported")

example/javalib/basic/5-single-file/Foo.java

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

example/javalib/basic/5-single-file/build.mill

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

0 commit comments

Comments
 (0)