diff --git a/CMakeLists.txt b/CMakeLists.txt index 96f2705..c9539e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,75 +1,76 @@ cmake_minimum_required(VERSION 2.8.12) project(kdevrust) set(KDEVRUST_VERSION_MAJOR 0) set(KDEVRUST_VERSION_MINOR 1) set(KDEVRUST_VERSION_PATCH 0) # KDevplatform dependency version set(KDEVPLATFORM_VERSION "${KDEVRUST_VERSION_MAJOR}.${KDEVRUST_VERSION_MINOR}.${KDEVRUST_VERSION_PATCH}") find_package(ECM 5.14.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) include(KDECompilerSettings NO_POLICY_SCOPE) include(GenerateExportHeader) include(CMakePackageConfigHelpers) include(ECMAddTests) include(ECMQtDeclareLoggingCategory) include(FeatureSummary) include(KDEInstallDirs) include(KDECMakeSettings) find_package(Qt5 REQUIRED Core Widgets Test) find_package(KF5 REQUIRED COMPONENTS ItemModels ThreadWeaver TextEditor I18n) find_package(KDevPlatform ${KDEVPLATFORM_VERSION} REQUIRED) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation") endif() add_definitions(-DTRANSLATION_DOMAIN=\"kdevrust\") enable_testing() include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) set(kdevrustlanguagesupport_PART_SRCS rustlanguagesupport.cpp rustparsejob.cpp rusthighlighting.cpp ) ecm_qt_declare_logging_category(kdevrustlanguagesupport_PART_SRCS HEADER rustdebug.h IDENTIFIER KDEV_RUST CATEGORY_NAME "kdevelop.languages.rust" ) +add_subdirectory(app_templates) add_subdirectory(duchain) add_subdirectory(codecompletion) kdevplatform_add_plugin(kdevrustlanguagesupport JSON kdevrustsupport.json SOURCES ${kdevrustlanguagesupport_PART_SRCS} ) target_link_libraries(kdevrustlanguagesupport KDev::Interfaces KDev::Language KF5::ThreadWeaver KF5::TextEditor kdevrustduchain kdevrustcompletion ) install(FILES kdevrustsupport.categories DESTINATION ${KDE_INSTALL_CONFDIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/app_templates/CMakeLists.txt b/app_templates/CMakeLists.txt new file mode 100644 index 0000000..1030a17 --- /dev/null +++ b/app_templates/CMakeLists.txt @@ -0,0 +1,5 @@ +kdevplatform_add_app_templates( + rust_binary + rust_library +) + diff --git a/app_templates/rust_binary/Cargo.toml b/app_templates/rust_binary/Cargo.toml new file mode 100644 index 0000000..eb62afe --- /dev/null +++ b/app_templates/rust_binary/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "%{APPNAMELC}" +version = "0.1.0" + +[dependencies] diff --git a/app_templates/rust_binary/rust_binary.kdevtemplate b/app_templates/rust_binary/rust_binary.kdevtemplate new file mode 100644 index 0000000..f3d9e07 --- /dev/null +++ b/app_templates/rust_binary/rust_binary.kdevtemplate @@ -0,0 +1,12 @@ +# KDE Config File +[General] +Name=Rust application +Name[en_GB]=Rust application +Name[x-test]=xxRust applicationxx +Comment=Simple Rust binary application +Comment[en_GB]=Simple Rust binary application +Comment[x-test]=xxSimple Rust binary applicationxx +Category=Rust +Icon=default-kdevelop +ShowFilesAfterGeneration=src/main.rs +ValidProjectName=^[a-zA-Z_][a-zA-Z0-9_]+$ diff --git a/app_templates/rust_binary/src/main.rs b/app_templates/rust_binary/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/app_templates/rust_binary/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/app_templates/rust_library/Cargo.toml b/app_templates/rust_library/Cargo.toml new file mode 100644 index 0000000..eb62afe --- /dev/null +++ b/app_templates/rust_library/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "%{APPNAMELC}" +version = "0.1.0" + +[dependencies] diff --git a/app_templates/rust_library/rust_library.kdevtemplate b/app_templates/rust_library/rust_library.kdevtemplate new file mode 100644 index 0000000..bac0783 --- /dev/null +++ b/app_templates/rust_library/rust_library.kdevtemplate @@ -0,0 +1,12 @@ +# KDE Config File +[General] +Name=Rust library +Name[en_GB]=Rust library +Name[x-test]=xxRust libraryxx +Comment=Simple Rust library +Comment[en_GB]=Simple Rust library +Comment[x-test]=xxSimple Rust libraryxx +Category=Rust +Icon=default-kdevelop +ShowFilesAfterGeneration=src/lib.rs +ValidProjectName=^[a-zA-Z_][a-zA-Z0-9_]+$ diff --git a/app_templates/rust_library/src/lib.rs b/app_templates/rust_library/src/lib.rs new file mode 100644 index 0000000..cdfbe1a --- /dev/null +++ b/app_templates/rust_library/src/lib.rs @@ -0,0 +1,6 @@ +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + } +}