Permalink
Browse files

initial version of sbt010 artifact publish plugin

  • Loading branch information...
0 parents commit f1623e23378522df7d457450d69286f59477fd85 @steppenwells steppenwells committed Jun 20, 2011
Showing with 54 additions and 0 deletions.
  1. +12 −0 .gitignore
  2. +7 −0 build.sbt
  3. +4 −0 sbt
  4. BIN sbt-launch-0.10.0.jar
  5. +31 −0 src/main/scala/com/gu/SbtArtifactPublishPlugin.scala
@@ -0,0 +1,12 @@
+target
+*.iml
+*.ipr
+*.iws
+/.idea
+out
+lib_managed
+src_managed
+project/boot*
+project/plugins/project
+ctags
+idea.iml
@@ -0,0 +1,7 @@
+sbtPlugin := true
+
+name := "sbt-artifact-publish-plugin"
+
+organization := "com.gu"
+
+version := "0.1-SNAPSHOT"
@@ -0,0 +1,4 @@
+#!/bin/bash
+cd $(dirname $0)
+java -Xmx256m -jar sbt-launch-*.jar $*
+
Binary file not shown.
@@ -0,0 +1,31 @@
+package com.gu
+
+import sbt._
+import Keys._
+import Defaults._
+import Project.Initialize
+
+object SbtArtifactPublishPlugin extends Plugin {
+
+ val sourcefiles = TaskKey[Seq[(File, String)]]("assemble-source-files")
+ val artifactPublishPath = SettingKey[File]("artifact-publish-path")
+ val publishArtifacts = TaskKey[File]("publish-artifacts")
+
+
+ def publishArtifactsTask(src: Seq[(File, String)], dest: File) = {
+
+ println("source >> " + src)
+ println("dest is >> " + dest)
+ IO.zip(src, dest)
+
+ dest
+ }
+
+ val defaultSettings: Seq[Project.Setting[_]] = Seq(
+ sourcefiles := Nil,
+ artifactPublishPath <<= (target){ (target) => target / "dist" / "artifacts.zip"},
+ publishArtifacts <<= (sourcefiles, artifactPublishPath) map {publishArtifactsTask}
+ )
+
+
+}

0 comments on commit f1623e2

Please sign in to comment.