Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some gradle-related cleanup #109

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Some gradle-related cleanup #109

merged 2 commits into from
Jan 5, 2024

Conversation

dsvoronin
Copy link
Contributor

  • use centralized repository declaration
  • disable jetifier
  • enable configuration cache
  • use convention plugins to prevent scripts duplication

gradlePluginPortal()
}
dependencies {
classpath(libs.com.android.tools.build.gradle)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this, because it's already in plugin classpath, leaking from buildSrc.
Here

@@ -1,19 +1,3 @@
buildscript {
repositories {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

repositories {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google()
}

group = Description.mavenGroup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Group is set in publishing convention now

@@ -32,12 +16,3 @@ detekt {
xml.enabled = true
}
}

subprojects {
repositories {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -4,4 +4,10 @@ dependencyResolutionManagement {
from(files("../gradle/libs.versions.toml"))
}
}

repositories {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildSrc still need separate repositories declaration, because it's a separate build; even if it's "included"

@@ -4,4 +4,10 @@ dependencyResolutionManagement {
from(files("../gradle/libs.versions.toml"))
}
}

repositories {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pluginManagement is not declared here. Some Gradle "Magic": gradlePluginPortal implicitly added anyway and we don't need anything else yet, so let it be

project.extra.set("signing.secretKeyRingFile", "${project.rootProject.rootDir}/buildsystem/secring.gpg")
}

fun readVersion(): String {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version is set a bit differently now: we need to have a version file in every "publishable" library project directory.

I hope no additional external systems depends on previous versions files layout (under buildsystem/)

@@ -1,3 +1,4 @@
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No dependencies requires Jetifier was found by Studio, I assume it's safe to disable now

org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.configuration-cache=true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC is also working for all the tasks I tested so it's also safe to enable: a little boost to productivity for this repo

- use centralized repository declaration
- disable jetifier
- enable configuration cache
- use convention plugins to prevent scripts duplication
@Vacxe Vacxe enabled auto-merge January 5, 2024 00:45
@Vacxe Vacxe merged commit abb5719 into master Jan 5, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants