Skip to content

Commit

Permalink
commit web assets and remove build scripts
Browse files Browse the repository at this point in the history
This removes node as a build dependency, making setup easier.

Updating web assets can now be done manually using the "web" target in
the Makefile which will:

- Download latests mobile app styles
- Install npm modules
- Run grunt (linting & processing JS code)

Remaining script build phases in the project are for processing the app
icon and copying them into the app's "assets" folder (so the webview can
grab the app icon).

Bug: T94231
Change-Id: Ic535eb9644d66e3632e353544b82494c859d8a7a
  • Loading branch information
bgerstle committed Apr 7, 2015
1 parent 1d82c6f commit 2876189
Show file tree
Hide file tree
Showing 22 changed files with 2,339 additions and 64 deletions.
3 changes: 3 additions & 0 deletions .jshintignore
@@ -0,0 +1,3 @@
Wikipedia/assets/**
fastlane/**
www/node_modules/**
28 changes: 26 additions & 2 deletions Makefile
Expand Up @@ -105,13 +105,37 @@ exec-check: ##Check that executable dependencies are installed
done

#!!!!!
#!!!!! Node dependency management
#!!!!! Web dependency management
#!!!!!

web: ##Make web assets
web: css grunt

CSS_ORIGIN = http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules=
WEB_ASSETS_DIR = "Wikipedia/assets"

define get_css_module
curl -s -L -o
endef

css: ##Download latest stylesheets
@echo "Downloading CSS assets..."; \
mkdir -p $(WEB_ASSETS_DIR); \
cd $(WEB_ASSETS_DIR); \
$(get_css_module) 'styles.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \
$(get_css_module) 'abusefilter.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \
$(get_css_module) 'preview.css' "$(CSS_ORIGIN)mobile.app.preview" > /dev/null

NODE_VERSION = "$(shell node -v 2>/dev/null)"
NPM_VERSION = "$(shell npm -version 2>/dev/null)"

npm: ##TODO, run npm install
grunt: ##Run grunt
grunt: npm
@cd www && grunt && cd ..

npm: ##Install Javascript dependencies
npm: node-check
@cd www && npm install && cd ..

get-node: ##Install node via Homebrew
brew install node
Expand Down
35 changes: 2 additions & 33 deletions Wikipedia.xcodeproj/project.pbxproj
Expand Up @@ -2567,14 +2567,12 @@
F33F4F6424C55FEF072D1A81 /* Check Pods Manifest.lock */,
D4991431181D51DE00E6073C /* Sources */,
D4991432181D51DE00E6073C /* Frameworks */,
04272E7619404CDF00CC682F /* run-grunt */,
04272E75193FF7F000CC682F /* make-css-assets */,
D4C16A621970946900CD91AD /* update-storyboard-strings */,
D4C16A631970949A00CD91AD /* update-qqq */,
D4991433181D51DE00E6073C /* Resources */,
0EB312441ACB96C300C7F7A6 /* Process Icons */,
04E0C2771A7750AB00FE22DA /* copy-wmflogo-to-assets */,
45FA417DEEAE18B42A662320 /* Copy Pods Resources */,
0EB312441ACB96C300C7F7A6 /* Process Icons */,
);
buildRules = (
);
Expand Down Expand Up @@ -2802,35 +2800,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
04272E75193FF7F000CC682F /* make-css-assets */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"",
);
name = "make-css-assets";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "scripts/make-css-assets.bash";
};
04272E7619404CDF00CC682F /* run-grunt */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "run-grunt";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "scripts/run-grunt.sh";
};
04E0C2771A7750AB00FE22DA /* copy-wmflogo-to-assets */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -2843,7 +2812,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "scripts/copy-wmflogo-to-assets.sh";
shellScript = "./scripts/copy-wmflogo-to-assets.sh";
};
0EB312441ACB96C300C7F7A6 /* Process Icons */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
108 changes: 108 additions & 0 deletions Wikipedia/assets/about.html
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" id="viewport" content="width=device-width, user-scalable=no">

<style type="text/css">

body{
font-size:100%;
margin:1.45em;
font-family: Helvetica;
color:#444444;
border-style:none;
-webkit-text-size-adjust: none;
direction:ltr;
}

div body{
margin-top:0.5em;
margin-bottom:0.5em;
}

.heading{
font-weight:bold;
color:#000000;
}

#version{
font-size:1.5em;
}

#wikipedia{
font-size:2.0em;
}

.title{
color:#888888;
margin-bottom:0.5em;
}

A{
color:#4F76eB;
}

.feedback{
text-align:center;
}

.title, .feedback{
margin-top:1.5em;
}

.footer-table{
margin-top:1.0em;
width:100%;
}

.footer{
width:100%;
}

.wmf-logo{
padding-right:0.5em;
}

</style>
</head>
<body>

<div id="wikipedia" class="heading">wikipedia</div>

<div id="version" class="heading">version</div>

<div id="contributors_title" class="title">contributors_title</div>

<div id="contributors_body">contributors_body</div>

<div id="translators_title" class="title">translators_title</div>

<div id="translators_body">translators_body</div>

<div id="testers_title" class="title">testers_title</div>

<div id="testers_body">testers_body</div>

<div id="libraries_title" class="title">libraries_title</div>

<div id="libraries_body">libraries_body</div>

<div id="repositories_title" class="title">repositories_title</div>

<div id="repositories_body">repositories_body</div>

<div id="feedback_body" class="feedback">feedback_body</div>

<table class="footer-table">
<tr>
<td>
<img class="wmf-logo" src="./images/wmflogo_60.png" srcset="./images/wmflogo_60.png 1x, ./images/wmflogo_120.png 2x, ./images/wmflogo_180.png 3x">
</td>
<td id="footer" class="footer">
footer
</td>
</tr>
</table>

</body>
</html>
2 changes: 2 additions & 0 deletions Wikipedia/assets/abusefilter.css

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions Wikipedia/assets/abusefilter.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html class="content-ltr ui-ltr" dir="ltr">
<head>

<script src="bundle.js"></script>
<meta name="viewport" id="viewport" content="width=device-width, user-scalable=no">
<link href="abusefilter.css" rel="stylesheet" type="text/css"></link>

<base href="https://wikipedia.org">

</head>
<body class="stable">
<div class="content" id="content">
</div>
</body>
</html>

0 comments on commit 2876189

Please sign in to comment.