forked from virgileb/ebay-sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
223 lines (178 loc) · 10.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# This Makefile was taken from the AWS for PHP project with some modifications.
#
# https://github.com/aws/aws-sdk-php/blob/2.7.19/Makefile
#
phpcs-report:
@vendor/bin/phpcs $(DIR) --extensions=php --standard=PSR2 --report=summary -n
phpcs:
@vendor/bin/phpcs $(DIR) --extensions=php --standard=PSR2 -n -a
phpcbf:
@vendor/bin/phpcbf $(DIR) --extensions=php --standard=PSR2 -n
test:
@vendor/bin/phpunit $(TEST)
clean:
rm -rf build/artifacts
cd docs && make clean
guide:
cd docs && make html
guide-show:
open docs/_build/html/index.html
api: api-get-apigen
# Build the package if necessary.
[ -d build/artifacts/staging ] || make package
# Delete a previously built API build to avoid the prompt.
rm -rf build/artifacts/docs
php build/artifacts/apigen.phar generate --config build/docs/apigen.neon --debug
api-get-apigen:
mkdir -p build/artifacts
[ -f build/artifacts/apigen.phar ] || wget -q -O build/artifacts/apigen.phar https://github.com/ApiGen/ApiGen/releases/download/v4.1.0/apigen-4.1.0.phar
api-show:
open build/artifacts/docs/index.html
api-package:
zip -r build/artifacts/ebay-sdk-php-docs-api.zip build/artifacts/docs
# Packages the phar and zip
package:
php build/packager.php
# Ensures that the TAG variable was passed to the make command
check_tag:
$(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))
# Creates a release but does not push it. This task updates the changelog
# with the TAG environment variable, replaces the VERSION constant, ensures
# that the source is still valid after updating, commits the changelog and
# updated VERSION constant, and prints out a diff of the last commit.
tag: check_tag
@echo Tagging $(TAG)
chag update $(TAG)
sed -i -e "s/const VERSION = '.*'/const VERSION = '$(TAG)'/" src/Sdk.php
php -l src/Sdk.php
git commit -a -m 'update: bump version to $(TAG)'
@echo "Release has been created. Push using 'make release'"
@echo "Changes made in the release commit"
git diff HEAD~1 HEAD
# Creates a release based on the master branch and latest tag. This task
# creates an annotated git tag using chag, pushes the latest tag,
# pushes master, creates a phar and zip, and creates Github release.
# Use "TAG=X.Y.Z make tag" to create a release, and use
# "make release" to push a release. This task requires that the
# OAUTH_TOKEN environment variable is available and the token has permission
# to push to the repository.
release: check_tag clean package
chag tag
git push origin master
git push origin $(TAG)
php build/gh-release.php $(TAG)
# Tags the repo and publishes a release.
full_release: tag release
sync_account:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Account/src/Account/ src/Account/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Account/test/Account/ test/Account/
sync_analytics:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Analytics/src/Analytics/ src/Analytics/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Analytics/test/Analytics/ test/Analytics/
sync_browse:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Browse/src/Browse/ src/Browse/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Browse/test/Browse/ test/Browse/
sync_bulk:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/BulkDataExchange/src/BulkDataExchange/ src/BulkDataExchange/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/BulkDataExchange/test/BulkDataExchange/ test/BulkDataExchange/
sync_bus:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/BusinessPoliciesManagement/src/BusinessPoliciesManagement/ src/BusinessPoliciesManagement/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/BusinessPoliciesManagement/test/BusinessPoliciesManagement/ test/BusinessPoliciesManagement/
sync_catalog:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Catalog/src/Catalog/ src/Catalog/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Catalog/test/Catalog/ test/Catalog/
sync_compliance:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Compliance/src/Compliance/ src/Compliance/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Compliance/test/Compliance/ test/Compliance/
sync_feed:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Feed/src/Feed/ src/Feed/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Feed/test/Feed/ test/Feed/
sync_feedback:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Feedback/src/Feedback/ src/Feedback/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Feedback/test/Feedback/ test/Feedback/
sync_file:
rsync -rtvu --delete --exclude *BaseService.php --exclude Data.php --exclude XopInclude.php ../ebay-api-sdk-php/dist/FileTransfer/src/FileTransfer/ src/FileTransfer/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/FileTransfer/test/FileTransfer/ test/FileTransfer/
sed -i -e "s/@property string/@property \\\DTS\\\eBaySDK\\\FileTransfer\\\Types\\\Data/" src/FileTransfer/Types/FileAttachment.php
sed -i -e "s/'string'/'DTS\\\eBaySDK\\\FileTransfer\\\Types\\\Data'/" src/FileTransfer/Types/FileAttachment.php
sync_finding:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Finding/src/Finding/ src/Finding/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Finding/test/Finding/ test/Finding/
sync_fulfillment:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Fulfillment/src/Fulfillment/ src/Fulfillment/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Fulfillment/test/Fulfillment/ test/Fulfillment/
sync_half:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/HalfFinding/src/HalfFinding/ src/HalfFinding/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/HalfFinding/test/HalfFinding/ test/HalfFinding/
sync_inventory:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Inventory/src/Inventory/ src/Inventory/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Inventory/test/Inventory/ test/Inventory/
sync_marketing:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Marketing/src/Marketing/ src/Marketing/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Marketing/test/Marketing/ test/Marketing/
sync_merchand:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Merchandising/src/Merchandising/ src/Merchandising/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Merchandising/test/Merchandising/ test/Merchandising/
sync_merc:
rsync -rtvu --delete --exclude MerchantData.php ../ebay-api-sdk-php/dist/MerchantData/src/MerchantData/ src/MerchantData/
rsync -rtvu --delete --exclude /Mocks/ --exclude MerchantDataTest.php ../ebay-api-sdk-php/dist/MerchantData/test/MerchantData/ test/MerchantData/
sync_metadata:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Metadata/src/Metadata/ src/Metadata/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Metadata/test/Metadata/ test/Metadata/
sync_order:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Order/src/Order/ src/Order/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Order/test/Order/ test/Order/
sync_taxonomy:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Taxonomy/src/Taxonomy/ src/Taxonomy/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Taxonomy/test/Taxonomy/ test/Taxonomy/
sync_post:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/PostOrder/src/PostOrder/ src/PostOrder/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/PostOrder/test/PostOrder/ test/PostOrder/
sync_product:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Product/src/Product/ src/Product/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Product/test/Product/ test/Product/
sync_product_metadata:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/ProductMetadata/src/ProductMetadata/ src/ProductMetadata/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/ProductMetadata/test/ProductMetadata/ test/ProductMetadata/
sync_related:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/RelatedItemsManagement/src/RelatedItemsManagement/ src/RelatedItemsManagement/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/RelatedItemsManagement/test/RelatedItemsManagement/ test/RelatedItemsManagement/
sync_res:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/ResolutionCaseManagement/src/ResolutionCaseManagement/ src/ResolutionCaseManagement/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/ResolutionCaseManagement/test/ResolutionCaseManagement/ test/ResolutionCaseManagement/
sync_return:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/ReturnManagement/src/ReturnManagement/ src/ReturnManagement/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/ReturnManagement/test/ReturnManagement/ test/ReturnManagement/
sync_shop:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Shopping/src/Shopping/ src/Shopping/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Shopping/test/Shopping/ test/Shopping/
sync_trade:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Trading/src/Trading/ src/Trading/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Trading/test/Trading/ test/Trading/
sync_all: sync_account \
sync_analytics \
sync_browse \
sync_bulk \
sync_bus \
sync_catalog \
sync_compliance \
sync_feedback \
sync_file \
sync_finding \
sync_fulfillment \
sync_half \
sync_inventory \
sync_marketing \
sync_merchand \
sync_merc \
sync_metadata \
sync_order \
sync_post \
sync_product \
sync_product_metadata \
sync_related \
sync_res \
sync_return \
sync_shop \
sync_trade
.PHONY: test