Exemplo n.º 1
0
def tests():
  # ============================
  # Build tests
  # ============================
    sed = Sed()
    PH.replacer(sed)

    # Get the remoty shims first
    remoty = Yak.links["airstrip"]["url"].split('/')
    remoty.pop()
    remoty = '/'.join(remoty)
    sed.add('{AIRSTRIP-BASE}', remoty)

    # Python doesn't support SNI :(((( - SUCKS!
    # https://github.com/kennethreitz/requests/issues/749
    yam = json.loads(http.get(Yak.links["airstrip"]["url"], verify=False).text)[Yak.links["airstrip"]["version"]]

    # Prep-up the jasmine links
    for i in yam['jasmine']:
      if (Yak.istrunk and i.find('trunk') != -1) or ((not Yak.istrunk) and i.find('stable') != -1):
        if i.find('.css') != -1:
          sed.add('{SPIT-JASCSS}', remoty + '/' + i.replace('.css', ''))#.replace('.css', '-min.css'))
        elif i.find('.html') != -1:
          sed.add('{SPIT-JASHTML}', remoty + '/' + i.replace('.js', ''))#.replace('.js', '-min.js'))
        else:
          sed.add('{SPIT-JAS}', remoty + '/' + i.replace('.js', ''))#.replace('.js', '-min.js'))


    list = FileList("src/tests", filter="*.js,*.html", exclude="*xxx*")
    deepcopy(list, Yak.build_root + '/tests', replace=sed)

    # Can't access from raw github using IE (mimetype mismatch, bitch)
    list = [
      "https://raw.github.com/kriskowal/es5-shim/master/tests/helpers/h.js",
      "https://raw.github.com/kriskowal/es5-shim/master/tests/helpers/h-matchers.js",
      "https://raw.github.com/kriskowal/es5-shim/master/tests/spec/s-array.js",
      "https://raw.github.com/kriskowal/es5-shim/master/tests/spec/s-function.js",
      "https://raw.github.com/kriskowal/es5-shim/master/tests/spec/s-string.js",
      "https://raw.github.com/kriskowal/es5-shim/master/tests/spec/s-object.js",
      "https://raw.github.com/kriskowal/es5-shim/master/tests/spec/s-date.js"
    ]
    deepcopy(list, Yak.build_root + '/tests/es5/');
Exemplo n.º 2
0
def build():
    sed = Sed()
    PH.replacer(sed)

    bootman = PH.getmanifest('jsboot')

    sed.add(
        '{JSBOOT}', bootman['jsbootstrap'].encode('latin-1').replace(
            'only.jsboot.js', 'only.jsboot-min.js'))
    sed.add('{MINIBOOT}', 'miniboot-min.js')

    sed.add('{PUKE-SERVICE-HOST}', Yak.service['host'])
    sed.add('{PUKE-SERVICE-PORT}', Yak.service['port'])

    # sed.add('{PUKE_ANALYTICS}', Yak.ACCESS['GA'])
    # sed.add('{PUKE_FBKEY}', Yak.ACCESS['FACEBOOK']['KEY'])
    # sed.add('{PUKE_KEY}', Yak.ACCESS['LXXL']['KEY'])
    # sed.add('{PUKE_SECRET}', Yak.ACCESS['LXXL']['SECRET'])

    BOOTSTRAP_BUILD = FileSystem.join(Yak.build_root)
    VERSIONED_ROOT = FileSystem.join(Yak.build_root, Yak.package['version'])

    # ================================
    # Bootstrap
    # ================================
    miniboot = FileList("src/miniboot/common/", filter="*.js")
    combine(miniboot, BOOTSTRAP_BUILD + '/miniboot.js', replace=sed)
    combine(miniboot, BOOTSTRAP_BUILD + '/miniboot-min.js', replace=sed)

    copyfile("src/miniboot/miniboot.ico", Yak.build_root + "/miniboot.ico")
    copyfile("src/miniboot/miniboot.png", Yak.build_root + "/miniboot.png")

    combine('src/miniboot/index.html',
            BOOTSTRAP_BUILD + '/index.html',
            replace=sed)

    # ================================
    # Modeling as an Ember application
    # ================================

    # ================================
    # Helpers libraries
    # ================================
    helpers = FileList('src', filter='*libs*')
    deepcopy(helpers, Yak.build_root)

    # ================================
    # Standalone activity viewer
    # ================================

    # spitman = PH.getmanifest('spitfire', '0.1', istrunk)
    # bootman = PH.getmanifest('jsboot', '0.1', istrunk)
    # actlist = [
    #   spitman['spitfire-lab'],
    #   'src/onegateisopening/boot.js',
    # ]
    # combine(spitfireList, Yak.BUILD_ROOT + "/there.is.only.jsboot.js", replace=sed)

    # ================================
    # Versioned part of the app
    # ================================
    lxxl = [
        'src/lxxl/data.js', 'src/lxxl/mutable.js',
        'src/lxxl/service/activities.js', 'src/lxxl/service/blob.js',
        'src/lxxl/service/user.js', 'src/lxxl/model/model.js',
        'src/lxxl/factories.js'
    ]
    combine(lxxl, VERSIONED_ROOT + "/lxxl-standalone-library.js", replace=sed)

    #js application
    js = FileList("src/app/common/helpers", filter="*.js")
    js.merge(FileList("src/app/common/", filter="*i18n.js"))
    js.merge(FileList("src/app/common/root", filter="*.js"))
    js.merge(FileList("src/app/common/states", filter="*.js"))
    js.merge(FileList("src/app/common/models", filter="*.js"))
    js.merge(FileList("src/app/common/controllers", filter="*.js"))
    js.merge(FileList("src/app/common/views", filter="*.js"))
    # js.merge(FileList("src/app/desktop/", filter = "*app.js"))
    # js.merge(FileList("src/app/desktop/states", filter = "*.js"))
    # js.merge(FileList("src/app/desktop/models", filter = "*.js"))
    # js.merge(FileList("src/app/desktop/controllers", filter = "*.js"))
    # js.merge(FileList("src/app/desktop/views", filter = "*.js"))

    js.merge("src/activity/apiwrapper.js")
    js.merge("src/activity/scoring.js")
    js.merge("src/activity/activity.js")

    combine(js, VERSIONED_ROOT + "/lxxl.js", replace=sed)

    deepcopy('src/activity/scorm/', VERSIONED_ROOT)

    # js.merge(FileList("src/app/desktop/", filter = "*routing.js"))
    # js.merge(FileList("src/app/desktop/", filter = "*hotkeys.js"))
    # js.merge(FileList("src/app/desktop/model/", filter = "*.js"))
    # js.merge(FileList("src/app/desktop/views/", filter = "*.js"))
    # js.merge(FileList("src/app/desktop/states/", filter = "*.js"))

    # css application
    css = FileList("src/assets/common/css", filter="*.css,*.scss")
    # css.merge("src/activity/activity.scss")
    # css.merge(FileList("src/assets/desktop/css", filter = "*.css,*.scss"))
    combine(css, VERSIONED_ROOT + "/lxxl.css", replace=sed)

    # fonts copy
    # fonts = FileList("src/assets/common/fonts/")
    # fonts.merge(FileList("src/assets/desktop/fonts/"))
    # deepcopy(fonts, VERSIONED_ROOT + '/fonts/')

    # images copy
    images = FileList('src/assets/common/images',
                      filter="*.jpg,*.png,*.gif,*.ico")
    # images.merge(FileList('src/assets/desktop/images', filter = "*.jpg,*.png,*.gif,*.ico"))
    deepcopy(images, VERSIONED_ROOT + "/images/")

    # templates merge
    templates = FileList('src/app/common/templates', filter="*.tpl")
    # templates.merge(FileList("src/app/desktop/templates/", filter = "*.tpl"))
    combine(templates, VERSIONED_ROOT + "/lxxl.tpl")

    # ================================
    # Versioned runner
    # ================================

    list = FileList('src', filter='*activity*')
    deepcopy(list, VERSIONED_ROOT, replace=sed)
    combine(lxxl,
            VERSIONED_ROOT + "/activity/lxxl-standalone-library.js",
            replace=sed)

    # combine("src/activity/activity.tpl", VERSIONED_ROOT + "/activity.tpl", replace=sed)
    # css.merge(FileList("src/assets/desktop/css", filter = "*.css,*.scss"))

    combine("src/activity/activity.scss",
            VERSIONED_ROOT + "/activity/activity.css",
            replace=sed)
    combine("src/activity/miniboot.js",
            VERSIONED_ROOT + "/activity/miniboot-min.js",
            replace=sed)

    # XXX new stuff
    deepcopy("src/miniapp", Yak.build_root + "/miniapp", replace=sed)
Exemplo n.º 3
0
def build():
  # ============================
  # Basic stuff
  # ============================
  sed = Sed()
  PH.replacer(sed)

    # # Get the remoty shims first
    # remoty = Yak.links["jsboot"]["url"].split('/')
    # remoty.pop()
    # remoty = '/'.join(remoty)
    # yam = json.loads(http.get(Yak.links["jsboot"]["url"], verify=False).text)[Yak.links["jsboot"]["version"]]



  # ================================
  # Modeling as an Ember application
  # ================================

  # ================================
  # Bootstrap
  # ================================
  VERSIONED_ROOT = FileSystem.join(Yak.build_root, Yak.package['version']);

  # First, merge in bootstraps
  js = FileList("src/bootstrap/common/" , filter="*.js")
  # js.merge(FileList("src/bootstrap/desktop/", filter = "*.js"))

  # css = FileList("src/bootstrap/common/" , filter="*.css,*.scss")
  # css.merge(FileList("src/bootstrap/desktop/", filter = "*.css,*.scss"))

  # Now generate min and non min version

  sed.add('{PUKE-BOOT-ROOT}', Yak.package['version'])

  copyfile("src/bootstrap/miniboot.ico", Yak.build_root + "/miniboot.ico")
  copyfile("src/bootstrap/miniboot.png", Yak.build_root + "/miniboot.png")

  bootman = PH.getmanifest('jsboot', usemin = True)
  sed.add('{JSBOOT}', bootman['jsbootstrap'].encode('latin-1'))
  sed.add('{MINIBOOT}', 'miniboot-min.js')
  combine(js, Yak.build_root + "/miniboot-min.js", replace=sed)
  # combine(css, Yak.build_root + "/miniboot-min.css", replace=sed)

  combine('src/bootstrap/index.html', Yak.build_root + '/index.html', replace=sed)

  # copyfile('src/bootstrap/taupale.json', Yak.build_root)
  # copyfile('src/bootstrap/taupale.tpl', Yak.build_root)
  # XXX
  # combine('src/test.jqz', Yak.build_root + '/test.jqz', replace=sed)



  # ================================
  # Versioned part of the app
  # ================================

  #js application
  js = FileList("src/app/common/helpers", filter = "*.js")

  list = [
    "src/lib/closure.js",

    "src/lib/github/error.js",
    "src/lib/github/core.js",
    "src/lib/github/auth.js",
    "src/lib/github/users.js",
    "src/lib/github/organizations.js",
    "src/lib/github/teams.js",
    "src/lib/github/repositories.js",
    "src/lib/github/search.js",

    "src/lib/jscore/eventdispatcher.js",
    "src/lib/jscore/mutable.js",
    "src/lib/jscore/utils.js",

    "src/lib/gitbay/base.js",
    "src/lib/gitbay/user.js",
    "src/lib/gitbay/organization.js",
    "src/lib/gitbay/team.js",
    "src/lib/gitbay/repository.js",
    "src/lib/gitbay/search.js",
    "src/lib/gitbay/factory.js"
  ]
  js.merge(list)

  js.merge(FileList("src/app/common/", filter = "*i18n.js"))
  js.merge(FileList("src/app/common/root", filter = "*.js"))
  js.merge(FileList("src/app/common/states", filter = "*.js"))
  js.merge(FileList("src/app/common/models", filter = "*.js"))
  js.merge(FileList("src/app/common/controllers", filter = "*.js"))
  js.merge(FileList("src/app/common/views", filter = "*.js"))

  md = FileList('src/lib/markdown', filter="*.js")
  js.merge(md)

  # js.merge(FileList('src/lib/prettify', filter="*.js"))

  js.merge(FileList('src/lib/skimify', filter="*.js"))

  combine(js, VERSIONED_ROOT + "/gitbay.js", replace=sed)


  # css application
  css = FileList("src/assets/common/css", filter = "*.css,*.scss")

  # css.merge(FileList("src/assets/desktop/css", filter = "*.css,*.scss"))
  combine(css, VERSIONED_ROOT + "/gitbay.css", replace=sed)


  # images copy
  images = FileList('src/assets/common/images', filter = "*.jpg,*.png,*.gif,*.ico")
  # images.merge(FileList('src/assets/desktop/images', filter = "*.jpg,*.png,*.gif,*.ico"))
  deepcopy(images, VERSIONED_ROOT + "/images/")


  # images copy
  fonts = FileList('src/assets/common/fonts', filter = "*.eot,*.svg,*.ttf,*.woff")
  # images.merge(FileList('src/assets/desktop/images', filter = "*.jpg,*.png,*.gif,*.ico"))
  deepcopy(fonts, VERSIONED_ROOT + "/fonts/")

  # templates merge
  templates = FileList('src/app/common/templates', filter = "*.tpl")
  # templates.merge(FileList("src/app/desktop/templates/", filter = "*.tpl"))
  combine(templates, VERSIONED_ROOT +  "/gitbay.tpl")
