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

feat(deps): Update dependencies and create script to update dependencies #427

Merged
merged 4 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ https://github.com/bancolombia/scaffold-clean-architecture/wiki/Contributing
- [ ] Automated tests are written
- [ ] The documentation is up-to-date
- [ ] The pull request has a descriptive title that describes what has changed, and provides enough context for the changelog
- [ ] If the pull request has a new driven-adpater or entry-point, you should add it to `RADME.md` and `generate_project.sh` files for generated code tests.
- [ ] If the pull request has a new driven-adpater or entry-point, you should add it to `RADME.md` and `sh_generate_project.sh` files for generated code tests.
- [ ] If the pull request has changed structural files, you have implemented an UpgradeAction according to the [guide](https://github.com/bancolombia/scaffold-clean-architecture/wiki/Contributing#upgradeaction)
- [ ] If the pull request has a new Gradle Task, you should add `Analytics` according to the [guide](https://github.com/bancolombia/scaffold-clean-architecture/wiki/Contributing#analytics)
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
# Generated code Analysis
- name: Publish local
if: steps.changes.outputs.templates == 'true'
run: ./publish_plugin_local.sh
run: ./sh_publish_plugin_local.sh
# Generated code reactive
- name: Generate reactive project to scan
if: steps.changes.outputs.templates == 'true'
run: ./generate_project.sh reactive
run: ./sh_generate_project.sh reactive
- name: Scan generated reactive project dependencies
if: steps.changes.outputs.templates == 'true'
working-directory: ./build/toscan
Expand All @@ -86,7 +86,7 @@ jobs:
# Generated code imperative
- name: Generate imperative project to scan
if: steps.changes.outputs.templates == 'true'
run: ./generate_project.sh imperative
run: ./sh_generate_project.sh imperative
- name: Scan generated imperative project dependencies
if: steps.changes.outputs.templates == 'true'
working-directory: ./build/toscan
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
name: Release Bot
email: release-bot@bancolombia.com.co
- name: Set Analytics Endpoint
run: sed -i "s/ENDPOINT = \"\"/ENDPOINT = \"$ANALYTICS_ENDPOINT\"/g" src/main/java/co/com/bancolombia/analytics/AnalyticsExporter.java
run: sed -i "s/ENDPOINT = \"\"/ENDPOINT = \"$ANALYTICS_ENDPOINT\"/g" src/main/java/co/com/bancolombia/utils/analytics/AnalyticsExporter.java
env:
ANALYTICS_ENDPOINT: ${{ secrets.ANALYTICS_ENDPOINT }}
- name: Publish plugin in gradle plugins
Expand Down
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ if (project.hasProperty('signing.keyId')) { // publish as library in maven centr
}

def signingTasks = tasks.withType(Sign)
signingTasks.forEach {project.logger.lifecycle('task sign: ' + it.name)}
signingTasks.forEach { project.logger.lifecycle('task sign: ' + it.name) }
tasks.withType(PublishToMavenRepository).configureEach { task ->
project.logger.lifecycle('task publish: ' + task.name)
if(task.name == 'publishMavenJavaPublicationToSonatypeRepository') {
if (task.name == 'publishMavenJavaPublicationToSonatypeRepository') {
project.logger.lifecycle('Applied to ' + task.name)
task.mustRunAfter('signMavenJavaPublication')
task.mustRunAfter('signPluginMavenPublication')
Expand Down Expand Up @@ -144,7 +144,7 @@ if (project.hasProperty('signing.keyId')) { // publish as library in maven centr
}
}

// Add a source set for the functional test suite
// Add a source set for the functional test suite
sourceSets {
functionalTest {
}
Expand All @@ -153,7 +153,7 @@ if (project.hasProperty('signing.keyId')) { // publish as library in maven centr
gradlePlugin.testSourceSets(sourceSets.functionalTest)
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation)

// Add a task to run the functional tests
// Add a task to run the functional tests
tasks.register('functionalTest', Test) {
description = 'Runs functional tests.'
group = 'verification'
Expand All @@ -166,12 +166,19 @@ if (project.hasProperty('signing.keyId')) { // publish as library in maven centr
dependsOn(tasks.functionalTest)
}

// Add a task to run the utility class
tasks.register('updateDependencies', JavaExec) {
classpath = sourceSets.main.runtimeClasspath
mainClass = 'co.com.bancolombia.utils.offline.LocalTasks'
args 'UPDATE'
}
}

dependencies {
api 'com.github.spullara.mustache.java:compiler:0.9.11'
api 'com.fasterxml.jackson.core:jackson-databind:2.16.0'
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.0'
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.16.0'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.0'
implementation 'org.reflections:reflections:0.10.2'

Expand Down Expand Up @@ -214,7 +221,7 @@ sonar {
property "sonar.java-coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/report.xml"
property "sonar.test", "src/test/java"
property "sonar.exclusions", ".github/**,src/functionalTest/**,src/test/**/*Test.java,**/**models**,src/test/**/CAAssert.java,src/test/**/*Provider.java,**/**exceptions**,**/examples-ca/**,src/test/**/AnUpdate*.java"
property "sonar.exclusions", ".github/**,src/functionalTest/**,src/test/**/*Test.java,**/**models**,src/test/**/CAAssert.java,src/test/**/*Provider.java,**/**exceptions**,**/examples-ca/**,src/test/**/AnUpdate*.java,**/LocalTasks.java"
property "sonar.sourceEncoding", "UTF-8"
}
}
Expand All @@ -239,7 +246,7 @@ tasks.register('copyPreCommit', Copy) {
tasks.register('downloadCommitMessage') {
def f = new File('.git/hooks/commit-msg.sample2')
if (!f.exists()) {
new URL('https://raw.githubusercontent.com/hazcod/semantic-commit-hook/master/commit-msg').withInputStream{ i -> f.withOutputStream{ it << i }}
new URL('https://raw.githubusercontent.com/hazcod/semantic-commit-hook/master/commit-msg').withInputStream { i -> f.withOutputStream { it << i } }
}
}

Expand All @@ -251,7 +258,7 @@ tasks.register('fileModeCommitMessage', Copy) {
fileMode 0777
}

tasks.register('installGitHooks'){
tasks.register('installGitHooks') {
dependsOn 'copyPreCommit', 'downloadCommitMessage', 'fileModeCommitMessage'
doLast {
println 'GitHooks installed!'
Expand Down
2 changes: 1 addition & 1 deletion config/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ REPO_ROOT_DIR="$(git rev-parse --show-toplevel)"
files=$(git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.java$" || true)
if [ ! -z "${files}" ]; then
comma_files=$(echo "$files" | paste -s -d "," -)
"${REPO_ROOT_DIR}/gradlew" goJF -DgoogleJavaFormat.include="$comma_files" &>/dev/null
"${REPO_ROOT_DIR}/gradlew" goJF -DgoogleJavaFormat.include="$comma_files"
git add $(echo "$files" | paste -s -d " " -)
fi
cat <<\EOF
Expand Down
83 changes: 83 additions & 0 deletions sh_dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"maven": [
{
"name": "SECRETS_VERSION",
"packageName": "com.github.bancolombia:aws-secrets-manager-sync"
},
{
"name": "SPRING_BOOT_VERSION",
"packageName": "org.springframework.boot:spring-boot-dependencies"
},
{
"name": "LOMBOK_VERSION",
"packageName": "org.projectlombok:lombok"
},
{
"name": "REACTIVE_COMMONS_VERSION",
"packageName": "org.reactivecommons:async-commons-rabbit-starter"
},
{
"name": "REACTIVE_COMMONS_MAPPER_VERSION",
"packageName": "org.reactivecommons.utils:object-mapper-api"
},
{
"name": "BLOCK_HOUND_VERSION",
"packageName": "io.projectreactor.tools:blockhound-junit-platform"
},
{
"name": "AWS_BOM_VERSION",
"packageName": "software.amazon.awssdk:bom"
},
{
"name": "COMMONS_JMS_VERSION",
"packageName": "com.github.bancolombia:commons-jms-mq"
},
{
"name": "GRAPHQL_KICKSTART_VERSION",
"packageName": "com.graphql-java-kickstart:graphql-spring-boot-starter"
},
{
"name": "ARCH_UNIT_VERSION",
"packageName": "com.tngtech.archunit:archunit"
},
{
"name": "OKHTTP_VERSION",
"packageName": "com.squareup.okhttp3:okhttp"
},
{
"name": "RESILIENCE_4J_VERSION",
"packageName": "io.github.resilience4j:resilience4j-spring-boot3"
},
{
"name": "BIN_STASH_VERSION",
"packageName": "com.github.bancolombia:bin-stash-local"
},
{
"name": "SPRING_DOC_OPENAPI_VERSION",
"packageName": "org.springdoc:springdoc-openapi-starter-webmvc-ui"
},
{
"name": "JACOCO_VERSION",
"packageName": "org.jacoco:jacoco-maven-plugin"
}
],
"gradle": [
{
"name": "SONAR_VERSION",
"packageName": "org.sonarqube:org.sonarqube.gradle.plugin"
},
{
"name": "COBERTURA_VERSION",
"packageName": "net.saliman.cobertura:net.saliman.cobertura.gradle.plugin"
},
{
"name": "DEPENDENCY_CHECK_VERSION",
"packageName": "org.owasp.dependencycheck:org.owasp.dependencycheck.gradle.plugin"
}
],
"custom": [
{
"name": "GRADLE_WRAPPER_VERSION"
}
]
}
File renamed without changes.
File renamed without changes.
49 changes: 19 additions & 30 deletions src/main/java/co/com/bancolombia/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,34 @@

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Constants {
// All these constants are set automatically as params in ModuleBuilder
public static final String PLUGIN_TASK_GROUP = "Clean Architecture";
public static final String APP_SERVICE = "app-service";
public static final String PATH_GRAPHQL = "/graphql";
public static final String SECRETS_VERSION = "4.1.0";
public static final String SPRING_BOOT_VERSION = "3.2.1";
public static final String SONAR_VERSION = "4.4.1.3373";
// dependencies
public static final String SECRETS_VERSION = "4.4.0";
public static final String SPRING_BOOT_VERSION = "3.1.8";
public static final String LOMBOK_VERSION = "1.18.30";
public static final String JACOCO_VERSION = "0.8.10";
public static final String COBERTURA_VERSION = "4.0.0";
public static final String RCOMMONS_ASYNC_COMMONS_STARTER_VERSION = "2.0.4";
public static final String RCOMMONS_OBJECT_MAPPER_VERSION = "0.1.0";
public static final String REACTIVE_COMMONS_VERSION = "2.0.4";
public static final String REACTIVE_COMMONS_MAPPER_VERSION = "0.1.0";
public static final String BLOCK_HOUND_VERSION = "1.0.8.RELEASE";
public static final String PLUGIN_VERSION = "3.12.4";
public static final String GRADLE_WRAPPER_VERSION = "8.5";
public static final String KOTLIN_VERSION = "1.9.20";
public static final String AWS_BOM_VERSION = "2.20.94";
public static final String COMMONS_JMS_VERSION = "1.4.0-alpha";
public static final String GRAPHQL_KICKSTART_VERSION = "15.0.0";
public static final String AWS_BOM_VERSION = "2.23.6";
public static final String COMMONS_JMS_VERSION = "1.4.1";
public static final String GRAPHQL_KICKSTART_VERSION = "15.1.0";
public static final String ARCH_UNIT_VERSION = "1.2.1";
public static final String OKHTTP_VERSION = "4.12.0";
public static final String RESILIENCE_4J_VERSION = "2.2.0";
public static final String BIN_STASH_VERSION = "1.2.2";
public static final String SPRINGDOC_OPENAPI_VERSION = "2.3.0";
public static final String DEPENDENCY_CHECK_VERSION = "9.0.7";
public static final String TOMCAT_EXCLUSION_KOTLIN =
"configurations {\n\tall {\n\t\texclude(group = \"org.springframework.boot\", module = \"spring-boot-starter-tomcat\")\n\t}\n}";
public static final String TOMCAT_EXCLUSION =
"implementation.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'";
public static final String AWS_BOM =
"\timplementation platform('software.amazon.awssdk:bom:" + Constants.AWS_BOM_VERSION + "')";
public static final String AWS_BOM_KT =
"\timplementation(platform(\"software.amazon.awssdk:bom:"
+ Constants.AWS_BOM_VERSION
+ "\"))";

public enum BooleanOption {
TRUE,
FALSE
}
public static final String SPRING_DOC_OPENAPI_VERSION = "2.3.0";
// gradle plugins
public static final String JACOCO_VERSION = "0.8.11";
public static final String SONAR_VERSION = "4.4.1.3373";
public static final String COBERTURA_VERSION = "4.0.0";
public static final String PLUGIN_VERSION = "3.12.4";
public static final String DEPENDENCY_CHECK_VERSION = "9.0.9";
// custom
public static final String GRADLE_WRAPPER_VERSION = "8.5";
public static final String KOTLIN_VERSION = "1.9.20";

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public static class MainFiles {
Expand Down
112 changes: 0 additions & 112 deletions src/main/java/co/com/bancolombia/adapters/RestService.java

This file was deleted.

Loading
Loading