forked from davidtsadler/ebay-sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
126 lines (99 loc) · 5.73 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
# 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, creates an annotated git tag using chag, 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 '$(TAG) release'
chag 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
# pushes the latest tag, pushes master, creates a phar and zip, and creates
# a 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 package
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_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_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_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_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_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_bulk sync_bus sync_file sync_finding sync_half sync_merc sync_res sync_return sync_shop sync_trade
.PHONY: test