diff --git a/CMakeLists.txt b/CMakeLists.txt index a287bd1..21873f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,58 +1,59 @@ cmake_minimum_required(VERSION 2.8.12) project(kdevgoplugin) set(VERSION_MAJOR 1) set(VERSION_MINOR 90) set(VERSION_PATCH 90) # KDevplatform dependency version set(KDEVPLATFORM_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") find_package(ECM 0.0.9 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(ECMAddTests) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings) include(GenerateExportHeader) find_package(Qt5 REQUIRED Core Widgets Test) find_package(KF5 REQUIRED COMPONENTS ItemModels ThreadWeaver TextEditor I18n) find_package(KDevPlatform ${KDEVPLATFORM_VERSION} REQUIRED) find_package(KDevelop-PG-Qt REQUIRED) include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) enable_testing() +add_subdirectory(app_templates) add_subdirectory(buildsystem) add_subdirectory(parser) add_subdirectory(duchain) add_subdirectory(codecompletion) include_directories( ${KDEVPGQT_INCLUDE_DIR} ) kdevplatform_add_plugin(kdevgoplugin JSON kdevgo.json SOURCES kdevgoplugin.cpp golangparsejob.cpp gohighlighting.cpp godebug.cpp ) target_link_libraries(kdevgoplugin KDev::Interfaces KDev::Language KF5::ThreadWeaver KF5::TextEditor kdevgoparser kdevgoduchain kdevgocompletion ) install(FILES builtins.go DESTINATION ${DATA_INSTALL_DIR}/kdev-go) diff --git a/app_templates/CMakeLists.txt b/app_templates/CMakeLists.txt new file mode 100644 index 0000000..99b4b5a --- /dev/null +++ b/app_templates/CMakeLists.txt @@ -0,0 +1,3 @@ +set(apptemplate_DIRS console_app) + +kdevplatform_add_app_templates(${apptemplate_DIRS}) \ No newline at end of file diff --git a/app_templates/console_app/%{PROJECTDIRNAME}.kdev4 b/app_templates/console_app/%{PROJECTDIRNAME}.kdev4 new file mode 100644 index 0000000..44bd89a --- /dev/null +++ b/app_templates/console_app/%{PROJECTDIRNAME}.kdev4 @@ -0,0 +1,3 @@ +[Project] +Name=%{APPNAME} +Manager=KDevGoBuildSystem \ No newline at end of file diff --git a/app_templates/console_app/console_app.kdevtemplate b/app_templates/console_app/console_app.kdevtemplate new file mode 100644 index 0000000..63935a1 --- /dev/null +++ b/app_templates/console_app/console_app.kdevtemplate @@ -0,0 +1,8 @@ +# KDE Config File +[General] +Name=Simple Go console application +Name[x-test]=xxSimple Go console applicationxx +Category=Go +Comment=Generate filestructure to start a Go console application +Comment[x-test]=xxGenerate filestructure to start a Go console applicationxx +ShowFilesAfterGeneration=main.go \ No newline at end of file diff --git a/app_templates/console_app/main.go b/app_templates/console_app/main.go new file mode 100644 index 0000000..70a7fe5 --- /dev/null +++ b/app_templates/console_app/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello world!") +}