diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b4e052e..ad63ab927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### New features +* [#1833](https://github.com/bbatsov/projectile/pull/1833): Add Julia project discovery. * [#1828](https://github.com/bbatsov/projectile/pull/1828): Add Nimble-based Nim project discovery. * Add elm project type. * [#1821](https://github.com/bbatsov/projectile/pull/1821): Add `pyproject.toml` discovery for python projects. diff --git a/projectile.el b/projectile.el index 09f6d436d..8f340bae2 100644 --- a/projectile.el +++ b/projectile.el @@ -3527,6 +3527,14 @@ a manual COMMAND-TYPE command is created with :project-file "elm.json" :compile "elm make") +;; Julia +(projectile-register-project-type 'julia '("Project.toml") + :project-file "Project.toml" + :compile "julia --project=@. -e 'import Pkg; Pkg.precompile(); Pkg.build()'" + :test "julia --project=@. -e 'import Pkg; Pkg.test()' --check-bounds=yes" + :src-dir "src" + :test-dir "test") + ;; OCaml (projectile-register-project-type 'ocaml-dune '("dune-project") :project-file "dune-project" diff --git a/test/projectile-test.el b/test/projectile-test.el index c9d3a12ba..24ad73f3e 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -1338,7 +1338,24 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'. "project/project.el") (let ((projectile-indexing-method 'native)) (spy-on 'projectile-project-root :and-return-value (file-truename (expand-file-name "project/"))) - (expect (projectile-detect-project-type) :to-equal 'emacs-eldev)))))) + (expect (projectile-detect-project-type) :to-equal 'emacs-eldev))))) + (it "detects project-type for projects with src dir and no other marker" + (projectile-test-with-sandbox + (projectile-test-with-files + ("project/" + "project/src/") + (let ((projectile-indexing-method 'native)) + (spy-on 'projectile-project-root :and-return-value (file-truename (expand-file-name "project/"))) + (expect (projectile-detect-project-type) :to-equal 'dotnet-sln))))) + (it "detects project-type for Julia PkgTemplates.jl projects" + (projectile-test-with-sandbox + (projectile-test-with-files + ("project/" + "project/src/" + "project/Project.toml") + (let ((projectile-indexing-method 'native)) + (spy-on 'projectile-project-root :and-return-value (file-truename (expand-file-name "project/"))) + (expect (projectile-detect-project-type) :to-equal 'julia)))))) (describe "projectile-dirname-matching-count" (it "counts matching dirnames ascending file paths"