Exemplo n.º 1
0
def populate_package_names(build):
    build.config['package_name'] = re.sub(
        "[^a-zA-Z0-9]", "",
        build.config["name"].lower()) + build.config["uuid"]
    if "core" not in build.config:
        build.config["core"] = {}
    if "android" not in build.config["core"]:
        build.config["core"]["android"] = {}
    build.config["core"]["android"][
        "package_name"] = android_tasks._generate_package_name(build)
    if "firefox" not in build.config["core"]:
        build.config["core"]["firefox"] = {}
    build.config["core"]["firefox"][
        "package_name"] = firefox_tasks._generate_package_name(build)
    if "safari" not in build.config["core"]:
        build.config["core"]["safari"] = {}
    build.config["core"]["safari"][
        "package_name"] = safari_tasks._generate_package_name(build)
    if "ios" not in build.config["core"]:
        build.config["core"]["ios"] = {}
    build.config["core"]["ios"][
        "package_name"] = ios_tasks._generate_package_name(build)
    if "osx" not in build.config["core"]:
        build.config["core"]["osx"] = {}
    build.config["core"]["osx"][
        "package_name"] = osx_tasks._generate_package_name(build)
    if "ie" not in build.config["core"]:
        build.config["core"]["ie"] = {}
    build.config["core"]["ie"][
        "package_name"] = ie_tasks._generate_package_name(build)
def populate_package_names(build):
    if "core" not in build.config:
        build.config["core"] = {}
    if "android" not in build.config["core"]:
        build.config["core"]["android"] = {}
    build.config["core"]["android"][
        "package_name"] = android_tasks._generate_package_name(build)
    if "firefox" not in build.config["core"]:
        build.config["core"]["firefox"] = {}
    build.config["core"]["firefox"][
        "package_name"] = firefox_tasks._generate_package_name(build)
    if "safari" not in build.config["core"]:
        build.config["core"]["safari"] = {}
    build.config["core"]["safari"][
        "package_name"] = safari_tasks._generate_package_name(build)
    if "ios" not in build.config["core"]:
        build.config["core"]["ios"] = {}
    build.config["core"]["ios"][
        "package_name"] = ios_tasks._generate_package_name(build)
    if "osx" not in build.config["core"]:
        build.config["core"]["osx"] = {}
    build.config["core"]["osx"][
        "package_name"] = osx_tasks._generate_package_name(build)
    if "ie" not in build.config["core"]:
        build.config["core"]["ie"] = {}
    build.config["core"]["ie"][
        "package_name"] = ie_tasks._generate_package_name(build)
Exemplo n.º 3
0
def populate_package_names(build):
	build.config['package_name'] = re.sub("[^a-zA-Z0-9]", "", build.config["name"].lower()) + build.config["uuid"]
	if "package_names" not in build.config["modules"]:
		build.config["modules"]["package_names"] = {}
	build.config["modules"]["package_names"]["android"] = android_tasks._generate_package_name(build)
	build.config["modules"]["package_names"]["firefox"] = firefox_tasks._generate_package_name(build)
	build.config["modules"]["package_names"]["safari"] = safari_tasks._generate_package_name(build)
	build.config["modules"]["package_names"]["ios"] = ios_tasks._generate_package_name(build)
	build.config["modules"]["package_names"]["ie"] = ie_tasks._generate_package_name(build)
def populate_package_names(build):
	build.config['package_name'] = re.sub("[^a-zA-Z0-9]", "", build.config["name"].lower()) + build.config["uuid"]
	if "core" not in build.config:
		build.config["core"] = {}
	if "firefox" not in build.config["core"]:
		build.config["core"]["firefox"] = {}
	build.config["core"]["firefox"]["package_name"] = firefox_tasks._generate_package_name(build)
	if "safari" not in build.config["core"]:
		build.config["core"]["safari"] = {}
	build.config["core"]["safari"]["package_name"] = safari_tasks._generate_package_name(build)
	if "ie" not in build.config["core"]:
		build.config["core"]["ie"] = {}
	build.config["core"]["ie"]["package_name"] = ie_tasks._generate_package_name(build)