Exemplo n.º 4
0
def build(buildonly = False):
  # Crossdomain
  sed = Sed()
  sed.add("<\!--.*-->\s*", "")
  combine("src/crossdomain.xml", Yak.build_root + "/crossdomain.xml", replace = sed)

  # Robots
  sed = Sed()
  # XXX partially f****d-up
  sed.add("(?:^|\n+)(?:#[^\n]*\n*)+", "")
  combine("src/robots.txt", Yak.build_root + "/robots.txt", replace = sed)

  # Deepcopy other stuff
  sed = Sed()
  PH.replacer(sed)
  list = FileList("src/", exclude="*robots.txt,*crossdomain.xml,*index.html")
  deepcopy(list, Yak.build_root, replace=sed)


  # Process the remote leaves
  description = {}

  # Yak.collection.items()
  colls = PH.getyanks()
  # print Yak.collection
  # for name in Yak.collection:
  #   print name
  for name in colls:
    packinfo = colls[name]
    # Temporary and build output directories definitions
    tmpdir = FileSystem.join(Yak.tmp_root, "lib", packinfo["Destination"], name)
    builddir = FileSystem.join(Yak.build_root, "lib", packinfo["Destination"], name)

    desclist = []
    marker = 'lib/%s/' % packinfo["Destination"]
    for(localname, url) in packinfo["Source"].items():
      # Do the fetch of 
      PH.fetchone(url, tmpdir, localname)
      # Copy files that "exists" to build directory
      f = FileSystem.join(tmpdir, localname)
      if FileSystem.exists(f):
        d = FileSystem.join(builddir, localname)
        # if not FileSystem.exists(FileSystem.dirname(d)):
        #   FileSystem.makedir(FileSystem.dirname(d));
        FileSystem.copyfile(f, d)
        # Augment desclist with provided localname
        desclist += [FileSystem.join(marker, name, localname)]

    if "Build" in packinfo:
      buildinfo = packinfo["Build"]
      production = buildinfo["production"]
      tmpdir = FileSystem.join(tmpdir, buildinfo["dir"])
      extra = ''
      if 'args' in buildinfo:
        extra = buildinfo["args"]
      if not buildonly or buildonly == name:
        PH.make(tmpdir, buildinfo["type"], extra)

      # Copy production to build dir
      for(local, builded) in production.items():
        f = FileSystem.join(tmpdir, builded)
        d = FileSystem.join(builddir, local)
        desclist += [FileSystem.join(marker, name, local)]
        if FileSystem.isfile(f):
          FileSystem.copyfile(f, d)
        elif FileSystem.isdir(f):
          deepcopy(FileList(f), d)

      # ["coin%s" % key for key in ['item1', 'item2']]


      # map((lambda item: "%s%s" % (name, item)), ['item1', 'item2'])
      # # Augment description list with build result
      # bitch = production.keys();

      # for x in bitch:
      #   bitch[x] = FileSystem.join(name, bitch[x]);

      # print bitch
      # raise "toto"

      # desclist = desclist + production.keys()

    description[name] = desclist
    # description[name] = "%s%s" % (name, marker, ('",\n"%s' % marker).join(desclist)))

    # miam += """
    #   %s:
    #     ["%s%s"]
    # """ % (name, marker, ('", "%s' % marker).join(desclist))
  # FileSystem.writefile(FileSystem.join(Yak.build_root, "airstrip.yaml"), yaml.dump(yaml.load('\n'.join(description))))


    # print json.dumps(description)
    # raise "toto"

  shortversion = Yak.package['version'].split('-').pop(0).split('.')
  shortversion = shortversion[0] + "." + shortversion[1]
  PH.describe(shortversion, "airstrip", description)
  # Write description file
  # FileSystem.writefile(FileSystem.join(Yak.build_root, "airstrip.json"), '{%s}' % ',\n'.join(description))

  # Build-up the description file
  file = "src/index.html"
  sed.add("{PUKE-LIST}", json.dumps(description, indent=4))
  deepcopy(file, Yak.build_root, replace=sed)
