Esempio n. 1
0
# JSBuilder http://code.google.com/p/javascript-builder/

copyright = "(C) @WebReflection - Mit Style License"

import JSBuilder, string, re, os

defneProperty = JSBuilder.read(os.path.join("..", "src", "defineProperty.js"))

for dirname, dirnames, filenames in os.walk("src"):
    for subdirname in dirnames:
        subdirname = "build/" + os.path.join(dirname, subdirname)[4:]
        if not os.path.exists(subdirname):
            os.makedirs(subdirname)
    for filename in filenames:
        if filename in ["yunode.js", "yuno.package.js", "defineProperty.js"]:
            continue
        filename = os.path.join(dirname, filename)[4:]
        print("")
        print("-----------------------")
        print(filename)
        print("-----------------------")
        JSBuilder.compile(
            copyright,
            os.path.join("build", filename),
            os.path.join("build", JSBuilder.replace(filename, [".js"], [".min.js"])),
            [filename],
            ["//:inject defineProperty.js"],
            [defneProperty],
        )
        print("----------------------")
print("")
Esempio n. 2
0
# JSBuilder http://code.google.com/p/javascript-builder/

copyright = '(C) @WebReflection - Mit Style License'

import JSBuilder, string, re, os

defneProperty = JSBuilder.read(os.path.join('..', 'src', 'defineProperty.js'))

for dirname, dirnames, filenames in os.walk('src'):
    for subdirname in dirnames:
        subdirname = 'build/' + os.path.join(dirname, subdirname)[4:]
        if not os.path.exists(subdirname):
            os.makedirs(subdirname)
    for filename in filenames:
        if (filename in ["yunode.js", "yuno.package.js", "defineProperty.js"]):
            continue
        filename = os.path.join(dirname, filename)[4:]
        print("")
        print("-----------------------")
        print(filename)
        print("-----------------------")
        JSBuilder.compile(
            copyright, os.path.join('build', filename),
            os.path.join('build',
                         JSBuilder.replace(filename, ['.js'], ['.min.js'])),
            [filename], ["//:inject defineProperty.js"], [defneProperty])
        print("----------------------")
print("")

# let me read the result ...
import time
Esempio n. 3
0
        "wru.functions.js",
        "wru.js",
        "wru.variables.js",
        "wru.console.variables.js",
        "wru.shared.js",
        "wru.console.log.js",
        "wru.export.js",
        "wru.global.shortcuts.js",
        "wru.console.cursor.js",
        "wru.debug.js",
        "wru.outro.js"
    ]
)

# YUICompressor bug fixed after build
compiled = JSBuilder.read('../build/wru.console.js')
compiled = re.sub(r'\w+=global.setInterval=', 'setInterval=global.setInterval=', compiled)
compiled = re.sub(r'\w+=global.setTimeout=', 'setTimeout=global.setTimeout=', compiled)
compiled = re.sub(r'\w+=global.clearInterval=', 'clearInterval=global.clearInterval=', compiled)
compiled = re.sub(r'\w+=global.clearTimeout=', 'clearTimeout=global.clearTimeout=', compiled)
JSBuilder.write('../build/wru.console.js', compiled)

print ("----------------------")
print ("")

# web
JSBuilder.write(
    '../build/template.html',
    JSBuilder.replace(
        JSBuilder.read('../src/template.html'),
        [
Esempio n. 4
0
# node.js / Rhino console version
print("")
print("-----------------------")
print("| wru console version |")
print("-----------------------")
JSBuilder.compile(
    copyright, 'build/wru.console.max.js', 'build/wru.console.js', [
        "rhinoTimers.js", "wru.intro.js", "wru.console.functions.js",
        "wru.functions.js", "wru.js", "wru.variables.js",
        "wru.console.variables.js", "wru.shared.js", "wru.console.log.js",
        "wru.export.js", "wru.global.shortcuts.js", "wru.console.cursor.js",
        "wru.debug.js", "wru.outro.js"
    ])

# YUICompressor bug fixed after build
compiled = JSBuilder.read('../build/wru.console.js')
compiled = re.sub(r'\w+=global.setInterval=',
                  'setInterval=global.setInterval=', compiled)
compiled = re.sub(r'\w+=global.setTimeout=', 'setTimeout=global.setTimeout=',
                  compiled)
compiled = re.sub(r'\w+=global.clearInterval=',
                  'clearInterval=global.clearInterval=', compiled)
compiled = re.sub(r'\w+=global.clearTimeout=',
                  'clearTimeout=global.clearTimeout=', compiled)
JSBuilder.write('../build/wru.console.js', compiled)

print("----------------------")
print("")

# web
JSBuilder.write(