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

Simplify dependency locking and version def #1024

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

dexamundsen
Copy link
Contributor

@dexamundsen dexamundsen commented Oct 3, 2024

  • Simplify command for dependency locking by wrapping sub-project tasks within a root task
  • Define plugin versions in build.gradle, ensures same version is used across projects
  • use Buildscript variables instead of gradle variables. The former is build structure agnostic
  • Bump spring boot version from 3.3.3 to 3.3.4; dep management from 1.1.5 to 1.1.6

@@ -3,8 +3,8 @@ plugins {

// These plugins are needed to resolve versions of spring dependencies
// transitively added by terra-common-lib
id 'org.springframework.boot' version '3.3.3'
id 'io.spring.dependency-management' version '1.1.5'
id 'io.spring.dependency-management' version "${vSpringDepMgt}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Versions defined as build script variables in build.gradle.

@@ -39,9 +39,9 @@ dependencies {
implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3'
}

implementation "org.slf4j:slf4j-api:${gradle.vSlf4jApi}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Build script variables do not need gradle qualifier, hence removed in all references

repositories {
mavenCentral()
}
}

gradle.ext {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved up.

@@ -1,22 +1,35 @@
// Required by spotless. https://github.com/diffplug/spotless/issues/747
buildscript {
ext {
// plugin versions
vSpringBoot = '3.3.4'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

spring boot bumped from 3.3.3 to 3.3.4
dep management plugin bumped from 1.1.5 to 1.1.6

vSwaggerCodegen = '3.0.57'
vPicocliVersion = '4.7.6'
vJunit5 = '5.10.2'
tasks.named('dependencies') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This configures a root task dependencies that depends on below subtasks. hence auto triggered.

Copy link
Collaborator

@tjennison-work tjennison-work left a comment

Choose a reason for hiding this comment

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

This is a good improvement. It's surprising to me that Gradle doesn't doesn't have a more automatic way to handle this but I don't have much experience with it.

@dexamundsen dexamundsen merged commit 3db4e4f into main Oct 3, 2024
8 checks passed
@dexamundsen dexamundsen deleted the dexamundsen/locks branch October 3, 2024 16:38
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.

2 participants