Warning, /utilities/kate/addons/project/kateproject.example is written in an unsupported language. File is not indexed.

0001 /// This struct describes in almost-C++ the json data structure as expected by the
0002 /// project plugin.
0003 /// The json file has to be named ".kateproject".
0004 struct
0005 {
0006    /// name of the project
0007    string name;
0008 
0009    /// The "directory" is optional.
0010    /// It is probably only useful for the kate-project-generator in cmake (>= 3.0.0).
0011    /// If set, the directory given here is used as the base directory for the project.
0012    /// Otherwise, the directory in which the project file is located as the base directory.
0013    string directory;
0014    
0015    /// "exclude_patterns" is a list of regex patterns than can be used to exclude folders and files from the project tree
0016    vector< string > exclude_patterns;
0017 
0018    /// The "files" struct describes which files belong to the project.
0019    /// There are five miutually exclusive methods to do this.
0020    struct files
0021    {
0022       /// "directory" is the files directory. If it is empty, the project base directory
0023       /// will be used. If it is a relative path, it is appended to the project
0024       /// base directory. Absolute paths work too.
0025       string directory;
0026 
0027       /// If "git" is set to "1", the list of files is retrieved by running git in the files directory.
0028       bool git;
0029 
0030       /// If "hg" is set to "1", the list of files is retrieved by running hg (mercurial) in the files directory.
0031       bool hg;
0032 
0033       /// If "svn" is set to "1", the list of files is retrieved by running svn (subversion) in the files directory.
0034       bool svn;
0035 
0036       /// If "fossil" is set to "1", the list of files is retrieved by running fossil in the files directory.
0037       bool fossil;
0038 
0039       /// "list" can be set to a list of files.
0040       vector< string > list;
0041 
0042       /// If nothing of the above has been set, "filters" can be set to a list of globbing expressions, which
0043       /// will be executed in the files directory.
0044       vector< string > filters;
0045 
0046       /// If "recursive" is set to 1, the globbing expressions in filters are executed recursively in the directory tree.
0047       bool recursive;
0048 
0049       /// If "hidden" is set to 1, hidden files will be retrieved. Only affects directories not managed by version control.
0050       bool hidden;
0051    };
0052 
0053    /// The "build" structure is optional.
0054    /// If set, its contents are used by the build plugin in kate.
0055    /// "targets", "default_target" and "clean_target" are supported starting with kate 4.13.
0056    /// The "build", "clean" and "quick" fields are only used if "targets" is empty.
0057    /// They servce for backward compatibility with the build plugin < 4.13, or they can
0058    /// be used as a quicker way to set up projects with up to 3 targets.
0059    struct build
0060    {
0061       /// The build directory
0062       string directory;
0063 
0064       /// "targets" contains a vector of targets (as in a makefile). Each target has a name
0065       /// a build command and a run command. The commands are executed in the build directory.
0066       vector< {string name, string build_cmd, string run_cmd} > targets;
0067 
0068       /// "default_target" must be set to one of the target names in "targets". This is the target
0069       /// which will be built by the "Build default target" action of the build plugin.
0070       string default_target;
0071 
0072       /// "clean_target" must be set to one of the target names in "targets". This is the target
0073       /// which will be built by the "Build clean target" action of the build plugin.
0074       string clean_target;
0075 
0076       /// Creates a target names "build" with the given command.
0077       string build;
0078 
0079       /// Creates a target names "clean" with the given command.
0080       string clean;
0081 
0082       /// Creates a target names "quick" with the given command.
0083       string quick;
0084 
0085    };
0086 
0087    /// The "ctags" structure is optional.
0088    /// If set, it may contain extra options for ctags command used to populate the auto completion popup in Kate.
0089    struct ctags
0090    {
0091       /// If "enable" is set to "1", a ctags index file is generated.
0092       /// If not present, generation of index depends on project plugin setting.
0093       bool enable;
0094 
0095       /// "options" can be set to a list of ctags options. You may need to escape character "\".
0096       vector< string > options;
0097 
0098       /// "index_file" can be set to path of ctags file to generate.
0099       /// A relative path is wrt to the project base directory.
0100       string index_file;
0101    }
0102 
0103 };
0104 
0105 
0106 
0107 Simple example, get files via globbing recursively in doc/, no build plugin:
0108 
0109 {
0110    "name": "MyProject",
0111    "files": [ {
0112              "directory": "doc",
0113              "filters": ["*.tex", "Makefile"],
0114              "recursive": 1
0115        } ]
0116 }
0117 
0118 
0119 A project for a custom language named Swine whose source files have a suffix .swn:
0120 
0121 {
0122    "name": "Custom",
0123    "files": [ {
0124          "directory": ".",
0125          "filters": ["*.swn"],
0126          "recursive": 1
0127       } ],
0128    "exclude_patterns": [ "build" ],
0129    "ctags": {
0130       "options": [
0131          "--langdef=swine",
0132          "--langmap=swine:.swn",
0133          "--regex-swine=/^def[ \t]*([a-zA-Z0-9_]+)/\\1/d,definition/"
0134       ]
0135    }
0136 }
0137 
0138 
0139 A more advanced project file, get the files from svn, set up three commands for the build plugin:
0140 
0141 {
0142    "name": "Foo",
0143    "files": [ { "svn" : 1  } ],
0144 
0145    "build": {
0146       "directory": "build",
0147       "build": "make all -j4",
0148       "clean": "make clean",
0149       "quick": "make install"
0150   }
0151 }
0152 
0153 
0154 An out-of-source project file as generated by cmake: it points to the actual project directory,
0155 it retrieves the file list from git, and a long list of targets for the build plugin:
0156 
0157 
0158 {
0159    "name": "CMake@build",
0160    "directory": "/home/neundorf/src/CMake/cmake",
0161    "files": [ { "git": 1 } ],
0162    "build": {
0163        "directory": "/home/neundorf/src/CMake/build",
0164        "default_target": "all",
0165        "clean_target": "clean",
0166        "targets":[
0167            { "name":"all", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build -j8 all" },
0168            { "name":"clean", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build -j8 clean" },
0169            { "name":"cmLocalGenerator.cxx.o", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmLocalGenerator.cxx.o" },
0170            { "name":"cmLocalGenerator.cxx.i", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmLocalGenerator.cxx.i" },
0171 ...
0172            { "name":"cmLocalGenerator.cxx.s", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmLocalGenerator.cxx.s" },
0173            { "name":"cmMakefile.cxx.o", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmMakefile.cxx.o" },
0174            { "name":"cmMakefile.cxx.i", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmMakefile.cxx.i" },
0175            { "name":"cmMakefile.cxx.s", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmMakefile.cxx.s" }
0176        ] }
0177 }