Exemplo n.º 5
0
def build():
  # ============================
  # Basic stuff
  # ============================
    sed = Sed()
    PH.replacer(sed)

    # Get the remoty shims first
    remoty = Yak.links["airstrip"]["url"].split('/')
    remoty.pop()
    remoty = '/'.join(remoty)
    yam = json.loads(http.get(Yak.links["airstrip"]["url"], verify=False).text)[Yak.links["airstrip"]["version"]]

    # Allow to test separate loaders as well
    # print yam
    # for i in yam['yahoo']:
    #   if (i.find('trunk') == -1) or istrunk:
    #     sed.add('{SPIT-YAHOO}', remoty + '/' + i)#.replace('.css', '-min.css'))
    # print yam
    # for i in yam['head']:
    #   if (i.find('trunk') == -1) or istrunk:
    #     sed.add('{SPIT-HEAD}', remoty + '/' + i)#.replace('.css', '-min.css'))


  # ============================
  # Get the external shims
  # ============================
    allshims = FileList("src/burnscars", filter="*.js", exclude="*xxx*")
    for (k, elem) in {
      'json3': 'json3',
      'xmlhttprequest': 'xmlhttprequest',
      'es5-shim': 'es5',
      'es5-sham': 'es5',
      'console': 'console'
    }.items():
      candidate = ''
      for i in yam[elem]:
        if (Yak.istrunk and i.find('trunk') != -1) or ((not Yak.istrunk) and i.find('stable') != -1) and (i.find(k) != -1):
          candidate = remoty + '/' + i
          allshims.merge([candidate])
          break
      combine(['src/strict.js', candidate], '%s/burnscars/%s.js' % (Yak.build_root, k), replace=sed)
      sed.add('{SPIT-%s}' % k.upper(), k)

  # ============================
  # Get local shims and vanilla flavors
  # ============================
    deepcopy(FileList("src/burnscars", filter="*.js,*.html", exclude="*xxx*"), Yak.build_root + '/burnscars', replace=sed)
    deepcopy("src/shimer.js", Yak.build_root, replace=sed)
    deepcopy("src/loader.js", Yak.build_root, replace=sed)
    deepcopy("src/gulliver.js", Yak.build_root, replace=sed)
    combine(["src/loader.js", "src/shimer.js"], Yak.build_root + '/spitfire.js', replace=sed)

  # ============================
  # Prep-up the manifest
  # ============================
    shortversion = Yak.package['version'].split('-').pop(0).split('.')
    shortversion = shortversion[0] + "." + shortversion[1]
    spitroot = Yak.package['name'] + "/" + shortversion

    # All in one shim
    combine(allshims, Yak.build_root + '/burnscars.js', replace=sed)

  # ============================
  # Build tainted loaders
  # ============================
    for elem in ['lab', 'head', 'require']:
      candidate = ''
      for i in yam[elem]:
        if (Yak.istrunk and i.find('trunk') != -1) or ((not Yak.istrunk) and i.find('stable') != -1):
          candidate = remoty + '/' + i
          break
      combine(['src/strict.js', candidate, 'src/loader.js'], '%s/loader-%s.js' % (Yak.build_root, elem), replace=sed)

    # YepNope and Yahoo are crap and don't support strict mode
    candidate = ''
    elem = 'yahoo'
    for i in yam[elem]:
      if (Yak.istrunk and i.find('trunk') != -1) or ((not Yak.istrunk) and i.find('stable') != -1):
        candidate = remoty + '/' + i
        break
    combine([candidate, 'src/loader.js'], '%s/loader-%s.js' % (Yak.build_root, elem), replace=sed)

    candidate = ''
    elem = 'yepnope'
    for i in yam[elem]:
      if (Yak.istrunk and i.find('trunk') != -1) or ((not Yak.istrunk) and i.find('stable') != -1):
        candidate = remoty + '/' + i
        break
    combine([candidate, 'src/loader.js'], '%s/loader-%s.js' % (Yak.build_root, elem), replace=sed)


  # ============================
  # Build all-in-one
  # ============================
    for elem in ['lab', 'head', 'require', 'yepnope', 'yahoo']:
      combine(['%s/loader-%s.js' % (Yak.build_root, elem), '%s/shimer.js' % Yak.build_root], '%s/spitfire-%s.js' % (Yak.build_root, elem), replace=sed)

  # ============================
  # Build manifest itself
  # ============================
    description = {}
    # Separate components
    description["shimer"] = '%s/shimer.js' % spitroot;
    description["gulliver"] = '%s/gulliver.js' % spitroot;
    description["loader"] = '%s/loader.js' % spitroot;
    # Tainted loaders
    for elem in ['lab', 'head', 'require', 'yahoo', 'yepnope']:
      description["loader-%s" % elem] = "%s/loader-%s.js" % (spitroot, elem)

    # Standalone shims that can be used bundled by build systems
    description["json"] = '%s/burnscars/json3.js' % spitroot;
    description["xhr"] = '%s/burnscars/xmlhttprequest.js' % spitroot;
    description["es5"] = '%s/burnscars/es5-shim.js' % spitroot;
    description["console"] = '%s/burnscars/console.js' % spitroot;
    # All-in-one shim
    description["burnscars"] = '%s/burnscars.js' % spitroot;

    # The actual spitfire (loader + shimer)
    description["spitfire"] = '%s/spitfire.js' % spitroot;
    # And the tainted versions
    for elem in ['lab', 'head', 'require', 'yahoo', 'yepnope']:
      description["spitfire-%s" % elem] = "%s/spitfire-%s.js" % (spitroot, elem)


    PH.describe(shortversion, "spitfire", description)
