diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e13e36256..63df95b83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -125,6 +125,17 @@ jobs: owner: WerWolv event_type: update_submodule + - name: ✉️ Update Rust Plugin Template + uses: mvasigh/dispatch-action@main + env: + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + if: "${{ env.RELEASE_TOKEN != '' }}" + with: + token: ${{ secrets.RELEASE_TOKEN }} + repo: ImHex-Rust-Plugin-Template + owner: WerWolv + event_type: update_submodule + release-windows: name: Release Windows needs: release-common diff --git a/.gitignore b/.gitignore index 28597356b..bf27a3448 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,3 @@ imgui.ini plugins/.rustc_info.json **/target - -plugins/example_rust/Cargo.lock diff --git a/plugins/example_cpp/CMakeLists.txt b/plugins/example_cpp/CMakeLists.txt deleted file mode 100644 index feb649c73..000000000 --- a/plugins/example_cpp/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -cmake_minimum_required(VERSION 3.16) - -# Change this to the name of your plugin # -project(example_cpp) - -# Add your source files here # -add_library(${PROJECT_NAME} SHARED - source/plugin_example.cpp -) - -# Add additional include directories here # -target_include_directories(${PROJECT_NAME} PRIVATE include) -# Add additional libraries here # -target_link_libraries(${PROJECT_NAME} PRIVATE libimhex) - - - -# ---- No need to change anything from here downwards unless you know what you're doing ---- # - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_SHARED_LIBRARY_PREFIX "") -set(CMAKE_SHARED_LIBRARY_SUFFIX ".hexplug") - -if (WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition -fvisibility=hidden") -endif() - -add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") -set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) -setupCompilerWarnings(${PROJECT_NAME}) \ No newline at end of file diff --git a/plugins/example_cpp/source/plugin_example.cpp b/plugins/example_cpp/source/plugin_example.cpp deleted file mode 100644 index 77e02aaec..000000000 --- a/plugins/example_cpp/source/plugin_example.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include - -class ViewExample : public hex::View { -public: - ViewExample() : hex::View("Example") { } - ~ViewExample() override { } - - void drawContent() override { - if (ImGui::Begin("Example")) { - ImGui::TextUnformatted("Custom plugin window"); - } - ImGui::End(); - } -}; - -IMHEX_PLUGIN_SETUP("Example C++", "WerWolv", "Example C++ plugin used as template for plugin devs") { - - hex::ContentRegistry::Views::add(); -} diff --git a/plugins/example_rust/CMakeLists.txt b/plugins/example_rust/CMakeLists.txt deleted file mode 100644 index 704a40e51..000000000 --- a/plugins/example_rust/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -cmake_minimum_required(VERSION 3.16) - -# Change this to the name of your plugin # -project(example_rust) - -# ---- No need to change anything from here downwards unless you know what you're doing ---- # - -if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(CARGO_CMD ${RUST_PATH}cargo build) - set(TARGET_DIR "debug") -else () - set(CARGO_CMD ${RUST_PATH}cargo build --release) - set(TARGET_DIR "release") -endif () - -if (WIN32) - set(PLUGIN_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") -else () - set(PLUGIN_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") -endif () - -get_target_property(LIBIMHEX_SOURCE_DIRECTORY libimhex SOURCE_DIR) - -add_custom_target(${PROJECT_NAME} ALL - COMMAND ${CMAKE_COMMAND} -E env - CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} - LIBIMHEX_SOURCE_DIRECTORY=${LIBIMHEX_SOURCE_DIRECTORY} - LIBIMHEX_OUTPUT_DIRECTORY=$ - CXX_COMPILER=${CMAKE_CXX_COMPILER} - IMHEX_VERSION=${IMHEX_VERSION_STRING} - ${CARGO_CMD} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PLUGIN_OUTPUT_PATH} "${CMAKE_CURRENT_BINARY_DIR}/../${PROJECT_NAME}.hexplug" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - VERBATIM - USES_TERMINAL -) -set_target_properties(${PROJECT_NAME} PROPERTIES LOCATION ${CMAKE_CURRENT_BINARY_DIR}) -set_target_properties(${PROJECT_NAME} PROPERTIES RUST_PROJECT 1) -set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE Rust) -set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) - -add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") diff --git a/plugins/example_rust/Cargo.toml b/plugins/example_rust/Cargo.toml deleted file mode 100644 index bebc59594..000000000 --- a/plugins/example_rust/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "example_rust" -version = "0.1.0" -authors = ["WerWolv "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] -path = "source/plugin_example.rs" - -[dependencies] -hex = { package = "libimhex-rs", path = "../../lib/libimhex-rs" } - -[profile.release] -lto = true diff --git a/plugins/example_rust/source/plugin_example.rs b/plugins/example_rust/source/plugin_example.rs deleted file mode 100644 index 49bb26874..000000000 --- a/plugins/example_rust/source/plugin_example.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate hex; - -#[hex::plugin_setup("Example Rust", "WerWolv", "Example Rust plugin used as template for plugin devs")] -fn init() {} -