Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KDevelop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
30
Merge Requests
30
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KDevelop
KDevelop
Commits
1656092a
Commit
1656092a
authored
Oct 25, 2020
by
Alexander Lohnau
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add template to generate a custom file template
parent
f124dab2
Pipeline
#38657
canceled with stage
in 16 minutes and 46 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
0 deletions
+64
-0
app_templates/CMakeLists.txt
app_templates/CMakeLists.txt
+1
-0
app_templates/kdevelop/file_template_template/%{APPNAMELC}/%{APPNAMELC}.desktop
.../file_template_template/%{APPNAMELC}/%{APPNAMELC}.desktop
+14
-0
app_templates/kdevelop/file_template_template/%{APPNAMELC}/DemoFile.txt
...kdevelop/file_template_template/%{APPNAMELC}/DemoFile.txt
+1
-0
app_templates/kdevelop/file_template_template/%{APPNAMELC}/options.kcfg
...kdevelop/file_template_template/%{APPNAMELC}/options.kcfg
+14
-0
app_templates/kdevelop/file_template_template/CMakeLists.txt
app_templates/kdevelop/file_template_template/CMakeLists.txt
+11
-0
app_templates/kdevelop/file_template_template/README.md
app_templates/kdevelop/file_template_template/README.md
+18
-0
app_templates/kdevelop/file_template_template/kdevelop_file_template_template.kdevtemplate
...ate_template/kdevelop_file_template_template.kdevtemplate
+5
-0
No files found.
app_templates/CMakeLists.txt
View file @
1656092a
...
...
@@ -7,4 +7,5 @@ kdevplatform_add_app_templates(
cpp/QMake/qt5-qml2
c/CMake/cmake_plainc
empty
kdevelop/file_template_template
)
app_templates/kdevelop/file_template_template/%{APPNAMELC}/%{APPNAMELC}.desktop
0 → 100644
View file @
1656092a
[General]
# See https://techbase.kde.org/KDevelop5/File_template_specification for documentation
Name=%{APPNAME}
Comment=
Category=MyCategory/Subcategory
Type=Other
Language=MyProgrammingLanguage
Files=MyFile
OptionsFile=options.kcfg
[MyFile]
Name=Demo File
File=DemoFile.txt
OutputFile={{ name }}.txt
app_templates/kdevelop/file_template_template/%{APPNAMELC}/DemoFile.txt
0 → 100644
View file @
1656092a
Example Value: {{ example }}
app_templates/kdevelop/file_template_template/%{APPNAMELC}/options.kcfg
0 → 100644
View file @
1656092a
<?xml version="1.0" encoding="UTF-8"?>
<kcfg
xmlns=
"http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"
>
<kcfgfile
arg=
"true"
/>
<group
name=
""
>
<entry
name=
"example"
type=
"String"
>
<tooltip>
Example tooltip (optional)
</tooltip>
<label>
Example
</label>
<default>
Default Value
</default>
</entry>
</group>
</kcfg>
app_templates/kdevelop/file_template_template/CMakeLists.txt
0 → 100644
View file @
1656092a
project
(
%{APPNAMELC}
)
cmake_minimum_required
(
VERSION 3.0
)
find_package
(
ECM REQUIRED NO_MODULE
)
set
(
CMAKE_MODULE_PATH
${
ECM_MODULE_PATH
}
${
CMAKE_MODULE_PATH
}
)
include
(
KDEInstallDirs
)
include
(
KDEPackageAppTemplates
)
kde_package_app_templates
(
TEMPLATES
"%{APPNAMELC}"
INSTALL_DIR
"
${
KDE_INSTALL_DATADIR
}
/kdevfiletemplates/templates"
)
app_templates/kdevelop/file_template_template/README.md
0 → 100644
View file @
1656092a
### %{APPNAME} template
To install tis template you can use cmake:
```
# create a build directory called build and configure cmake
# with the custom install prefix we install it in the user-specific folder
cmake --source . --build build -DCMAKE_INSTALL_PREFIX=~/.local
# create and install the template
cmake --build build --target install
```
After this the template shows up in the dialog under File -> New From Template.
If you think that the template can be useful to other people
you can upload it to the KDE store https://store.kde.org/browse/cat/327/.
In case you have an older version of the CMake macro that generates the archive
you can run
`rm build/%{APPNAMELC}.tar.bz2`
to make sure the file gets recreated.
app_templates/kdevelop/file_template_template/kdevelop_file_template_template.kdevtemplate
0 → 100644
View file @
1656092a
[General]
Name=KDevelop File Template
Comment=Setup for KDevelop File Template which is packaged using CMake
Category=KDevelop/Template
ShowFilesAfterGeneration=%{APPNAMELC}/%{APPNAMELC}.desktop
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment