Skip to content

Commit 4ba6d11

Browse files
committed
Fix indentation of the sbt excludePrefix and bindingConfig examples
1 parent c178e72 commit 4ba6d11

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

build.sbt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff 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 := {

docs/src/paradox/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ or as part of the sbt bindings declaration.
1111
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 `__`.
1212

1313
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 }
1515

1616
CLI
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
6666
types defined in the [C standard library] and [C POSIX library] bindings
6767
shipped with Scala Native. Let's assume we have a binding with a method that uses the `FILE` type
6868
from `<stdio.h>`:

sbt-scala-native-bindgen/src/sbt-test/bindgen/generate/build.sbt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@ nativeBindgenPath := Some(file(System.getProperty("bindgen.path")))
1111
inConfig(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

0 commit comments

Comments
 (0)