This is part of #7639.
Expectations
Implement Ivyless publishLocal task, which publishes to the local Ivy repo.
- 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.
- Run scripted test such that when
useIvy is set to false it will produce the identical set of files.
- 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
- Please follow https://github.com/sbt/sbt/blob/develop/CONTRIBUTING.md carefully.
- 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.
- See https://www.scala-sbt.org/1.x/docs/Artifacts.html for the details of artifacts.
- See https://ant.apache.org/ivy/history/2.3.0/index.html for general information about Apache Ivy.
This is part of #7639.
Expectations
Implement Ivyless
publishLocaltask, which publishes to the local Ivy repo.publishLocalcan publish to an arbitrary named directory undertarget(see note below)2 Create a global setting
useIvy, which defaults totruefor now.useIvyis set tofalseit will produce the identical set of files.Compile / packageDoc / publishArtifact := false.Note
$ 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 filessbt uses a forked version Ivy, which we manage in https://github.com/sbt/ivy.
Implementation notes