Skip to content

Commit

Permalink
Detect Julia projects (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist authored Mar 16, 2023
1 parent 1a0fd56 commit 30a340f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 18 additions & 1 deletion test/projectile-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 30a340f

Please sign in to comment.