Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/jquery/jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
rkatic committed Mar 14, 2010
2 parents c8fc687 + ba8938d commit 5cba876
Show file tree
Hide file tree
Showing 20 changed files with 5,996 additions and 365 deletions.
13 changes: 9 additions & 4 deletions Makefile
Expand Up @@ -29,11 +29,12 @@ JQ_MIN = ${DIST_DIR}/jquery.min.js
JQ_VER = `cat version.txt`
VER = sed s/@VERSION/${JQ_VER}/

RHINO = java -jar ${BUILD_DIR}/js.jar
MINJAR = java -jar ${BUILD_DIR}/google-compiler-20091218.jar

DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`

all: jquery min
all: jquery lint min
@@echo "jQuery build complete."

${DIST_DIR}:
Expand All @@ -49,7 +50,7 @@ init:
jquery: ${DIST_DIR} selector ${JQ}
jq: ${DIST_DIR} ${JQ}

${JQ}: ${MODULES}
${JQ}: selector ${MODULES}
@@echo "Building" ${JQ}

@@mkdir -p ${DIST_DIR}
Expand All @@ -58,9 +59,13 @@ ${JQ}: ${MODULES}
sed 's/Date:./&'"${DATE}"'/' | \
${VER} > ${JQ};

selector: init
selector: ${DIST_DIR} init
@@echo "Building selector code from Sizzle"
@@sed '/EXPOSE/r src/sizzle-jquery.js' src/sizzle/sizzle.js > src/selector.js
@@sed '/EXPOSE/r src/sizzle-jquery.js' src/sizzle/sizzle.js | grep -v window.Sizzle > src/selector.js

lint: ${JQ}
@@echo "Checking jQuery against JSLint..."
@@${RHINO} build/jslint-check.js

min: ${JQ_MIN}

Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -36,6 +36,10 @@ Makes: ./dist/jquery.js
A compressed version of jQuery (made the Closure Compiler).
Makes: ./dist/jquery.min.js

`make lint`

Tests a build of jQuery against JSLint, looking for potential errors or bits of confusing code.

`make selector`

Builds the selector library for jQuery from Sizzle.
Expand All @@ -50,10 +54,6 @@ directory, you can specify the PREFIX directory, for example:

`make PREFIX=/home/john/test/`

OR

`make PREFIX=~/www/ docs`

If you have any questions, please feel free to ask them on the jQuery
mailing list, which can be found here:
[http://docs.jquery.com/Discussion](http://docs.jquery.com/Discussion)
Binary file added build/js.jar
Binary file not shown.
36 changes: 36 additions & 0 deletions build/jslint-check.js
@@ -0,0 +1,36 @@
load("build/jslint.js");

var src = readFile("dist/jquery.js");

JSLINT(src, { evil: true, forin: true });

// All of the following are known issues that we think are 'ok'
// (in contradiction with JSLint) more information here:
// http://docs.jquery.com/JQuery_Core_Style_Guidelines
var ok = {
"Expected an identifier and instead saw 'undefined' (a reserved word).": true,
"Use '===' to compare with 'null'.": true,
"Use '!==' to compare with 'null'.": true,
"Expected an assignment or function call and instead saw an expression.": true,
"Expected a 'break' statement before 'case'.": true

};

var e = JSLINT.errors, found = 0, w;

for ( var i = 0; i < e.length; i++ ) {
w = e[i];

if ( !ok[ w.reason ] ) {
found++;
print( "\n" + w.evidence + "\n" );
print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
}
}

if ( found > 0 ) {
print( "\n" + found + " Error(s) found." );

} else {
print( "JSLint check passed." );
}

0 comments on commit 5cba876

Please sign in to comment.