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")
154154 NativeBinding (docsUsingBindingsDirectory.value / " vector.h" )
155155 .name(" vector" )
156156 .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"
165160 // #sbt-binding-config
166161 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
168173 .name(" WordCount" )
169174 .link(" wordcount" )
170175 .packageName(" org.example.wordcount" )
171- .excludePrefix(" __" )
172- // #sbt-binding-config
173- .bindingConfig(pathToConfig)
174- // #sbt-binding-config
176+ .bindingConfig(docsScalaNativeBindingsDirectory.value / " config.json" )
175177 }
176178 ),
177179 nativeBindgenPath := {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ or as part of the sbt bindings declaration.
1111Definitions 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 ` __ ` .
1212
1313sbt
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 }
1515
1616CLI
1717: ```sh
@@ -62,7 +62,7 @@ will reference the `Point` type alias inside the `Vector` object:
6262
6363### Using Types From the Scala Native Bindings
6464
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
6666types defined in the [ C standard library] and [ C POSIX library] bindings
6767shipped with Scala Native. Let's assume we have a binding with a method that uses the ` FILE ` type
6868from ` <stdio.h> ` :
Original file line number Diff line number Diff line change @@ -11,14 +11,10 @@ nativeBindgenPath := Some(file(System.getProperty("bindgen.path")))
1111inConfig(Compile )(
1212 Def .settings(
1313 nativeBindings += {
14- // #sbt-exclude-prefix
1514 NativeBinding (resourceDirectory.value / " stdlib.h" )
16- // #sbt-exclude-prefix
1715 .name(" stdlib" )
1816 .packageName(" org.example.app.stdlib" )
19- // #sbt-exclude-prefix
2017 .excludePrefix(" __" )
21- // #sbt-exclude-prefix
2218 }
2319 ))
2420// #example
You can’t perform that action at this time.
0 commit comments