RT: np - new sbt project generation made simple(r)

介绍了一个名为np的工具,该工具简化了使用sbt创建新项目的流程。通过简单的配置即可快速建立项目骨架。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

np - new sbt project generation made simple(r)

As pointed out in the comments by @0__ below, there's another project that aims at simplifying how new projects in sbt are created - np. That seems exactly what you needed.

In https://github.com/softprops/np#for-sbt-013 there's a complete description of what's needed to set it up and create new sbt projects using the utility that boils down to:

  1. Registering the sbt plugin. Add the following to ~/.sbt/0.13/plugins/np.sbt.

    addSbtPlugin("me.lessis" % "np" % "0.2.0")
    
  2. Define a custom global overrides in ~/.sbt/0.13/np.sbt. Add the following to the file.

    seq(npSettings:_*)
    
    (NpKeys.defaults in (Compile, NpKeys.np)) ~= {
      _.copy(org="me.lessis", version="0.1.0-SNAPSHOT")
    }
    
  3. Use the np plugin's command - np. Create an empty directory for the sbt project and run sbt np.

    jacek:~/sandbox/stackoverflow
    $ mkdir np-sandbox/
    jacek:~/sandbox/stackoverflow
    $ cd np-sandbox/
    jacek:~/sandbox/stackoverflow/np-sandbox
    $ sbt np
    [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
    [info] Set current project to np-sandbox (in build file:/Users/jacek/sandbox/stackoverflow/np-sandbox/)
    [info] Generated build file
    [info] Generated source directories
    [success] Total time: 0 s, completed Dec 7, 2013 12:51:42 PM
    jacek:~/sandbox/stackoverflow/np-sandbox
    $ tree
    .
    ├── build.sbt
    ├── src
    │   ├── main
    │   │   ├── resources
    │   │   └── scala
    │   └── test
    │       ├── resources
    │       └── scala
    └── target
        └── streams
            └── compile
                └── np
                    └── $global
                        └── out
    
    12 directories, 2 files
    jacek:~/sandbox/stackoverflow/np-sandbox
    $ cat build.sbt
    organization := "me.lessis"
    
    name := "default"
    
    version := "0.1.0-SN

转载于:https://www.cnblogs.com/qiangxia/p/4953091.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值