Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ organizationHomepage := Some(new URL("https://www.versioneye.com"))
description := "This is the sbt plugin for https://www.VersionEye.com. It allows you to create and update a project at VersionEye. You can find a complete documentation of this project on GitHub: https://github.com/versioneye/versioneye_sbt_plugin."
startYear := Some(2015)

scalaVersion := "2.10.2"
scalaVersion := "2.12.4"

libraryDependencies ++= Seq("com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.6.1",
"org.scala-lang" % "scala-library" % "2.10.2", "org.scalaj" %% "scalaj-http" % "1.1.5")
crossSbtVersions := Vector("0.13.16", "1.0.4")


libraryDependencies ++= Seq("com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.1",
"org.scalaj" %% "scalaj-http" % "2.3.0")

publishArtifact in Test := false
publishMavenStyle := true
pomIncludeRepository := { _ => false }

// scripted-plugin
ScriptedPlugin.scriptedSettings
scriptedBufferLog := false
scriptedLaunchOpts <+= version { "-Dplugin.version=" + _ }
watchSources <++= sourceDirectory map { path => (path ** "*").get }
scriptedLaunchOpts := { scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
}
scriptedBufferLog := false
watchSources ++= { sourceDirectory.map { path => (path ** "*").get }.value }

// maven repositories
resolvers ++= Seq(
Expand All @@ -28,10 +32,10 @@ resolvers ++= Seq(
"Local Maven Repository" at ("file://" + Path.userHome.absolutePath + "/.m2/repository")
)

publishTo <<= version { (v: String) =>
publishTo := {
// Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
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=0.13.8
sbt.version=1.0.2
8 changes: 1 addition & 7 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")

// scripted for plugin testing
libraryDependencies <+= (sbtVersion) { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
}

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
2 changes: 2 additions & 0 deletions project/scripted.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// scripted for plugin testing
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ object VersionEyePlugin extends sbt.AutoPlugin {

val projectResponse = getResponse(response)

mergeWithParent((organization.value, name.value), (parentGroupId.value, parentArtifactId.value), baseUrl.value, apiPath.value, apiKeyValue, projectResponse.getId, proxyConfig)
mergeWithParent(mergeAfterCreate.value, (organization.value, name.value), (parentGroupId.value, parentArtifactId.value), baseUrl.value, apiPath.value, apiKeyValue, projectResponse.getId, proxyConfig)

if (updatePropertiesAfterCreate.value) {
writeProperties(projectResponse, getPropertiesFile(propertiesPath.value, baseDirectory.value, false), baseUrl.value)
Expand Down Expand Up @@ -219,7 +219,7 @@ object VersionEyePlugin extends sbt.AutoPlugin {

val projectResponse = getResponse(response)

mergeWithParent((organization.value, name.value), (parentGroupId.value, parentArtifactId.value), baseUrl.value, apiPath.value, apiKeyValue, projectResponse.getId, proxyConfig)
mergeWithParent(mergeAfterCreate.value, (organization.value, name.value), (parentGroupId.value, parentArtifactId.value), baseUrl.value, apiPath.value, apiKeyValue, projectResponse.getId, proxyConfig)

prettyPrint(log, baseUrl.value, projectResponse)
}
Expand Down Expand Up @@ -268,7 +268,7 @@ object VersionEyePlugin extends sbt.AutoPlugin {
"More details here: " + baseUrl.value + "/user/projects/" + projectResponse.getId)
}

mergeWithParent((organization.value, name.value), (parentGroupId.value, parentArtifactId.value), baseUrl.value, apiPath.value, apiKeyValue, projectResponse.getId, proxyConfig)
mergeWithParent(mergeAfterCreate.value, (organization.value, name.value), (parentGroupId.value, parentArtifactId.value), baseUrl.value, apiPath.value, apiKeyValue, projectResponse.getId, proxyConfig)

prettyPrint(log, baseUrl.value, projectResponse)
log.info("Everything is is fine.")
Expand Down Expand Up @@ -299,9 +299,9 @@ object VersionEyePlugin extends sbt.AutoPlugin {
/**
* Invoke a metadata merge with the parent artifacts.
*/
def mergeWithParent(projectGA: (String, String), parentGA: (String, String), baseUrl: String, apiPath: String, apiKey: String, requestId: String, proxyConfig: ProxyConfig): Unit = {
def mergeWithParent(mergeAfterCreateValue: Boolean, projectGA: (String, String), parentGA: (String, String), baseUrl: String, apiPath: String, apiKey: String, requestId: String, proxyConfig: ProxyConfig): Unit = {

if (!mergeAfterCreate.value) {
if (!mergeAfterCreateValue) {
return
}

Expand Down
Loading