Lines Matching full:arktsconfig
16 #include "arktsconfig.h"
30 bool ArkTsConfig::Check(bool cond, const diagnostic::DiagnosticKind &diag, const util::DiagnosticMe… in Check()
100 ArkTsConfig::Pattern::Pattern(std::string value, std::string base) : value_(std::move(value)), base… in Pattern()
105 bool ArkTsConfig::Pattern::IsPattern() const in IsPattern()
110 std::string ArkTsConfig::Pattern::GetSearchRoot() const in GetSearchRoot()
124 bool ArkTsConfig::Pattern::Match(const std::string &path) const in Match()
130 // Replace arktsconfig special symbols with regular expressions in Match()
166 std::optional<ArkTsConfig> ArkTsConfig::ParseExtends(const std::string &configPath, const std::stri… in ParseExtends()
179 auto base = ArkTsConfig(basePath, diagnosticEngine_); in ParseExtends()
199 bool ArkTsConfig::ParsePaths(const JsonObject::JsonObjPointer *options, PathsMap &pathsMap, const s… in ParsePaths()
234 bool ArkTsConfig::ParseDynamicPaths(const JsonObject::JsonObjPointer *options, in ParseDynamicPaths()
255 bool ArkTsConfig::ParseSingleDynamicPath(const std::string &key, const JsonObject::JsonObjPointer *… in ParseSingleDynamicPath()
292 …{ark::os::NormalizePath(key), ArkTsConfig::DynamicImportData(*lang, normalizedDeclPath, ohmUrlValu… in ParseSingleDynamicPath()
297 bool ArkTsConfig::ParseCollection(const JsonObject *config, Collection &out, const std::string &tar… in ParseCollection()
317 void ArkTsConfig::ResolveConfigDependencies(std::unordered_map<std::string, std::shared_ptr<ArkTsCo… in ResolveConfigDependencies()
322 … auto config = std::make_shared<ArkTsConfig>(std::string_view(dependency), diagnosticEngine_); in ResolveConfigDependencies()
330 std::optional<std::string> ArkTsConfig::ReadConfig(const std::string &path) in ReadConfig()
349 static void ResolvePathInDependenciesImpl(ArkTsConfig *arktsConfig, in ResolvePathInDependenciesImpl() argument
353 for (const auto &dependencyPath : arktsConfig->Paths()) { in ResolvePathInDependenciesImpl()
356 if (!arktsConfig->Entry().empty()) { in ResolvePathInDependenciesImpl()
357 entries.emplace(arktsConfig->Package(), arktsConfig->Entry()); in ResolvePathInDependenciesImpl()
359 for (const auto &config : arktsConfig->Dependencies()) { in ResolvePathInDependenciesImpl()
364 void ArkTsConfig::ResolveAllDependenciesInArkTsConfig() in ResolveAllDependenciesInArkTsConfig()
369 bool ArkTsConfig::ParseCompilerOptions(std::string &arktsConfigDir, std::unordered_set<std::string>… in ParseCompilerOptions()
370 const JsonObject *arktsConfig) in ParseCompilerOptions() argument
372 auto compilerOptions = arktsConfig->GetValue<JsonObject::JsonObjPointer>(COMPILER_OPTIONS); in ParseCompilerOptions()
414 bool ArkTsConfig::Parse(std::unordered_set<std::string> &parsedConfigPath) in Parse()
433 auto arktsConfig = std::make_unique<JsonObject>(*tsConfigSource); in Parse() local
434 if (!Check(arktsConfig->IsValid(), diagnostic::INVALID_JSON, {})) { in Parse()
440 if (arktsConfig->HasKey(EXTENDS)) { in Parse()
441 auto *extends = arktsConfig->GetValue<JsonObject::StringT>(EXTENDS); in Parse()
454 if (arktsConfig->HasKey(COMPILER_OPTIONS) && in Parse()
455 !ParseCompilerOptions(arktsConfigDir, parsedConfigPath, arktsConfig.get())) { in Parse()
461 …if (arktsConfig->HasKey(FILES) && !ParseCollection(arktsConfig.get(), files_, FILES, concatPath)) { in Parse()
468 …if (arktsConfig->HasKey(INCLUDE) && !ParseCollection(arktsConfig.get(), include_, INCLUDE, consPat… in Parse()
471 …if (arktsConfig->HasKey(EXCLUDE) && !ParseCollection(arktsConfig.get(), exclude_, EXCLUDE, consPat… in Parse()
479 void ArkTsConfig::Inherit(const ArkTsConfig &base) in Inherit()
503 std::optional<std::string> ArkTsConfig::ResolvePath(std::string_view path, bool isDynamic) const in ResolvePath()
511 … // NOTE(ivagin): arktsconfig contains array of paths for each prefix, for now just get first one in ResolvePath()
525 // keep 'arktsconfig.json's smaller. in ResolvePath()
549 static bool MatchExcludes(const fs::path &path, const std::vector<ArkTsConfig::Pattern> &excludes) in MatchExcludes()
559 std::vector<fs::path> GetSourceList(const std::shared_ptr<ArkTsConfig> &arktsConfig) in GetSourceList() argument
561 auto includes = arktsConfig->Include(); in GetSourceList()
562 auto excludes = arktsConfig->Exclude(); in GetSourceList()
563 auto files = arktsConfig->Files(); in GetSourceList()
566 auto configDir = fs::absolute(fs::path(arktsConfig->ConfigPath())).parent_path(); in GetSourceList()
568 includes = {ArkTsConfig::Pattern("**/*", configDir.string())}; in GetSourceList()
571 if (fs::exists(arktsConfig->OutDir()) && !fs::equivalent(arktsConfig->OutDir(), configDir)) { in GetSourceList()
572 excludes.emplace_back("**/*", arktsConfig->OutDir()); in GetSourceList()
578 … if (!arktsConfig->Check(fs::exists(f) && fs::path(f).has_filename(), diagnostic::NO_FILE, {f})) { in GetSourceList()
625 fs::path ArkTsConfig::ComputeDestination(const fs::path &src, const fs::path &rootDir, const fs::pa… in ComputeDestination()
642 …pair<std::string, std::string>> FindProjectSources(const std::shared_ptr<ArkTsConfig> &arktsConfig) in FindProjectSources() argument
644 auto sourceFiles = GetSourceList(arktsConfig); in FindProjectSources()
647 … auto dst = arktsConfig->ComputeDestination(src, arktsConfig->RootDir(), arktsConfig->OutDir()); in FindProjectSources()
648 if (!arktsConfig->Check(!dst.empty(), diagnostic::INVALID_DESTINATION_FILE, {})) { in FindProjectSources()
660 [[maybe_unused]] const std::shared_ptr<ArkTsConfig> &arkts_config) in FindProjectSources()