Exemplo n.º 6
0
def build():
  sed = Sed()
  PH.replacer(sed)

  bootman = PH.getmanifest('jsboot')

  sed.add('{JSBOOT}', bootman['jsbootstrap'].encode('latin-1').replace('only.jsboot.js', 'only.jsboot-min.js'))
  sed.add('{MINIBOOT}', 'miniboot-min.js')

  sed.add('{PUKE-SERVICE-HOST}', Yak.service['host'])
  sed.add('{PUKE-SERVICE-PORT}', Yak.service['port'])

  # sed.add('{PUKE_ANALYTICS}', Yak.ACCESS['GA'])
  # sed.add('{PUKE_FBKEY}', Yak.ACCESS['FACEBOOK']['KEY'])
  # sed.add('{PUKE_KEY}', Yak.ACCESS['LXXL']['KEY'])
  # sed.add('{PUKE_SECRET}', Yak.ACCESS['LXXL']['SECRET'])

  BOOTSTRAP_BUILD = FileSystem.join(Yak.build_root)
  VERSIONED_ROOT = FileSystem.join(Yak.build_root, Yak.package['version'])


  # ================================
  # Bootstrap
  # ================================
  miniboot = FileList("src/miniboot/common/" , filter="*.js")
  combine(miniboot, BOOTSTRAP_BUILD + '/miniboot.js', replace=sed)
  combine(miniboot, BOOTSTRAP_BUILD + '/miniboot-min.js', replace=sed)

  copyfile("src/miniboot/miniboot.ico", Yak.build_root + "/miniboot.ico")
  copyfile("src/miniboot/miniboot.png", Yak.build_root + "/miniboot.png")


  combine('src/miniboot/index.html', BOOTSTRAP_BUILD + '/index.html', replace=sed)



  # ================================
  # Modeling as an Ember application
  # ================================

  # ================================
  # Helpers libraries
  # ================================
  helpers = FileList('src', filter = '*libs*')
  deepcopy(helpers, Yak.build_root);


  # ================================
  # Standalone activity viewer
  # ================================

  # spitman = PH.getmanifest('spitfire', '0.1', istrunk)
  # bootman = PH.getmanifest('jsboot', '0.1', istrunk)
  # actlist = [
  #   spitman['spitfire-lab'],
  #   'src/onegateisopening/boot.js',
  # ]
  # combine(spitfireList, Yak.BUILD_ROOT + "/there.is.only.jsboot.js", replace=sed)




  # ================================
  # Versioned part of the app
  # ================================
  lxxl = [
    'src/lxxl/data.js',
    'src/lxxl/mutable.js',
    'src/lxxl/service/activities.js',
    'src/lxxl/service/blob.js',
    'src/lxxl/service/user.js',
    'src/lxxl/model/model.js',
    'src/lxxl/factories.js'
  ]
  combine(lxxl, VERSIONED_ROOT + "/lxxl-standalone-library.js", replace=sed)

  #js application
  js = FileList("src/app/common/helpers", filter = "*.js")
  js.merge(FileList("src/app/common/", filter = "*i18n.js"))
  js.merge(FileList("src/app/common/root", filter = "*.js"))
  js.merge(FileList("src/app/common/states", filter = "*.js"))
  js.merge(FileList("src/app/common/models", filter = "*.js"))
  js.merge(FileList("src/app/common/controllers", filter = "*.js"))
  js.merge(FileList("src/app/common/views", filter = "*.js"))
  # js.merge(FileList("src/app/desktop/", filter = "*app.js"))
  # js.merge(FileList("src/app/desktop/states", filter = "*.js"))
  # js.merge(FileList("src/app/desktop/models", filter = "*.js"))
  # js.merge(FileList("src/app/desktop/controllers", filter = "*.js"))
  # js.merge(FileList("src/app/desktop/views", filter = "*.js"))

  js.merge("src/activity/apiwrapper.js")
  js.merge("src/activity/scoring.js")
  js.merge("src/activity/activity.js")

  combine(js, VERSIONED_ROOT + "/lxxl.js", replace=sed)

  deepcopy('src/activity/scorm/', VERSIONED_ROOT);


  # js.merge(FileList("src/app/desktop/", filter = "*routing.js"))
  # js.merge(FileList("src/app/desktop/", filter = "*hotkeys.js"))
  # js.merge(FileList("src/app/desktop/model/", filter = "*.js"))
  # js.merge(FileList("src/app/desktop/views/", filter = "*.js"))
  # js.merge(FileList("src/app/desktop/states/", filter = "*.js"))


  # css application
  css = FileList("src/assets/common/css", filter = "*.css,*.scss")
  # css.merge("src/activity/activity.scss")
  # css.merge(FileList("src/assets/desktop/css", filter = "*.css,*.scss"))
  combine(css, VERSIONED_ROOT + "/lxxl.css", replace=sed)

  # fonts copy
  # fonts = FileList("src/assets/common/fonts/")
  # fonts.merge(FileList("src/assets/desktop/fonts/"))
  # deepcopy(fonts, VERSIONED_ROOT + '/fonts/')

  # images copy
  images = FileList('src/assets/common/images', filter = "*.jpg,*.png,*.gif,*.ico")
  # images.merge(FileList('src/assets/desktop/images', filter = "*.jpg,*.png,*.gif,*.ico"))
  deepcopy(images, VERSIONED_ROOT + "/images/")

  # templates merge
  templates = FileList('src/app/common/templates', filter = "*.tpl")
  # templates.merge(FileList("src/app/desktop/templates/", filter = "*.tpl"))
  combine(templates, VERSIONED_ROOT +  "/lxxl.tpl")


  # ================================
  # Versioned runner
  # ================================


  list = FileList('src', filter = '*activity*')
  deepcopy(list, VERSIONED_ROOT, replace=sed)
  combine(lxxl, VERSIONED_ROOT + "/activity/lxxl-standalone-library.js", replace=sed)
  
  # combine("src/activity/activity.tpl", VERSIONED_ROOT + "/activity.tpl", replace=sed)
  # css.merge(FileList("src/assets/desktop/css", filter = "*.css,*.scss"))

  combine("src/activity/activity.scss", VERSIONED_ROOT + "/activity/activity.css", replace=sed)
  combine("src/activity/miniboot.js", VERSIONED_ROOT + "/activity/miniboot-min.js", replace=sed)



  # XXX new stuff
  deepcopy("src/miniapp", Yak.build_root + "/miniapp", replace=sed)
