Port build to Gradle 7.4-rc-2 (#1707)

This commit is contained in:
Harsh Shandilya 2022-02-04 19:29:36 +05:30 committed by GitHub
parent ce75d0e49b
commit 2b293e5805
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 17 deletions

View file

@ -20,8 +20,8 @@ crowdin {
fun isSnapshot(): Boolean { fun isSnapshot(): Boolean {
with(project.providers) { with(project.providers) {
val workflow = environmentVariable("GITHUB_WORKFLOW").forUseAtConfigurationTime() val workflow = environmentVariable("GITHUB_WORKFLOW")
val snapshot = environmentVariable("SNAPSHOT").forUseAtConfigurationTime() val snapshot = environmentVariable("SNAPSHOT")
return workflow.isPresent || snapshot.isPresent return workflow.isPresent || snapshot.isPresent
} }
} }

View file

@ -14,15 +14,14 @@ plugins {
fun Project.isSnapshot(): Boolean { fun Project.isSnapshot(): Boolean {
with(project.providers) { with(project.providers) {
val workflow = environmentVariable("GITHUB_WORKFLOW").forUseAtConfigurationTime() val workflow = environmentVariable("GITHUB_WORKFLOW")
val snapshot = environmentVariable("SNAPSHOT").forUseAtConfigurationTime() val snapshot = environmentVariable("SNAPSHOT")
return workflow.isPresent || snapshot.isPresent return workflow.isPresent || snapshot.isPresent
} }
} }
android { android {
val minifySwitch = val minifySwitch = project.providers.environmentVariable("DISABLE_MINIFY")
project.providers.environmentVariable("DISABLE_MINIFY").forUseAtConfigurationTime()
adbOptions.installOptions("--user 0") adbOptions.installOptions("--user 0")

View file

@ -20,7 +20,7 @@ import org.gradle.language.nativeplatform.internal.BuildType
* variants in Android App and Library projects, and all tests in JVM projects. * variants in Android App and Library projects, and all tests in JVM projects.
*/ */
internal fun Project.configureSlimTests() { internal fun Project.configureSlimTests() {
if (providers.gradleProperty(SLIM_TESTS_PROPERTY).forUseAtConfigurationTime().isPresent) { if (providers.gradleProperty(SLIM_TESTS_PROPERTY).isPresent) {
// disable unit test tasks on the release build type for Android Library projects // disable unit test tasks on the release build type for Android Library projects
extensions.findByType<LibraryAndroidComponentsExtension>()?.run { extensions.findByType<LibraryAndroidComponentsExtension>()?.run {
beforeVariants(selector().withBuildType(BuildType.RELEASE.name)) { beforeVariants(selector().withBuildType(BuildType.RELEASE.name)) {

View file

@ -19,7 +19,7 @@ internal fun Project.configureBuildSigning() {
val keystoreConfigFile = rootProject.layout.projectDirectory.file(KEYSTORE_CONFIG_PATH) val keystoreConfigFile = rootProject.layout.projectDirectory.file(KEYSTORE_CONFIG_PATH)
if (keystoreConfigFile.asFile.exists()) { if (keystoreConfigFile.asFile.exists()) {
extensions.configure<BaseAppModuleExtension> { extensions.configure<BaseAppModuleExtension> {
val contents = providers.fileContents(keystoreConfigFile).asText.forUseAtConfigurationTime() val contents = providers.fileContents(keystoreConfigFile).asText
val keystoreProperties = Properties() val keystoreProperties = Properties()
keystoreProperties.load(contents.get().byteInputStream()) keystoreProperties.load(contents.get().byteInputStream())
signingConfigs { signingConfigs {

View file

@ -53,7 +53,7 @@ class VersioningPlugin : Plugin<Project> {
require(propFile.asFile.exists()) { require(propFile.asFile.exists()) {
"A 'version.properties' file must exist in the project subdirectory to use this plugin" "A 'version.properties' file must exist in the project subdirectory to use this plugin"
} }
val contents = providers.fileContents(propFile).asText.forUseAtConfigurationTime() val contents = providers.fileContents(propFile).asText
val versionProps = Properties().also { it.load(contents.get().byteInputStream()) } val versionProps = Properties().also { it.load(contents.get().byteInputStream()) }
val versionName = val versionName =
requireNotNull(versionProps.getProperty(VERSIONING_PROP_VERSION_NAME)) { requireNotNull(versionProps.getProperty(VERSIONING_PROP_VERSION_NAME)) {

View file

@ -7,6 +7,6 @@ import org.gradle.api.tasks.wrapper.Wrapper
import org.gradle.kotlin.dsl.withType import org.gradle.kotlin.dsl.withType
tasks.withType<Wrapper> { tasks.withType<Wrapper> {
gradleVersion = "7.3.3" gradleVersion = "7.4-rc-2"
distributionSha256Sum = "b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302" distributionSha256Sum = "21491c9f0656e1529ccb39cbd587d01c33ba00d25f994b10240748ed0d45894a"
} }

View file

@ -28,7 +28,7 @@ class CrowdinDownloadPlugin : Plugin<Project> {
override fun apply(project: Project) { override fun apply(project: Project) {
with(project) { with(project) {
val buildDirectory = layout.buildDirectory.asFile.forUseAtConfigurationTime().get() val buildDirectory = layout.buildDirectory.asFile
val extension = extensions.create<CrowdinExtension>("crowdin") val extension = extensions.create<CrowdinExtension>("crowdin")
afterEvaluate { afterEvaluate {
val projectName = extension.projectName val projectName = extension.projectName
@ -38,9 +38,8 @@ class CrowdinDownloadPlugin : Plugin<Project> {
val buildOnApi = val buildOnApi =
tasks.register("buildOnApi") { tasks.register("buildOnApi") {
doLast { doLast {
val login = providers.environmentVariable("CROWDIN_LOGIN").forUseAtConfigurationTime() val login = providers.environmentVariable("CROWDIN_LOGIN")
val key = val key = providers.environmentVariable("CROWDIN_PROJECT_KEY")
providers.environmentVariable("CROWDIN_PROJECT_KEY").forUseAtConfigurationTime()
if (!login.isPresent) { if (!login.isPresent) {
throw GradleException("CROWDIN_LOGIN environment variable must be set") throw GradleException("CROWDIN_LOGIN environment variable must be set")
} }

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302 distributionSha256Sum=21491c9f0656e1529ccb39cbd587d01c33ba00d25f994b10240748ed0d45894a
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-rc-2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists