public ITargetChecker NewTargetFactoryForFamily(TargetPlatforms family) { switch (family) { case TargetPlatforms.windows: return(new WindowsTargetChecker()); case TargetPlatforms.unix: return(new UnixTargetChecker()); case TargetPlatforms.ios: return(new CiscoIosChecker()); case TargetPlatforms.undefined: return(new UndefinedTargetChecker()); case TargetPlatforms.catos: case TargetPlatforms.macos: case TargetPlatforms.pixos: case TargetPlatforms.vmware_infrastructure: break; } throw new NotSupportedException(String.Format("{0} platform is not supported currently.", family.ToString())); }
static void InitializePrototypes() { // #TODO_BLAM: if we use a 'null' engine entry, add it here, before the prototypes are read using (var s = OpenRegistryTagElementStream()) { SerializePrototypes(s); SerializeTargets(s); } KSoft.Debug.ValueCheck.IsLessThanEqualTo("EngineRegistry: Too many registered engines", BlamEngine.kMaxCount, Engines.Count); KSoft.Debug.ValueCheck.IsLessThanEqualTo("EngineRegistry: Too many registered target platforms", EngineTargetPlatform.kMaxCount, TargetPlatforms.Count); KSoft.Debug.ValueCheck.IsLessThanEqualTo("EngineRegistry: Too many registered resource models", kMaxResourceModels, ResourceModels.Count); KSoft.Debug.ValueCheck.IsDistinct("EngineRegistry: Duplicate engines registered", "name", Engines.Select(e => e.Name)); KSoft.Debug.ValueCheck.IsDistinct("EngineRegistry: Duplicate target platforms registered", "name", TargetPlatforms.Select(e => e.Name)); KSoft.Debug.ValueCheck.IsDistinct("EngineRegistry: Duplicate resource models registered", "name", ResourceModels); gEngines.TrimExcess(); gTargetPlatforms.TrimExcess(); gResourceModels.TrimExcess(); BlamEngine.InitializeEngineBuildHandles(); kNullValidTargetPlatforms = new Collections.BitSet(TargetPlatforms.Count); InitializeTargetPlatformIndicies(); }
public static void TranslateAll( TextWriter logw, string outputPath, bool readSymbols, bool enableCpp, bool enableBundler, TargetPlatforms targetPlatform, DebugInformationOptions debugInformationOptions, IEnumerable <string> assemblyPaths) { var storage = new CodeTextStorage( logw, outputPath, enableCpp, " "); foreach (var aseemblyPath in assemblyPaths) { Translate( logw, storage, readSymbols, enableBundler, targetPlatform, debugInformationOptions, aseemblyPath); } }
public static void Translate( CodeTextStorage storage, bool readSymbols, bool enableBundler, TargetPlatforms targetPlatform, DebugInformationOptions debugInformationOptions, string assemblyPath) { System.Console.WriteLine("IL2C: Preparing assembly: \"{0}\" ...", Path.GetFullPath(assemblyPath)); var translateContext = new TranslateContext(assemblyPath, readSymbols); System.Console.WriteLine(" done."); using (var _ = storage.EnterScope("meta")) { MetadataSerializer metaSerializer = new MetadataSerializer(translateContext); metaSerializer.WriteResult(storage); } using (var _ = storage.EnterScope("include")) { } using (var _ = storage.EnterScope("src")) { } }
public static void Translate( TextWriter logw, CodeTextStorage storage, bool readSymbols, bool enableBundler, TargetPlatforms targetPlatform, DebugInformationOptions debugInformationOptions, string assemblyPath) { logw.Write("IL2C: Preparing assembly: \"{0}\" ...", Path.GetFullPath(assemblyPath)); var translateContext = new TranslateContext(assemblyPath, readSymbols, targetPlatform); var preparedFunctions = AssemblyPreparer.Prepare(translateContext); logw.WriteLine(" done."); using (var _ = storage.EnterScope("include")) { AssemblyWriter.WriteHeader( storage, translateContext, preparedFunctions); } using (var _ = storage.EnterScope("src")) { AssemblyWriter.WriteSourceCode( storage, translateContext, preparedFunctions, enableBundler, debugInformationOptions); } }
public virtual TargetCheckingResult CheckTargetAvailability(TargetPlatforms targetPlatform, string address, string encryptedCredentials, string sshPort) { var token = LogonModSic(); try { return(ModSicProxyService.CheckTargetAvailability(targetPlatform, address, encryptedCredentials, sshPort, token)); } finally { ModSicProxyService.Logout(token); } }
public static void TranslateAll( CodeTextStorage storage, bool readSymbols, bool enableBundler, TargetPlatforms targetPlatform, DebugInformationOptions debugInformationOptions, params string[] assemblyPaths) { TranslateAll( storage, readSymbols, enableBundler, targetPlatform, debugInformationOptions, (IEnumerable <string>)assemblyPaths); }
public static void TranslateAll( TextWriter logw, string outputPath, bool readSymbols, bool enableBundler, TargetPlatforms targetPlatform, DebugInformationOptions debugInformationOptions, params string[] assemblyPaths) { TranslateAll( logw, outputPath, readSymbols, enableBundler, targetPlatform, debugInformationOptions, (IEnumerable <string>)assemblyPaths); }
public static void TranslateAll( CodeTextStorage storage, bool readSymbols, bool enableBundler, TargetPlatforms targetPlatform, DebugInformationOptions debugInformationOptions, IEnumerable <string> assemblyPaths) { foreach (var aseemblyPath in assemblyPaths) { Translate( storage, readSymbols, enableBundler, targetPlatform, debugInformationOptions, aseemblyPath); } }
/// <summary> /// Default constructor. /// </summary> /// <param name="platforms">Specifies the platforms where the tagged test should execute.</param> public PlatformFactAttribute(TargetPlatforms platforms) : base() { if (NeonHelper.IsWindows && (platforms & TargetPlatforms.Windows) != 0) { return; } if (NeonHelper.IsLinux && (platforms & TargetPlatforms.Linux) != 0) { return; } if (NeonHelper.IsOSX && (platforms & TargetPlatforms.Osx) != 0) { return; } Skip = $"Unit test is disabled for: {RuntimeInformation.OSDescription}"; }
public TargetCheckingResult CheckTargetAvailability(TargetPlatforms targetPlatform, string address, string encryptedCredentials, string sshPort, string token) { try { var targetChecker = new TargetChecker(); var credentialsInBytes = Encoding.Default.GetBytes(encryptedCredentials); var targetInfo = new TargetInfoExtractor().GetTargetInformation(credentialsInBytes, address, sshPort); return(targetChecker.Check(targetPlatform, targetInfo)); } catch (Exception ex) { var logMessage = String.Format(EXECUTION_ERROR_MESSAGE, ex.Message, ex.StackTrace); Logger.Error(logMessage); return(new TargetCheckingResult() { ErrorMessage = ex.Message, IsTargetAvailable = false }); } }
public GMExtensionProxyFile CreateFromDisk(string path, TargetPlatforms targetPlatform) { if (path == null) { throw new ArgumentNullException(nameof(path)); } var proxyFile = new GMExtensionProxyFile(extensionFile) { Project = extensionFile.Project, Id = Guid.NewGuid(), TargetPlatform = targetPlatform }; proxyFile.SetFile(path); proxyFiles.Add(proxyFile); return(proxyFile); }
public ITargetChecker NewTargetFactoryForFamily(TargetPlatforms family) { switch (family) { case TargetPlatforms.windows: return new WindowsTargetChecker(); case TargetPlatforms.unix: return new UnixTargetChecker(); case TargetPlatforms.ios: return new CiscoIosChecker(); case TargetPlatforms.undefined: return new UndefinedTargetChecker(); case TargetPlatforms.catos: case TargetPlatforms.macos: case TargetPlatforms.pixos: case TargetPlatforms.vmware_infrastructure: break; } throw new NotSupportedException(String.Format("{0} platform is not supported currently.", family.ToString())); }
public TargetCheckingResult Check(TargetPlatforms family, TargetInfo targetInfo) { var targetChecker = new TargetCheckerFactory().NewTargetFactoryForFamily(family); return targetChecker.Check(targetInfo); }
public virtual TargetCheckingResult CheckTargetAvailability(TargetPlatforms targetPlatform, string address, string encryptedCredentials, string sshPort, string token) { return this.ModSicChannel.CheckTargetAvailability(targetPlatform, address, encryptedCredentials, sshPort, token); }
public virtual TargetCheckingResult CheckTargetAvailability(TargetPlatforms targetPlatform, string address, string encryptedCredentials, string sshPort) { var token = LogonModSic(); try { return ModSicProxyService.CheckTargetAvailability(targetPlatform, address, encryptedCredentials, sshPort, token); } finally { ModSicProxyService.Logout(token); } }
public TargetCheckingResult Check(TargetPlatforms family, TargetInfo targetInfo) { var targetChecker = new TargetCheckerFactory().NewTargetFactoryForFamily(family); return(targetChecker.Check(targetInfo)); }
public TargetCheckingResult CheckTargetAvailability(TargetPlatforms targetPlatform, string address, string encryptedCredentials, string sshPort, string token) { try { var targetChecker = new TargetChecker(); var credentialsInBytes = Encoding.Default.GetBytes(encryptedCredentials); var targetInfo = new TargetInfoExtractor().GetTargetInformation(credentialsInBytes, address, sshPort); return targetChecker.Check(targetPlatform, targetInfo); } catch (Exception ex) { var logMessage = String.Format(EXECUTION_ERROR_MESSAGE, ex.Message, ex.StackTrace); Logger.Error(logMessage); return new TargetCheckingResult() { ErrorMessage = ex.Message, IsTargetAvailable = false }; } }
public virtual TargetCheckingResult CheckTargetAvailability(TargetPlatforms targetPlatform, string address, string encryptedCredentials, string sshPort, string token) { return(this.ModSicChannel.CheckTargetAvailability(targetPlatform, address, encryptedCredentials, sshPort, token)); }