Пример #1
0
def build(mode='production'):
    prepare()
    print("\n-- [ BUILD STARTED ] --------------------------------------")

    packer = x3dom_packer.packer()
    
    # building compressed files
    packer.build(CORE_PROFILE, "dist/x3dom.js", "jsmin", include_version=True, src_prefix_path=SRC_ROOT)
    packer.build(FULL_PROFILE, "dist/x3dom-full.js", "jsmin", include_version=True, src_prefix_path=SRC_ROOT)
    packer.build(FULL_PHYS_PROFILE, "dist/x3dom-full-physics.js", "jsmin", include_version=True, src_prefix_path=SRC_ROOT) 	
    # add compressed external libraries to full release
    packer.build(COMPRESSED_EXT_LIBS + [("x3dom-full-physics.js", ["../dist/x3dom-full-physics.js"])], "dist/x3dom-full-physics.js", 'none', src_prefix_path=SRC_ROOT)
    
        
    if not mode == 'no-debug':
        # building plain files (debug)
        packer.build(FULL_PHYS_PROFILE, "dist/x3dom-full-physics.debug.js", 'none', src_prefix_path=SRC_ROOT)
        packer.build(FULL_PROFILE, "dist/x3dom-full.debug.js", 'none', src_prefix_path=SRC_ROOT)
        packer.build(CORE_PROFILE, "dist/x3dom.debug.js", 'none', src_prefix_path=SRC_ROOT)
        # add compressed external libraries to full release
        packer.build(COMPRESSED_EXT_LIBS + [("x3dom-full-physics.debug.js", ["../dist/x3dom-full-physics.debug.js"])], "dist/x3dom-full-physics.debug.js", 'none', src_prefix_path=SRC_ROOT)
    

    # ~~~~ copy copy components extras ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    print("\nBundling extensions...")
    nodes_dest = os.path.join(DIST_ROOT, 'components')

    if not os.path.exists(nodes_dest):
        os.makedirs(nodes_dest)
        
    for (component, files) in EXTENSIONS:
        packer.build([(component, files)], os.path.join(nodes_dest, os.path.basename(component + '.js')), 'jsmin', include_version=False, src_prefix_path=SRC_ROOT)

        try:
            """
            #Handle special case (folder instead of single js file):
            if not src.endswith(".js"):
                #Construct name for concatenated file:
                if src.endswith("/"):
                    filename = src[:-1]+".js"
                else:
                    filename = src+".js"
                print "  Copying files from folder %s concatenated as %s to %s" % (src, filename, nodes_dest)
            else:
                print "  Copying file %s to %s" % (src, nodes_dest)
                filename = src
            """
