Exemplo n.º 1
0
 internal InternalBuildStep(int number, BuildStepType type, FilePath inputFile, FilePath outputFile,
                            IAssemblerFactory assemblerFactory)
 {
     _stepNumber       = number;
     _stepType         = type;
     _inputFile        = inputFile;
     _outputFile       = outputFile;
     _assemblerFactory = assemblerFactory;
 }
Exemplo n.º 2
0
 public BuildStep(Guid InUniqueId, int InOrderIndex, string InDescription, string InStatusText, int InEstimatedDuration, string InFileName, string InArguments, string InWorkingDir, bool bInUseLogWindow)
 {
     UniqueId          = InUniqueId;
     OrderIndex        = InOrderIndex;
     Description       = InDescription;
     StatusText        = InStatusText;
     EstimatedDuration = InEstimatedDuration;
     Type          = BuildStepType.Other;
     FileName      = InFileName;
     Arguments     = InArguments;
     WorkingDir    = InWorkingDir;
     bUseLogWindow = bInUseLogWindow;
 }
Exemplo n.º 3
0
        public BuildStep(ConfigObject Object)
        {
            if (!Guid.TryParse(Object.GetValue(UniqueIdKey, ""), out UniqueId))
            {
                UniqueId = Guid.NewGuid();
            }
            if (!Int32.TryParse(Object.GetValue("OrderIndex", ""), out OrderIndex))
            {
                OrderIndex = -1;
            }

            Description = Object.GetValue("Description", "Untitled");
            StatusText  = Object.GetValue("StatusText", "Untitled");

            if (!int.TryParse(Object.GetValue("EstimatedDuration", ""), out EstimatedDuration) || EstimatedDuration < 1)
            {
                EstimatedDuration = 1;
            }

            if (!Enum.TryParse(Object.GetValue("Type", ""), true, out Type))
            {
                Type = BuildStepType.Other;
            }

            Target        = Object.GetValue("Target");
            Platform      = Object.GetValue("Platform");
            Configuration = Object.GetValue("Configuration");
            FileName      = Object.GetValue("FileName");
            WorkingDir    = Object.GetValue("WorkingDir");
            Arguments     = Object.GetValue("Arguments");

            if (!Boolean.TryParse(Object.GetValue("bUseLogWindow", ""), out bUseLogWindow))
            {
                bUseLogWindow = true;
            }
            if (!Boolean.TryParse(Object.GetValue("bNormalSync", ""), out bNormalSync))
            {
                bNormalSync = true;
            }
            if (!Boolean.TryParse(Object.GetValue("bScheduledSync", ""), out bScheduledSync))
            {
                bScheduledSync = bNormalSync;
            }
            if (!Boolean.TryParse(Object.GetValue("bShowAsTool", ""), out bShowAsTool))
            {
                bShowAsTool = false;
            }
        }
Exemplo n.º 4
0
 public BuildStep(Guid InUniqueId, int InOrderIndex, string InDescription, string InStatusText, int InEstimatedDuration, string InTarget, string InPlatform, string InConfiguration, string InArguments, bool bInSyncDefault)
 {
     UniqueId          = InUniqueId;
     OrderIndex        = InOrderIndex;
     Description       = InDescription;
     StatusText        = InStatusText;
     EstimatedDuration = InEstimatedDuration;
     Type           = BuildStepType.Compile;
     Target         = InTarget;
     Platform       = InPlatform;
     Configuration  = InConfiguration;
     Arguments      = InArguments;
     bUseLogWindow  = true;
     bNormalSync    = bInSyncDefault;
     bScheduledSync = bInSyncDefault;
 }
Exemplo n.º 5
0
		public BuildStep(Guid InUniqueId, int InOrderIndex, string InDescription, string InStatusText, int InEstimatedDuration, string InTarget, string InPlatform, string InConfiguration, string InArguments, bool bInSyncDefault)
		{
			UniqueId = InUniqueId;
			OrderIndex = InOrderIndex;
			Description = InDescription;
			StatusText = InStatusText;
			EstimatedDuration = InEstimatedDuration;
			Type = BuildStepType.Compile;
			Target = InTarget;
			Platform = InPlatform;
			Configuration = InConfiguration;
			Arguments = InArguments;
			bUseLogWindow = true;
			bNormalSync = bInSyncDefault;
			bScheduledSync = bInSyncDefault;
		}
Exemplo n.º 6
0
		public BuildStep(ConfigObject Object)
		{
			if(!Guid.TryParse(Object.GetValue(UniqueIdKey, ""), out UniqueId))
			{
				UniqueId = Guid.NewGuid();
			}
			if(!Int32.TryParse(Object.GetValue("OrderIndex", ""), out OrderIndex))
			{
				OrderIndex = -1;
			}

			Description = Object.GetValue("Description", "Untitled");
			StatusText = Object.GetValue("StatusText", "Untitled");

			if(!int.TryParse(Object.GetValue("EstimatedDuration", ""), out EstimatedDuration) || EstimatedDuration < 1)
			{
				EstimatedDuration = 1;
			}

			if(!Enum.TryParse(Object.GetValue("Type", ""), true, out Type))
			{
				Type = BuildStepType.Other;
			}

			Target = Object.GetValue("Target");
			Platform = Object.GetValue("Platform");
			Configuration = Object.GetValue("Configuration");
			FileName = Object.GetValue("FileName");
			Arguments = Object.GetValue("Arguments");

			if(!Boolean.TryParse(Object.GetValue("bUseLogWindow", ""), out bUseLogWindow))
			{
				bUseLogWindow = true;
			}
			if(!Boolean.TryParse(Object.GetValue("bNormalSync", ""), out bNormalSync))
			{
				bNormalSync = true;
			}
			if(!Boolean.TryParse(Object.GetValue("bScheduledSync", ""), out bScheduledSync))
			{
				bScheduledSync = bNormalSync;
			}
			if(!Boolean.TryParse(Object.GetValue("bShowAsTool", ""), out bShowAsTool))
			{
				bShowAsTool = false;
			}
		}
Exemplo n.º 7
0
 public static List <IBuildStep> GetBuildSteps(BuildStepType type)
 {
     return(m_steps.Where(s => s.GetBuildType() == type).ToList());
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a new build step using the built in spasm functions
 /// </summary>
 /// <param name="number">Build step number (0 indexed)</param>
 /// <param name="type">Type of internal operation to peform</param>
 /// <param name="inputFile">File to input to spasm</param>
 /// <param name="outputFile">File expected to be received</param>
 public InternalBuildStep(int number, BuildStepType type, FilePath inputFile, FilePath outputFile)
     : this(number, type, inputFile, outputFile, new AssemblerFactory())
 {
 }
Exemplo n.º 9
0
        public void ReadXML(XmlTextReader reader)
        {
            FilePath root = _project.ProjectDirectory;

            if (reader.Name != "BuildSystem")
            {
                throw new ArgumentException("Invalid XML Format");
            }

            var attribute = reader.GetAttribute("IncludeDirs");

            if (attribute != null)
            {
                string[] includeDirs = attribute.Split(';');
                foreach (string include in includeDirs.Where(include => !string.IsNullOrEmpty(include)))
                {
                    string path = Uri.UnescapeDataString(new Uri(Path.Combine(root, include)).AbsolutePath);
                    _project.IncludeDirs.Add(new FilePath(path));
                }
            }

            BuildConfig configToAdd = null;

            while (reader.MoveToNextElement())
            {
                if (reader.Name.Contains("Step"))
                {
                    if (configToAdd == null)
                    {
                        throw new ArgumentException("Invalid XML Format");
                    }

                    int    count     = Convert.ToInt32(reader.GetAttribute("StepNum"));
                    string inputFile = reader.GetAttribute("InputFile");
                    switch (reader.Name)
                    {
                    case "ExternalBuildStep":
                        string arguments = reader.GetAttribute("Arguments");
                        if (inputFile != null)
                        {
                            ExternalBuildStep exstep = new ExternalBuildStep(
                                count,
                                root.Combine(inputFile),
                                arguments);
                            configToAdd.AddStep(exstep);
                        }
                        break;

                    case "InternalBuildStep":
                        string        outputFile = reader.GetAttribute("OutputFile");
                        BuildStepType type       = (BuildStepType)Convert.ToInt16(reader.GetAttribute("StepType"));
                        if (inputFile != null && outputFile != null)
                        {
                            InternalBuildStep instep = new InternalBuildStep(
                                count,
                                type,
                                root.Combine(inputFile),
                                root.Combine(outputFile));
                            configToAdd.AddStep(instep);
                        }
                        break;

                    default:
                        throw new ArgumentException("Invalid XML Format");
                    }
                }
                else
                {
                    string configName = reader.Name;
                    configToAdd = new BuildConfig(configName);
                    _buildConfigs.Add(configToAdd);
                }
            }
        }