-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix java compile warning, again #3762
Merged
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
acaa193
.
lihaoyi 266ac3c
.
lihaoyi e3e55bc
wip
lihaoyi 523ef43
.
lihaoyi b947bcd
.
lihaoyi 414541a
.
lihaoyi 8ac26a5
.
lihaoyi 644dcc1
.
lihaoyi c28c38e
.
lihaoyi 16cbefa
.
lihaoyi 226d9d9
.
lihaoyi c2e522a
.
lihaoyi d0a8310
.
lihaoyi 18d3348
.
lihaoyi 6a4dd4c
.
lihaoyi 6e564e5
.
lihaoyi 2c020a2
.
lihaoyi b797902
.
lihaoyi 7f19292
.
lihaoyi e9f19d9
.
lihaoyi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,9 @@ | ||
package build | ||
import mill._, javalib._ | ||
|
||
object `package` extends RootModule with JavaModule { | ||
def ivyDeps = Agg( | ||
ivy"net.sourceforge.argparse4j:argparse4j:0.9.0", | ||
ivy"org.apache.commons:commons-text:1.12.0" | ||
) | ||
} |
33 changes: 33 additions & 0 deletions
33
integration/feature/full-run-logs/resources/src/foo/Foo.java
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,33 @@ | ||
package foo; | ||
|
||
import org.apache.commons.text.StringEscapeUtils; | ||
import net.sourceforge.argparse4j.ArgumentParsers; | ||
import net.sourceforge.argparse4j.inf.ArgumentParser; | ||
import net.sourceforge.argparse4j.inf.ArgumentParserException; | ||
import net.sourceforge.argparse4j.inf.Namespace; | ||
|
||
|
||
public class Foo{ | ||
public static String generateHtml(String text){ | ||
return "<h1>" + StringEscapeUtils.escapeHtml4(text) + "</h1>"; | ||
} | ||
public static void main(String[] args) { | ||
ArgumentParser parser = ArgumentParsers.newFor("template").build() | ||
.defaultHelp(true) | ||
.description("Inserts text into a HTML template"); | ||
|
||
parser.addArgument("-t", "--text") | ||
.required(true) | ||
.help("text to insert"); | ||
|
||
Namespace ns = null; | ||
try { | ||
ns = parser.parseArgs(args); | ||
}catch(Exception e){ | ||
System.out.println(e.getMessage()); | ||
System.exit(1); | ||
} | ||
|
||
System.out.println(generateHtml(ns.getString("text"))); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
integration/feature/full-run-logs/src/FullRunLogsTests.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,53 @@ | ||
package mill.integration | ||
|
||
import mill.testkit.UtestIntegrationTestSuite | ||
import utest._ | ||
|
||
// Run simple commands on a simple build and check their entire output, | ||
// ensuring we don't get spurious warnings or logging messages slipping in | ||
object FullRunLogsTests extends UtestIntegrationTestSuite { | ||
|
||
def tests: Tests = Tests { | ||
test("noticker") - integrationTest { tester => | ||
import tester._ | ||
|
||
val res = eval(("--ticker", "false", "run", "--text", "hello")) | ||
res.isSuccess ==> true | ||
assert(res.out == "<h1>hello</h1>") | ||
assert( | ||
res.err.replace('\\', '/') == | ||
s"""[build.mill] [info] compiling 1 Scala source to ${tester.workspacePath}/out/mill-build/compile.dest/classes ... | ||
|[build.mill] [info] done compiling | ||
|[info] compiling 1 Java source to ${tester.workspacePath}/out/compile.dest/classes ... | ||
|[info] done compiling""".stripMargin | ||
) | ||
} | ||
test("ticker") - integrationTest { tester => | ||
import tester._ | ||
|
||
val res = eval(("--ticker", "true", "run", "--text", "hello")) | ||
res.isSuccess ==> true | ||
assert(res.out == "[46] <h1>hello</h1>") | ||
|
||
val expectedErrorRegex = | ||
s"""==================================================== run --text hello ================================================ | ||
|====================================================================================================================== | ||
|[build.mill-56/60] compile | ||
|[build.mill-56] [info] compiling 1 Scala source to ${tester.workspacePath}/out/mill-build/compile.dest/classes ... | ||
|[build.mill-56] [info] done compiling | ||
|[40/46] compile | ||
|[40] [info] compiling 1 Java source to ${tester.workspacePath}/out/compile.dest/classes ... | ||
|[40] [info] done compiling | ||
|[46/46] run | ||
|[46/46] ============================================ run --text hello ============================================= ?s | ||
|======================================================================================================================""" | ||
.stripMargin | ||
.replace('\\', '/') | ||
.split('?') | ||
.map(java.util.regex.Pattern.quote) | ||
.mkString("[\\d]+") | ||
|
||
assert(expectedErrorRegex.r.matches(res.err.replace('\\', '/'))) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new test emits some benign warnings on Java 11, so just run on java 17 instead