Exemple #1
0
    def __init__(self, log: Log, name: str, scanMethod: Optional[int] = None, blacklist: Optional[List[str]] = None) -> None:
        xmlAttribs = {'Name': name}
        if scanMethod is not None:
            xmlAttribs['ScanMethod'] = ScanMethod.ToString(scanMethod)
        xmlElement = FakeXmlElementFactory.Create("PackageLocation", xmlAttribs)
        if blacklist is not None:
            for blacklistEntry in blacklist:
                xmlBlacklistElement = FakeXmlElementFactory.CreateWithName("Blacklist", blacklistEntry)
                xmlElement.append(xmlBlacklistElement)

        super().__init__(log, xmlElement)
 def __init__(self, config: Config, defaultPackageLanguage: int) -> None:
     super().__init__(config, FakeXmlElementFactory.CreateWithName("FakeGenFile", "FSLBUILD_INVALID_INITIAL_VALUE"), SubPackageSupportConfig(PackageType.TopLevel, SubPackageSupport.Disabled))
     self.SourceFilename = None # type: Optional[str]
     self.SourceFileHash = ""   # type: str
     self.Name = ''
     self.ShortName = None  # type: Optional[str]
     self.Namespace = None  # type: Optional[str]
     self.PackageFile = None # type: Optional[PackageFile]
     self.PackageLocation = None  # type: Optional[ToolConfigPackageLocation]
     self.Type = PackageType.Library
     self.IsVirtual = False
     self.DirectDependencies = []  # type: List[XmlGenFileDependency]
     self.DirectRequirements = []  # type: List[XmlGenFileRequirement]
     self.DirectDefines = []
     self.DirectExperimentalRecipe = None    # type: Optional[XmlExperimentalRecipe]
     self.Platforms = {}  # type: Dict[str, XmlGenFilePlatform]
     self.IncludePath = None  # type: Optional[PackagePath]
     self.SourcePath = None  # type: Optional[PackagePath]
     self.ContentPath = None  # type: Optional[PackagePath]
     self.ContentSourcePath = None  # type: Optional[PackagePath]
     self.PackageLanguage = defaultPackageLanguage
     self.BaseIncludePath = "include"
     self.BaseSourcePath = "source"
     self.BuildCustomization = {}  # type: Dict[str, XmlGenFileBuildCustomization]
     self.CompanyName = "NotDefined"
     self.CreationYear = None  # type: Optional[str]
     self.TemplateType = ""
     self.AllowCheck = True
     self.EnableExtendedSourceExtensions = False
     self.AllowCombinedDirectory = False
     self.PackageNameBasedIncludePath = True
     self.PlatformDefaultSupportedValue = True
     self.SystemDefaultValues = LocalPackageDefaultValues()
     self.UnitTest = False
     self.ShowInMainReadme = True
 def __init__(self, log: Log, platformName: str,
              defaultValues: LocalPackageDefaultValues,
              subPackageSupport: SubPackageSupportConfig) -> None:
     fakeXmlElement = FakeXmlElementFactory.CreateWithName(
         "Platform", platformName)
     super().__init__(log, fakeXmlElement, defaultValues, [], [], [], None,
                      subPackageSupport)
Exemple #4
0
 def __init__(self, log: Log, name: str, access: int) -> None:
     fakeXmlElementAttribs = {'Name': name, 'Access': AccessType.ToString(access)}
     fakeXmlElement = FakeXmlElementFactory.Create("FakeXmlGenFileDependency", fakeXmlElementAttribs)
     super().__init__(log, fakeXmlElement)
     if self.Name != name:
         raise Exception("Failed to setting fake element name")
     if self.Access != access:
         raise Exception("Failed to setting fake element access")
def _LoadPackageConfigurations(log: Log, projectElem: ET.Element, filename: str) -> List[XmlConfigPackageConfiguration]:
    xmlPackageConfigurations = LoadUtil.XMLLoadPackageConfiguration(log, projectElem, filename)
    for entry in xmlPackageConfigurations:
        # if no locations has been supplied then we assume the root folder of the project file
        #if entry.Name == 'default' and len(entry.Locations) <= 0:
        if len(entry.Locations) <= 0:
            xmlConfigPackageLocation = XmlConfigPackageLocation(log, FakeXmlElementFactory.CreateWithName("PackageLocation", MagicStrings.ProjectRoot))
            entry.Locations = [xmlConfigPackageLocation]
    return xmlPackageConfigurations
    def __init__(self, log: Log, name: str, version: Optional[Version], targetName: Optional[str], path: Optional[str], ifCondition: Optional[str]) -> None:
        fakeXmlElementAttribs = {'Name': name, 'Type': ExternalDependencyType.ToString(ExternalDependencyType.CMakeFindModern)}
        if version is not None:
            fakeXmlElementAttribs['Version'] = str(version)
        if targetName is not None:
            fakeXmlElementAttribs['TargetName'] = targetName
        if path is not None:
            fakeXmlElementAttribs['Location'] = path
        if ifCondition is not None:
            fakeXmlElementAttribs['If'] = ifCondition

        fakeXmlElement = FakeXmlElementFactory.Create("FakeExternalDep", fakeXmlElementAttribs)
        super().__init__(log, fakeXmlElement)
Exemple #7
0
    def __init__(self, log: Log, name: str, version: Optional[Version],
                 targetName: Optional[str], path: Optional[str],
                 ifCondition: Optional[str]) -> None:
        fakeXmlElementAttribs = {'Name': name}
        if version is not None:
            fakeXmlElementAttribs['Version'] = str(version)
        if targetName is not None:
            fakeXmlElementAttribs['TargetName'] = targetName
        if path is not None:
            fakeXmlElementAttribs['Path'] = path
        if ifCondition is not None:
            fakeXmlElementAttribs['If'] = ifCondition

        fakeXmlElement = FakeXmlElementFactory.Create(
            "FakeXmlGenFileFindPackage", fakeXmlElementAttribs)
        super().__init__(log, fakeXmlElement)
Exemple #8
0
    def __init__(self,
                 log: Log,
                 name: str,
                 location: str,
                 access: AccessType,
                 extDepType: ExternalDependencyType,
                 debugName: Optional[str] = None,
                 includeLocation: Optional[str] = None,
                 isManaged: bool = False) -> None:
        strType = ExternalDependencyType.ToString(extDepType)
        fakeXmlElementAttribs = {
            'Name': name,
            'Location': location,
            'Access': AccessType.ToString(access),
            "Type": strType
        }  # type: Dict[str, str]

        if debugName is not None:
            fakeXmlElementAttribs['DebugName'] = debugName
        if includeLocation is not None:
            fakeXmlElementAttribs['Include'] = location

        fakeXmlElement = FakeXmlElementFactory.Create("FakeExternalDep",
                                                      fakeXmlElementAttribs)
        super().__init__(log, fakeXmlElement)
        if self.Name != name:
            raise Exception("Failed to setting fake element attribute Name")
        if self.Location != location:
            raise Exception(
                "Failed to setting fake element attribute Location")
        if self.Access != access:
            raise Exception("Failed to setting fake element attribute Access")
        if debugName is not None and self.DebugName != debugName:
            raise Exception(
                "Failed to setting fake element attribute DebugName")
        if includeLocation is not None and self.Include != includeLocation:
            raise Exception(
                "Failed to setting fake element attribute IncludeLocation")
        # Override the value set in the base class
        self.IsManaged = isManaged
Exemple #9
0
 def __init__(self, log: Log) -> None:
     xmlElement = FakeXmlElementFactory.Create("Config")
     super().__init__(log, xmlElement)