/// <summary>
        /// Read the table referenced in the source file using either the xref file or the RCODE-INFO:TABLE-LIST,
        /// make sure to also get the CRC value for each table
        /// </summary>
        /// <param name="ienv"></param>
        /// <param name="analysisModeSimplifiedDatabaseReferences"></param>
        public void ComputeRequiredDatabaseReferences(AUoeExecutionEnv ienv, bool analysisModeSimplifiedDatabaseReferences)
        {
            if (!IsAnalysisMode || string.IsNullOrEmpty(CompilationXrefFilePath) && string.IsNullOrEmpty(CompilationRcodeTableListFilePath))
            {
                return;
            }
            AddWarningIfFileDefinedButDoesNotExist(CompilationRcodeTableListFilePath);

            RequiredDatabaseReferences = new List <UoeDatabaseReference>();

            // read from xref (we need the table CRC from the environment)
            if (ienv is UoeExecutionEnv env && !analysisModeSimplifiedDatabaseReferences)
            {
                if (File.Exists(CompilationXrefFilePath))
                {
                    foreach (var dbRef in UoeUtilities.GetDatabaseReferencesFromXrefFile(CompilationXrefFilePath, ienv.IoEncoding))
                    {
                        if (env.TablesCrc.ContainsKey(dbRef))
                        {
                            RequiredDatabaseReferences.Add(new UoeDatabaseReferenceTable {
                                QualifiedName = dbRef,
                                Crc           = env.TablesCrc[dbRef]
                            });
                        }
                        else if (env.Sequences.Contains(dbRef))
                        {
                            RequiredDatabaseReferences.Add(new UoeDatabaseReferenceSequence {
                                QualifiedName = dbRef
                            });
                        }
                    }
                }
            }

            // read from rcode-info:table-list
            if (File.Exists(CompilationRcodeTableListFilePath))
            {
                Utils.ForEachLine(CompilationRcodeTableListFilePath, null, (i, line) => {
                    var split = line.Split('\t');
                    if (split.Length >= 1)
                    {
                        var qualifiedName = split[0].Trim();
                        if (!RequiredDatabaseReferences.Exists(r => r.QualifiedName.EqualsCi(qualifiedName)))
                        {
                            RequiredDatabaseReferences.Add(new UoeDatabaseReferenceTable {
                                QualifiedName = qualifiedName,
                                Crc           = split[1].Trim()
                            });
                        }
                    }
                }, ienv.IoEncoding);
            }
        }
Esempio n. 2
0
 public UoeExecutionParallelCompile(AUoeExecutionEnv env) : base(env)
 {
 }
Esempio n. 3
0
 public AUoeExecutionDbExtract(AUoeExecutionEnv env) : base(env)
 {
     _databaseExtractFilePath = Path.Combine(_tempDir, "db.dump");
 }
Esempio n. 4
0
 public UoeExecutionDbExtractTableCrcAndSequenceList(AUoeExecutionEnv env) : base(env)
 {
 }
Esempio n. 5
0
 public AUoeExecutionHandleCompilation(AUoeExecutionEnv env) : base(env)
 {
     _filesListPath       = Path.Combine(_tempDir, "files.list");
     _progressionFilePath = Path.Combine(_tempDir, "compile.progression");
     _compilationLog      = Path.Combine(_tempDir, "compilation.log");
 }
Esempio n. 6
0
 public UoeExecutionDbExtractDefinition(AUoeExecutionEnv env) : base(env)
 {
     _extractProgramPath = Path.Combine(_tempDir, $"dbextract_{DateTime.Now:HHmmssfff}.p");
 }
 public UoeExecutionDbExtractLastSchemaUpdate(AUoeExecutionEnv env) : base(env)
 {
 }
 public UoeExecutionRun(AUoeExecutionEnv env, string filePathToRun) : base(env)
 {
     _filePathToRun = filePathToRun;
 }