in settings.gradle vs projectName in build.gradle

What is the different between = “TradeData” in settings.gradle and

def projectName = “TradeData”. Both are in the same directory TradeData. We have multiple sub projects each having their own gradle scripts and projectName values.

‘def projectName’ declares a local variable that per se, doesn’t have any meaning to Gradle.

I see. Thank you.

It looks like in build.gradle populated from containing directory name or settings.gradle : value.

This implies that we MUST have settings.gradle (specifying ) for CI builds ( considering checkout directory names are random )

That’s correct. Project names can only be set in ‘settings.gradle’; they are read-only in build scripts. And yes, you do want to nail down the root project name to avoid issues on (say) CI.