Kate Changelog

What's new in Kate 4.13.0

May 13, 2014
  • “Opening” a project:
  • Projects are opened automatically by Kate. Whenever a file is opened, Kate goes the directories from that file upwards until it finds a file named .kateproject , which defines the project. This is a simple json file, which is intended to be written manually by the user.
  • The .kateproject file defines the name of the project, the set of files which belong to the project, and optionally commands for the build plugin .
  • In 4.13, “out-of-source” project files are now also supported (actually already in 4.12). What does that mean ? You can create a .kateproject file in some directory, but it will refer to a different directory as root of the project. This is useful if you have multiple build trees for one source tree, and then need different build commands for each build tree.
  • Creating such a .kateproject file is easy, simply add a top-level “directory” entry:
  • "name": "MyProject",
  • "directory": "/home/alex/src/myproject",
  • "files": [ { "filters": [ "*.cpp", "*.h"] } ]
  • So if you create this file e.g. in /home/alex/src/myproject-build/.kateproject, once the project is opened, the files below /home/alex/src/myproject/ will belong to the project “MyProject”. Again, to “open” this project, open any file in the same directory as the .kateproject file or any of its subdirectories in Kate. Kate will again automatically find the .kateproject file and load it.
  • Support for the improved build plugin:
  • In 4.13 the build plugin has seen several improvements, the main one being that it is now possible to define an arbitrary number of targets, instead of being limited to 3. This is fully supported by the project plugin. Also the “old” format is still fully supported, and the .kateproject files can even contain both the old and the new format, so it works with the build plugin in version before 4.13 and also after.
  • Below there is a simple example for a hello-world project, which defines 4 targets for the build plugin: build all, clean, install and building just “hello”:
  • "name": "Hello",
  • "files": [ { "filters": [ "*.cpp", "*.h"] } ],
  • "build": {
  • "directory": "/home/alex/src/tests/hello/build",
  • "targets":[
  • {"name":"all", "build_cmd":"make -j4 all"}
  • ,{"name":"clean", "build_cmd":"make -j4 clean"}
  • ,{"name":"hello", "build_cmd":"make -j4 hello"}
  • ,{"name":"install", "build_cmd":"make install"}
  • "default_target": "all",
  • "clean_target": "clean"
  • So, for each target, a “name” and a “build_cmd” is defined, and that’s it. One of the targets can be chosen to be the default target (which can be assigned a dedicated shortcut in the build plugin), and one can be chosen to be the “clean” target (again, which can be assigned a dedicated shortcut in the build plugin).
  • Using the project plugin with CMake-based projects;
  • Until now, the only way to create .kateproject files was to write them manually. If you are using Kate with C/C++ projects which are built using CMake, there are more news for you. CMake 3.0.0 will be released soon, and among others, it will contain a generator for, guess what: project files for the Kate project plugin! With that, run CMake, select “Kate – Unix Makefiles” as generator, and there you go, everything set up ready to use for you, including all targets of the project available in the build plugin.
  • Documentation:
  • Last but not least, starting with 4.13, you can find documentation for the project json file in /share/apps/apps/kate/plugins/project/kateproject.example.