Esempio n. 1
0
        /// <summary>
        /// Updates a <see cref="MSH" /> segment.
        /// </summary>
        /// <param name="msh">The MSH segment to update.</param>
        /// <param name="patient">The patient.</param>
        /// <param name="targetConfiguration">The target configuration.</param>
        internal static void UpdateMSH(MSH msh, Patient patient, TargetConfiguration targetConfiguration)
        {
            // ensure authenticated
            EnsureAuthenticated();

            tracer.TraceEvent(TraceEventType.Verbose, 0, "Start updating MSH segment");

            msh.AcceptAcknowledgmentType.Value        = "AL";
            msh.DateTimeOfMessage.TimeOfAnEvent.Value = DateTime.Now.ToString("yyyyMMddHHmmss");
            msh.MessageControlID.Value          = BitConverter.ToInt64(Guid.NewGuid().ToByteArray(), 0).ToString();
            msh.ProcessingID.ProcessingID.Value = "P";

            if (targetConfiguration.DeviceId.Contains('|'))
            {
                msh.ReceivingApplication.NamespaceID.Value = targetConfiguration.DeviceId.Split('|')[0];
                msh.ReceivingFacility.NamespaceID.Value    = targetConfiguration.DeviceId.Split('|')[1];
            }
            else
            {
                msh.ReceivingApplication.NamespaceID.Value = targetConfiguration.DeviceId;
                msh.ReceivingFacility.NamespaceID.Value    = targetConfiguration.NotificationDomainConfigurations.FirstOrDefault()?.Domain;
            }

            var configuration = ApplicationContext.Current.Configuration;

            // set MSH-3 as the NSID of the patient identifier
            msh.SendingApplication.NamespaceID.Value = patient.Identifiers.FirstOrDefault()?.Authority?.DomainName ?? configuration.DeviceName;
            msh.SendingFacility.NamespaceID.Value    = configuration.JurisdictionData.Name;
            msh.VersionID.VersionID.Value            = "2.3.1";
        }
Esempio n. 2
0
        private static ushort CompressPlatformConfiguration(TargetPlatform platform, TargetConfiguration configuration)
        {
            ushort platformValue      = (byte)Convert.ChangeType(platform, platform.GetTypeCode());
            ushort configurationValue = (byte)Convert.ChangeType(configuration, platform.GetTypeCode());

            return((ushort)(platformValue | (configurationValue << 8)));
        }
Esempio n. 3
0
 public ValueBinderContext(object source, object result, TargetConfiguration targetConfiguration, ValueProvider valueProvider, IObjectMapper objectMapper)
 {
     Source = source;
     Result = result;
     TargetConfiguration = targetConfiguration;
     ValueProvider       = valueProvider;
     ObjectMapper        = objectMapper;
 }
Esempio n. 4
0
        public override string ResolveDependency(TargetConfiguration Configuration)
        {
            string CoreProjectPath = Path.Combine(this.Location, String.Format("GoddamnCore{0}{1}",
                ((Configuration == TargetConfiguration.Debug) ? ".Debug" : ""),
                Target.GetPlatformStaticLibraryExtension())
                );

            return CoreProjectPath;
        }
Esempio n. 5
0
        public static TConfiguration UseTarget <TConfiguration>(this TConfiguration configuration, string name, Action <ITargetConfiguration> action = null)
            where TConfiguration : IApplicationConfiguration
        {
            ITargetConfiguration targetConfiguration = new TargetConfiguration(configuration.Context);

            action?.Invoke(targetConfiguration);
            configuration.AddTarget(name, targetConfiguration);

            return(configuration);
        }
Esempio n. 6
0
        static bool ConfigSupportsTarget(TargetConfiguration config, TargetType target)
        {
            //Editor not supported for Test/Shipping
            if (target == TargetType.Editor)
            {
                return(config != TargetConfiguration.Shipping && config != TargetConfiguration.Test);
            }

            return(true);
        }
Esempio n. 7
0
 /// <summary>
 /// Create a receiver node for the HL7 transport wrapper
 /// </summary>
 private Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Receiver CreateReceiverNode(TargetConfiguration configuration)
 {
     return(new Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Receiver(
                new Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Device(
                    !String.IsNullOrEmpty(configuration.DeviceIdentifier) ? new SET <II>(new II(configuration.DeviceIdentifier)) : new SET <II>()
     {
         NullFlavor = NullFlavor.NoInformation
     }
                    )
                ));
 }
