Skip to content

Commit

Permalink
Fixing broken imports part II
Browse files Browse the repository at this point in the history
  • Loading branch information
orodeh committed Jun 5, 2019
1 parent 680415c commit 177b65b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/run_tests.py
Expand Up @@ -487,7 +487,7 @@ def compiler_per_test_flags(tname):
if tname in test_private_registry:
flags += ["--extras", os.path.join(top_dir, "test/extras_private_registry.json")]
if tname in test_import_dirs:
flags += ["--imports", os.path.join(top_dir, "test/imports/library")]
flags += ["--imports", os.path.join(top_dir, "test/imports/lib")]
return flags

# Which project to use for a test
Expand Down
8 changes: 6 additions & 2 deletions src/main/scala/dxWDL/util/ParseWomSourceFile.scala
Expand Up @@ -78,15 +78,19 @@ object ParseWomSourceFile {
val absPath = Paths.get(mainFile.toAbsolutePath.toString)
val mainFileContents = Files.readAllLines(absPath).asScala.mkString(System.lineSeparator())

// We need to get all the sources sources
// We need to get all the WDL sources, so we could analyze them
val mainFileResolvers =
DirectoryResolver.localFilesystemResolvers(Some(DefaultPathBuilder.build(mainFile)))

// look for source files in each of the import directories
val fileImportResolvers : List[ImportResolver] = imports.map{ p =>
val p2 : cromwell.core.path.Path = DefaultPathBuilder.build(p)
val p2 : cromwell.core.path.Path = DefaultPathBuilder.build(p.toAbsolutePath)
DirectoryResolver(p2, None, None, false)
}
val importResolvers: List[ImportResolver] =
mainFileResolvers ++ fileImportResolvers :+ HttpResolver(relativeTo = None)

// Allow http addresses when importing
val importResolversRecorded: List[ImportResolver] =
importResolvers.map{ impr => fileRecorder(allSources, impr) }

Expand Down

0 comments on commit 177b65b

Please sign in to comment.