/usr/share/kateproject/kateproject.example is in kate5-data 4:15.12.3-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | /// This struct describes in almost-C++ the json data structure as expected by the
/// project plugin.
/// The json file has to be named ".kateproject".
struct
{
/// name of the project
string name;
/// The "directory" is optional.
/// It is probably only useful for the kate-project-generator in cmake (>= 3.0.0).
/// If set, the directory given here is used as the base directory for the project.
/// Otherwise, the directory in which the project file is located as the base directory.
string directory;
/// The "files" struct describes which files belong to the project.
/// There are five miutually exclusive methods to do this.
struct files
{
/// "directory" is the files directory. If it is empty, the project base directory
/// will be used. If it is a relative path, it is appended to the project
/// base directory. Absolute paths work too.
string directory;
/// If "git" is set to "1", the list of files is retrieved by running git in the files directory.
bool git;
/// If "hg" is set to "1", the list of files is retrieved by running hg (mercurial) in the files directory.
bool hg;
/// If "svn" is set to "1", the list of files is retrieved by running svn (subversion) in the files directory.
bool svn;
/// "list" can be set to a list of files.
vector< string > list;
/// If nothing of the above has been set, "filters" can be set to a list of globbing expressions, which
/// will be executed in the files directory.
vector< string > filters;
/// If "recursive" is set to 1, the globbing expressions in filters are executed recursively in the directory tree.
bool recursive;
};
/// The "build" structure is optional.
/// If set, its contents are used by the build plugin in kate.
/// "targets", "default_target" and "clean_target" are supported starting with kate 4.13.
/// The "build", "clean" and "quick" fields are only used if "targets" is empty.
/// They servce for backward compatibility with the build plugin < 4.13, or they can
/// be used as a quicker way to set up projects with up to 3 targets.
struct build
{
/// The build directory
string directory;
/// "targets" contains a vector of targets (as in a makefile). Each target has a name
/// and a command. The commands are exeucted in the build directory.
vector< {string name, string build_cmd} > targets;
/// "default_target" must be set to one of the target names in "targets". This is the target
/// which will be built by the "Build default target" action of the build plugin.
string default_target;
/// "clean_target" must be set to one of the target names in "targets". This is the target
/// which will be built by the "Build clean target" action of the build plugin.
string clean_target;
/// Creates a target names "build" with the given command.
string build;
/// Creates a target names "clean" with the given command.
string clean;
/// Creates a target names "quick" with the given command.
string quick;
};
};
Simple example, get files via globbing recursively in doc/, no build plugin:
{
"name": "MyProject",
"files": [ {
"directory": "doc",
"filters": ["*.tex", "Makefile"],
"recursive": 1
} ]
}
A more advanced project file, get the files from svn, set up three commands for the build plugin:
{
"name": "Foo",
"files": [ { "svn" : 1 } ],
"build": {
"directory": "build",
"build": "make all -j4",
"clean": "make clean",
"quick": "make install"
}
}
An out-of-source project file as generated by cmake: it points to the actual project directory,
it retrieves the file list from git, and a long list of targets for the build plugin:
{
"name": "CMake@build",
"directory": "/home/neundorf/src/CMake/cmake",
"files": [ { "git": 1 } ],
"build": {
"directory": "/home/neundorf/src/CMake/build",
"default_target": "all",
"clean_target": "clean",
"targets":[
{ "name":"all", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build -j8 all" },
{ "name":"clean", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build -j8 clean" },
{ "name":"cmLocalGenerator.cxx.o", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmLocalGenerator.cxx.o" },
{ "name":"cmLocalGenerator.cxx.i", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmLocalGenerator.cxx.i" },
...
{ "name":"cmLocalGenerator.cxx.s", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmLocalGenerator.cxx.s" },
{ "name":"cmMakefile.cxx.o", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmMakefile.cxx.o" },
{ "name":"cmMakefile.cxx.i", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmMakefile.cxx.i" },
{ "name":"cmMakefile.cxx.s", "build_cmd":"/usr/bin/gmake -C /home/neundorf/src/CMake/build/Source -j8 cmMakefile.cxx.s" }
] }
}
|