Esempio n. 8
0
        /// <summary>
        /// Returns directory of the compilation result.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        public virtual string GetOutputDir(TargetPlatform platform, TargetConfiguration configuration)
        {
            Debug.Assert(platform != TargetPlatform.Unknown);
            var outputDirectory = Path.Combine(BuildSystem.GetSdkLocation(), "Bin");

            if (configuration == TargetConfiguration.Release)
            {
                return(outputDirectory);
            }
            return(Path.Combine(outputDirectory, configuration.ToString()));
        }
Esempio n. 9
0
 /// <summary>
 /// Returns path to the import library (only actual for Windows DLLs), or null if no import library needs to be generated.
 /// </summary>
 /// <param name="platform">One of the target platforms.</param>
 /// <param name="configuration">One of the target configurations.</param>
 public virtual string GetImportLibraryOutputPath(TargetPlatform platform, TargetConfiguration configuration)
 {
     Debug.Assert(platform != TargetPlatform.Unknown);
     if (TargetInfo.IsMicrosoftPlatform(platform) && GetBuildType(platform, configuration) == ProjectBuildType.DynamicLibrary)
     {
         var importLibraryOutputDirectory = Path.Combine(BuildSystem.GetSdkLocation(), "lib", GetName());
         return(configuration != TargetConfiguration.Release
             ? importLibraryOutputDirectory + "." + configuration + ".lib"
             : importLibraryOutputDirectory + ".lib");
     }
     return(null);
 }
        public ConfigurationBuilder AddTarget(string name, Action <ITargetConfiguration> action = null)
        {
            if (_targets.ContainsKey(name))
            {
                _context.CakeContext.LogAndThrow($"Target {name} already exists");
            }

            ITargetConfiguration targetConfiguration = new TargetConfiguration(_context);

            action?.Invoke(targetConfiguration);
            _targets.Add(name, targetConfiguration);
            return(this);
        }
Esempio n. 11
0
        internal static string GetCSharpBuildDefine(TargetConfiguration configuration)
        {
            switch (configuration)
            {
            case TargetConfiguration.Debug: return("BUILD_DEBUG");

            case TargetConfiguration.Development: return("BUILD_DEVELOPMENT");

            case TargetConfiguration.Release: return("BUILD_RELEASE");

            default: throw new Exception();
            }
        }
Esempio n. 12
0
        //MUST BE IN SYNC : MonoUE.Core.props, ConfigurationHelpers.cs, MonoMainDomain.cpp, MonoRuntimeStagingRules.cs, MonoScriptCodeGenerator.cpp, and IDE extensions
        public static string GetAssemblyDirectory(TargetConfiguration targetConfiguration, TargetPlatform targetPlatform, TargetType targetType, string rootDirectory = null)
        {
            string ConfigSuffix = null;

            switch (targetConfiguration)
            {
            case TargetConfiguration.Debug:
                ConfigSuffix = "-Debug";
                break;

            case TargetConfiguration.DebugGame:
                ConfigSuffix = "-DebugGame";
                break;

            case TargetConfiguration.Development:
                ConfigSuffix = null;
                break;

            case TargetConfiguration.Test:
                ConfigSuffix = "-Test";
                break;

            case TargetConfiguration.Shipping:
                ConfigSuffix = "-Shipping";
                break;
            }

            string Name = "Mono";

            switch (targetType)
            {
            case TargetType.Editor:
                Name = Name + "Editor";
                break;

            case TargetType.Client:
                Name = Name + "Client";
                break;

            case TargetType.Server:
                Name = Name + "Server";
                break;

            case TargetType.Program:
                throw new ArgumentException(nameof(targetType));
            }

            var dir = Path.Combine("Binaries", targetPlatform.ToString(), Name + ConfigSuffix);

            return(rootDirectory == null ? dir : Path.Combine(rootDirectory, dir));
        }
 /// <summary>
 /// Returns the information for specific platform.
 /// </summary>
 /// <param name="theConfiguration">Desired configuration.</param>
 public static TargetConfigurationInfo Get(TargetConfiguration theConfiguration)
 {
     if (s_CachedInformation == null)
     {
         s_CachedInformation = new Dictionary <TargetConfiguration, TargetConfigurationInfo>
         {
             [TargetConfiguration.Unknown]     = null,
             [TargetConfiguration.Debug]       = new DebugConfigurationInfo(),
             [TargetConfiguration.Release]     = new ReleaseConfigurationInfo(),
             [TargetConfiguration.Development] = new DevelopmentConfigurationInfo(),
         };
     }
     return(s_CachedInformation[theConfiguration]);
 }
