branch: elpa/projectile
commit 827fa6555cf40801c11cab65a7231a340758352f
Author: Laurence Warne <laurencewa...@gmail.com>
Commit: Bozhidar Batsov <bozhi...@batsov.dev>

    Add build.mill as a project file name for the mill project type
    
    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.
---
 projectile.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/projectile.el b/projectile.el
index ac61fd8e5a..ce67447d5c 100644
--- a/projectile.el
+++ b/projectile.el
@@ -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)
@@ -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)
@@ -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
@@ -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"

Reply via email to