{"action":"created","issue":{"url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/issues/17","repository_url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core","labels_url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/issues/17/comments","events_url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/issues/17/events","html_url":"https://github.com/gedankenlab/Kaleidoglyph-Core/issues/17","id":332643048,"node_id":"MDU6SXNzdWUzMzI2NDMwNDg=","number":17,"title":"Including headers from the sketch","user":{"login":"gedankenexperimenter","id":17190757,"node_id":"MDQ6VXNlcjE3MTkwNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/17190757?v=4","gravatar_id":"","url":"https://api.github.com/users/gedankenexperimenter","html_url":"https://github.com/gedankenexperimenter","followers_url":"https://api.github.com/users/gedankenexperimenter/followers","following_url":"https://api.github.com/users/gedankenexperimenter/following{/other_user}","gists_url":"https://api.github.com/users/gedankenexperimenter/gists{/gist_id}","starred_url":"https://api.github.com/users/gedankenexperimenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedankenexperimenter/subscriptions","organizations_url":"https://api.github.com/users/gedankenexperimenter/orgs","repos_url":"https://api.github.com/users/gedankenexperimenter/repos","events_url":"https://api.github.com/users/gedankenexperimenter/events{/privacy}","received_events_url":"https://api.github.com/users/gedankenexperimenter/received_events","type":"User","site_admin":false},"labels":[{"id":964845932,"node_id":"MDU6TGFiZWw5NjQ4NDU5MzI=","url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/labels/idea","name":"idea","color":"ffbca8","default":false}],"state":"open","locked":false,"assignee":{"login":"gedankenexperimenter","id":17190757,"node_id":"MDQ6VXNlcjE3MTkwNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/17190757?v=4","gravatar_id":"","url":"https://api.github.com/users/gedankenexperimenter","html_url":"https://github.com/gedankenexperimenter","followers_url":"https://api.github.com/users/gedankenexperimenter/followers","following_url":"https://api.github.com/users/gedankenexperimenter/following{/other_user}","gists_url":"https://api.github.com/users/gedankenexperimenter/gists{/gist_id}","starred_url":"https://api.github.com/users/gedankenexperimenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedankenexperimenter/subscriptions","organizations_url":"https://api.github.com/users/gedankenexperimenter/orgs","repos_url":"https://api.github.com/users/gedankenexperimenter/repos","events_url":"https://api.github.com/users/gedankenexperimenter/events{/privacy}","received_events_url":"https://api.github.com/users/gedankenexperimenter/received_events","type":"User","site_admin":false},"assignees":[{"login":"gedankenexperimenter","id":17190757,"node_id":"MDQ6VXNlcjE3MTkwNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/17190757?v=4","gravatar_id":"","url":"https://api.github.com/users/gedankenexperimenter","html_url":"https://github.com/gedankenexperimenter","followers_url":"https://api.github.com/users/gedankenexperimenter/followers","following_url":"https://api.github.com/users/gedankenexperimenter/following{/other_user}","gists_url":"https://api.github.com/users/gedankenexperimenter/gists{/gist_id}","starred_url":"https://api.github.com/users/gedankenexperimenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedankenexperimenter/subscriptions","organizations_url":"https://api.github.com/users/gedankenexperimenter/orgs","repos_url":"https://api.github.com/users/gedankenexperimenter/repos","events_url":"https://api.github.com/users/gedankenexperimenter/events{/privacy}","received_events_url":"https://api.github.com/users/gedankenexperimenter/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-06-15T04:31:16Z","updated_at":"2018-06-25T02:12:20Z","closed_at":null,"author_association":"MEMBER","body":"In order to get around some C++ compilation limitations, I'm going to incorporate configuration data from the user sketch into some of the Kaleidoglyph modules. This is a bit convoluted, so I'm going to write it up here.\r\n\r\nFirst, I'm going to use the `LOCAL_CFLAGS` parameter defined in `.kaleidoglyph-builder.conf` to defined preprocessor macros. These macros will set the names of header files in the sketch's `src` directory that will be conditionally included (if the macro is defined) in the relevant source file. If the macro in question is not defined, reasonable defaults will be provided in an `#else` block. For example:\r\n\r\nIn a `*.cpp` file for a plugin:\r\n```c++\r\n#if defined(PLUGIN_CONSTANTS_H)\r\n#include PLUGIN_CONSTANTS_H\r\n#else\r\nconstexpr byte plugin_constant_1 {100};\r\n#endif\r\n```\r\n…and in the sketch's `.kaleidoglyph-builder.conf`:\r\n```sh\r\nLOCAL_CFLAGS='-DPLUGIN_CONSTANTS_H=<plugin-constants.h>'\r\n```\r\n…and in `src/plugin-constants.h`:\r\n```c++\r\n#pragma once\r\nconstexpr byte plugin_constant_1 {200};\r\n```"},"comment":{"url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/issues/comments/399811305","html_url":"https://github.com/gedankenlab/Kaleidoglyph-Core/issues/17#issuecomment-399811305","issue_url":"https://api.github.com/repos/gedankenlab/Kaleidoglyph-Core/issues/17","id":399811305,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTgxMTMwNQ==","user":{"login":"gedankenexperimenter","id":17190757,"node_id":"MDQ6VXNlcjE3MTkwNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/17190757?v=4","gravatar_id":"","url":"https://api.github.com/users/gedankenexperimenter","html_url":"https://github.com/gedankenexperimenter","followers_url":"https://api.github.com/users/gedankenexperimenter/followers","following_url":"https://api.github.com/users/gedankenexperimenter/following{/other_user}","gists_url":"https://api.github.com/users/gedankenexperimenter/gists{/gist_id}","starred_url":"https://api.github.com/users/gedankenexperimenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedankenexperimenter/subscriptions","organizations_url":"https://api.github.com/users/gedankenexperimenter/orgs","repos_url":"https://api.github.com/users/gedankenexperimenter/repos","events_url":"https://api.github.com/users/gedankenexperimenter/events{/privacy}","received_events_url":"https://api.github.com/users/gedankenexperimenter/received_events","type":"User","site_admin":false},"created_at":"2018-06-25T02:12:20Z","updated_at":"2018-06-25T02:12:20Z","author_association":"MEMBER","body":"TODO: Figure out how arduino-builder figures out which board to use if there's more than one defined in `boards.txt`."}}
{"actor":{"display_login":"gedankenexperimenter"}}