static int Main(string[] Args)
        {
            //FilesMetaDataGenerator.Generate(@"E:\Omid\New folder\SourceCode");

            Args = new string[] { "-Engine", "-X86", "-Debug" };

            if (Args.Length >= 3)
            {
                if (Enum.IsDefined(typeof(BuildSystem.TargetsToBuild), Args[0].Substring(1)))
                {
                    BuildSystem.TargetsToBuild toBuild = (BuildSystem.TargetsToBuild)Enum.Parse(typeof(BuildSystem.TargetsToBuild), Args[0].Substring(1));

                    if (Enum.IsDefined(typeof(BuildSystem.PlatformArchitectures), Args[1].Substring(1)))
                    {
                        BuildSystem.PlatformArchitectures architecture = (BuildSystem.PlatformArchitectures)Enum.Parse(typeof(BuildSystem.PlatformArchitectures), Args[1].Substring(1));

                        if (Enum.IsDefined(typeof(ProjectFileGenerator.BuildConfigurations), Args[2].Substring(1)))
                        {
                            ProjectFileGenerator.BuildConfigurations buildConfiguration = (ProjectFileGenerator.BuildConfigurations)Enum.Parse(typeof(ProjectFileGenerator.BuildConfigurations), Args[2].Substring(1));

                            BuildSystem builder = new BuildSystem(toBuild, architecture, buildConfiguration);
                            if (builder.Build())
                            {
                                return(0);
                            }

                            return(1);
                        }
                    }
                }
            }

            ConsoleHelper.WriteLineError("Parameters should be like -TargetToBuild -PlatformArchitecture -BuildConfiguration");
            return(1);
        }
示例#2
0
        public BuildSystem(TargetsToBuild ToBuild, PlatformArchitectures PlatformArchitecture, ProjectFileGenerator.BuildConfigurations BuildConfiguration)
        {
            ConsoleHelper.WriteLineInfo(EnvironmentHelper.Runtime + " under " + EnvironmentHelper.Platform + " is present");

            finalOutputDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + EnvironmentHelper.PathSeparator;
            string rootPath = Path.GetFullPath(finalOutputDirectory + ".." + EnvironmentHelper.PathSeparator);

            processDirectory      = rootPath;
            intermediateDirectory = rootPath + "Intermediate" + EnvironmentHelper.PathSeparator;

            platformType       = PlatformType;
            buildConfiguration = BuildConfiguration;

            //rootPath = @"D:\Omid\Engine\ge3d\SourceCode";
            //processDirectory = rootPath;
            //intermediateDirectory = rootPath + "Intermediate\\";

            compiler.ErrorRaised += OnError;
        }