Esempio n. 14
0
        /// <summary>
        /// Generates a strigified list of macros.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        /// <param name="separator">Separator string between macros. ';' By default.</param>
        /// <returns>A strigified list of macros.</returns>
        public string GenerateMacros(TargetPlatform platform, TargetConfiguration configuration, string separator = null)
        {
            if (separator == null)
            {
                separator = Path.PathSeparator.ToString();
            }

            var macrosBuilder = new StringBuilder();

            foreach (var macro in Macros[platform, configuration])
            {
                macrosBuilder.Append(macro).Append(separator);
            }
            return(macrosBuilder.ToString());
        }
Esempio n. 15
0
 /// <summary>
 /// Accesses the platform/configuration specific value of the container.
 /// </summary>
 /// <param name="platform">One of the target platforms.</param>
 /// <param name="configuration">One of the target configurations.</param>
 public T this[TargetPlatform platform, TargetConfiguration configuration]
 {
     get
     {
         if (platform == TargetPlatform.Any)
         {
             platform = TargetInfo.EnumerateAllPlatforms().First();
         }
         if (configuration == TargetConfiguration.Any)
         {
             configuration = TargetInfo.EnumerateAllConfigurations().First();
         }
         return(m_Container[CompressPlatformConfiguration(platform, configuration)]);
     }
 }
