Don't build rust non-megazords as release on android unless in CI or requested in local.properties
This commit is contained in:
Родитель
e32186e23f
Коммит
1cf44049c0
23
build.gradle
23
build.gradle
|
@ -160,6 +160,29 @@ if (rootProject.ext.libsGitSha != null) {
|
|||
}
|
||||
}
|
||||
|
||||
Properties localProperties = null;
|
||||
if (file('local.properties').canRead()) {
|
||||
localProperties = new Properties();
|
||||
localProperties.load(file('local.properties').newDataInputStream())
|
||||
logger.lifecycle('Local configuration: loaded local.properties')
|
||||
}
|
||||
|
||||
// For non-megazord builds, don't do a release build unless we explicitly want
|
||||
// it (e.g. in CI, or if specified in local.properties). This avoids some cases
|
||||
// where two builds of some crates are required when they wouldn't otherwise be,
|
||||
// as well as improving build times for local development.
|
||||
ext.nonMegazordProfile = "debug"
|
||||
|
||||
if (System.getenv("CI")) {
|
||||
ext.nonMegazordProfile = "release"
|
||||
} else if (localProperties != null) {
|
||||
String localNonMegazordProfile = localProperties.getProperty(
|
||||
"application-services.nonmegazord-profile");
|
||||
if (localNonMegazordProfile != null) {
|
||||
ext.nonMegazordProfile = localNonMegazordProfile;
|
||||
}
|
||||
}
|
||||
|
||||
// Configure some environment variables, per toolchain, that will apply during
|
||||
// the Cargo build. We assume that the `libs/` directory has been populated
|
||||
// before invoking Gradle (or Cargo).
|
||||
|
|
|
@ -79,9 +79,7 @@ cargo {
|
|||
'x86',
|
||||
]
|
||||
|
||||
// Perform release builds (which should have debug info, due to
|
||||
// `debug = true` in Cargo.toml).
|
||||
profile = "release"
|
||||
profile = rootProject.ext.nonMegazordProfile
|
||||
|
||||
exec = rootProject.ext.cargoExec
|
||||
}
|
||||
|
|
|
@ -72,9 +72,7 @@ cargo {
|
|||
'x86',
|
||||
]
|
||||
|
||||
// Perform release builds (which should have debug info, due to
|
||||
// `debug = true` in Cargo.toml).
|
||||
profile = "release"
|
||||
profile = rootProject.ext.nonMegazordProfile
|
||||
|
||||
exec = rootProject.ext.cargoExec
|
||||
}
|
||||
|
|
|
@ -79,9 +79,7 @@ cargo {
|
|||
'x86',
|
||||
]
|
||||
|
||||
// Perform release builds (which should have debug info, due to
|
||||
// `debug = true` in Cargo.toml).
|
||||
profile = "release"
|
||||
profile = rootProject.ext.nonMegazordProfile
|
||||
|
||||
exec = rootProject.ext.cargoExec
|
||||
}
|
||||
|
|
|
@ -70,9 +70,7 @@ cargo {
|
|||
'linux-x86-64',
|
||||
]
|
||||
|
||||
// Perform release builds (which should have debug info, due to
|
||||
// `debug = true` in Cargo.toml).
|
||||
profile = "release"
|
||||
profile = rootProject.ext.nonMegazordProfile
|
||||
|
||||
exec = rootProject.ext.cargoExec
|
||||
}
|
||||
|
|
|
@ -72,9 +72,7 @@ cargo {
|
|||
'x86',
|
||||
]
|
||||
|
||||
// Perform release builds (which should have debug info, due to
|
||||
// `debug = true` in Cargo.toml).
|
||||
profile = "release"
|
||||
profile = rootProject.ext.nonMegazordProfile
|
||||
|
||||
exec = rootProject.ext.cargoExec
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче