Skip to content

Commit

Permalink
publish to sonatype (#4)
Browse files Browse the repository at this point in the history
* publish to sonatype

* sbt test:console
  • Loading branch information
erikerlandson authored Jul 16, 2021
1 parent fa422e8 commit 43c78af
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 42 deletions.
26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,27 @@ A few examples are below.
* Enforce inequality constraints of the form s(x) < y and s(x) > y

### How to use `snowball` in your project
The `snowball` package is implemented in java, and so it can be used in both java and scala. It is built on, and designed to work with, Apache Commons Math 3.6

`snowball` expects you to provide `commons-math3` and `gibbous` dependencies, as shown here:
The `snowball` package is implemented in java, and so it can be used in both java and scala. It is built on, and designed to work with, Apache Commons Math 3.6.

#### using SBT
```scala
resolvers += "manyangled" at "https://dl.bintray.com/manyangled/maven/"

libraryDependencies ++= Seq(
"com.manyangled" % "snowball" % "0.2.2",
"com.manyangled" % "gibbous" % "0.2.2",
"org.apache.commons" % "commons-math3" % "3.6.1")
"com.manyangled" % "snowball" % "0.3.0"
)
```

#### using maven
```xml
<dependency>
<groupId>com.manyangled</groupId>
<artifactId>snowball</artifactId>
<version>0.2.2</version>
<version>0.3.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.manyangled</groupId>
<artifactId>gibbous</artifactId>
<version>0.2.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
<version>0.3.0</version>
<type>pom</type>
</dependency>
```
Expand All @@ -65,6 +55,10 @@ PolynomialSplineFunction s = interpolator.interpolate(x, y);
```

#### Scala REPL
```sh
$ sbt test:console
```

```scala
scala> import com.manyangled.snowball.analysis.interpolation._, com.manyangled.gnuplot4s._
import com.manyangled.snowball.analysis.interpolation._
Expand Down
67 changes: 54 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,58 @@

// do clean first!
// sbt clean
// sbt unidoc
// sbt previewSite
// sbt ghpagesPushSite

// initiate publish from clean repo
// sbt clean
// sbt publish

name := "snowball"

version := "0.3.0"

organization := "com.manyangled"

version := "0.2.3-SNAPSHOT"
//isSnapshot := true,

//publishConfiguration := publishConfiguration.value.withOverwrite(true)

//publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)

pomIncludeRepository := { _ => false }

publishMavenStyle := true

publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}

licenses += ("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0"))

homepage := Some(url("https://github.com/erikerlandson/snowball/"))

scmInfo := Some(
ScmInfo(
url("https://github.com/erikerlandson/snowball.git"),
"scm:[email protected]:erikerlandson/snowball.git"
)
)

developers := List(
Developer(
id = "erikerlandson",
name = "Erik Erlandson",
email = "[email protected]",
url = url("https://erikerlandson.github.io/")
)
)

crossPaths := false // drop off Scala suffix from artifact names.

autoScalaLibrary := false // exclude scala-library from dependencies
Expand All @@ -15,27 +62,21 @@ resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots")
)

// commons math used to be '% Provided' but the 'packageDoc' target
// now fails with that, so I'm just going to make it required
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-math3" % "3.6.1" % Provided,
"com.manyangled" % "gibbous" % "0.2.2" % Provided,
"com.manyangled" %% "gnuplot4s" % "0.1.0" % Test,
"org.apache.commons" % "commons-math3" % "3.6.1",
"com.manyangled" % "gibbous" % "0.3.0",
"com.manyangled" %% "gnuplot4s" % "0.2.0" % Test,
"org.hamcrest" % "hamcrest-library" % "1.3" % Test,
"com.novocode" % "junit-interface" % "0.11" % Test
)

licenses += ("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0"))

compileOrder := CompileOrder.JavaThenScala

javacOptions ++= Seq()

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

scalacOptions in (Compile, doc) ++= Seq("-doc-root-content", baseDirectory.value+"/root-doc.txt")

// xsbt clean xsbt unidoc; xsbt previewSite; xsbt ghpagesPushSite // do clean first!

enablePlugins(JavaUnidocPlugin, GenJavadocPlugin, PublishJavadocPlugin, GhpagesPlugin)
enablePlugins(JavaUnidocPlugin, PublishJavadocPlugin, GhpagesPlugin)

siteSubdirName in JavaUnidoc := "java/api"

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.2
sbt.version=1.3.12
17 changes: 5 additions & 12 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(
Resolver.ivyStylePatterns)
resolvers += "jgit-repo" at "https://download.eclipse.org/jgit/maven"

resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/"
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")

resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")

// addSbtPlugin("me.lessis" % "bintray-sbt" % "0.4.0")
addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.1")

addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")

addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")

addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.2")

0 comments on commit 43c78af

Please sign in to comment.