diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-07-06 23:36:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-06 23:36:40 -0400 |
commit | c07b2e2dc582a5354fdd47b75236d1d221b98c91 (patch) | |
tree | 0777e40e452cffa0f785f1cc809ba2bc46418cb2 /stage2 | |
parent | dff71b0fce364e7edab5c1a1f11dd8b32e2c3983 (diff) | |
parent | ec35ffeba2f5e8a2b1e61c3ba7da4276aa0c8211 (diff) | |
download | cbt-c07b2e2dc582a5354fdd47b75236d1d221b98c91.tar.gz cbt-c07b2e2dc582a5354fdd47b75236d1d221b98c91.tar.bz2 cbt-c07b2e2dc582a5354fdd47b75236d1d221b98c91.zip |
Merge pull request #203 from cvogt/publish-local
Publish local
Diffstat (limited to 'stage2')
-rw-r--r-- | stage2/Lib.scala | 12 | ||||
-rw-r--r-- | stage2/Publish.scala | 10 |
2 files changed, 21 insertions, 1 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala index b65af2d..81d36f3 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -367,6 +367,18 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ } } + def publishLocal( sourceFiles: Seq[File], artifacts: Seq[File], mavenCache: File, releaseFolder: String ): Unit = { + if(sourceFiles.nonEmpty){ + val targetDir = mavenCache ++ releaseFolder.stripSuffix("/") + targetDir.mkdirs + artifacts.foreach{ a => + val target = targetDir ++ ("/" ++ a.getName) + System.err.println(blue("publishing ") ++ target.getPath) + Files.copy( a.toPath, target.toPath, StandardCopyOption.REPLACE_EXISTING ) + } + } + } + def publishSigned( sourceFiles: Seq[File], artifacts: Seq[File], url: URL, credentials: Option[String] = None ): Unit = { // TODO: make concurrency configurable here if(sourceFiles.nonEmpty){ diff --git a/stage2/Publish.scala b/stage2/Publish.scala index 1cc3b70..96e856b 100644 --- a/stage2/Publish.scala +++ b/stage2/Publish.scala @@ -35,7 +35,7 @@ trait Publish extends PackageJars{ ) // ========== publish ========== - final protected def releaseFolder = s"/${groupId.replace(".","/")}/${artifactId}_$scalaMajorVersion/$version/" + final protected val releaseFolder = s"/${groupId.replace(".","/")}/${artifactId}_$scalaMajorVersion/$version/" private def snapshotUrl = new URL("https://oss.sonatype.org/content/repositories/snapshots") private def releaseUrl = new URL("https://oss.sonatype.org/service/local/staging/deploy/maven2") def publishUrl = if(version.endsWith("-SNAPSHOT")) snapshotUrl else releaseUrl @@ -50,6 +50,14 @@ trait Publish extends PackageJars{ copy( context.copy(version = Some(version+"-SNAPSHOT")) ).publishUnsigned } + def publishLocal: Unit = { + lib.publishLocal( sourceFiles, `package` :+ pom, context.paths.mavenCache, releaseFolder ) + } + + def publishSnapshotLocal: Unit = { + copy( context.copy(version = Some(version+"-SNAPSHOT")) ).publishLocal + } + def publishUnsigned: Unit = { lib.publishUnsigned( sourceFiles, `package` :+ pom, publishUrl ++ releaseFolder, sonatypeCredentials |