Add Builders and construction variables for SunPRO C++.
354528
def generate(env):
    """"""
    path, cxx, shcxx, version = get_cppc(env)
    if path:
        cxx = os.path.join(path, cxx)
        shcxx = os.path.join(path, shcxx)

    cplusplus.generate(env)

    env['CXX'] = cxx
    env['SHCXX'] = shcxx
    env['CXXVERSION'] = version
    env['SHCXXFLAGS']   = SCons.Util.CLVar('$CXXFLAGS -KPIC')
    env['SHOBJPREFIX']  = 'so_'
    env['SHOBJSUFFIX']  = '.o'
333704
def set_build_vars
    warning_flags = ' -W -Wall'
    if 'release' == @config.release
      optimization_flags = " #{@config.optimization_release} -DRELEASE"
    else
      optimization_flags = " #{@config.optimization_dbg} -g"
    end

    # we could make these also arrays of source directories ...
    @settings['APP_SRC_DIR'] = 'src/app'
    @settings['LIB_SRC_DIR'] = 'src/lib'

    # derived settings
    @settings['BUILD_DIR'] = "#{build_dir}"
    @settings['LIB_OUT'] = "#{@settings['BUILD_DIR']}/libs"
    @settings['APP_OUT'] = "#{@settings['BUILD_DIR']}/apps"
    unless @settings['OECORE_TARGET_SYSROOT'].nil? || @settings['OECORE_TARGET_SYSROOT'].empty?
      @settings['SYS_LFLAGS'] = "-L#{@settings['OECORE_TARGET_SYSROOT']}/lib -L#{@settings['OECORE_TARGET_SYSROOT']}/usr/lib"
    end

    # set LD_LIBRARY_PATH
    @settings['LD_LIBRARY_PATH'] = @settings['LIB_OUT']

    # standard settings
    @settings['CXXFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_cpp}"
    @settings['CFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_c}"
    if @settings['PRJ_TYPE'] == 'SOLIB'
      @settings['CXXFLAGS'] += ' -fPIC'
      @settings['CFLAGS'] += ' -fPIC'
    end
    # !! don't change order of the following string components without care !!
    @settings['LDFLAGS'] = @settings['LDFLAGS'] + " -L #{@settings['LIB_OUT']} #{@settings['SYS_LFLAGS']} -Wl,--no-as-needed -Wl,--start-group"
  end
845292
def generate(env):
    """"""
    as_module.generate(env)

    env['AS']        = '386asm'
    env['ASFLAGS']   = SCons.Util.CLVar('')
    env['ASPPFLAGS'] = '$ASFLAGS'
    env['ASCOM']     = '$AS $ASFLAGS $SOURCES -o $TARGET'
    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES -o $TARGET'

    addPharLapPaths(env)
987492
def build(self, builder):
        """"""
        params = dict(
            OID=self.oid,
            Active=bool_to_true_false(self.active),
            BypassDuringMigration=bool_to_true_false(self.bypass_during_migration),
            NeedsRetesting=bool_to_true_false(self.needs_retesting),
        )

        if self.variable_oid is not None:
            params["VariableOID"] = self.variable_oid

        if self.field_oid is not None:
            params["FieldOID"] = self.field_oid

        if self.form_oid is not None:
            params["FormOID"] = self.form_oid

        if self.folder_oid is not None:
            params["FolderOID"] = self.folder_oid

        if self.record_position is not None:
            params["RecordPosition"] = str(self.record_position)

        if self.form_repeat_number is not None:
            params["FormRepeatNumber"] = str(self.form_repeat_number)

        if self.folder_repeat_number is not None:
            params["FolderRepeatNumber"] = str(self.folder_repeat_number)

        if self.all_variables_in_folders is not None:
            params["AllVariablesInFolders"] = bool_to_true_false(
                self.all_variables_in_folders
            )

        if self.all_variables_in_fields is not None:
            params["AllVariablesInFields"] = bool_to_true_false(
                self.all_variables_in_fields
            )

        if self.logical_record_position is not None:
            params["LogicalRecordPosition"] = self.logical_record_position.value

        builder.start("mdsol:DerivationDef", params)
        for step in self.derivation_steps:
            step.build(builder)
        builder.end("mdsol:DerivationDef")
919277
def add_options(cls, manager):
        """"""
        kw = {}
        if flake8.__version__ >= '3.0.0':
            kw['parse_from_config'] = True
        manager.add_option(
            "--known-modules",
            action='store',
            default="",
            help=(
                "User defined mapping between a project name and a list of"
                " provided modules. For example: ``--known-modules=project:"
                "[Project],extra-project:[extras,utilities]``."
            ),
            **kw
        )
1314361
def generate(env):
    """"""
    link.generate(env)
    
    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')

    env['RPATHPREFIX'] = '-R'
    env['RPATHSUFFIX'] = ''
    env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'

    # Support for versioned libraries
    link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True) 
    env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
266195
def build(self, builder):
        """"""
        params = dict()

        if self.variable_oid is not None:
            params["VariableOID"] = self.variable_oid

        if self.data_format is not None:
            params["DataFormat"] = self.data_format

        if self.folder_oid is not None:
            params["FolderOID"] = self.folder_oid

        if self.field_oid is not None:
            params["FieldOID"] = self.field_oid

        if self.form_oid is not None:
            params["FormOID"] = self.form_oid

        if self.static_value is not None:
            params["StaticValue"] = self.static_value

        if self.function is not None:
            params["Function"] = self.function.value

        if self.custom_function is not None:
            params["CustomFunction"] = self.custom_function

        if self.record_position is not None:
            params["RecordPosition"] = str(self.record_position)

        if self.form_repeat_number is not None:
            params["FormRepeatNumber"] = str(self.form_repeat_number)

        if self.folder_repeat_number is not None:
            params["FolderRepeatNumber"] = str(self.folder_repeat_number)

        if self.logical_record_position is not None:
            params["LogicalRecordPosition"] = self.logical_record_position.value

        builder.start("mdsol:CheckStep", params)
        builder.end("mdsol:CheckStep")
156726
def build(self, builder):
        """"""

        params = dict(
            OID=self.oid,
            Name=self.name,
            DataType=self.datatype.value,
            Length=str(self.length),
        )

        if self.date_time_format is not None:
            params["mdsol:DateTimeFormat"] = self.date_time_format

        params["mdsol:Active"] = bool_to_yes_no(self.active)

        if self.significant_digits is not None:
            params["SignificantDigits"] = str(self.significant_digits)

        if self.sas_field_name is not None:
            params["SASFieldName"] = self.sas_field_name

        if self.sds_var_name is not None:
            params["SDSVarName"] = self.sds_var_name

        if self.origin is not None:
            params["Origin"] = self.origin

        if self.comment is not None:
            params["Comment"] = self.comment

        if self.control_type is not None:
            params["mdsol:ControlType"] = self.control_type.value

        if self.acceptable_file_extensions is not None:
            params["mdsol:AcceptableFileExtensions"] = self.acceptable_file_extensions

        if self.default_value is not None:
            params["mdsol:DefaultValue"] = str(self.default_value)

        params["mdsol:SourceDocument"] = bool_to_yes_no(self.source_document_verify)
        params["mdsol:IndentLevel"] = str(self.indent_level)

        if self.sas_format is not None:
            params["mdsol:SASFormat"] = self.sas_format

        if self.sas_label is not None:
            params["mdsol:SASLabel"] = self.sas_label

        params["mdsol:QueryFutureDate"] = bool_to_yes_no(self.query_future_date)
        params["mdsol:Visible"] = bool_to_yes_no(self.visible)
        params["mdsol:TranslationRequired"] = bool_to_yes_no(self.translation_required)
        params["mdsol:QueryNonConformance"] = bool_to_yes_no(self.query_non_conformance)
        params["mdsol:OtherVisits"] = bool_to_yes_no(self.other_visits)
        params["mdsol:CanSetItemGroupDate"] = bool_to_yes_no(
            self.can_set_item_group_date
        )
        params["mdsol:CanSetFormDate"] = bool_to_yes_no(self.can_set_form_date)
        params["mdsol:CanSetStudyEventDate"] = bool_to_yes_no(
            self.can_set_study_event_date
        )
        params["mdsol:CanSetSubjectDate"] = bool_to_yes_no(self.can_set_subject_date)
        params["mdsol:VisualVerify"] = bool_to_yes_no(self.visual_verify)
        params["mdsol:DoesNotBreakSignature"] = bool_to_yes_no(
            self.does_not_break_signature
        )

        if self.field_number is not None:
            params["mdsol:FieldNumber"] = self.field_number

        if self.variable_oid is not None:
            params["mdsol:VariableOID"] = self.variable_oid

        builder.start("ItemDef", params)

        if self.question is not None:
            self.question.build(builder)

        if self.codelistref is not None:
            self.codelistref.build(builder)

        for mur in self.measurement_unit_refs:
            mur.build(builder)

        for range_check in self.range_checks:
            range_check.build(builder)

        if self.header_text is not None:
            self.header_text.build(builder)

        for view_restriction in self.view_restrictions:
            view_restriction.build(builder)

        for entry_restriction in self.entry_restrictions:
            entry_restriction.build(builder)

        for help_text in self.help_texts:
            help_text.build(builder)

        for review_group in self.review_groups:
            review_group.build(builder)

        for alias in self.aliases:
            alias.build(builder)

        builder.end("ItemDef")
1023463
def add(self, variables: Dict[str, str], overwrite: bool=False):
        
        preset_variables = self._project.variables.list()
        preset_variable_keys = [variable.key for variable in preset_variables]

        for key, value in variables.items():
            if key in preset_variable_keys:
                if overwrite:
                    variable = preset_variables[preset_variable_keys.index(key)]
                    variable.value = value
                    variable.save()
            else:
                variable = self._project.variables.create({
                    _VARIABLE_KEY_PROPERTY: key, _VARIABLE_VALUE_PROPERTY: value})
                variable.save()
1230341
def generate(env):
    """"""
    SCons.Tool.createSharedLibBuilder(env)
    SCons.Tool.createProgBuilder(env)

    env['SHLINK']      = '$LINK'
    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
    env['_SHLINK_TARGETS'] = windowsShlinkTargets
    env['_SHLINK_SOURCES'] = windowsShlinkSources
    env['SHLINKCOM']   =  compositeShLinkAction
    env.Append(SHLIBEMITTER = [windowsLibEmitter])
    env.Append(LDMODULEEMITTER = [windowsLibEmitter])
    env['LINK']        = 'link'
    env['LINKFLAGS']   = SCons.Util.CLVar('/nologo')
    env['_PDB'] = pdbGenerator
    env['LINKCOM'] = compositeLinkAction
    env.Append(PROGEMITTER = [prog_emitter])
    env['LIBDIRPREFIX']='/LIBPATH:'
    env['LIBDIRSUFFIX']=''
    env['LIBLINKPREFIX']=''
    env['LIBLINKSUFFIX']='$LIBSUFFIX'

    env['WIN32DEFPREFIX']        = ''
    env['WIN32DEFSUFFIX']        = '.def'
    env['WIN32_INSERT_DEF']      = 0
    env['WINDOWSDEFPREFIX']      = '${WIN32DEFPREFIX}'
    env['WINDOWSDEFSUFFIX']      = '${WIN32DEFSUFFIX}'
    env['WINDOWS_INSERT_DEF']    = '${WIN32_INSERT_DEF}'

    env['WIN32EXPPREFIX']        = ''
    env['WIN32EXPSUFFIX']        = '.exp'
    env['WINDOWSEXPPREFIX']      = '${WIN32EXPPREFIX}'
    env['WINDOWSEXPSUFFIX']      = '${WIN32EXPSUFFIX}'

    env['WINDOWSSHLIBMANIFESTPREFIX'] = ''
    env['WINDOWSSHLIBMANIFESTSUFFIX'] = '${SHLIBSUFFIX}.manifest'
    env['WINDOWSPROGMANIFESTPREFIX']  = ''
    env['WINDOWSPROGMANIFESTSUFFIX']  = '${PROGSUFFIX}.manifest'

    env['REGSVRACTION'] = regServerCheck
    env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
    env['REGSVRFLAGS'] = '/s '
    env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'

    env['WINDOWS_EMBED_MANIFEST'] = 0
    env['MT'] = 'mt'
    #env['MTFLAGS'] = ['-hashupdate']
    env['MTFLAGS'] = SCons.Util.CLVar('/nologo')
    # Note: use - here to prevent build failure if no manifest produced.
    # This seems much simpler than a fancy system using a function action to see
    # if the manifest actually exists before trying to run mt with it.
    env['MTEXECOM']   = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;1'
    env['MTSHLIBCOM'] = '-$MT $MTFLAGS -manifest ${TARGET}.manifest $_MANIFEST_SOURCES -outputresource:$TARGET;2'
    # TODO Future work garyo 27-Feb-11
    env['_MANIFEST_SOURCES'] = None # _windowsManifestSources

    # Set-up ms tools paths
    msvc_setup_env_once(env)


    # Loadable modules are on Windows the same as shared libraries, but they
    # are subject to different build parameters (LDMODULE* variables).
    # Therefore LDMODULE* variables correspond as much as possible to
    # SHLINK*/SHLIB* ones.
    SCons.Tool.createLoadableModuleBuilder(env)
    env['LDMODULE'] = '$SHLINK'
    env['LDMODULEPREFIX'] = '$SHLIBPREFIX'
    env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'
    env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
    env['_LDMODULE_TARGETS'] = _windowsLdmodTargets
    env['_LDMODULE_SOURCES'] = _windowsLdmodSources
    env['LDMODULEEMITTER'] = [ldmodEmitter]
    env['LDMODULECOM'] = compositeLdmodAction
1048382
def setup(build=True, installdir="MalmoPlatform"):
    """"""

    gradlew = './gradlew'
    if os.name == 'nt':
        gradlew = 'gradlew.bat'

    cwd = os.getcwd()
    os.chdir(installdir)
    os.chdir("Minecraft")
    try:
        # Create the version properties file.
        pathlib.Path("src/main/resources/version.properties").write_text("malmomod.version={}\n".format(malmo_version))
        # Optionally do a test build.
        if build:
            subprocess.check_call([gradlew, "setupDecompWorkspace", "build", "testClasses",
                                   "-x", "test", "--stacktrace", "-Pversion={}".format(malmo_version)])
        minecraft_dir = os.getcwd()
    finally:
        os.chdir(cwd)
    return minecraft_dir
1055944
private B newProcessBuilder(Class[] param_types, Object[] params)
    {
        if (process_builder_class != null)
        {
            try
            {
                Constructor<B> constructor = process_builder_class.getDeclaredConstructor(param_types);
                return constructor.newInstance(params);
            }
            catch (Exception e)
            {
                throw new QueujException(e);
            }
        }

        if (parent_queue != null)
            return (B)parent_queue.newProcessBuilder(param_types, params);

        // else
        throw new QueujException("No ProcessBuilder exists for Queue");
    }
658590
def _include_environment_variables(self, program, executor_vars):
        """"""
        env_vars = {
            'RESOLWE_HOST_URL': self.settings_actual.get('RESOLWE_HOST_URL', 'localhost'),
        }

        set_env = self.settings_actual.get('FLOW_EXECUTOR', {}).get('SET_ENV', {})
        env_vars.update(executor_vars)
        env_vars.update(set_env)

        export_commands = ['export {}={}'.format(key, shlex.quote(value)) for key, value in env_vars.items()]
        return os.linesep.join(export_commands) + os.linesep + program
1287239
def build_extensions (self):
        """"""
        # For gcc >= 3 we can add -std=gnu99 to get rid of warnings.
        extra = []
        if self.compiler.compiler_type == 'unix':
            option = "-std=gnu99"
            if cc_supports_option(self.compiler.compiler, option):
                extra.append(option)
        # First, sanity-check the 'extensions' list
        self.check_extensions_list(self.extensions)
        for ext in self.extensions:
            for opt in extra:
                if opt not in ext.extra_compile_args:
                    ext.extra_compile_args.append(opt)
            self.build_extension(ext)
334900
public static BuildInfo appendBuildInfo(CpsScript cpsScript, Map<String, Object> stepVariables) {
        BuildInfo buildInfo = (BuildInfo) stepVariables.get(BUILD_INFO);
        if (buildInfo == null) {
            buildInfo = (BuildInfo) cpsScript.invokeMethod("newBuildInfo", Maps.newLinkedHashMap());
            stepVariables.put(BUILD_INFO, buildInfo);
        }
        buildInfo.setCpsScript(cpsScript);
        return buildInfo;
    }
627242
@Override
    public void makeBuildVariables(AbstractBuild build, Map<String, String> variables) {
        // global var/password pairs
        MaskPasswordsConfig config = MaskPasswordsConfig.getInstance();
        List<VarPasswordPair> globalVarPasswordPairs = config.getGlobalVarPasswordPairs();
        // we can't use variables.putAll() since passwords are ciphered when in varPasswordPairs
        for(VarPasswordPair globalVarPasswordPair: globalVarPasswordPairs) {
            variables.put(globalVarPasswordPair.getVar(), globalVarPasswordPair.getPassword());
        }

        // job's var/password pairs
        if(varPasswordPairs != null) {
            // cf. comment above
            for(VarPasswordPair varPasswordPair: varPasswordPairs) {
                if(StringUtils.isNotBlank(varPasswordPair.getVar())) {
                    variables.put(varPasswordPair.getVar(), varPasswordPair.getPassword());
                }
            }
        }
    }
1152773
def setup(app):
    """"""
    app.connect("builder-inited", build_configuration_parameters)
    app.connect("autodoc-skip-member", skip_slots)
    app.add_stylesheet("css/custom.css")