aboutsummaryrefslogtreecommitdiff
path: root/doc/modules
diff options
context:
space:
mode:
authortoshokan <toshokan@shojigate.net>2022-11-12 11:37:59 -0500
committerBozhidar Batsov <bozhidar@batsov.dev>2022-11-18 12:35:49 +0200
commit1654956cfed4691f3e9553d91e573efe0be8646a (patch)
tree314967831c71fafb4e8781b59cbc58e08d8e6a59 /doc/modules
parent7d414ea3421689a766383b03e566c5399419c566 (diff)
Allow multiple project-files per type and wildcards in project-files
Diffstat (limited to 'doc/modules')
-rw-r--r--doc/modules/ROOT/pages/projects.adoc17
1 files changed, 15 insertions, 2 deletions
diff --git a/doc/modules/ROOT/pages/projects.adoc b/doc/modules/ROOT/pages/projects.adoc
index c39beac..f3db50d 100644
--- a/doc/modules/ROOT/pages/projects.adoc
+++ b/doc/modules/ROOT/pages/projects.adoc
@@ -162,8 +162,8 @@ initialization code
What this does is:
. add your own type of project, in this case `npm` package.
-. add a list of files and/or folders in a root of the project that helps to identify the type, in this case it is only `package.json`.
-. add _project-file_, which is typically the primary project configuration file. In this case that's `package.json`.
+. add a list of files and/or folders in a root of the project that helps to identify the type, in this case it is only `package.json`. This can also be a function which takes a project root as argument and verifies whether that directory has the correct project structure for the type.
+. add _project-file_, which is typically the primary project configuration file. In this case that's `package.json`. The value can contain wildcards and/or be a list containing multiple project files to look for.
. add _compile-command_, in this case it is `npm install`.
. add _test-command_, in this case it is `npm test`.
. add _run-command_, in this case it is `npm start`.
@@ -173,6 +173,19 @@ Let's see a couple of more complex examples.
[source,elisp]
----
+;; .NET C# or F# projects
+(projectile-register-project-type 'dotnet #'projectile-dotnet-project-p
+ :project-file '("?*.csproj" "?*.fsproj")
+ :compile "dotnet build"
+ :run "dotnet run"
+ :test "dotnet test")
+----
+
+This example uses _projectile-dotnet-project-p_ to validate the project's structure.
+Since C# and F# project files have names containing the name of the project, it uses a list of wildcards to specify the different valid _project-file_ name patterns.
+
+[source,elisp]
+----
;; Ruby + RSpec
(projectile-register-project-type 'ruby-rspec '("Gemfile" "lib" "spec")
:project-file "Gemfile"