Skip to content

Instantly share code, notes, and snippets.

@wongk
Created December 3, 2019 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wongk/b218789b36c96d6612757bfd8f415b0f to your computer and use it in GitHub Desktop.
Save wongk/b218789b36c96d6612757bfd8f415b0f to your computer and use it in GitHub Desktop.
Local flag to control building a module
Properties moduleProperties = new Properties()
File modulePropertiesFile = file(rootDir.absolutePath + '/modules.properties')
def buildMyModule = false
if (modulePropertiesFile.exists()) {
moduleProperties.load(sdkPropertiesFile.newDataInputStream())
buildMyModule = moduleProperties.getProperty('build.myModule', 'false').toBoolean()
}
gradle.ext.set('buildMyModule', buildMyModule)
if (buildMyModule) {
include ':my-module'
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment