Skip to content

Commit 101337b

Browse files
TheTripleVclaudektoso
authored
Add option to skip samples in build (#512)
Co-authored-by: Claude Sonnet 4.5 <[email protected]> Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
1 parent da6be2f commit 101337b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ Please always use the gradle wrapper (`./gradlew`) to make sure to use the appro
167167

168168
Sample apps are located in the `Samples/` directory, and they showcase full "roundtrip" usage of the library and/or tools.
169169

170+
Samples are build by default by Gradle. Building samples can be skipped by appending the flag `-PskipSamples=true` to a gradle command.
171+
170172
#### SwiftJava (Swift -> Java)
171173

172174
To run a simple app showcasing a Swift process calling into a Java library you can run:

settings.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ include "SwiftKitCore"
2222
include "SwiftKitFFM"
2323

2424
// Include sample apps -- you can run them via `gradle Name:run`
25-
new File(rootDir, "Samples").listFiles().each {
26-
if (it.directory && new File(it, 'build.gradle').exists()) {
27-
include ":Samples:${it.name}"
25+
// Can be disabled with -PskipSamples=true
26+
if (!hasProperty('skipSamples') || skipSamples != 'true') {
27+
new File(rootDir, "Samples").listFiles().each {
28+
if (it.directory && new File(it, 'build.gradle').exists()) {
29+
include ":Samples:${it.name}"
30+
}
2831
}
2932
}

0 commit comments

Comments
 (0)