Skip to content

Commit

Permalink
Add build.mill as a project file name for the mill project type
Browse files Browse the repository at this point in the history
Add build.mill as a project file name for the mill project type, it
seems to be the recommended extension now, see https://mill-build.org/mill/scalalib/intro.html.
  • Loading branch information
LaurenceWarne authored and bbatsov committed Feb 13, 2025
1 parent ef17d29 commit 827fa65
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,8 @@ ones and overrule settings in the other lists."

A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
and optional keyword arguments:
PROJECT-FILE the main project file in the root project directory.
PROJECT-FILE the main project file in the root project directory. It may be a
single file or a list of possible files.
COMPILATION-DIR the directory to run the tests- and compilations in,
CONFIGURE which specifies a command that configures the project
`%s' in the command will be substituted with (projectile-project-root)
Expand Down Expand Up @@ -2955,7 +2956,8 @@ files such as test/impl/other files as below:

A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
and optional keyword arguments:
PROJECT-FILE the main project file in the root project directory.
PROJECT-FILE the main project file in the root project directory. It may be a
single file or a list of possible files.
COMPILATION-DIR the directory to run the tests- and compilations in,
CONFIGURE which specifies a command that configures the project
`%s' in the command will be substituted with (projectile-project-root)
Expand Down Expand Up @@ -3128,6 +3130,13 @@ it acts on the current project."
(or (projectile-verify-file "go.mod" dir)
(projectile-verify-file-wildcard "*.go" dir)))

(defun projectile-mill-project-p (&optional dir)
"Check if a project contains a mill build file.
When DIR is specified it checks DIR's project, otherwise
it acts on the current project."
(or (projectile-verify-file "build.mill" dir)
(projectile-verify-file "build.sc" dir)))

(defcustom projectile-go-project-test-function #'projectile-go-project-p
"Function to determine if project's type is go."
:group 'projectile
Expand Down Expand Up @@ -3538,8 +3547,8 @@ a manual COMMAND-TYPE command is created with
:test "sbt test"
:test-suffix "Spec")

(projectile-register-project-type 'mill '("build.sc")
:project-file "build.sc"
(projectile-register-project-type 'mill #'projectile-mill-project-p
:project-file '("build.sc" "build.mill")
:src-dir "src/"
:test-dir "test/src/"
:compile "mill __.compile"
Expand Down

0 comments on commit 827fa65

Please sign in to comment.