def sublude(name) {
  def projectName = ':' + name.substring(1).replace(':', '-')
  include projectName
  project(projectName).projectDir = file(name.substring(1).replace(':', '/'))
}

def localProperties = new Properties()
try {
  var stream = new File(rootDir, 'local.properties').newDataInputStream()
  localProperties.load(stream)
  stream.close()
} catch (ignored) {
  // Ignore
}
def hasModule = (String name, boolean enabledByDefault) -> {
  return localProperties.getProperty("modules." + name, enabledByDefault.toString()).toBoolean()
}

include ':fake-signature'
include ':safe-parcel-processor'
include ':vending-app'

include ':play-services-ads'
include ':play-services-ads-base'
include ':play-services-ads-identifier'
include ':play-services-ads-lite'
include ':play-services-appinvite'
include ':play-services-appset'
include ':play-services-auth'
include ':play-services-auth-api-phone'
include ':play-services-auth-base'
include ':play-services-auth-blockstore'
include ':play-services-auth-workaccount'
include ':play-services-base'
include ':play-services-basement'
include ':play-services-cast'
include ':play-services-cast-framework'
include ':play-services-clearcut'
include ':play-services-drive'
include ':play-services-droidguard'
include ':play-services-fido'
include ':play-services-games'
include ':play-services-gcm'
include ':play-services-gmscompliance'
include ':play-services-iid'
include ':play-services-location'
include ':play-services-maps'
include ':play-services-measurement-base'
sublude ':play-services-mlkit:barcode-scanning'
sublude ':play-services-mlkit:face-detection'
include ':play-services-nearby'
include ':play-services-oss-licenses'
include ':play-services-panorama'
include ':play-services-pay'
include ':play-services-phenotype'
include ':play-services-places'
include ':play-services-places-placereport'
include ':play-services-recaptcha'
include ':play-services-safetynet'
include ':play-services-tapandpay'
include ':play-services-threadnetwork'
include ':play-services-tasks'
include ':play-services-vision'
include ':play-services-vision-common'
include ':play-services-wearable'
include ':play-services-fitness'

include ':play-services-api'
include ':play-services'

include ':firebase-auth'
include ':firebase-dynamic-links'

// core only

include ':play-services-core-proto'

sublude ':play-services-basement:ktx'
sublude ':play-services-tasks:ktx'

sublude ':play-services-ads:core'
sublude ':play-services-ads-identifier:core'
sublude ':play-services-ads-lite:core'
sublude ':play-services-appinvite:core'
sublude ':play-services-appset:core'
sublude ':play-services-auth-api-phone:core'
sublude ':play-services-auth-blockstore:core'
sublude ':play-services-auth-workaccount:core'
sublude ':play-services-base:core'
sublude ':play-services-base:core:package'
sublude ':play-services-cast:core'
sublude ':play-services-cast-framework:core'
include ':play-services-chimera-core'
include ':play-services-conscrypt-provider-core'
sublude ':play-services-cronet:core'
sublude ':play-services-droidguard:core'
sublude ':play-services-fido:core'
sublude ':play-services-fitness:core'
sublude ':play-services-gmscompliance:core'
sublude ':play-services-location:core'
sublude ':play-services-location:core:base'
sublude ':play-services-location:core:provider'
sublude ':play-services-location:core:system-api'
if (hasModule("hms", false)) sublude ':play-services-maps:core:hms'
sublude ':play-services-maps:core:mapbox'
sublude ':play-services-maps:core:vtm'
sublude ':play-services-maps:core:vtm:microg-theme'
if (hasModule("nearby", true)) sublude ':play-services-nearby:core'
if (hasModule("nearby", true)) sublude ':play-services-nearby:core:package'
sublude ':play-services-oss-licenses:core'
sublude ':play-services-panorama:core'
sublude ':play-services-pay:core'
sublude ':play-services-safetynet:core'
sublude ':play-services-recaptcha:core'
sublude ':play-services-tapandpay:core'
sublude ':play-services-threadnetwork:core'
sublude ':play-services-vision:core'
sublude ':play-services-wearable:core'

sublude ':firebase-auth:core'

include ':play-services-core:microg-ui-tools' // Legacy
include ':play-services-core'
