@@ -111,6 +111,7 @@ endef
111
111
# --------------------------------------------------------------------
112
112
113
113
.PHONY : source-dist clean-source-dist
114
+ .PHONY : source-bundle clean-source-bundle
114
115
115
116
SOURCE_DIST_BASE ?= rabbitmq-server
116
117
SOURCE_DIST_SUFFIXES ?= tar.xz
@@ -122,6 +123,13 @@ SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
122
123
123
124
.PHONY : $(SOURCE_DIST_FILES )
124
125
126
+ # Override rsync flags as a pre-requisite
127
+ source-bundle : RSYNC_FLAGS = $(SOURCE_BUNDLE_RSYNC_FLAGS )
128
+ source-bundle : $(SOURCE_DIST_FILES )
129
+ @:
130
+
131
+ # Override rsync flags as a pre-requisite
132
+ source-dist : RSYNC_FLAGS = $(SOURCE_DIST_RSYNC_FLAGS )
125
133
source-dist : $(SOURCE_DIST_FILES )
126
134
@:
127
135
@@ -130,7 +138,9 @@ RSYNC_V_0 =
130
138
RSYNC_V_1 = -v
131
139
RSYNC_V_2 = -v
132
140
RSYNC_V = $(RSYNC_V_$(V ) )
133
- RSYNC_FLAGS += -a $(RSYNC_V ) \
141
+ BASE_RSYNC_FLAGS += -a $(RSYNC_V ) \
142
+ --delete \
143
+ --delete-excluded \
134
144
--exclude '.sw?' --exclude '.*.sw?' \
135
145
--exclude '*.beam' \
136
146
--exclude '*.d' \
@@ -162,7 +172,6 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
162
172
--exclude '$(notdir $(DEPS_DIR ) ) /' \
163
173
--exclude 'hexer*' \
164
174
--exclude 'logs/' \
165
- --exclude 'packaging' \
166
175
--exclude 'PKG_*.md' \
167
176
--exclude '/plugins/' \
168
177
--include 'cli/plugins' \
@@ -185,9 +194,21 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
185
194
--exclude '/ranch/doc/' \
186
195
--exclude '/ranch/examples/' \
187
196
--exclude '/sockjs/examples/' \
188
- --exclude '/workflow_sources/' \
189
- --delete \
190
- --delete-excluded
197
+ --exclude '/workflow_sources/'
198
+
199
+ SOURCE_DIST_RSYNC_FLAGS += $(BASE_RSYNC_FLAGS ) \
200
+ --exclude 'packaging' \
201
+ --exclude 'test'
202
+
203
+ # For source-bundle, explicitly include folders that are needed
204
+ # for tests to execute. These are added before excludes from
205
+ # the base flags so rsync honors the first match.
206
+ SOURCE_BUNDLE_RSYNC_FLAGS += \
207
+ --include 'rabbit_shovel_test/ebin' \
208
+ --include 'rabbit_shovel_test/ebin/*' \
209
+ --include 'rabbitmq_ct_helpers/tools' \
210
+ --include 'rabbitmq_ct_helpers/tools/*' \
211
+ $(BASE_RSYNC_FLAGS )
191
212
192
213
TAR ?= tar
193
214
TAR_V_0 =
@@ -352,6 +373,8 @@ $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest
352
373
353
374
clean :: clean-source-dist
354
375
376
+ clean-source-bundle :: clean-source-dist
377
+
355
378
clean-source-dist :
356
379
$(gen_verbose ) rm -rf -- $(SOURCE_DIST_BASE ) -*
357
380
0 commit comments