forked from wikimedia/wikipedia-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
116 lines (86 loc) · 3.04 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
.PHONY=build
XCODE_VERSION = "$(shell xcodebuild -version 2>/dev/null)"
help: ##Show this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
setup: ##Install all required dependencies to build & run the app
@./scripts/setup
bootstrap: ##Install all required dependencies to build & run the app (alias for setup)
bootstrap: setup
prebuild: ##Install all required dependencies to build & run the app (alias for setup)
prebuild: setup
build: ##Build the project
build: setup
@xcodebuild
deps: ##Build deps from scratch. Uses carthage.
@./scripts/setup force
#!!!!!
#!!!!! Individual executable dependencies (instead of running the all of setup)
#!!!!
get-homebrew: ##Install Homebrew using the bootstrapping script from http://brew.sh
@./scripts/setup_homebrew
brew-install: ##Install executable dependencies via Homebrew
brew-install:
@./scripts/brew_install
#!!!!!
#!!!!! Web dependency management
#!!!!!
web: ##Make web assets
web: css grunt
PROD_CSS_PREFIX="https://en.wikipedia.org/w"
BETA_CSS_PREFIX="https://beta.wmflabs.org/w"
LOCAL_CSS_PREFIX="http://127.0.0.1:8080/w"
# Switch to LOCAL_CSS_PREFIX when testing CSS changes in a local MW instance (in vagrant),
# or to BETA_CSS_PREFIX when testing CSS changes which have been staged to beta but not
# yet deployed to production.
CSS_PREFIX=$(PROD_CSS_PREFIX)
WEB_ASSETS_DIR = "Wikipedia/assets"
CSS_ORIGIN = $(CSS_PREFIX)/load.php?only=styles&target=mobile&skin=minerva&modules=skins.minerva.base.reset|skins.minerva.content.styles|ext.math.styles|ext.pygments|mobile.app
define get_css_module
curl -s -L -o
endef
css: ##Download latest stylesheets
@echo "Downloading CSS assets from $(CSS_PREFIX)..."; \
mkdir -p $(WEB_ASSETS_DIR); \
cd $(WEB_ASSETS_DIR); \
$(get_css_module) 'styles.css' "$(CSS_ORIGIN)" > /dev/null; \
$(get_css_module) 'abusefilter.css' "$(CSS_ORIGIN)" > /dev/null; \
$(get_css_module) 'preview.css' "$(CSS_ORIGIN)" > /dev/null
NODE_VERSION = "$(shell node -v 2>/dev/null)"
NPM_VERSION = "$(shell npm -version 2>/dev/null)"
get-grunt: ##Install grunt via Homebrew
get-grunt: brew-install
brew install grunt
grunt: ##Run grunt
grunt: npm get-grunt
@cd www && grunt && cd ..
npm: ##Install Javascript dependencies
npm:
@cd www && npm install && cd ..
get-node: ##Install node via Homebrew
get-node: brew-install
brew install node
#!!!!!
#!!!!! Ruby dependency management
#!!!!!
RUBY_VERSION = "$(shell ruby -v 2>/dev/null)"
BUNDLER = "$(shell which bundle 2/dev/null)"
get-ruby: ##Install Ruby via rbenv and Homebrew (to remove need for sudo)
@./scripts/setup_rbenv_and_ruby
bundle-install: ##Install all gems using Bundler
bundle-install: bundler-check
@bundle install
bundler-check: ##Make sure Bundler is installed
bundler-check: ruby-check
@if ! which -s bundle; then \
echo "Missing the Bundler Ruby gem." ; \
exit 1 ; \
else \
echo "Bundler is installed!" ; \
fi
ruby-check: ##Make sure Ruby is installed
@if [[ $(RUBY_VERSION) == "" ]]; then \
echo "Ruby is missing!" ; \
exit 1 ; \
else \
echo "Ruby is installed!" ; \
fi