Example #1
0
        private void DoAOTCompile()
        {
            string fileList = _sshHelper.WriteSSHCommand(_sshHelper.GetFileListCommand(_cmd.DeviceDirectory), false, true);

            var exeDllList = _sshHelper.RegexExeDll.Matches(fileList)
                             .OfType <Match>()
                             .Select(m => m.Groups[0].Value)
                             .ToArray();

            var soList = _sshHelper.RegexSo.Matches(fileList)
                         .OfType <Match>()
                         .Select(m => m.Groups[0].Value)
                         .ToArray();

            var compileList = exeDllList.Where(fileNative => !soList.Contains(fileNative)).ToArray();

            if (compileList.Count() == 0)
            {
                _console.Log.WriteLine("All files compiled, nothing to do!");
            }

            foreach (var file in compileList)
            {
                string compileTarget = string.Format(@"mono --aot=full {0}{1}", _cmd.DeviceDirectory, file);
                _console.Log.WriteLine(string.Format("Compiling {0} for AOT execution", file));
                _sshHelper.WriteSSHCommand(compileTarget, true);
            }
        }
        private bool VerifiyRemoteFiles()
        {
            string fileListRemote = _sshHelper.WriteSSHCommand(_sshHelper.GetFileListCommand(_remotePath), false, true);

            var usedFileListRemote = _sshHelper.RegexExecutionFiles.Matches(fileListRemote)
                                     .OfType <Match>()
                                     .Select(m => m.Groups[0].Value)
                                     .ToArray();

            var usedFileListLocal = new DirectoryInfo(_localPath).GetFiles().Select(o => o.Name).Where(f => _sshHelper.RegexExtension.IsMatch(f)).ToArray();

            var    missingFileList = usedFileListLocal.Where(file => !usedFileListRemote.Contains(file)).ToArray();
            string missingFiles    = string.Concat(missingFileList.ToArray().Select(a => a += ", ").ToArray());

            if (missingFileList.Count() > 0)
            {
                _console.Log.WriteLine("Found missing remote file(s): {0} forcing upload...", missingFiles);
            }

            return(missingFileList.Count() == 0);
        }