fix(gateway): undo move headers to root `include`

Keeping headers in the src directory makes sense for the interfaces we
don't want to expose outside, but the `include_lib` directive fails to
compile under Mix. Changing `include_lib("emqx_gateway/src/...")` to
`-include("src/...")` pleases both Mix and Rebar.
This commit is contained in:
Thales Macedo Garitezi 2021-12-28 17:13:30 -03:00
parent fe444bf134
commit 8f4453fedb
No known key found for this signature in database
GPG Key ID: DD279F8152A9B6DD
40 changed files with 41 additions and 42 deletions

View File

@ -18,7 +18,7 @@
-behaviour(minirest_api).
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
%% API
-export([api_spec/0]).

View File

@ -43,7 +43,7 @@
-export_type([channel/0]).
-include_lib("emqx/include/logger.hrl").
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include_lib("emqx/include/emqx_authentication.hrl").
-define(AUTHN, ?EMQX_AUTHENTICATION_CONFIG_ROOT_NAME_ATOM).

View File

@ -28,7 +28,7 @@
, is_message/1
]).
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include_lib("emqx/include/types.hrl").
-define(VERSION, 1).

View File

@ -20,7 +20,7 @@
-module(emqx_coap_medium).
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
%% API
-export([ empty/0, reset/1, reset/2

View File

@ -34,7 +34,7 @@
-export([ set/3, set_payload/2, get_option/2
, get_option/3, set_payload_block/3, set_payload_block/4]).
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
request(Type, Method) ->
request(Type, Method, <<>>, []).

View File

@ -18,7 +18,7 @@
-include_lib("emqx/include/emqx.hrl").
-include_lib("emqx/include/emqx_mqtt.hrl").
-include_lib("emqx/include/logger.hrl").
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
%% API
-export([ new/0

View File

@ -28,7 +28,7 @@
-export_type([manager/0, event_result/1]).
-include_lib("emqx/include/logger.hrl").
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-type direction() :: in | out.

View File

@ -1,7 +1,7 @@
-module(emqx_coap_transport).
-include_lib("emqx/include/logger.hrl").
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-define(ACK_TIMEOUT, 2000).
-define(ACK_RANDOM_FACTOR, 1000).

View File

@ -16,7 +16,7 @@
-module(emqx_coap_mqtt_handler).
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-export([handle_request/4]).
-import(emqx_coap_message, [response/2, response/3]).

View File

@ -18,7 +18,7 @@
-module(emqx_coap_pubsub_handler).
-include_lib("emqx/include/emqx_mqtt.hrl").
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-export([handle_request/4]).

View File

@ -15,7 +15,7 @@
%%--------------------------------------------------------------------
-module(emqx_exproto_channel).
-include("emqx_exproto.hrl").
-include("src/exproto/include/emqx_exproto.hrl").
-include_lib("emqx/include/emqx.hrl").
-include_lib("emqx/include/emqx_mqtt.hrl").
-include_lib("emqx/include/types.hrl").

View File

@ -19,7 +19,7 @@
% -behaviour(emqx_exproto_v_1_connection_adapter_bhvr).
-include("emqx_exproto.hrl").
-include("src/exproto/include/emqx_exproto.hrl").
-include_lib("emqx/include/logger.hrl").
-define(IS_QOS(X), (X =:= 0 orelse X =:= 1 orelse X =:= 2)).

View File

@ -17,8 +17,8 @@
-module(emqx_lwm2m_channel).
-include_lib("emqx/include/logger.hrl").
-include("emqx_coap.hrl").
-include("emqx_lwm2m.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
%% API
-export([ info/1

View File

@ -17,8 +17,8 @@
-module(emqx_lwm2m_cmd).
-include_lib("emqx/include/logger.hrl").
-include("emqx_coap.hrl").
-include("emqx_lwm2m.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-export([ mqtt_to_coap/2
, coap_to_mqtt/4

View File

@ -23,7 +23,7 @@
, translate_json/1
]).
-include("emqx_lwm2m.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
tlv_to_json(BaseName, TlvData) ->
DecodedTlv = emqx_lwm2m_tlv:parse(TlvData),

View File

@ -18,8 +18,8 @@
-include_lib("emqx/include/logger.hrl").
-include_lib("emqx/include/emqx.hrl").
-include_lib("emqx/include/emqx_mqtt.hrl").
-include("emqx_coap.hrl").
-include("emqx_lwm2m.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
%% API
-export([ new/0, init/4, update/3, parse_object_list/1

View File

@ -25,7 +25,7 @@
-export([binary_to_hex_string/1]).
-endif.
-include("emqx_lwm2m.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-define(TLV_TYPE_OBJECT_INSTANCE, 0).
-define(TLV_TYPE_RESOURCE_INSTANCE, 1).

View File

@ -16,7 +16,7 @@
-module(emqx_lwm2m_xml_object).
-include("emqx_lwm2m.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-include_lib("xmerl/include/xmerl.hrl").
-export([ get_obj_def/2

View File

@ -16,7 +16,7 @@
-module(emqx_lwm2m_xml_object_db).
-include("emqx_lwm2m.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-include_lib("xmerl/include/xmerl.hrl").
-include_lib("emqx/include/logger.hrl").

View File

@ -18,7 +18,7 @@
-behaviour(gen_server).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("emqx/include/logger.hrl").
-export([ start_link/2

View File

@ -18,7 +18,7 @@
-behaviour(emqx_gateway_channel).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("emqx/include/emqx.hrl").
-include_lib("emqx/include/emqx_mqtt.hrl").
-include_lib("emqx/include/logger.hrl").

View File

@ -20,7 +20,7 @@
-behaviour(emqx_gateway_frame).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-export([ initial_parse_state/1
, serialize_opts/0

View File

@ -21,7 +21,7 @@
-behaviour(gen_server).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("emqx/include/logger.hrl").
-export([ start_link/2

View File

@ -18,7 +18,7 @@
-behaviour(emqx_gateway_channel).
-include("emqx_stomp.hrl").
-include("src/stomp/include/emqx_stomp.hrl").
-include_lib("emqx/include/emqx.hrl").
-include_lib("emqx/include/logger.hrl").

View File

@ -70,7 +70,7 @@
-behaviour(emqx_gateway_frame).
-include("emqx_stomp.hrl").
-include("src/stomp/include/emqx_stomp.hrl").
-export([ initial_parse_state/1
, parse/2

View File

@ -17,7 +17,7 @@
%% @doc Stomp heartbeat.
-module(emqx_stomp_heartbeat).
-include("emqx_stomp.hrl").
-include("src/stomp/include/emqx_stomp.hrl").
-export([ init/1
, check/3

View File

@ -19,7 +19,7 @@
-compile(export_all).
-compile(nowarn_export_all).
-include("emqx_coap.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").

View File

@ -23,8 +23,8 @@
-define(LOGT(Format, Args), ct:pal("TEST_SUITE: " ++ Format, Args)).
-include("emqx_lwm2m.hrl").
-include("emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").

View File

@ -23,8 +23,8 @@
-define(LOGT(Format, Args), ct:pal("TEST_SUITE: " ++ Format, Args)).
-include("emqx_lwm2m.hrl").
-include("emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").

View File

@ -19,7 +19,7 @@
-compile(export_all).
-compile(nowarn_export_all).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("eunit/include/eunit.hrl").
%%--------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
-compile(export_all).
-compile(nowarn_export_all).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").

View File

@ -17,7 +17,7 @@
-module(emqx_stomp_SUITE).
-include_lib("eunit/include/eunit.hrl").
-include("emqx_stomp.hrl").
-include("src/stomp/include/emqx_stomp.hrl").
-compile(export_all).
-compile(nowarn_export_all).

View File

@ -21,8 +21,8 @@
-define(LOGT(Format, Args), logger:debug("TEST_SUITE: " ++ Format, Args)).
-include("emqx_lwm2m.hrl").
-include("emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl").
-include("src/coap/include/emqx_coap.hrl").
-include_lib("eunit/include/eunit.hrl").
%%--------------------------------------------------------------------

View File

@ -16,7 +16,7 @@
-module(emqx_sn_proper_types).
-include("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("proper/include/proper.hrl").
-compile({no_auto_import, [register/1]}).

View File

@ -16,7 +16,7 @@
-module(prop_emqx_sn_frame).
-include_lib("emqx_sn.hrl").
-include("src/mqttsn/include/emqx_sn.hrl").
-include_lib("proper/include/proper.hrl").
-compile({no_auto_import, [register/1]}).
@ -76,4 +76,3 @@ mqtt_sn_message() ->
, M:'WILLTOPICRESP'(), M:'WILLMSGUPD'()
, M:'WILLMSGRESP'()
]).