Skip to content

[2.x] Ivyless publishLocal #8631

@eed3si9n

Description

@eed3si9n

This is part of #7639.

Expectations

Implement Ivyless publishLocal task, which publishes to the local Ivy repo.

  1. Setup a scripted test such that publishLocal can publish to an arbitrary named directory under target (see note below)
    2 Create a global setting useIvy, which defaults to true for now.
  2. Run scripted test such that when useIvy is set to false it will produce the identical set of files.
  3. Extend the implementation to support the customization of artifacts. For example, the user can skip publishing Scaladocs by setting Compile / packageDoc / publishArtifact := false.

Note

name := "lib1"

organization := "com.example"
version := "0.1.0-SNAPSHOT"
ivyPaths := IvyPaths(
  ((LocalRootProject / baseDirectory).value / "ivy").toString,
  Some(((LocalRootProject / target).value / "ivy" / "cache").toString)
)
$ tree target/out/jvm/scala-3.7.4/lib1/ivy/cache/local/
target/out/jvm/scala-3.7.4/lib1/ivy/cache/local/
└── com.example
    └── lib1_3
        └── 0.1.0-SNAPSHOT
            ├── docs
            │   ├── lib1_3-javadoc.jar
            │   ├── lib1_3-javadoc.jar.md5
            │   └── lib1_3-javadoc.jar.sha1
            ├── ivys
            │   ├── ivy.xml
            │   ├── ivy.xml.md5
            │   └── ivy.xml.sha1
            ├── jars
            │   ├── lib1_3.jar
            │   ├── lib1_3.jar.md5
            │   └── lib1_3.jar.sha1
            ├── poms
            │   ├── lib1_3.pom
            │   ├── lib1_3.pom.md5
            │   └── lib1_3.pom.sha1
            └── srcs
                ├── lib1_3-sources.jar
                ├── lib1_3-sources.jar.md5
                └── lib1_3-sources.jar.sha1

9 directories, 15 files

sbt uses a forked version Ivy, which we manage in https://github.com/sbt/ivy.

Implementation notes

  1. Please follow https://github.com/sbt/sbt/blob/develop/CONTRIBUTING.md carefully.
  2. Please follow https://github.com/sbt/sbt/blob/develop/contributing-docs/07_tech_stack.md where possible. For example, datatype should be generated using Contraband , and HTTP client should use Gigahorse.
  3. See https://www.scala-sbt.org/1.x/docs/Artifacts.html for the details of artifacts.
  4. See https://ant.apache.org/ivy/history/2.3.0/index.html for general information about Apache Ivy.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions