Java 中的新构建工具!

  • Author and Title: By Ethan McCue. The title is a ? ->! of a recent Reddit thread and a continuation of a series of posts.
  • Purpose: Go over Maven/Gradle alternatives in a Reddit thread, explain why they don't meet the need, give a status update on work, and ask for reader help.
  • What is Wanted: A smooth on-ramp from java src/Main.java to running with dependencies, packaging, and using Java tools. No focus on maximal efficiency.
  • Ant: A cross-platform scripting language with targets. Outsources dependencies to Ivy. Not a great path from java src/Main.java. Bundles jars in a single folder.
  • Scorecard for Ant: 🔴 Clear path from java src/Main.java, 🟡 Clear path to making use of other tools, 🔴 Split dependencies across different paths.
  • Mill: A Scala build tool with a history of breaking changes. Jumps into building code with Scala. Bundles modules but has a large gap between specified tasks and actual commands. Reuses --class-path for both --class-path and --module-path.
  • Scorecard for Mill: 🔴 Clear path from java src/Main.java, 🔴 Clear path to making use of other tools, 🔴 Split dependencies across different paths.
  • bld: From the Rife2 people, copies Maven directory layout. Has no overarching Task abstraction. Explicit support for modules but no obvious way to fill other paths.
  • Scorecard for bld: 🔴 Clear path from java src/Main.java, 🟢 Clear path to making use of other tools, 🟡 Split dependencies across different paths.
  • bach: Built around Java modules. Focuses on JDK tools. Doesn't solve the core dependency problem. Lack of documentation.
  • Scorecard for bach (Disqualified): 🟡 Clear path from java src/Main.java, 🟢 Clear path to making use of other tools, 🔴 Split dependencies across different paths.
  • pottery: Another "maven, but" with defaults and a yaml file. Can make different types of artifacts but can't put on --module-path and has a tight bundle.
  • Scorecard for pottery: 🔴 Clear path from java src/Main.java, 🔴 Clear path to making use of other tools, 🔴 Split dependencies across different paths.
  • jbang: Downloads dependencies with a comment at the top. Easy from java src/Main.java to jbang src/Main.java, but can't put on --module-path and not usable in other tooling.
  • Scorecard for jbang: 🟢 Clear path from java src/Main.java, 🔴 Clear path to making use of other tools, 🔴 Split dependencies across different paths.
  • java-jpm: Downloads dependencies and symlinks them. Easy from java src/Main.java to java -cp deps/* src/Main.java, but no support for different paths.
  • Scorecard for java-jpm: 🟡 Clear path from java src/Main.java, 🟡 Clear path to making use of other tools, 🔴 Split dependencies across different paths.
  • What has been worked on: The jresolve tool. Can print dependencies separated by platform specific path separators. Added --output-file and --output-directory arguments. Newest version uses jproject.toml to specify dependency usage and dump argfiles.
  • What is needed help with: Teaching an IDE how to read dependencies from an argument file. Getting the java launcher to support nested argfiles. Tools looking in jproject.toml for config.
阅读 5
0 条评论