Repository navigation
Expand file tree
/
Copy pathbuild.sbt
More file actions
99 lines (93 loc) · 3.26 KB
/
Copy pathbuild.sbt
File metadata and controls
99 lines (93 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name := "pdal-jni"
val scala212 = "2.12.21"
val scala213 = "2.13.18"
val scala3 = "3.9.0"
val scalaVersions = Seq(scala213, scala3, scala212)
lazy val commonSettings = Seq(
scalaVersion := scalaVersions.head,
crossScalaVersions := scalaVersions,
organization := "io.pdal",
description := "PDAL JNI bindings",
licenses := Seq("BSD" -> uri("https://github.com/PDAL/PDAL/blob/master/LICENSE.txt")),
homepage := Some(uri("https://www.pdal.io")),
versionScheme := Some("semver-spec"),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
"-language:postfixOps",
"-language:existentials",
"-feature",
"-target:jvm-1.8"
),
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
Test / publishArtifact := false,
developers := List(
Developer(
"pomadchin",
"Grigory Pomadchin",
"@pomadchin",
uri("https://github.com/pomadchin")
)
)
)
lazy val root = (project in file("."))
.settings(commonSettings*)
.settings(
scalaVersion := scalaVersions.head,
crossScalaVersions := Nil,
publish := {},
publishLocal := {}
)
.aggregate(`core-scala`, core, native)
lazy val `core-scala` = project
.settings(commonSettings*)
.settings(Dependencies.macroSettings)
.settings(Dependencies.licenseSettings)
.settings(scalaVersion := scala213, crossScalaVersions := Seq(scala213, scala212))
.settings(name := "pdal-scala")
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
.settings(
libraryDependencies ++= Seq(
Dependencies.circe("core"),
Dependencies.circe("generic"),
Dependencies.circe("generic-extras"),
Dependencies.circe("parser"),
Dependencies.jtsCore,
Dependencies.scalaTest % Test
)
)
.dependsOn(core)
.dependsOn(Environment.dependOnNative(native % Runtime)*)
lazy val core = project
.settings(commonSettings*)
.settings(name := "pdal")
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
.settings(sbtJniCoreScope := Compile)
.settings(
libraryDependencies ++= Seq(
Dependencies.scalaTest % Test,
Dependencies.circe("parser") % Test
)
)
.dependsOn(Environment.dependOnNative(native % Runtime)*)
lazy val native = project
.settings(commonSettings*)
.settings(crossPaths := false)
.settings(name := "pdal-native")
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
// keep native binaries at native/target/native/<platform> (sbt 2 moved target under target/out)
.settings(nativeCompile / target := baseDirectory.value / "target" / "native" / nativePlatform.value)
.settings(
Compile / unmanagedPlatformDependentNativeDirectories := Seq(
"x86_64-linux" -> baseDirectory.value / "target/native/x86_64-linux/bin/",
"x86_64-darwin" -> baseDirectory.value / "target/native/x86_64-darwin/bin/",
"arm64-darwin" -> baseDirectory.value / "target/native/arm64-darwin/bin/"
)
)
.settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
artifact.name + "-" + nativePlatform.value + "-" + module.revision + "." + artifact.extension
})
.enablePlugins(JniNative, JniPackage)