Skip to content

Commit

Permalink
Fetch updated externs files from the web.
Browse files Browse the repository at this point in the history
  • Loading branch information
smhanov committed Apr 28, 2011
1 parent dba1a7b commit 32c9364
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 72 deletions.
22 changes: 22 additions & 0 deletions externs/jquery-mobile.js
@@ -0,0 +1,22 @@
/**
*/
jQuery.prototype.mobile = {};

/**
@param {jQuery|string} to
@param {string=} transition
@param {boolean=} back
@param {string=} changeHash
*/
jQuery.prototype.mobile.changePage = function(to, transition, back, changeHash
)
{
}

/**
@param {string} arg
*/
jQuery.prototype.listview = function(arg) {}


94 changes: 22 additions & 72 deletions jzbuild.py
Expand Up @@ -33,26 +33,6 @@
SOFTWARE.
*/
The JZBUILD software may include an "externs" file taken from the Google
Closure project. That portion is covered under this license:
/*
* Copyright 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"""

import re
Expand Down Expand Up @@ -130,6 +110,15 @@
},
}

EXTERNS = {
"jquery-1.5.js":
"http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/jquery-1.5.js",
"json.js":
"http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/json.js",
"jquery-mobile.js":
"http://github.com/smhanov/jzbuild/raw/master/externs/jquery-mobile.js",
}

VALID_COMPILERS = COMPILERS.keys();
VALID_COMPILERS.append("cat")

Expand Down Expand Up @@ -816,6 +805,14 @@ def DownloadProgram(url, fileInZip, outputPath):

return True

def DownloadExterns():
"""Downloads Closure compiler externs files, if necessary."""
for (extern,url) in EXTERNS.iteritems():
path = os.path.join( GetStorageFolder(), extern )
if not os.path.exists( path ):
print "Fetching %s" % path
file(path,"wb").write(urllib2.urlopen(url).read())

def RunCompiler(type, files, output, compilerOptions, prepend, exports):
"""Downloads and runs the compiler of the given type.
Expand Down Expand Up @@ -851,14 +848,10 @@ def RunCompiler(type, files, output, compilerOptions, prepend, exports):
cmdLine.extend( compiler["requiredOptions"] )

if type == "closure":
externs = os.path.join(GetStorageFolder(), "externs.js")
if not os.path.exists(externs):
# decompress externs file
f = file(externs, "wb")
f.write(zlib.decompress(base64.b64decode(CLOSURE_EXTERNS)))
f.close()
cmdLine.extend( ["--externs", externs ] )

DownloadExterns()
for extern in EXTERNS.keys():
cmdLine.extend( ["--externs", os.path.join( GetStorageFolder(),
extern ) ] )

if not needsStdin:
for f in files:
Expand Down Expand Up @@ -984,7 +977,7 @@ def CheckEnvironment(projects, names):
break
else:
print "Java is not installed on this system. Please install " + \
"the sun-java6-bin package or equivalent."
"the default-jre or openjdk-6-jre or sun-java6-bin package or equivalent."
okay = False

return okay
Expand Down Expand Up @@ -2249,49 +2242,6 @@ def main():
qaff0Dfxf7Z++2e897UHGrw7C3V8d7fZsjf97ndbdI8Q2Iub/ALzE3cM=
"""

CLOSURE_EXTERNS = """
eJzNW1tz2zYWfvevwGQ6U9ujUKn3aZvLVLHltdpEaiMlnjztQCQoIaEABgAta2P99z0AQZkXkSIlU0l
nOjFF8HzfuQA45xDsnp+gc3TJw5Wgs7lCFy9e/Bv9h/NZQNCAuQ7c1QPeUZcwSTwUMY8IpOYE9ULswj
/2Tgd9IkJSztCF8wKd6gHP7K1nZy+1iBWP0AKvEOMKRZKADCqRTwGH3LskVIgy5PJFGFDMXIKWVM0Nj
pWimaDPVgafKgzDMTwQwpWfHoiwsqT1f3Olwt+73eVy6WBD2OFi1g3iobL7bnDZH477z4G0fegjC4iU
SJBvERWg8HSFcAikXDwFqgFeIi4QngkC9xTXpJeCKspmHSS5r5ZYEC3Go1IJOo1UxmYJRdA8PQCshhl
61hujwfgZetsbD8YdLeR2MLkZfZyg296HD73hZNAfo9EHdDkaXg0mg9EQrq5Rb/gZ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