Esempio n. 16
0
            private static void DeployEditorBinaries(TargetConfiguration configuration)
            {
                if (Platform.BuildPlatform.Target == TargetPlatform.Windows)
                {
                    var binariesSubDir = "Binaries/Editor/Win64/" + configuration;
                    var src            = Path.Combine(RootPath, binariesSubDir);
                    var dst            = Path.Combine(OutputPath, binariesSubDir);
                    var dstDebug       = Path.Combine(Deployer.PackageOutputPath, "EditorDebugSymbols/Win64/" + configuration);
                    Directory.CreateDirectory(dst);
                    Directory.CreateDirectory(dstDebug);

                    // Validate that build editor app has a valid version number
                    var editorExeName = "FlaxEditor.exe";
                    var version       = FileVersionInfo.GetVersionInfo(Path.Combine(src, editorExeName));
                    if (version.FileMajorPart != Deployer.VersionMajor || version.FileMinorPart != Deployer.VersionMinor || version.FileBuildPart != Deployer.VersionBuild)
                    {
                        throw new InvalidDataException("Invalid engine build number. Output " + editorExeName + " has not matching version number.");
                    }

                    // Deploy binaries
                    DeployFile(src, dst, editorExeName);
                    DeployFile(src, dst, "FlaxEditor.Build.json");
                    DeployFile(src, dst, "FlaxEditor.lib");
                    DeployFile(src, dst, "FlaxEngine.CSharp.pdb");
                    DeployFile(src, dst, "FlaxEngine.CSharp.xml");
                    DeployFile(src, dst, "Newtonsoft.Json.pdb");
                    DeployFiles(src, dst, "*.dll");

                    // Deploy debug symbols files
                    DeployFiles(src, dstDebug, "*.pdb");
                    File.Delete(Path.Combine(dstDebug, "FlaxEngine.CSharp.pdb"));
                    File.Delete(Path.Combine(dstDebug, "Newtonsoft.Json.pdb"));
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
Esempio n. 17
0
        /// <summary>
        /// Generates a strigified list of linked libraries paths.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        /// <param name="separator">Separator string between linked libraries paths. ';' By default.</param>
        /// <param name="filter">Linked library path filter.</param>
        /// <returns>A strigified list of linked libraries paths.</returns>
        public string GenerateLinkedLibrariesPaths(TargetPlatform platform, TargetConfiguration configuration, string separator = null, Func <string, string> filter = null)
        {
            if (separator == null)
            {
                separator = Path.PathSeparator.ToString();
            }
            if (filter == null)
            {
                filter = s => s;
            }

            // Adding libraries from dependencies.
            var linkedLibraries = new StringBuilder();

            foreach (var projectDependency in Dependencies[platform, configuration])
            {
                foreach (var projectDependencyLibraryPath in projectDependency.LinkedLibraries[platform, configuration])
                {
                    linkedLibraries.Append(filter(projectDependencyLibraryPath.FilePath)).Append(separator);
                }
            }
            return(linkedLibraries.ToString());
        }
Esempio n. 18
0
        public virtual string ResolveDependency(TargetConfiguration Configuration)
        {
            string DependencyPCE = String.Format("*{0}.{1}{2}", Target.Platform.ToString(), Configuration.ToString(), Target.GetPlatformStaticLibraryExtension());
            if (Directory.GetFiles(this.Location, DependencyPCE).Length == 0)
            {   // Seams that library is build for all configurations into single library.
                string DependencyPE = String.Format("*{0}{1}", Target.Platform.ToString(), Target.GetPlatformStaticLibraryExtension());
                if (Directory.GetFiles(this.Location, DependencyPE).Length == 0)
                {   // Libary path on disk contains only extension
                    string DependencyE = "*" + Target.GetPlatformStaticLibraryExtension();
                    if (Directory.GetFiles(this.Location, DependencyE).Length == 0)
                    {   // Nothing found.
                        ConsoleOutput.WriteLine(Path.Combine(this.Location, ".gddep"), "warning: not static libraries was found this dependecy");
                        return "";
                    }

                    return Path.Combine(this.Location, DependencyE);
                }

                return Path.Combine(this.Location, DependencyPE);
            }

            return Path.Combine(this.Location, DependencyPCE);
        }
Esempio n. 19
0
        /// <summary>
        /// Generates a strigified list of include paths.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        /// <param name="separator">Separator string between include paths. ';' By default.</param>
        /// <returns>A strigified include paths.</returns>
        public string GenerateIncludePaths(TargetPlatform platform, TargetConfiguration configuration, string separator = null)
        {
            if (separator == null)
            {
                separator = Path.PathSeparator.ToString();
            }

            // Adding header paths from this projects.
            var includePathesBuilder = new StringBuilder();

            foreach (var headerDirectory in HeaderDirectories[platform, configuration])
            {
                includePathesBuilder.Append(headerDirectory).Append(separator);
            }
            // Adding header paths from dependencies.
            foreach (var dependency in Dependencies[platform, configuration])
            {
                foreach (var dependencyIncludePath in dependency.HeaderDirectories[platform, configuration])
                {
                    includePathesBuilder.Append(dependencyIncludePath).Append(separator);
                }
            }
            return(includePathesBuilder.ToString());
        }
Esempio n. 20
0
 private static void BuildTargetDotNet(RulesAssembly rules, TaskGraph graph, Target target, Platform platform, TargetConfiguration configuration)
 {
     throw new NotImplementedException("TODO: building C# targets");
 }
Esempio n. 21
0
            private static void DeployEditorBinaries(TargetConfiguration configuration)
            {
                if (Platform.BuildPlatform.Target == TargetPlatform.Windows)
                {
                    var binariesSubDir = "Binaries/Editor/Win64/" + configuration;
                    var src            = Path.Combine(RootPath, binariesSubDir);
                    var dst            = Path.Combine(OutputPath, binariesSubDir);
                    var dstDebug       = Path.Combine(Deployer.PackageOutputPath, "EditorDebugSymbols/Win64/" + configuration);
                    Directory.CreateDirectory(dst);
                    Directory.CreateDirectory(dstDebug);

                    // Validate that build editor app has a valid version number
                    var editorExeName = "FlaxEditor.exe";
                    var version       = FileVersionInfo.GetVersionInfo(Path.Combine(src, editorExeName));
                    if (version.FileMajorPart != Deployer.VersionMajor || version.FileMinorPart != Deployer.VersionMinor || version.FileBuildPart != Deployer.VersionBuild)
                    {
                        throw new InvalidDataException("Invalid engine build number. Output " + editorExeName + " has not matching version number.");
                    }

                    // Deploy binaries
                    DeployFile(src, dst, editorExeName);
                    CodeSign(Path.Combine(dst, editorExeName));
                    DeployFile(src, dst, "FlaxEditor.Build.json");
                    DeployFile(src, dst, "FlaxEditor.lib");
                    DeployFile(src, dst, "FlaxEngine.CSharp.pdb");
                    DeployFile(src, dst, "FlaxEngine.CSharp.xml");
                    DeployFile(src, dst, "Newtonsoft.Json.pdb");
                    DeployFiles(src, dst, "*.dll");
                    CodeSign(Path.Combine(dst, "FlaxEngine.CSharp.dll"));

                    // Deploy debug symbols files
                    DeployFiles(src, dstDebug, "*.pdb");
                    File.Delete(Path.Combine(dstDebug, "FlaxEngine.CSharp.pdb"));
                    File.Delete(Path.Combine(dstDebug, "Newtonsoft.Json.pdb"));
                    if (configuration == TargetConfiguration.Development)
                    {
                        // Deploy Editor executable debug file for Development configuration to improve crash reporting
                        DeployFile(src, dst, "FlaxEditor.pdb");
                    }
                }
                else if (Platform.BuildPlatform.Target == TargetPlatform.Linux)
                {
                    var binariesSubDir = "Binaries/Editor/Linux/" + configuration;
                    var src            = Path.Combine(RootPath, binariesSubDir);
                    var dst            = Path.Combine(OutputPath, binariesSubDir);
                    Directory.CreateDirectory(dst);

                    // Deploy binaries
                    DeployFile(src, dst, "FlaxEditor");
                    DeployFile(src, dst, "FlaxEditor.Build.json");
                    DeployFile(src, dst, "FlaxEngine.CSharp.pdb");
                    DeployFile(src, dst, "FlaxEngine.CSharp.xml");
                    DeployFile(src, dst, "Newtonsoft.Json.pdb");
                    DeployFiles(src, dst, "*.dll");
                    DeployFiles(src, dst, "*.so");
                    DeployFile(src, dst, "Logo.png");

                    // Optimize package size
                    Utilities.Run("strip", "FlaxEditor", null, dst, Utilities.RunOptions.None);
                    Utilities.Run("strip", "libFlaxEditor.so", null, dst, Utilities.RunOptions.None);
                    Utilities.Run("strip", "libmonosgen-2.0.so", null, dst, Utilities.RunOptions.None);
                    Utilities.Run("ln", "-s libmonosgen-2.0.so libmonosgen-2.0.so.1", null, dst, Utilities.RunOptions.None);
                    Utilities.Run("ln", "-s libmonosgen-2.0.so libmonosgen-2.0.so.1.0.0", null, dst, Utilities.RunOptions.None);
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
Esempio n. 22
0
 /// <summary>
 /// Returns type of compiler/linker output.
 /// </summary>
 /// <param name="platform">One of the target platforms.</param>
 /// <param name="configuration">One of the target configurations.</param>
 public virtual ProjectBuildType GetBuildType(TargetPlatform platform, TargetConfiguration configuration)
 {
     Debug.Assert(platform != TargetPlatform.Unknown);
     return(TargetInfo.IsDesktopPlatform(platform) ? ProjectBuildType.DynamicLibrary : ProjectBuildType.StaticLibrary);
 }
Esempio n. 23
0
        private void RegisterHotKeys()
        {
            _hotKeyService.UnregisterAllHotKeys();

            if (_settingsService.ToggleHotKey != HotKey.None)
            {
                _hotKeyService.RegisterHotKey(_settingsService.ToggleHotKey, Toggle);
            }

            if (_settingsService.IncreaseTemperatureOffsetHotKey != HotKey.None)
            {
                _hotKeyService.RegisterHotKey(_settingsService.IncreaseTemperatureOffsetHotKey, () =>
                {
                    const double delta = +100;

                    // Avoid changing offset when it's already at its limit
                    if (TargetConfiguration.WithOffset(delta, 0) != TargetConfiguration)
                    {
                        TemperatureOffset += delta;
                    }
                });
            }

            if (_settingsService.DecreaseTemperatureOffsetHotKey != HotKey.None)
            {
                _hotKeyService.RegisterHotKey(_settingsService.DecreaseTemperatureOffsetHotKey, () =>
                {
                    const double delta = -100;

                    // Avoid changing offset when it's already at its limit
                    if (TargetConfiguration.WithOffset(delta, 0) != TargetConfiguration)
                    {
                        TemperatureOffset += delta;
                    }
                });
            }

            if (_settingsService.IncreaseBrightnessOffsetHotKey != HotKey.None)
            {
                _hotKeyService.RegisterHotKey(_settingsService.IncreaseBrightnessOffsetHotKey, () =>
                {
                    const double delta = +0.05;

                    // Avoid changing offset when it's already at its limit
                    if (TargetConfiguration.WithOffset(0, delta) != TargetConfiguration)
                    {
                        BrightnessOffset += delta;
                    }
                });
            }

            if (_settingsService.DecreaseBrightnessOffsetHotKey != HotKey.None)
            {
                _hotKeyService.RegisterHotKey(_settingsService.DecreaseBrightnessOffsetHotKey, () =>
                {
                    const double delta = -0.05;

                    // Avoid changing offset when it's already at its limit
                    if (TargetConfiguration.WithOffset(0, delta) != TargetConfiguration)
                    {
                        BrightnessOffset += delta;
                    }
                });
            }

            if (_settingsService.ResetConfigurationOffsetHotKey != HotKey.None)
            {
                _hotKeyService.RegisterHotKey(_settingsService.ResetConfigurationOffsetHotKey, ResetConfigurationOffset);
            }
        }
Esempio n. 24
0
        /// <summary>
        /// Gets the build options for the given target and the configuration.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="platform">The platform.</param>
        /// <param name="toolchain">The toolchain.</param>
        /// <param name="architecture">The build architecture.</param>
        /// <param name="configuration">The build configuration.</param>
        /// <param name="workingDirectory">The build workspace root folder path.</param>
        /// <param name="hotReloadPostfix">The output binaries postfix added for hot-reload builds in Editor to prevent file names collisions.</param>
        /// <returns>The build options.</returns>
        public static BuildOptions GetBuildOptions(Target target, Platform platform, Toolchain toolchain, TargetArchitecture architecture, TargetConfiguration configuration, string workingDirectory, string hotReloadPostfix = "")
        {
            var platformName      = platform.Target.ToString();
            var architectureName  = architecture.ToString();
            var configurationName = configuration.ToString();
            var options           = new BuildOptions
            {
                Target             = target,
                Platform           = platform,
                Toolchain          = toolchain,
                Architecture       = architecture,
                Configuration      = configuration,
                CompileEnv         = new CompileEnvironment(),
                LinkEnv            = new LinkEnvironment(),
                IntermediateFolder = Path.Combine(workingDirectory, Configuration.IntermediateFolder, target.Name, platformName, architectureName, configurationName),
                OutputFolder       = Path.Combine(workingDirectory, Configuration.BinariesFolder, target.Name, platformName, architectureName, configurationName),
                WorkingDirectory   = workingDirectory,
                HotReloadPostfix   = hotReloadPostfix,
            };

            toolchain?.SetupEnvironment(options);
            target.SetupTargetEnvironment(options);
            return(options);
        }
Esempio n. 25
0
        /// <summary>
        /// Enumerates list of directories that contain header files.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        public virtual IEnumerable <string> EnumerateHeaderDirectories(TargetPlatform platform, TargetConfiguration configuration)
        {
            var projectSourceFiles = Path.Combine(GetLocation(), "Source");

            if (Directory.Exists(projectSourceFiles))
            {
                yield return(projectSourceFiles);
            }
        }
 public override sealed ProjectBuildType GetBuildType(TargetPlatform Platform, TargetConfiguration Configuration)
 {
     return ProjectBuildType.Application;
 }
Esempio n. 27
0
        /// <summary>
        /// Returns directory of the compilation result.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        public virtual string GetOutputFileName(TargetPlatform platform, TargetConfiguration configuration)
        {
            Debug.Assert(platform != TargetPlatform.Unknown);
            string outputExtension = null, outputPrefix = null;

            if (TargetInfo.IsMicrosoftPlatform(platform))
            {
                switch (GetBuildType(platform, configuration))
                {
                case ProjectBuildType.Application:
                    outputPrefix    = "";
                    outputExtension = ".exe";
                    break;

                case ProjectBuildType.DynamicLibrary:
                    outputPrefix    = "";
                    outputExtension = ".dll";
                    break;

                case ProjectBuildType.StaticLibrary:
                    outputPrefix    = "";
                    outputExtension = ".lib";
                    break;
                }
            }
            else if (TargetInfo.IsApplePlatform(platform))
            {
                switch (GetBuildType(platform, configuration))
                {
                case ProjectBuildType.Application:
                    outputPrefix    = "";
                    outputExtension = ".app";
                    break;

                case ProjectBuildType.DynamicLibrary:
                    outputPrefix    = "";
                    outputExtension = ".dylib";
                    break;

                case ProjectBuildType.StaticLibrary:
                    outputPrefix    = "lib";
                    outputExtension = ".a";
                    break;
                }
            }
            else if (TargetInfo.IsPosixPlatform(platform))
            {
                switch (GetBuildType(platform, configuration))
                {
                case ProjectBuildType.Application:
                    outputPrefix    = "";
                    outputExtension = "";
                    break;

                case ProjectBuildType.DynamicLibrary:
                    outputPrefix    = "lib";
                    outputExtension = ".so";
                    break;

                case ProjectBuildType.StaticLibrary:
                    outputPrefix    = "lib";
                    outputExtension = ".a";
                    break;
                }
            }
            else
            {
                throw new NotSupportedException("Unknown target platform for project output path.");
            }
            return(outputPrefix + GetName() + outputExtension);
        }
Esempio n. 28
0
 /// <summary>
 /// Creates a new Target.
 /// </summary>
 /// <param name="configuration">Deployment target configuration.</param>
 protected Target(TargetConfiguration configuration)
 {
     Configuration = configuration;
 }
Esempio n. 29
0
        /// <summary>
        /// Enumerates list of files with source code, which would be added to generated project data.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        public virtual IEnumerable <ProjectFile> EnumerateSourceFiles(TargetPlatform platform, TargetConfiguration configuration)
        {
            // Adding collected project files.
            var projectSourceDirectory = Path.Combine(GetLocation(), "Source");

            if (Directory.Exists(projectSourceDirectory))
            {
                foreach (var sourceFile in Directory.EnumerateFiles(projectSourceDirectory, "*.*", SearchOption.AllDirectories))
                {
                    var sourceFileExtension = (Path.GetExtension(sourceFile) ?? "").ToLowerInvariant();
                    switch (sourceFileExtension)
                    {
                    case ".h":
                    case ".hh":
                    case ".hpp":
                    case ".hxx":
                        yield return(new ProjectFile(sourceFile, GetProgrammingLanguage() == ProjectLanguge.Cpp ? ProjectSourceFileType.HeaderFile : ProjectSourceFileType.SupportFile));

                        break;

                    case ".c":
                    case ".cc":
                    case ".cpp":
                    case ".cxx":
                        yield return(new ProjectFile(sourceFile, GetProgrammingLanguage() == ProjectLanguge.Cpp ? ProjectSourceFileType.SourceCode : ProjectSourceFileType.SupportFile));

                        break;

                    case ".s":
                    case ".asm":
                        yield return(new ProjectFile(sourceFile, GetProgrammingLanguage() == ProjectLanguge.Cpp ? ProjectSourceFileType.SourceCodeAssembler : ProjectSourceFileType.SupportFile));

                        break;

                    case ".m":
                    case ".mm":
                        yield return(new ProjectFile(sourceFile, GetProgrammingLanguage() == ProjectLanguge.Cpp ? ProjectSourceFileType.SourceCodeObjective : ProjectSourceFileType.SupportFile));

                        break;

                    case ".inl":
                        yield return(new ProjectFile(sourceFile, GetProgrammingLanguage() == ProjectLanguge.Cpp ? ProjectSourceFileType.InlineImplementation : ProjectSourceFileType.SupportFile));

                        break;

                    case ".rc":
                        if (TargetInfo.IsMicrosoftPlatform(platform))
                        {
                            yield return(new ProjectFile(sourceFile, GetProgrammingLanguage() == ProjectLanguge.Cpp ? ProjectSourceFileType.ResourceScript : ProjectSourceFileType.SupportFile));
                        }
                        break;

                    case ".cs":
                        var projectFileSecondExtension = Path.GetExtension(Path.GetFileNameWithoutExtension(sourceFile) ?? "").ToLowerInvariant();
                        if (!string.IsNullOrEmpty(projectFileSecondExtension))
                        {
                            switch (projectFileSecondExtension)
                            {
                            case ".gdproj":
                            case ".gddep":
                            case ".gdsln":
                                yield return(new ProjectFile(sourceFile, ProjectSourceFileType.SupportFile));

                                break;
                            }
                        }
                        break;
                    }
                }
                // Adding project file as support file.
                yield return(new ProjectFile(GetSource(), ProjectSourceFileType.SupportFile));
            }
        }
Esempio n. 30
0
 private static string GenerateCondition(TargetConfiguration Configuration)
 {
     string Platform = GetPlatformString();
     return string.Format(@"'$(Configuration)|$(Platform)'=='{0}|{1}'", Configuration.ToString(), Platform);
 }
Esempio n. 31
0
 public sealed override ProjectBuildType GetBuildType(TargetPlatform Platform, TargetConfiguration Configuration)
 {
     return(ProjectBuildType.Application);
 }
Esempio n. 32
0
        /// <summary>
        /// Enumerates list of dependencies for this project.
        /// </summary>
        /// <param name="platform">One of the target platforms.</param>
        /// <param name="configuration">One of the target configurations.</param>
        public virtual IEnumerable <Dependency> EnumerateDependencies(TargetPlatform platform, TargetConfiguration configuration)
        {
            var projectDependencyDirectory = Path.Combine(GetLocation(), "Dependencies");

            if (Directory.Exists(projectDependencyDirectory))
            {
                // Adding explicit dependencies.
                foreach (var dependencySourcePath in Directory.EnumerateFiles(projectDependencyDirectory, "*.gddep.cs", SearchOption.AllDirectories))
                {
                    Dependency dependency;
                    try
                    {
                        dependency = DependencyFactory.Create(dependencySourcePath);
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine($"Failed to load dependency {dependencySourcePath} with exception {exception}");
                        continue;
                    }
                    if (dependency.IsSupported[platform, configuration])
                    {
                        yield return(dependency);
                    }
                }
            }
            // Adding implicit priority-related dependencies.
            var priority = GetPriority();

            if (priority < ProjectPriority.CoreLevel)
            {
                // Resolving Core library dependency.
                yield return(ProjectDependencyFactory.GetGoddamnCoreDependency());

                if (priority < ProjectPriority.EngineLevel)
                {
                    // Resolving Engine library dependency.
                    yield return(ProjectDependencyFactory.GetGoddamnEngineDependency());
                }
            }
        }
Esempio n. 33
0
 /// <summary>
 /// Creates a new message queue work item
 /// </summary>
 public MessageQueueWorkItem(TargetConfiguration target, IMessage message)
 {
     this.Target  = target;
     this.Message = message;
 }
Esempio n. 34
0
 /// <summary>
 /// Enumerates list of additional preprocessor definitions added to this project.
 /// </summary>
 /// <param name="platform">One of the target platforms.</param>
 /// <param name="configuration">One of the target configurations.</param>
 public virtual IEnumerable <ProjectMacro> EnumerateMacros(TargetPlatform platform, TargetConfiguration configuration)
 {
     if (TargetInfo.IsMicrosoftPlatform(platform))
     {
         if (TargetConfigurationInfo.Get(configuration).IsDebug)
         {
             yield return(new ProjectMacro("_DEBUG", "1"));
         }
         else
         {
             yield return(new ProjectMacro("NDEBUG", "1"));
         }
         if (GetBuildType(platform, configuration) == ProjectBuildType.DynamicLibrary)
         {
             yield return(new ProjectMacro("_WINDLL"));
         }
     }
     // Something else here..
 }