Exemplo n.º 7
0
def build():
    
    sed = Sed()
    PH.replacer(sed)

    spitman = PH.getmanifest('spitfire')

    spitbase = spitman['spitfire'].split('/')
    spitbase.pop()
    spitbase = '/'.join(spitbase)

    sed.add('{SPIT-BASE}', spitbase.encode('latin-1'))
    # Our own internal boot path to resolve modules against... - XXX unlikely to work properly due to deploy root variations?
    # sed.add('{SPIT-BOOT}', Yak.links['self']['url'] + "/"+ Yak.package['name'] + "/" + Yak.package['version'])
    # Tricky!
    sed.add("'{SPIT-STATICS}'", json.dumps(PH.getstaticmanifest('*')))

    # ================================
    # Tests
    # ================================

    list = FileList("tests", filter="*.js,*.html")
    deepcopy(list, Yak.build_root + '/tests', replace=sed)

    # ================================
    # Spitfire loader, in many variants
    # ================================

    # Mini-loader
    combine([spitman['gulliver'], 'src/onegateisopening/b.js'], Yak.build_root + "/t.i.o.j.js", replace=sed)

    # Bootstrappers - we use lab by default
    spitfireList = [
      spitman['spitfire-lab'],
      'src/onegateisopening/boot.js',
      'src/gister/packman.js'
    ]
    combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.js", replace=sed)

    # spitfireList = [
    #   spitman['spitfire'],
    #   'src/onegateisopening/boot.js',
    # ]
    # combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.vanilla.js", replace=sed)

    # spitfireList = [
    #   spitman['spitfire-require'],
    #   'src/onegateisopening/boot.js',
    # ]
    # # combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.require.js", replace=sed)
    # combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.require.js", replace=sed)

    # spitfireList = [
    #   spitman['spitfire-head'],
    #   'src/onegateisopening/boot.js',
    # ]
    # combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.head.js", replace=sed)

    # # These two don't support strict mode - the hell with them!
    # spitfireList = [
    #   spitman['spitfire-yahoo'],
    #   'src/onegateisopening/boot.js',
    # ]
    # combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.yahoo.js", replace=sed)

    # spitfireList = [
    #   spitman['spitfire-yepnope'],
    #   'src/onegateisopening/boot.js',
    # ]
    # combine(spitfireList, Yak.build_root + "/there.is.only.jsboot.yepnope.js", replace=sed)



    # XXX Have unified XHR bundled to be safe (?)
    # spitman['xhr'],

    # ================================
    # Monolithic ember stack test
    # ================================
    # f = [
    #   PH.getstaticmanifest('jquery'),
    #   PH.getstaticmanifest('handlebars'),
    #   PH.getstaticmanifest('ember'),
    #   PH.getstaticmanifest('i18n')
    # ]
    # combine(f, Yak.build_root + "/stack.ember.js", replace=sed)


    # ================================
    # Css normalizer
    # ================================
    cssnorm = PH.getstaticmanifest('normalize', Yak.istrunk)
    combine([cssnorm], Yak.build_root + "/there.is.only.jsboot.css", replace=sed)

    # ================================
    # Build-up the gate framy
    # ================================
    # XXX this must die and be replaced by a proper postmessage shim
    postmessageshim = PH.getstaticmanifest('postmessage', Yak.istrunk)
    postmessageshim = 'src/mingus/postmessage.js';

    gateList = [
      spitman['loader-lab'],
      spitman['spitfire'],
      postmessageshim,
      'src/onegateisopening/gate.js'
    ]

    combine(gateList, Yak.build_root + '/toobsj.ylno.si.ereht.js', replace=sed)
    # FileSystem.copyfile(Yak.build_root + '/gates/gate-frame.js', Yak.build_root + '/gates/gate-frame-min.js')

    shortversion = Yak.package['version'].split('-').pop(0).split('.')
    shortversion = shortversion[0] + "." + shortversion[1]

    # Build-up the frame to deploy connect to
    # XXX whether this works is undefined... because of shortversion and selectable versioned deploy
    sed.add('{PUKE-GATE-OPENER}', Yak.links['self']['url'] + "/"+ Yak.package['name'] + "/" + shortversion + "/toobsj.ylno.si.ereht.js")
    combine('src/onegateisopening/gate.html', Yak.build_root + '/gate.html', replace=sed)



    # ================================
    # Standalone mingus
    # ================================

    mingusList = [
      "src/strict.js",
      # Have postmessage shit
      postmessageshim,
    # Better safe than sorry - always include that
      # "src/lib/com/wiu/mingus/shim-plus/console.js",
      # "src/lib/com/wiu/mingus/shim-plus/cookies.js",
      # "src/lib/com/wiu/mingus/shim-plus/string.js",
      # "src/lib/com/wiu/mingus/shim-plus/iegetset.js",
#      "src/lib/com/wiu/mingus/shim/postmessage.js",
    # Mingus NS
      "src/mingus/namespace.js",
    # Base dep
      "src/mingus/grammar/ABNF.js",
      # "src/lib/com/wiu/mingus/converters/entity.js",
      # "src/lib/com/wiu/mingus/converters/bencoder.js",
      # "src/lib/com/wiu/mingus/converters/wikimedia.js",
    # And parsers / grammars
      "src/mingus/grammar/IMF.js",
      "src/mingus/grammar/IRI.js",
      "src/mingus/grammar/HTTP.js",

    # Then md5 dep
      "src/mingus/crypto/md5.js",


    # Not necessary per-se, but darn useful
      "src/mingus/converters/entity.js",

    # Then bases
      "src/mingus/xhr/ungate.js",
      "src/mingus/xhr/appkey.js",
      "src/mingus/xhr/digest.js",
    # Then the final XHR
      "src/mingus/xhr/appkeydigestxhr.js"
    ]

    # Shimmy yeah
    combine(mingusList, Yak.build_root + "/mingus.js", replace=sed)


    # ================================
    # jsBoot modules
    # ================================

    list = FileList('src/jsboot/debug', filter = '*.js', exclude = '*xxx*');
    combine(list, Yak.build_root + "/debug.js", replace=sed)

    # list = FileList('src/jsboot/gister', filter = '*.js', exclude = '*xxx*')
    list = FileList('src/jsboot/core', filter = '*.js', exclude = '*xxx*');
    # list.merge(FileList('src/jsboot/gister', filter = '*.js', exclude = '*xxx*'));
    list.merge(['src/jsboot/types/eventdispatcher.js'])

    # Not exactly "core" per-se
    list.merge(['src/jsboot/types/mutable.js'])
    list.merge(['src/jsboot/controllers/idle.js'])
    list.merge(['src/jsboot/controllers/singleapp.js'])
    list.merge(['src/jsboot/utils/storage.js'])
    list.merge(['src/jsboot/utils/tweener.js'])


    combine(list, Yak.build_root + "/core.js", replace=sed)

    list = [
      'src/jsboot/service/errors.js',
      'src/jsboot/service/client.js',
      'src/jsboot/service/core.js',
      'src/jsboot/service/flaves/account.js',
      'src/jsboot/controllers/application.js'
    ]

    combine(list, Yak.build_root + "/service.js", replace=sed)

    list = FileList('src/jsboot/ui', filter = '*.js', exclude = '*xxx*');
    combine(list, Yak.build_root + "/ui.js", replace=sed)




    spitroot = Yak.package['name'] + "/" + shortversion

    description = {}
    description["mingus"] = "%s/mingus.js" % spitroot
    description["jsbootstrap"] = "%s/there.is.only.jsboot.js" % spitroot
    description["gate"] = "%s/gate.html" % spitroot
    description["cssbootstrap"] = "%s/there.is.only.jsboot.css" % spitroot

    # Link the yaml stuff

    # yamu = FileSystem.join(Yak.deploy_root, "jsboot.yaml")
    # description = yaml.load('\n'.join(description))
    # if FileSystem.exists(yamu):
    #   mama = yaml.load(FileSystem.readfile(yamu))
    #   mama[Yak.package['version']] = description
    # else:
    #   mama = {Yak.package['version']: description}

    # # Straight to service root instead - kind of hackish...
    # FileSystem.writefile(yamu, yaml.dump(mama))



    PH.describe(shortversion, "jsboot", description)
Exemplo n.º 8
0
def tests():
  sed = Sed()
  PH.replacer(sed)
  list = FileList("src/tests", filter="*.js,*.html", exclude="*xxx*")
  deepcopy(list, Yak.build_root + '/tests', replace=sed)