File tree Expand file tree Collapse file tree 3 files changed +17
-19
lines changed
sbt-scala-native-bindgen/src/sbt-test/bindgen/generate Expand file tree Collapse file tree 3 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -154,24 +154,26 @@ lazy val docs = nativeProject("docs")
154
154
NativeBinding (docsUsingBindingsDirectory.value / " vector.h" )
155
155
.name(" vector" )
156
156
.link(" vector" )
157
- .packageName(" org.example" ),
158
- NativeBinding (docs3rdPartyBindingsDirectory.value / " geometry.h" )
159
- .name(" Geometry" )
160
- .link(" geometry" )
161
- .packageName(" org.example.geometry" )
162
- .bindingConfig(docs3rdPartyBindingsDirectory.value / " config.json" ), {
163
- val pathToHeader = docsScalaNativeBindingsDirectory.value / " wordcount.h"
164
- val pathToConfig = docsScalaNativeBindingsDirectory.value / " config.json"
157
+ .packageName(" org.example" ), {
158
+ val pathToHeader = docs3rdPartyBindingsDirectory.value / " geometry.h"
159
+ val pathToConfig = docs3rdPartyBindingsDirectory.value / " config.json"
165
160
// #sbt-binding-config
166
161
NativeBinding (pathToHeader)
167
- // #sbt-binding-config
162
+ .bindingConfig(pathToConfig)
163
+ // #sbt-binding-config
164
+ .name(" Geometry" )
165
+ .link(" geometry" )
166
+ .packageName(" org.example.geometry" )
167
+ }, {
168
+ val pathToHeader = docsScalaNativeBindingsDirectory.value / " wordcount.h"
169
+ // #sbt-exclude-prefix
170
+ NativeBinding (pathToHeader)
171
+ .excludePrefix(" __" )
172
+ // #sbt-exclude-prefix
168
173
.name(" WordCount" )
169
174
.link(" wordcount" )
170
175
.packageName(" org.example.wordcount" )
171
- .excludePrefix(" __" )
172
- // #sbt-binding-config
173
- .bindingConfig(pathToConfig)
174
- // #sbt-binding-config
176
+ .bindingConfig(docsScalaNativeBindingsDirectory.value / " config.json" )
175
177
}
176
178
),
177
179
nativeBindgenPath := {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ or as part of the sbt bindings declaration.
11
11
Definitions may be excluded by their prefix. This is useful when private definitions should not be part of the generated binding. This is often the case for definitions starting with ` __ ` .
12
12
13
13
sbt
14
- : @@snip [ sbt] (../../../sbt-scala-native-bindgen/src/sbt-test/bindgen/generate/ build.sbt) { #sbt-exclude-prefix }
14
+ : @@snip [ sbt] (../../../build.sbt) { #sbt-exclude-prefix }
15
15
16
16
CLI
17
17
: ```sh
@@ -62,7 +62,7 @@ will reference the `Point` type alias inside the `Vector` object:
62
62
63
63
### Using Types From the Scala Native Bindings
64
64
65
- Similar to the above, the following this example shows how you can use
65
+ Similar to the above, the following example shows how you can use
66
66
types defined in the [ C standard library] and [ C POSIX library] bindings
67
67
shipped with Scala Native. Let's assume we have a binding with a method that uses the ` FILE ` type
68
68
from ` <stdio.h> ` :
Original file line number Diff line number Diff line change @@ -11,14 +11,10 @@ nativeBindgenPath := Some(file(System.getProperty("bindgen.path")))
11
11
inConfig(Compile )(
12
12
Def .settings(
13
13
nativeBindings += {
14
- // #sbt-exclude-prefix
15
14
NativeBinding (resourceDirectory.value / " stdlib.h" )
16
- // #sbt-exclude-prefix
17
15
.name(" stdlib" )
18
16
.packageName(" org.example.app.stdlib" )
19
- // #sbt-exclude-prefix
20
17
.excludePrefix(" __" )
21
- // #sbt-exclude-prefix
22
18
}
23
19
))
24
20
// #example
You can’t perform that action at this time.
0 commit comments