From 4316943cf3f872cd0f94b617619dc7a32923a920 Mon Sep 17 00:00:00 2001 From: Hendrik Cannoodt Date: Thu, 12 Oct 2023 10:31:40 +0200 Subject: [PATCH 1/2] Fix github uri -> repo, add local repository and local dependency example --- .../viash/functionality/dependencies/Dependency.scala | 10 ++++++++-- .../functionality/dependencies/LocalRepository.scala | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/scala/io/viash/functionality/dependencies/Dependency.scala b/src/main/scala/io/viash/functionality/dependencies/Dependency.scala index 0e471af1b..f16b2d0ce 100644 --- a/src/main/scala/io/viash/functionality/dependencies/Dependency.scala +++ b/src/main/scala/io/viash/functionality/dependencies/Dependency.scala @@ -32,7 +32,7 @@ import io.viash.exceptions.MissingBuildYamlException """name: qc/multiqc | repository: | type: github - | uri: openpipelines-bio/modules + | repo: openpipelines-bio/modules | tag: 0.3.0 |""".stripMargin, "yaml", @@ -40,7 +40,7 @@ import io.viash.exceptions.MissingBuildYamlException ) @exampleWithDescription( """name: qc/multiqc - |repository: "github://openpipelines-bio/modules:0.3.0" + | repository: "github://openpipelines-bio/modules:0.3.0" |""".stripMargin, "yaml", "Definition of a dependency with a repository using sugar syntax." @@ -52,6 +52,12 @@ import io.viash.exceptions.MissingBuildYamlException "yaml", "Definition of a dependency with a repository defined as 'openpipelines-bio' under `.functionality.repositories`." ) +@exampleWithDescription( + """name: qc/multiqc + |""".stripMargin, + "yaml", + "Definition of a local dependency. This dependency is present in the current code base and will be built when `viash ns build` is run." +) case class Dependency( @description("The full name of the dependency component. This should include the namespace.") @example("name: \"my_namespace\"component", "yaml") diff --git a/src/main/scala/io/viash/functionality/dependencies/LocalRepository.scala b/src/main/scala/io/viash/functionality/dependencies/LocalRepository.scala index 69472d470..c90d10fbc 100644 --- a/src/main/scala/io/viash/functionality/dependencies/LocalRepository.scala +++ b/src/main/scala/io/viash/functionality/dependencies/LocalRepository.scala @@ -26,6 +26,14 @@ import java.nio.file.Paths |Alternatively, this can be used to refer to a code repository present on the local hard-drive instead of fetchable remotely, for example during development. |""".stripMargin ) +@exampleWithDescription( + """name: my_local_code + |type: local + |path: /additional_code/src + |""".stripMargin, + "yaml", + "Refer to a local code repository under `additional_code/src` referenced to the Viash Project Config file." +) @subclass("local") case class LocalRepository( name: String = "", From da5ff71400e368cd4b2a2a23ce0c3480611c45f0 Mon Sep 17 00:00:00 2001 From: Hendrik Cannoodt Date: Fri, 13 Oct 2023 11:19:44 +0200 Subject: [PATCH 2/2] Fix indentation in dependency examples --- .../functionality/dependencies/Dependency.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/io/viash/functionality/dependencies/Dependency.scala b/src/main/scala/io/viash/functionality/dependencies/Dependency.scala index f16b2d0ce..136deba39 100644 --- a/src/main/scala/io/viash/functionality/dependencies/Dependency.scala +++ b/src/main/scala/io/viash/functionality/dependencies/Dependency.scala @@ -30,24 +30,24 @@ import io.viash.exceptions.MissingBuildYamlException |""".stripMargin) @exampleWithDescription( """name: qc/multiqc - | repository: - | type: github - | repo: openpipelines-bio/modules - | tag: 0.3.0 + |repository: + | type: github + | repo: openpipelines-bio/modules + | tag: 0.3.0 |""".stripMargin, "yaml", "Definition of dependency with a fully defined repository" ) @exampleWithDescription( """name: qc/multiqc - | repository: "github://openpipelines-bio/modules:0.3.0" + |repository: "github://openpipelines-bio/modules:0.3.0" |""".stripMargin, "yaml", "Definition of a dependency with a repository using sugar syntax." ) @exampleWithDescription( """name: qc/multiqc - | repository: "openpipelines-bio" + |repository: "openpipelines-bio" |""".stripMargin, "yaml", "Definition of a dependency with a repository defined as 'openpipelines-bio' under `.functionality.repositories`."