From 531855983939ab44af09c4bdb73c7657f7c4382d Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 25 Feb 2014 23:19:05 +0900 Subject: [PATCH 1/4] Add sbt project settings --- build.sbt | 26 ++++++++++++++++++++++++++ project/build.properties | 2 ++ version.sbt | 1 + 3 files changed, 29 insertions(+) create mode 100644 build.sbt create mode 100755 project/build.properties create mode 100644 version.sbt diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..645af8c --- /dev/null +++ b/build.sbt @@ -0,0 +1,26 @@ +organization := "org.fluentd" + +description := "Fluent Logger for Java" + +name := "fluent-logger" + +libraryDependencies ++= Seq( + "org.msgpack" % "msgpack" % "0.6.8", + "org.slf4j" % "slf4j-api" % "1.7.6", + "ch.qos.logback" % "logback-classic" % "1.1.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" +) + +logBuffered in Test := false + +parallelExecution in Test := false + +autoScalaLibrary := false + +scalaVersion in Global := "2.10.3" + +crossPaths := false + +incOptions := incOptions.value.withNameHashing(true) + +javacOptions in Compile ++= Seq("-Xlint:unchecked") diff --git a/project/build.properties b/project/build.properties new file mode 100755 index 0000000..da7e802 --- /dev/null +++ b/project/build.properties @@ -0,0 +1,2 @@ +sbt.version=0.13.2-M2 + diff --git a/version.sbt b/version.sbt new file mode 100644 index 0000000..87c01ed --- /dev/null +++ b/version.sbt @@ -0,0 +1 @@ +version in ThisBuild := "0.3.0-SNAPSHOT" From f826396af223daa6a24e06402e29100756104898 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Wed, 26 Feb 2014 01:25:59 +0900 Subject: [PATCH 2/4] Add sonatypeSettings and assembly(one-jar) settings --- build.sbt | 43 +++++++++++++++++++++++++++++++++++++++++++ project/plugins.sbt | 8 ++++++++ 2 files changed, 51 insertions(+) create mode 100755 project/plugins.sbt diff --git a/build.sbt b/build.sbt index 645af8c..b59abae 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,9 @@ +import AssemblyKeys._ + +assemblySettings + +sonatypeSettings + organization := "org.fluentd" description := "Fluent Logger for Java" @@ -24,3 +30,40 @@ crossPaths := false incOptions := incOptions.value.withNameHashing(true) javacOptions in Compile ++= Seq("-Xlint:unchecked") + +javacOptions in (Compile, doc) <<= (baseDirectory, version) map { (bd, v) => Seq( + "-locale", "en_US", + "-sourcepath", bd.getAbsolutePath, + "-doctitle", s"Fluent Logger for Java ${v} API" +)} + +pomExtra := { + https://github.com/fluent/fluent-logger-java + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:git:git://github.com/fluent/fluent-logger-java.git + scm:git:git@github.com:fluent/fluent-logger-java.git + scm:git:git://github.com/fluent/fluent-logger-java.git + + + + muga + Muga Nishizawa + muga.nishizawa@gmail.com + + +} + + +// Publish fluent-logger-(version)-assembly.jar +artifact in (Compile, assembly) ~= { art => + art.copy(`classifier` = Some("assembly")) +} + +addArtifact(artifact in (Compile, assembly), assembly) diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100755 index 0000000..98abb53 --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1,8 @@ + +addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.7.1") + +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.2.0") + +addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") + +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.10.2") \ No newline at end of file From 90db8c7266447c93e15933b5ca53ba7ee51cc3be Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Wed, 26 Feb 2014 01:41:35 +0900 Subject: [PATCH 3/4] Add README.sbt.md --- README.sbt.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 README.sbt.md diff --git a/README.sbt.md b/README.sbt.md new file mode 100644 index 0000000..0db3769 --- /dev/null +++ b/README.sbt.md @@ -0,0 +1,51 @@ + +## Development with sbt + +sbt is a build tool for Scala, but it can be used for pure-java projects. To install sbt (in Mac OS X), do + +``` +$ brew install sbt +``` + +Alternatively, you can download a convenient sbt script that retrieves the latest sbt.jar to a local directory. + +## Using sbt + +To enter the sbt console, run sbt command: +``` +$ sbt +> +``` + +* Running tests +``` +> test +``` + +* Running tests again if some source code has changed +``` +> ~test +``` + +* Running specific tests in a test case class +``` +> ~test-only org.fluentd.logger.TestFluentLogger -- --tests=testNormal01 +``` + +* Publishing locally +``` +> pulbishLocal +``` + +* Publishing to local maven repository +``` +> publishM2 +``` + +* Publishing to Maven central +See the instruction of [sbt-sonatype](https://github.com/xerial/sbt-sonatype) plugin to set Sonatype account information. After that, you can publish GPG signed artifacts to Maven central: +``` +> publishSigned # Deploy to sonatype repository +> sonatypeRelease # Close, release and drop the deployed artifacts +``` + From f0c4a6d8cb0a57924305c4dc28eb998083c83ffd Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Thu, 27 Feb 2014 15:08:10 +0900 Subject: [PATCH 4/4] Update README.sbt.md --- README.sbt.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.sbt.md b/README.sbt.md index 0db3769..4e7e09c 100644 --- a/README.sbt.md +++ b/README.sbt.md @@ -1,4 +1,3 @@ - ## Development with sbt sbt is a build tool for Scala, but it can be used for pure-java projects. To install sbt (in Mac OS X), do @@ -22,7 +21,7 @@ $ sbt > test ``` -* Running tests again if some source code has changed +* Running tests again if some source code is changed ``` > ~test ```