Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ CSSTHEMEFILES = css/themes/${THEME}/jquery.mobile.theme.css
# Helper Variables
# The command to replace the @VERSION in the files with the actual version
VER = sed "s/v@VERSION/$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd")/"
VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} jquerymobile.com | jquery.org/license */"
VER_MIN = "/*! jQuery Mobile v$$(git log -1 --format=format:"Git Build: SHA1: %H <> Date: %cd") jquerymobile.com | jquery.org/license */"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that double $ intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, its needed to do inline shell commands

VER_OFFICIAL = $(shell cat version.txt)
deploy: VER = sed "s/v@VERSION/${VER_OFFICIAL}/"
deploy: VER_MIN = "/*! jQuery Mobile v${VER_OFFICIAL} jquerymobile.com | jquery.org/license */"

# The output folder for the finished files
OUTPUT = compiled
Expand All @@ -86,13 +88,13 @@ all: init css js zip notify
# Build and minify the CSS files
css: init
# Build the CSS file with the theme included
@@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.css
@@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.css
@@cat ${CSSTHEMEFILES} ${CSSFILES} >> ${OUTPUT}/${NAME}.css
# ..... and then minify it
@@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.css
@@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${NAME}.css >> ${OUTPUT}/${NAME}.min.css
# Build the CSS Structure-only file
@@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${STRUCTURE}.css
@@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${STRUCTURE}.css
@@cat ${CSSFILES} >> ${OUTPUT}/${STRUCTURE}.css
# ..... and then minify it
@@echo ${VER_MIN} > ${OUTPUT}/${STRUCTURE}.min.css
Expand All @@ -114,7 +116,7 @@ docs: init css js
-exec perl -pi -e \
's|js/"|${NAME}.min.js"|g;s|css/themes/default/|${NAME}.min.css|g;s|js/jquery.js"|jquery.js"|g' {} \;
# ... Move and zip up the the whole folder
@@zip -rq ${OUTPUT}/${NAME}.docs.zip tmp/${NAME}
@@cd tmp; zip -rq ../${OUTPUT}/${NAME}.docs.zip ${NAME}
@@mv tmp/${NAME} ${OUTPUT}/demos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're not out of tmp yet

# Finish by removing the temporary files
@@rm -rf tmp
Expand All @@ -134,7 +136,7 @@ init:
# Build and minify the JS files
js: init
# Build the JavaScript file
@@cat js/jquery.mobile.intro.js | ${VER} > ${OUTPUT}/${NAME}.js
@@cat LICENSE-INFO.txt | ${VER} > ${OUTPUT}/${NAME}.js
@@cat ${JSFILES} >> ${OUTPUT}/${NAME}.js
# ..... and then minify it
@@echo ${VER_MIN} > ${OUTPUT}/${NAME}.min.js
Expand All @@ -153,7 +155,7 @@ zip: init css js
# Packaging up the files into a zip archive
@@mkdir tmp
@@cp -r ${OUTPUT} tmp/${NAME}
@@zip -rq ${OUTPUT}/${NAME}.zip tmp/${NAME}/
@@cd tmp; zip -rq ../${OUTPUT}/${NAME}.zip ${NAME}
@@rm -rf tmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, still in tmp. I think using zip -jrq might save you the cd

# -------------------------------------------------

Expand Down