From 4133afb7f4cc60da7c31547dd4c3297bed754ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mohameth=20Fran=C3=A7ois=20SY?= Date: Tue, 20 Nov 2018 00:51:33 +0100 Subject: [PATCH] Updated build.sbt (#258) * Removed bintrayOrganization in build.sbt * Removed buildinfo settings in build.sbt * Used inThisBuild instead of commons settings * Used sbt 1.2.6 * Removed jvm options when calling sbt --- .travis.yml | 6 +-- build.sbt | 97 +++++++++++++++++++++++----------------- project/build.properties | 2 +- 3 files changed, 59 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43bb2576..dfd458fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,15 +11,15 @@ jobs: include: - stage: test script: - - sbt -javaOptions=.jvmopts compile - - sbt -javaOptions=.jvmopts test + - sbt clean compile + - sbt test - stage: bintraypublish before_install: - openssl aes-256-cbc -K $encrypted_b14561f0d260_key -iv $encrypted_b14561f0d260_iv -in .travis/secrets.tar.enc -out .travis/local.secrets.tar -d; - tar xv -C .travis -f .travis/local.secrets.tar; script: - - sbt -javaOptions=.jvmopts releaseEarly universal:packageZipTarball + - sbt releaseEarly env: global: - secure: Mw/BpJUUFHbB7MAJIZOWgVjjQkM89Nzt2YVWHU51ErTu2FZMXvrg7etg2+CRXpI442lMJn8N2VLyFSphtDNAQ48kC7ZC0Nl1OrmhCJVDW+jtKwH6oDEUMAvCvdoRElYIoqZgD4rrN0BEOr4C8kxA3BBM+bnn/NCowB0wt+syywnF1uZPaGUttenCAjo4Zk8qrAgkTNuyJZo7kXiwf0em/jTknWA2SUdbMEb+LOV8CxgF5ILvM98Owr2XDzCerFR9uGMjHUwMHpbWWXlTN/ud9clLuohpuxO3yQu7GIibh0mMmvTjRpGUa6TG3xraP5tQ387pu+pYFPuyOJCys4dLHU9xzBkNEgmzdHtrR9GM088P7Sw5VCsZpi+t6WK7JSXRPL7WYsGAXhI71bcgpWeGdiYxbU4WhLuuPdhadorY0mzaNTnFyT9RvTAPGG4S/lMzoJ/+eTuvy3Vh37pAd1SdY9bl4dcg5jZmg91IqhAZqW4lvW4G5HKlhkQCUf6QEtP1Q3BuGcOtTJ5kwZ728JQb/gDvh3zArd16/WDZ10eVpwnx5wWVlcXr9ctdg6kTpAqQVPBlXDwTSPapgvKWV5nF8UmNuh5ikXxrc4xASKsCPsXampwariJ1qZQYsgDfjfrYlIea8RzeWZc675RBDqn1Cn6Hsox3WMYRlbO4KF4N4o8= diff --git a/build.sbt b/build.sbt index fae78f1f..51777d50 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,29 @@ +/* +scalafmt: { + style = defaultWithAlign + maxColumn = 150 + align.tokens = [ + { code = "=>", owner = "Case" } + { code = "?", owner = "Case" } + { code = "extends", owner = "Defn.(Class|Trait|Object)" } + { code = "//", owner = ".*" } + { code = "{", owner = "Template" } + { code = "}", owner = "Template" } + { code = ":=", owner = "Term.ApplyInfix" } + { code = "++=", owner = "Term.ApplyInfix" } + { code = "+=", owner = "Term.ApplyInfix" } + { code = "%", owner = "Term.ApplyInfix" } + { code = "%%", owner = "Term.ApplyInfix" } + { code = "%%%", owner = "Term.ApplyInfix" } + { code = "->", owner = "Term.ApplyInfix" } + { code = "?", owner = "Term.ApplyInfix" } + { code = "<-", owner = "Enumerator.Generator" } + { code = "?", owner = "Enumerator.Generator" } + { code = "=", owner = "(Enumerator.Val|Defn.(Va(l|r)|Def|Type))" } + ] +} + */ + val commonsVersion = "0.7.6" val provVersion = "1.1.1" val kgVersion = "0.9.4" @@ -8,10 +34,9 @@ lazy val kgSchemas = "ch.epfl.bluebrain.nexus" %% "kg-schemas" % kgVer lazy val core = project .in(file("modules/core")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(nsgcommons) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-core-schemas", moduleName := "nsg-core-schemas" @@ -21,7 +46,7 @@ lazy val nexusschema = project .in(file("modules/nexus-schemas")) .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) - .settings(common, noPublish) + .settings(noPublish) .settings( noPublish, name := "kg-nsg-schemas", @@ -35,10 +60,9 @@ lazy val nexusschema = project lazy val experiment = project .in(file("modules/experiment")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(core) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-experiment-schemas", moduleName := "nsg-experiment-schemas" @@ -46,10 +70,9 @@ lazy val experiment = project lazy val nsgcommons = project .in(file("modules/commons")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(nexusschema) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-commons-schemas", moduleName := "nsg-commons-schemas", @@ -58,10 +81,9 @@ lazy val nsgcommons = project lazy val atlas = project .in(file("modules/atlas")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(experiment) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-atlas-schemas", moduleName := "nsg-atlas-schemas" @@ -69,10 +91,9 @@ lazy val atlas = project lazy val electrophysiology = project .in(file("modules/electrophysiology")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(experiment) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-electrophysiology-schemas", moduleName := "nsg-electrophysiology-schemas" @@ -80,10 +101,9 @@ lazy val electrophysiology = project lazy val morphology = project .in(file("modules/morphology")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(experiment) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-morphology-schemas", moduleName := "nsg-morphology-schemas" @@ -91,10 +111,9 @@ lazy val morphology = project lazy val simulation = project .in(file("modules/simulation")) - .enablePlugins(WorkbenchPlugin,BuildInfoPlugin, ServicePackagingPlugin) + .enablePlugins(WorkbenchPlugin) .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) .dependsOn(core) - .settings(common,publishSettings,buildInfoSettings) .settings( name := "nsg-simulation-schemas", moduleName := "nsg-simulation-schemas" @@ -104,43 +123,37 @@ lazy val simulation = project lazy val root = project .in(file(".")) .settings(name := "nsg-schemas", moduleName := "nsg-schemas") - .settings(common, noPublish) + .settings(noPublish) .aggregate(core, experiment, atlas, morphology, electrophysiology, simulation, nexusschema,nsgcommons) -lazy val common = Seq( - scalacOptions in (Compile, console) ~= (_ filterNot (_ == "-Xfatal-warnings")), - autoScalaLibrary := false, - workbenchVersion := "0.3.2", - bintrayOmitLicense := true, - homepage := Some(url("https://github.com/INCF/neuroshapes")), - licenses := Seq("CC-4.0" -> url("https://github.com/INCF/neuroshapes/blob/master/LICENSE")), - developers := List( +inThisBuild( + List( + workbenchVersion := "0.3.2", + bintrayOmitLicense := true, + homepage := Some(url("https://github.com/INCF/neuroshapes")), + licenses := Seq("CC-4.0" -> url("https://github.com/INCF/neuroshapes/blob/master/LICENSE")), + developers := List( Developer("MFSY", "Mohameth François Sy", "noreply@epfl.ch", url("https://incf.github.io/neuroshapes/")), Developer("annakristinkaufmann", "Anna-Kristin Kaufmann", "noreply@epfl.ch", url("https://incf.github.io/neuroshapes/")), Developer("huanxiang", "Lu Huanxiang", "noreply@epfl.ch", url("https://incf.github.io/neuroshapes/")), Developer("apdavison", "Andrew Davison", "noreply@epfl.ch", url("https://incf.github.io/neuroshapes/")), Developer("genric", "Ivaska Genrich", "noreply@epfl.ch", url("https://incf.github.io/neuroshapes/")) - ), - scmInfo := Some( - ScmInfo(url("https://github.com/INCF/neuroshapes"), "scm:git:git@https://github.com/INCF/neuroshapes.git")) -) + ), + scmInfo := Some(ScmInfo(url("https://github.com/INCF/neuroshapes"), "scm:git:git@https://github.com/INCF/neuroshapes.git")), + // These are the sbt-release-early settings to configure + releaseEarlyWith := BintrayPublisher, + bintrayRepository := "maven", + releaseEarlyNoGpg := true, + releaseEarlyEnableSyncToMaven := false, + )) -lazy val buildInfoSettings = Seq( - buildInfoKeys := Seq[BuildInfoKey](version), - buildInfoPackage := s"$name-${version}" -) -lazy val publishSettings = Seq( - releaseEarlyWith := BintrayPublisher, - bintrayOrganization := Some("neuroshapes"), - bintrayRepository := "maven", - releaseEarlyNoGpg := true, - releaseEarlyEnableSyncToMaven := false -) - - -lazy val noPublish = Seq(publishLocal := {}, publish := {}) +lazy val noPublish = Seq( + publishLocal := {}, + publish := {}, + publishArtifact := false, +) addCommandAlias("review", ";clean;test") addCommandAlias("rel", ";release with-defaults skip-tests") diff --git a/project/build.properties b/project/build.properties index 5517665b..091249b9 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.1.1 \ No newline at end of file +sbt.version = 1.2.6