Exemplo n.º 5
0
def preprocess_config(build):
    '''
	preprocess config
	'''
    build.log.info('preprocessing configuration')

    # Add a UUID to config.json if not already got one.
    if 'uuid' not in build.config:
        build.config['uuid'] = str(uuid.uuid4())
        build.log.warning('generated new UUID: %s' % build.config['uuid'])

    if build.test:
        ant = subprocess.Popen(['hg', 'id', '-i', build.source_dir],
                               stdout=PIPE,
                               stderr=STDOUT)
        cshash = ant.communicate()[0].replace('+', '').strip()
        build.log.warning('new UUID: %s' % cshash)
        build.config['uuid'] = cshash

    # Encode all configuration keys/values as UTF-8.
    build.config = dict(
        (k.encode('utf8'), v) for k, v in build.config.iteritems())

    desc = build.config.get('description', '')
    if not desc.endswith('(built on Forge)') and not build.remove_attribution:
        build.config['description'] = desc + ' (built on Forge)'

    # Package name is like "foobar" from "Foo Bar!"
    build.config['package_name'] = re.sub(
        "[^a-zA-Z0-9]", "",
        build.config["name"].lower()) + build.config["uuid"]
    if build.test:
        build.config['package_name'] = re.sub("[^a-zA-Z0-9]", "",
                                              build.config["name"].lower())

    build.config["core"]["firefox"][
        "package_name"] = firefox_tasks._generate_package_name(build)
    build.config["core"]["safari"][
        "package_name"] = safari_tasks._generate_package_name(build)
    build.config["core"]["ie"][
        "package_name"] = ie_tasks._generate_package_name(build)

    build.config['xml_safe_name'] = build.config["name"].replace(
        '"', '\\"').replace("'", "\\'")

    if "logging" in build.config and "level" in build.config["logging"]:
        build.config["logging_level"] = build.config["logging"]["level"]
    else:
        build.config["logging_level"] = "INFO"

    build.config['json'] = json
Exemplo n.º 6
0
def preprocess_config(build):
	'''
	preprocess config
	'''
	build.log.info('preprocessing configuration')

	# Add a UUID to config.json if not already got one.
	if 'uuid' not in build.config:
		build.config['uuid'] = str(uuid.uuid4())
		build.log.warning('generated new UUID: %s' % build.config['uuid'])

	if build.test:
		ant = subprocess.Popen(['hg', 'id', '-i', build.source_dir], stdout=PIPE, stderr=STDOUT)
		cshash = ant.communicate()[0].replace('+','').strip()
		build.log.warning('new UUID: %s' % cshash)
		build.config['uuid'] = cshash

	# Encode all configuration keys/values as UTF-8.
	build.config = dict((k.encode('utf8'), v) for k, v in build.config.iteritems())

	desc = build.config.get('description', '')
	if not desc.endswith('(built on Forge)') and not build.remove_attribution:
		build.config['description'] = desc + ' (built on Forge)'

	# Package name is like "foobar" from "Foo Bar!"
	build.config['package_name'] = re.sub("[^a-zA-Z0-9]", "", build.config["name"].lower()) + build.config["uuid"]
	if build.test:
		build.config['package_name'] = re.sub("[^a-zA-Z0-9]", "", build.config["name"].lower())

	build.config["core"]["firefox"]["package_name"] = firefox_tasks._generate_package_name(build)
	build.config["core"]["safari"]["package_name"] = safari_tasks._generate_package_name(build)
	build.config["core"]["ie"]["package_name"] = ie_tasks._generate_package_name(build)

	build.config['xml_safe_name'] = build.config["name"].replace('"', '\\"').replace("'", "\\'")

	if "logging" in build.config and "level" in build.config["logging"]:
		build.config["logging_level"] = build.config["logging"]["level"]
	else:
		build.config["logging_level"] = "INFO"

	build.config['json'] = json
Exemplo n.º 7
0
def populate_package_names(build):
	if "core" not in build.config:
		build.config["core"] = {}
	if "android" not in build.config["core"]:
		build.config["core"]["android"] = {}
	build.config["core"]["android"]["package_name"] = android_tasks._generate_package_name(build)
	if "firefox" not in build.config["core"]:
		build.config["core"]["firefox"] = {}
	build.config["core"]["firefox"]["package_name"] = firefox_tasks._generate_package_name(build)
	if "safari" not in build.config["core"]:
		build.config["core"]["safari"] = {}
	build.config["core"]["safari"]["package_name"] = safari_tasks._generate_package_name(build)
	if "ios" not in build.config["core"]:
		build.config["core"]["ios"] = {}
	build.config["core"]["ios"]["package_name"] = ios_tasks._generate_package_name(build)
	if "osx" not in build.config["core"]:
		build.config["core"]["osx"] = {}
	build.config["core"]["osx"]["package_name"] = osx_tasks._generate_package_name(build)
	if "ie" not in build.config["core"]:
		build.config["core"]["ie"] = {}
	build.config["core"]["ie"]["package_name"] = ie_tasks._generate_package_name(build)