#            shutil.copy(src, nodes_dest)
        except:
            print("  Error copying file to %s" % component)
    # done with components

    print("\nCopying additional files")
    shutil.copy('README.md', DIST_ROOT)
    shutil.copy('LICENSE', DIST_ROOT)
    shutil.copy('RELEASENOTES.rst', DIST_ROOT)
    shutil.copy('AUTHORS', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3dom.css', DIST_ROOT)
    shutil.copy(LIB_ROOT + '/dash.all.js', DIST_ROOT)
    shutil.copy(LIB_ROOT + '/ammo.js', DIST_ROOT)
Пример #2
0
def build(mode='production'):
    prepare()
    print("\n-- [ BUILD STARTED ] --------------------------------------")

    packer = x3dom_packer.packer()
    
    # building compressed files
    packer.build(FULL_PROFILE, "dist/x3dom-full.js", "jsmin", include_version=True, src_prefix_path=SRC_ROOT)
    packer.build(CORE_PROFILE, "dist/x3dom.js", "jsmin", include_version=True, src_prefix_path=SRC_ROOT)
        
    if not mode == 'no-debug':
        # building plain files (debug)
        packer.build(FULL_PROFILE, "dist/x3dom-full.debug.js", 'none', src_prefix_path=SRC_ROOT)
        packer.build(CORE_PROFILE, "dist/x3dom.debug.js", 'none', src_prefix_path=SRC_ROOT)

    # ~~~~ copy copy components extras ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    print("\nBundling components...")
    nodes_dest = os.path.join(DIST_ROOT, 'components')

    if not os.path.exists(nodes_dest):
        os.makedirs(nodes_dest)
        
    for (component, files) in COMPONENTS:
        packer.build([(component, files)], os.path.join(nodes_dest, os.path.basename(component)), 'jsmin', include_version=False, src_prefix_path=SRC_ROOT)

        try:
            """
            #Handle special case (folder instead of single js file):
            if not src.endswith(".js"):
                #Construct name for concatenated file:
                if src.endswith("/"):
                    filename = src[:-1]+".js"
                else:
                    filename = src+".js"
                print "  Copying files from folder %s concatenated as %s to %s" % (src, filename, nodes_dest)
            else:
                print "  Copying file %s to %s" % (src, nodes_dest)
                filename = src
            """
#            shutil.copy(src, nodes_dest)
        except:
            print "  Error copying file to %s" % component
    # done with components
    
    # ~~ copy other files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    dist_docs = os.path.join(DIST_ROOT, 'docs')
    if not os.path.exists(dist_docs):
        os.makedirs(dist_docs)

    print("\nCopying additional files")
    shutil.copy('README.md', DIST_ROOT)
    shutil.copy('LICENSE', DIST_ROOT)
    shutil.copy('CHANGELOG', DIST_ROOT)
    shutil.copy('AUTHORS', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3dom.css', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/flashbackend/bin/x3dom.swf', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/dash.all.js', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/ammo.js', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3domBulletPhysics.js', DIST_ROOT)
Пример #3
0
def build(mode='production'):
    print("\n-- [ BUILD STARTED ] --------------------------------------")

    packer = x3dom_packer.packer()

    # building compressed files
    packer.build(prefix_path(FULL_PROFILE, SRC_ROOT), "dist/x3dom-full.js",
                 "jsmin")
    packer.build(prefix_path(CORE_PROFILE, SRC_ROOT), "dist/x3dom.js", "jsmin")

    if mode == 'debug':
        # building plain files (debug)
        packer.build(prefix_path(FULL_PROFILE, SRC_ROOT),
                     "dist/x3dom-full.debug.js", 'none')
        packer.build(prefix_path(CORE_PROFILE, SRC_ROOT),
                     "dist/x3dom.debug.js", 'none')

    # ~~~~ copy copy components extras ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    print("\nBundling components...")
    nodes_dest = os.path.join(DIST_ROOT, 'components')

    if not os.path.exists(nodes_dest):
        os.makedirs(nodes_dest)

    for src in prefix_path(COMPONENTS, SRC_ROOT):
        try:
            print "  Copying file %s to %s" % (src, nodes_dest)
            packer.build([src],
                         os.path.join(nodes_dest, os.path.basename(src)),
                         'jsmin',
                         include_version=False)


#            shutil.copy(src, nodes_dest)
        except:
            print "  Error copying file %s" % src
    # done with components

    # ~~ copy other files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    dist_docs = os.path.join(DIST_ROOT, 'docs')
    if not os.path.exists(dist_docs):
        os.makedirs(dist_docs)

    print("\nCopying additional files")
    shutil.copy('README.md', DIST_ROOT)
    shutil.copy('LICENSE', DIST_ROOT)
    shutil.copy('CHANGELOG', DIST_ROOT)
    shutil.copy('AUTHORS', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3dom.css', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/flashbackend/bin/x3dom.swf', DIST_ROOT)
    shutil.copy(DOC_ROOT + '/help/dumpNodeTypeTree.html', DIST_ROOT + '/docs')
Пример #4
0
def build(mode='production'):
    prepare()
    print("\n-- [ BUILD STARTED ] --------------------------------------")

    packer = x3dom_packer.packer()
    
    # building compressed files
    packer.build(prefix_path(FULL_PROFILE, SRC_ROOT), "dist/x3dom-full.js", "jsmin", include_version=True)
    packer.build(prefix_path(CORE_PROFILE, SRC_ROOT), "dist/x3dom.js", "jsmin", include_version=True)
        
    if not mode == 'no-debug':
        # building plain files (debug)
        packer.build(prefix_path(FULL_PROFILE, SRC_ROOT), "dist/x3dom-full.debug.js", 'none')
        packer.build(prefix_path(CORE_PROFILE, SRC_ROOT), "dist/x3dom.debug.js", 'none')

    # ~~~~ copy copy components extras ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    print("\nBundling components...")
    nodes_dest = os.path.join(DIST_ROOT, 'components')

    if not os.path.exists(nodes_dest):
        os.makedirs(nodes_dest)
        
    for src in prefix_path(COMPONENTS, SRC_ROOT):
        try:
            print "  Copying file %s to %s" % (src, nodes_dest)
            packer.build([src], os.path.join(nodes_dest, os.path.basename(src)), 'jsmin', include_version=False)
#            shutil.copy(src, nodes_dest)
        except:
            print "  Error copying file %s" % src
    # done with components
    
    # ~~ copy other files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    dist_docs = os.path.join(DIST_ROOT, 'docs')
    if not os.path.exists(dist_docs):
        os.makedirs(dist_docs)

    print("\nCopying additional files")
    shutil.copy('README.md', DIST_ROOT)
    shutil.copy('LICENSE', DIST_ROOT)
    shutil.copy('CHANGELOG', DIST_ROOT)
    shutil.copy('AUTHORS', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3dom.css', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/flashbackend/bin/x3dom.swf', DIST_ROOT)
    shutil.copy(DOC_ROOT + '/help/dumpNodeTypeTree.html', DIST_ROOT + '/docs')
    shutil.copy(SRC_ROOT + '/dash.all.js', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/ammo.js', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3domBulletPhysics.js', DIST_ROOT)
Пример #5
0
def build(mode='production'):
    prepare()
    print("\n-- [ BUILD STARTED ] --------------------------------------")

    packer = x3dom_packer.packer()

    # building compressed files
    packer.build(CORE_PROFILE,
                 "dist/x3dom.js",
                 "jsmin",
                 include_version=True,
                 src_prefix_path=SRC_ROOT)
    packer.build(FULL_PROFILE,
                 "dist/x3dom-full.js",
                 "jsmin",
                 include_version=True,
                 src_prefix_path=SRC_ROOT)
    packer.build(FULL_PHYS_PROFILE,
                 "dist/x3dom-full-physics.js",
                 "jsmin",
                 include_version=True,
                 src_prefix_path=SRC_ROOT)
    # add compressed external libraries to full release
    packer.build(
        COMPRESSED_EXT_LIBS +
        [("x3dom-full-physics.js", ["../dist/x3dom-full-physics.js"])],
        "dist/x3dom-full-physics.js",
        'none',
        src_prefix_path=SRC_ROOT)

    if not mode == 'no-debug':
        # building plain files (debug)
        packer.build(FULL_PHYS_PROFILE,
                     "dist/x3dom-full-physics.debug.js",
                     'none',
                     src_prefix_path=SRC_ROOT)
        packer.build(FULL_PROFILE,
                     "dist/x3dom-full.debug.js",
                     'none',
                     src_prefix_path=SRC_ROOT)
        packer.build(CORE_PROFILE,
                     "dist/x3dom.debug.js",
                     'none',
                     src_prefix_path=SRC_ROOT)
        # add compressed external libraries to full release
        packer.build(COMPRESSED_EXT_LIBS +
                     [("x3dom-full-physics.debug.js",
                       ["../dist/x3dom-full-physics.debug.js"])],
                     "dist/x3dom-full-physics.debug.js",
                     'none',
                     src_prefix_path=SRC_ROOT)

    # ~~~~ copy copy components extras ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    print("\nBundling extensions...")
    nodes_dest = os.path.join(DIST_ROOT, 'components')

    if not os.path.exists(nodes_dest):
        os.makedirs(nodes_dest)

    for (component, files) in EXTENSIONS:
        packer.build([(component, files)],
                     os.path.join(nodes_dest,
                                  os.path.basename(component + '.js')),
                     'jsmin',
                     include_version=False,
                     src_prefix_path=SRC_ROOT)

        try:
            """
            #Handle special case (folder instead of single js file):
            if not src.endswith(".js"):
                #Construct name for concatenated file:
                if src.endswith("/"):
                    filename = src[:-1]+".js"
                else:
                    filename = src+".js"
                print "  Copying files from folder %s concatenated as %s to %s" % (src, filename, nodes_dest)
            else:
                print "  Copying file %s to %s" % (src, nodes_dest)
                filename = src
            """


#            shutil.copy(src, nodes_dest)
        except:
            print("  Error copying file to %s" % component)
    # done with components

    print("\nCopying additional files")
    shutil.copy('README.md', DIST_ROOT)
    shutil.copy('LICENSE', DIST_ROOT)
    shutil.copy('RELEASENOTES.rst', DIST_ROOT)
    shutil.copy('AUTHORS', DIST_ROOT)
    shutil.copy(SRC_ROOT + '/x3dom.css', DIST_ROOT)
    shutil.copy(LIB_ROOT + '/dash.all.js', DIST_ROOT)
    shutil.copy(LIB_ROOT + '/ammo.js', DIST_ROOT)