rclex
rclex copied to clipboard
Consider more appropriate location where message files will be generated
Currently, the files for custom messages will be generated at the following location in the build step.
- header files in C:
src/*/msg - typesupport definition for Elixir code:
lib/rclex/*/msg
We don't think the above is not the best since the library code may be modified by user operations. So we consider the another location and way to generate them.
Note:
- They are ignored about Git management.
- https://github.com/rclex/rclex/commit/7d642f21f751f0148bf54c3a54ac4f8e0d859375#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
- https://github.com/rclex/rclex/blob/main/.gitignore#L38-L41
- And also, they are also excluded for mix format.
- https://github.com/rclex/rclex/pull/135
- https://github.com/rclex/rclex/blob/main/.formatter.exs#L3-L8
素案を次のように検討している.
- メッセージに関わるファイル群は,定義ごとに別リポジトリ/Hexパッケージに分ける(StdMsgs, GeometryMsgsなど)
- rclex_std_msgs など接頭を陽に付けるかは検討の余地あり.気にしどころは Hex.pm として重複しないかだが,今のところは問題無さそう. https://hex.pm/packages?search=msgs&sort=recent_downloads
- Rclex のアプリケーションからは,使いたいメッセージ定義のパッケージを mix.exs -> deps() に書いてもらう.
- Rclex 自身の mix test で StdMsgs が必要になるので,本パッケージには追加する.アプリ側で二重定義されても依存関係は読み切ってくれるはず.
- Rclex およびアプリの
mix compile中ではメッセージ定義ファイルの生成は行わない. - .msg 等の記述からメッセージ定義ファイルを生成する mix task 用のリポジトリを作成する.
- https://github.com/rclex/rclex_gen_msgs をベースに育ててもいいかも.
- 総じて,ユーザ側の作業は次のとおりに変更される.
- (使用したいメッセージがHexとしてまだ存在しなければ) .msg等を作成,mix task でメッセージ定義のリポジトリとファイル群を生成.
- アプリの mix.exs -> deps() に使いたいメッセージのパッケージを記述する.
- アプリ内コードで利用して
mix compileする(すでに定義ファイルは生成されている)
I think this was improved by #185. So I decided to close this!