Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Dev additional plugins #5026

Merged
merged 77 commits into from
Aug 9, 2018
Merged

Conversation

asiniscalchi
Copy link
Contributor

@asiniscalchi asiniscalchi commented Aug 3, 2018

just run cmake with
$ cmake .. -DEOSIO_ADDITIONAL_PLUGINS="<path_to_source_plugin_0>[;<path_to_source_plugin_1] ..."

First additional plugin ever: https://github.com/asiniscalchi/eosio_sql_plugin

following the line you have to add in the root CMakeList.txt of an additional plugin
eosio_additional_plugin(<plugin_target0>[;<plugin_target1>] ...)

Cheers

@heifner heifner changed the base branch from master to develop August 3, 2018 13:14

foreach(ADDITIONAL_PLUGIN_SOURCE_DIR ${EOSIO_ADDITIONAL_PLUGINS})
message(STATUS "[Additional Plugin] source dir: ${ADDITIONAL_PLUGIN_SOURCE_DIR}")
add_subdirectory(${ADDITIONAL_PLUGIN_SOURCE_DIR} ${CMAKE_BINARY_DIR}/additional_plugins/${ADDITIONAL_PLUGIN_SOURCE_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would appear to concatenate the whole path to the additional plugin to the directory. Will this cause problems if the path is relative aka "../../../my_plugin" ?

When I was investigating something similar I used

get_filename_component(plugin_name "${external_plugin_path}" NAME)

to get just the last directory name in the path (aka "my_plugin" in the example) and concatenated that to the CMAKE_BINARY_DIR. It carries the problem of all plugins needing unique directory names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! You right.
I see 2 solution :

  1. use a random string
  2. use fixed path + incremental integer (ex plugin_1, plugin_2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was referenced Aug 3, 2018
include(additionalPlugin)

foreach(ADDITIONAL_PLUGIN_SOURCE_DIR ${EOSIO_ADDITIONAL_PLUGINS})
string(UUID ADDITIONAL_PLUGIN_SOURCE_DIR_MD5 NAMESPACE "00000000-0000-0000-0000-000000000000" NAME ${ADDITIONAL_PLUGIN_SOURCE_DIR} TYPE MD5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like where you went with this, should normalize the input first via get_filename_component( ... ABSOLUTE ... ) ?

I assume that ".././my_plugin", "../my_plugin", "../my_plugin/../my_plugin", "..//my_plugin" etc are all going to have different UUIDs if we don't normalize them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary: cmake will fail because you got targets with same name.

Copy link
Contributor Author

@asiniscalchi asiniscalchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only to make it all cleaner

@heifner heifner merged commit 867a9ee into EOSIO:develop Aug 9, 2018
@gleehokie
Copy link
Contributor

@wanderingbort is this stable now and should it be used by the community?

@cc32d9
Copy link
Contributor

cc32d9 commented Aug 15, 2018

@gleehokie better after #5229 is resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants