1- lazy val scalacheck = " org.scalacheck" %% " scalacheck" % " 1.14.3"
2- def scalaXmlDep (scalaV : String ): List [ModuleID ] =
3- CrossVersion .partialVersion(scalaV) match {
4- case Some ((2 , minor)) if minor <= 10 =>
5- Nil
6- case Some ((2 , 11 | 12 )) =>
7- List (" org.scala-lang.modules" %% " scala-xml" % " 1.0.6" )
8- case _ =>
9- List (" org.scala-lang.modules" %% " scala-xml" % " 1.2.0" )
10- }
1+ import Dependencies ._
2+
3+ ThisBuild / organization := " org.scala-sbt"
4+ ThisBuild / organizationHomepage := Some (url(" http://scala-sbt.org/" ))
5+ ThisBuild / homepage := Some (url(" https://github.com/sbt/sbinary" ))
6+ ThisBuild / version := " 0.5.1-SNAPSHOT"
7+ ThisBuild / scalaVersion := scala212
8+ ThisBuild / crossScalaVersions := Seq (scala210, scala211, scala212, scala213)
9+ ThisBuild / bintrayPackage := " sbinary"
10+ ThisBuild / developers := List (
11+ Developer (
12+ " drmaciver" ,
13+ " David R. MacIver" ,
14+ " @drmaciver" ,
15+ url(" https://github.com/DRMacIver" )
16+ ),
17+ Developer (" harrah" , " Mark Harrah" , " @harrah" , url(" https://github.com/harrah" )),
18+ Developer (" eed3si9n" , " Eugene Yokota" , " @eed3si9n" , url(" https://github.com/eed3si9n" ))
19+ )
20+ ThisBuild / description := " Library for describing binary formats for Scala types"
21+ ThisBuild / licenses := Seq (" MIT" -> new URL (" https://github.com/sbt/sbinary/blob/master/LICENSE" ))
22+ ThisBuild / scmInfo := Some (
23+ ScmInfo (url(" https://github.com/sbt/sbinary" ), " git@github.com:sbt/sbinary.git" )
24+ )
25+
26+ lazy val root = (project in file(" ." ))
27+ .aggregate(core, treeExample)
28+ .settings(nocomma {
29+ name := " SBinary Root"
30+ publish / skip := true
31+ mimaPreviousArtifacts := Set .empty
32+ })
33+
34+ lazy val core = (project in file(" core" ))
35+ .settings(nocomma {
36+ name := " SBinary"
37+
38+ mimaPreviousArtifacts := {
39+ Set .empty
40+ }
41+ libraryDependencies += scalacheck % Test
42+ libraryDependencies ++= scalaVersion(scalaXmlDep).value
43+ Compile / unmanagedSourceDirectories += {
44+ val base = (Compile / scalaSource).value.getParentFile
45+ CrossVersion .partialVersion(scalaVersion.value) match {
46+ case Some ((2 , v)) if v >= 13 =>
47+ base / s " scala-2.13+ "
48+ case _ =>
49+ base / s " scala-2.13- "
50+ }
51+ }
52+ Compile / unmanagedResources += (baseDirectory map { _ / " LICENSE" }).value
53+ mimaPreviousArtifacts := {
54+ val versions = Seq (" 0.5.0" )
55+ val crossVersion = if (crossPaths.value) CrossVersion .binary else CrossVersion .disabled
56+ versions.map(v => organization.value % moduleName.value % v cross crossVersion).toSet
57+ },
58+ })
59+ .settings(
60+ relaxOldScala,
61+ Fmpp .templateSettings
62+ )
63+
64+ lazy val treeExample = (project in (file(" examples" ) / " bt" ))
65+ .dependsOn(core)
66+ .settings(nocomma {
67+ name := " SBinary Tree Example"
68+ publish / skip := true
69+ mimaPreviousArtifacts := Set .empty
70+ })
71+ .settings(relaxOldScala)
1172
1273def relaxOldScala : Seq [Setting [_]] = Seq (
1374 scalacOptions := {
@@ -29,64 +90,3 @@ def relaxOldScala: Seq[Setting[_]] = Seq(
2990 }
3091 }
3192)
32-
33- lazy val root = (project in file(" ." ))
34- .aggregate(core, treeExample)
35- .settings(
36- inThisBuild(
37- Seq (
38- organization := " org.scala-sbt" ,
39- organizationHomepage := Some (url(" http://scala-sbt.org/" )),
40- homepage := Some (url(" https://github.com/sbt/sbinary" )),
41- version := " 0.5.1-SNAPSHOT" ,
42- scalaVersion := " 2.12.7" ,
43- crossScalaVersions := Seq (" 2.10.7" , " 2.11.12" , " 2.12.7" , " 2.13.0" ),
44- bintrayPackage := " sbinary" ,
45- developers := List (
46- Developer (
47- " drmaciver" ,
48- " David R. MacIver" ,
49- " @drmaciver" ,
50- url(" https://github.com/DRMacIver" )
51- ),
52- Developer (" harrah" , " Mark Harrah" , " @harrah" , url(" https://github.com/harrah" )),
53- Developer (" eed3si9n" , " Eugene Yokota" , " @eed3si9n" , url(" https://github.com/eed3si9n" ))
54- ),
55- description := " Library for describing binary formats for Scala types" ,
56- licenses := Seq (" MIT" -> new URL (" https://github.com/sbt/sbinary/blob/master/LICENSE" )),
57- scmInfo := Some (
58- ScmInfo (url(" https://github.com/sbt/sbinary" ), " git@github.com:sbt/sbinary.git" )
59- )
60- )),
61- name := " SBinary Parent" ,
62- skip in publish := true
63- )
64-
65- lazy val core = (project in file(" core" )).settings(
66- name := " SBinary" ,
67- relaxOldScala,
68- Fmpp .templateSettings,
69- mimaPreviousArtifacts := {
70- Set .empty
71- },
72- libraryDependencies += scalacheck % Test ,
73- libraryDependencies ++= scalaVersion(scalaXmlDep).value,
74- unmanagedSourceDirectories in Compile += {
75- val base = (scalaSource in Compile ).value.getParentFile
76- CrossVersion .partialVersion(scalaVersion.value) match {
77- case Some ((2 , v)) if v >= 13 =>
78- base / s " scala-2.13+ "
79- case _ =>
80- base / s " scala-2.13- "
81- }
82- },
83- unmanagedResources in Compile += (baseDirectory map { _ / " LICENSE" }).value
84- )
85-
86- lazy val treeExample = (project in (file(" examples" ) / " bt" ))
87- .dependsOn(core)
88- .settings(
89- name := " SBinary Tree Example" ,
90- relaxOldScala,
91- skip in publish := true
92- )
0 commit comments