Commit 81f65ce3 authored by John Resig's avatar John Resig

Pull in the Sizzle library dynamically using a submodule and make it part of...

Pull in the Sizzle library dynamically using a submodule and make it part of the jQuery build process.
parent bbffc99f
[submodule "test/qunit"]
path = test/qunit
url = git://github.com/jquery/qunit.git
[submodule "src/sizzle"]
path = src/sizzle
url = git://github.com/jeresig/sizzle.git
......@@ -2,7 +2,6 @@ SRC_DIR = src
BUILD_DIR = build
PREFIX = .
TEST_DIR = ${PREFIX}/test
DIST_DIR = ${PREFIX}/dist
BASE_FILES = ${SRC_DIR}/core.js\
......@@ -33,18 +32,24 @@ MINJAR = java -jar ${BUILD_DIR}/yuicompressor-2.4.2.jar
DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`
all: jquery test min
all: jquery min
@@echo "jQuery build complete."
${DIST_DIR}:
@@mkdir -p ${DIST_DIR}
jquery: ${DIST_DIR} ${JQ}
init:
@@echo "Grabbing external dependencies..."
@@git submodule init
@@git submodule update
jquery: ${DIST_DIR} selector ${JQ}
${JQ}: ${MODULES}
@@echo "Building" ${JQ}
@@mkdir -p ${DIST_DIR}
@@cat ${MODULES} | \
sed 's/Date:./&'"${DATE}"'/' | \
${VER} > ${JQ};
......@@ -52,6 +57,10 @@ ${JQ}: ${MODULES}
@@echo ${JQ} "Built"
@@echo
selector: init
@@echo "Building selector code from Sizzle"
@@sed '/EXPOSE/r src/sizzle-jquery.js' src/sizzle/sizzle.js > src/selector.js
min: ${JQ_MIN}
${JQ_MIN}: ${JQ}
......@@ -63,13 +72,9 @@ ${JQ_MIN}: ${JQ}
@@echo ${JQ_MIN} "Built"
@@echo
test: ${JQ}
@@echo "Building Test Suite"
@@echo "Test Suite Built"
@@echo
git submodule init
git submodule update
clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}
@@echo "Removing built copy of Sizzle"
@@rm src/selector.js
......@@ -24,11 +24,14 @@ What you need to build your own jQuery:
How to build your own jQuery:
In the main directory of the distribution (the one that this file is in), type
the following to make all versions of jQuery, the documentation, and the test suite:
the following to make all versions of jQuery:
make
Here are each of the individual items that are buildable from the Makefile.
make init
Pull in all the external dependencies (QUnit, Sizzle) for the project.
make jquery
The standard, uncompressed, jQuery code.
Makes: ./dist/jquery.js
......@@ -37,10 +40,9 @@ make min
A compressed version of jQuery (made the YUI Minifier).
Makes: ./dist/jquery.min.js
make test
Makes sure that the QUnit submodule is properly checked out.
Open this file in your browser:
./test/index.html
make selector
Builds the selector library for jQuery from Sizzle.
Makes: ./src/selector.js
Finally, you can remove all the built files using the command:
make clean
......
This diff is collapsed.
Subproject commit 3e97c27d19e18c984a29bfea89fcccadf3544fb3
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
return;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment