Skip to content
Permalink
Browse files

Pull in the Sizzle library dynamically using a submodule and make it …

…part of the jQuery build process.
  • Loading branch information
jeresig committed Oct 26, 2009
1 parent bbffc99 commit 81f65ce33931831dc651c5d3ebf2b31b551b6b8b
Showing with 32 additions and 1,022 deletions.
  1. +3 −0 .gitmodules
  2. +15 −10 Makefile
  3. +7 −5 README
  4. +0 −1,007 src/selector.js
  5. +1 −0 src/sizzle
  6. +6 −0 src/sizzle-jquery.js
@@ -1,3 +1,6 @@
[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,25 +32,35 @@ 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};

@@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
12 README
@@ -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

0 comments on commit 81f65ce

Please sign in to comment.
You can’t perform that action at this time.