mirror of https://github.com/sbt/sbt.git
Merge pull request #6005 from eed3si9n/wip/prefixpaths
Fix earlyOutput and remoteCachePom paths
This commit is contained in:
commit
3536959c31
|
|
@ -623,7 +623,7 @@ object Defaults extends BuildCommon {
|
||||||
val dir = classDirectory.value
|
val dir = classDirectory.value
|
||||||
converter.toVirtualFile(dir.toPath)
|
converter.toVirtualFile(dir.toPath)
|
||||||
},
|
},
|
||||||
earlyOutput / artifactPath := earlyArtifactPathSetting(artifact).value,
|
earlyOutput / artifactPath := configArtifactPathSetting(artifact, "early").value,
|
||||||
earlyOutput := {
|
earlyOutput := {
|
||||||
val converter = fileConverter.value
|
val converter = fileConverter.value
|
||||||
val jar = (earlyOutput / artifactPath).value
|
val jar = (earlyOutput / artifactPath).value
|
||||||
|
|
@ -1591,10 +1591,30 @@ object Defaults extends BuildCommon {
|
||||||
excludes: ScopedTaskable[FileFilter]
|
excludes: ScopedTaskable[FileFilter]
|
||||||
): Initialize[Task[Seq[File]]] = collectFiles(dirs: Taskable[Seq[File]], filter, excludes)
|
): Initialize[Task[Seq[File]]] = collectFiles(dirs: Taskable[Seq[File]], filter, excludes)
|
||||||
|
|
||||||
private[sbt] def earlyArtifactPathSetting(art: SettingKey[Artifact]): Initialize[File] =
|
private[sbt] def configArtifactPathSetting(
|
||||||
|
art: SettingKey[Artifact],
|
||||||
|
extraPrefix: String
|
||||||
|
): Initialize[File] =
|
||||||
Def.setting {
|
Def.setting {
|
||||||
val f = artifactName.value
|
val f = artifactName.value
|
||||||
crossTarget.value / "early" / f(
|
crossTarget.value /
|
||||||
|
(prefix(configuration.value.name) + extraPrefix) / f(
|
||||||
|
ScalaVersion(
|
||||||
|
(scalaVersion in artifactName).value,
|
||||||
|
(scalaBinaryVersion in artifactName).value
|
||||||
|
),
|
||||||
|
projectID.value,
|
||||||
|
art.value
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private[sbt] def prefixArtifactPathSetting(
|
||||||
|
art: SettingKey[Artifact],
|
||||||
|
extraPrefix: String
|
||||||
|
): Initialize[File] =
|
||||||
|
Def.setting {
|
||||||
|
val f = artifactName.value
|
||||||
|
crossTarget.value / extraPrefix / f(
|
||||||
ScalaVersion(
|
ScalaVersion(
|
||||||
(scalaVersion in artifactName).value,
|
(scalaVersion in artifactName).value,
|
||||||
(scalaBinaryVersion in artifactName).value
|
(scalaBinaryVersion in artifactName).value
|
||||||
|
|
|
||||||
|
|
@ -128,11 +128,18 @@ object RemoteCache {
|
||||||
},
|
},
|
||||||
remoteCachePom := {
|
remoteCachePom := {
|
||||||
val s = streams.value
|
val s = streams.value
|
||||||
val config = makePomConfiguration.value
|
val config = (remoteCachePom / makePomConfiguration).value
|
||||||
val publisher = Keys.publisher.value
|
val publisher = Keys.publisher.value
|
||||||
publisher.makePomFile((pushRemoteCache / ivyModule).value, config, s.log)
|
publisher.makePomFile((pushRemoteCache / ivyModule).value, config, s.log)
|
||||||
config.file.get
|
config.file.get
|
||||||
},
|
},
|
||||||
|
remoteCachePom / artifactPath := {
|
||||||
|
Defaults.prefixArtifactPathSetting(makePom / artifact, "remote-cache").value
|
||||||
|
},
|
||||||
|
remoteCachePom / makePomConfiguration := {
|
||||||
|
val config = makePomConfiguration.value
|
||||||
|
config.withFile((remoteCachePom / artifactPath).value)
|
||||||
|
},
|
||||||
remoteCachePom / remoteCacheArtifact := {
|
remoteCachePom / remoteCacheArtifact := {
|
||||||
PomRemoteCacheArtifact((makePom / artifact).value, remoteCachePom)
|
PomRemoteCacheArtifact((makePom / artifact).value, remoteCachePom)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue