Skip to content

Commit

Permalink
buildscripts: use properties to simplify configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 27, 2024
1 parent 1eacab0 commit c48c9ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ model {

Boolean isDp = (flavor == flavors.Dp)
String os = targetPlatform.operatingSystem.name
if (buildable) {
// Decide whether to build the current flavor:
if (project.hasProperty('flavor')) {
// -Pflavor= specified on the command line
String flavorArg = project.ext.flavor
buildable = (flavor.name == flavorArg)
}
if (buildable && project.hasProperty('bt')) {
// set in gradle.properties file or -Pbt= on the command line
String btArg = project.ext.bt
buildable = (buildType.name == btArg)
}
if (buildable && project.hasProperty('flavor')) {
// set in gradle.properties file or -Pflavor= on the command line
String flavorArg = project.ext.flavor
buildable = (flavor.name == flavorArg)
}

// flavor-specific defines:
Expand Down
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## configure Gradle properties for building the jolt-jni project

## options to build only a single flavor (default builds *all* flavors)
#flavor = Dp
#flavor = Sp

## options to build only a single buildtype (default builds *all* buildtypes)
#bt = Debug
#bt = Release

0 comments on commit c48c9ac

Please sign in to comment.