Don't build rust non-megazords as release on android unless in CI or requested in local.properties

This commit is contained in:
Thom Chiovoloni 2019-03-15 12:09:50 -07:00 коммит произвёл Thom Chiovoloni
Родитель e32186e23f
Коммит 1cf44049c0
6 изменённых файлов: 28 добавлений и 15 удалений

Просмотреть файл

@ -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