コード例 #1
0
ファイル: BuildDriver.cs プロジェクト: mohammedmanssour/uno
        public BuildDriver(Log log, BuildTarget target, BuildOptions options, Project project, UnoConfig config)
            : base(log)
        {
            _target           = target;
            _options          = options;
            _project          = project;
            _config           = config;
            Log.MaxErrorCount = options.MaxErrorCount;
            Log.WarningLevel  = options.WarningLevel;

            Log.Reset();
            if (target.IsObsolete)
            {
                Log.Warning("The build target " + target.Quote() + " is obsolete and might not work any more.");
            }

            _anim = Log.StartAnimation("Configuring");
            PrintRow("Project file", project.FullPath);

            _compilerOptions = new CompilerOptions {
                BuildTarget     = _target.Identifier,
                Configuration   = _options.Configuration.ToString(),
                OutputDirectory = !string.IsNullOrEmpty(_options.OutputDirectory)
                    ? Path.GetFullPath(_options.OutputDirectory)
                    : project.OutputDirectory,
                MainClass  = _options.MainClass,
                Debug      = _options.Configuration != BuildConfiguration.Release,
                Parallel   = _options.Parallel,
                Strip      = _options.Strip ?? _target.DefaultStrip,
                CanCacheIL = _options.PackageCache != null
            };

            if (_options.Test)
            {
                _options.Defines.Add("UNO_TEST");
                _compilerOptions.TestOptions = new TestOptions {
                    TestServerUrl = _options.TestServerUrl,
                    Filter        = _options.TestFilter
                };
            }

            _cache = _options.PackageCache ?? new PackageCache(Log, _config);
            PrintRow("Search paths", _cache.SearchPaths);

            _compiler = new Compiler(
                Log,
                _target.CreateBackend(config),
                GetPackage(),
                _compilerOptions);
            _env     = _compiler.Environment;
            _backend = _compiler.Backend;
            _input   = _compiler.Input;

            if (_options.Clean)
            {
                _compiler.Disk.DeleteDirectory(_env.OutputDirectory);
            }

            _file = new BuildFile(_env.OutputDirectory);
        }
コード例 #2
0
 internal BuildResult(Log log, Project project, BuildTarget target, ICompiler compiler, BuildOptions options, BuildFile file, BackendResult result)
 {
     Log             = log;
     Project         = project;
     Target          = target;
     File            = file;
     Compiler        = compiler;
     ErrorCount      = log.ErrorCount;
     WarningCount    = log.WarningCount;
     OutputDirectory = compiler.Environment.OutputDirectory;
     RunArguments    = options.RunArguments;
     BackendResult   = result;
     IL         = compiler.Data.IL;
     Entrypoint = compiler.Data.Entrypoint;
     IsDebug    = compiler.Environment.Debug;
 }
コード例 #3
0
        public virtual async Task <bool> Run(Shell shell, BuildFile file, string args = null, CancellationToken ct = default(CancellationToken))
        {
            var filename = string.Concat(file.RunCommand, " ", args).SplitCommand(file.RootDirectory, out args);

            return(await shell.Start(filename, args, file.RootDirectory, 0, null, ct) == 0);
        }
コード例 #4
0
        public virtual bool Build(Shell shell, BuildFile file, string args = null)
        {
            var filename = string.Concat(file.BuildCommand, " ", args).SplitCommand(file.RootDirectory, out args);

            return(shell.Run(filename, args, file.RootDirectory, RunFlags.Colors | RunFlags.Compact) == 0);
        }
コード例 #5
0
 public virtual bool CanRun(BuildFile file)
 {
     return(!string.IsNullOrEmpty(file.RunCommand));
 }