如何使用 Mill 构建工具而不使用 SBT 来设置 PlayFramework 项目? [英] How do I set up a PlayFramework project using the mill build tool, and without using SBT?

查看:135
本文介绍了如何使用 Mill 构建工具而不使用 SBT 来设置 PlayFramework 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我目前如何设置与 mill 一起使用的 PlayFramework 项目:

Here is how I currently set up a PlayFramework project for use with mill:

  1. 创建一个文件夹:/path/to/play-scala-seed-mill/ 并 cd 进入该文件夹.
  2. 根据PlayFramework 支持的官方文档.
  3. 这是我不喜欢的部分:为了创建文件夹结构并为 Play 添加文件,我按照 sbt new playframework/play-scala-seed.g8"https://www.playframework.com/getting-started" rel="nofollow noreferrer">Play 的官方文档.是否有更多 mill-ish 方式来做到这一点?
  4. 作为上述命令的结果,从 /path/to/play-scala-seed-mill/ 下创建的新文件夹中删除 SBT 相关代码.
  5. 使用命令 mill mill.scalalib.GenIdea/idea 创建一个想法项目.
  1. Create a folder: /path/to/play-scala-seed-mill/ and cd into that folder.
  2. Create a build.sc file in this folder, according to the instructions in the official documentation for PlayFramework support.
  3. This is the part I don't like: to create the folder structure and add files for Play, I run sbt new playframework/play-scala-seed.g8 as per Play's official documentation. Is there a more mill-ish way to do this?
  4. Remove the SBT related code from the new folder created under /path/to/play-scala-seed-mill/ as a result of the above command.
  5. Create an idea project using the command mill mill.scalalib.GenIdea/idea.

如何在不使用 SBT 的情况下执行此操作?

How can I do this without using SBT?

推荐答案

要在没有任何 SBT 的情况下开始一个新的 Mill 项目,我可以想想这两种可能性:

To start a new Mill project without any SBT, I can think of these two possibilities:

从头开始

我通常从一个空文件夹开始,然后添加一个空的 build.sc.

I usually start with an empty folder and add an empty build.sc.

设置几个需要的文件夹和配置有时比删除模板中不需要的所有内容要快.

To setup the few needed folders and configurations is sometime faster than to remove all the stuff not needed in the Template.

创建您自己的 Giter8 模板

如果您启动了很多项目 - 您可以创建自己的 Giter8 模板.

If you start a lot of Projects - you can create your own Giter8 Template.

这很简单,还有一个无需 sbt 即可工作的命令行工具.

This is straight forward and there is also a command-line tool that works without sbt.

例如:

g8 playframework/play-scala-seed.g8

创建您已经使用过的播放模板.

Creates the Play Template you already used.

请参阅此处了解更多信息:http://www.foundweekends.org/giter8/

See here for more information: http://www.foundweekends.org/giter8/

这篇关于如何使用 Mill 构建工具而不使用 SBT 来设置 PlayFramework 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