aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stage2/Lib.scala12
-rw-r--r--stage2/Publish.scala10
2 files changed, 21 insertions, 1 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index a060ac6..f769c44 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