提交 b5f73560 作者: 方治民

chore: upgrade deps && change hooks

上级 cc06d883
......@@ -5,11 +5,11 @@ plugins {
id 'org.springframework.boot' version '3.2.5'
id 'org.graalvm.buildtools.native' version '0.9.28'
// https://plugins.gradle.org/plugin/io.spring.dependency-management
id 'io.spring.dependency-management' version '1.1.4'
id 'io.spring.dependency-management' version '1.1.5'
// https://plugins.gradle.org/plugin/com.diffplug.spotless
id "com.diffplug.spotless" version "6.25.0"
// https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id "com.gorylenko.gradle-git-properties" version "2.4.2"
}
ext {
......@@ -33,7 +33,7 @@ ext {
// Sentry
// https://central.sonatype.com/artifact/io.sentry/sentry-spring-boot-starter-jakarta
sentryVersion = '7.8.0'
sentryVersion = '7.9.0'
// Dependencies
// https://central.sonatype.com/artifact/com.github.xiaoymin/knife4j-openapi3-jakarta-spring-boot-starter
......@@ -48,14 +48,12 @@ ext {
fastJsonVersion = '2.0.49'
// https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '2.4.1'
// https://central.sonatype.com/artifact/com.squareup.okhttp3/okhttp
okhttpVersion = '4.12.0'
// https://central.sonatype.com/artifact/io.minio/minio
minioVersion = '8.5.9'
minioVersion = '8.5.10'
// https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-63
hibernateTypesVersion = '3.7.4'
hibernateTypesVersion = '3.7.5'
// https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial
hibernateSpatialVersion = '6.4.4.Final'
hibernateSpatialVersion = '6.4.8.Final'
// https://central.sonatype.com/artifact/org.locationtech.jts/jts-core
jtsVersion = '1.19.0'
// https://central.sonatype.com/artifact/com.github.liaochong/myexcel
......@@ -150,33 +148,10 @@ subprojects {
prettier(['prettier': prettierVersion, 'prettier-plugin-java': prettierJavaVersion]).config([
'parser' : 'java',
'tabWidth' : 4,
'useTabs' : false,
'printWidth': 120,
'endOfLine' : 'lf'
])
}
}
}
tasks.register('preCommit') {
// fix: CI/CD
try {
// GitHook pre-commit (spotless, spotbugs)
def hook = new File("$rootProject.projectDir/.git/hooks/pre-commit")
hook.text = """#!/bin/bash
#set -x
./gradlew spotlessCheck
RESULT=\$?
exit \$RESULT
"""
} catch (ignored) {
}
}
gradle.getTaskGraph().whenReady {
def skipHooks = gradle.startParameter.getSystemPropertiesArgs().containsKey('skip-hooks')
if (!skipHooks) {
preCommit
}
}
......@@ -5,6 +5,11 @@
// }
//}
plugins {
// https://plugins.gradle.org/plugin/org.danilopianini.gradle-pre-commit-git-hooks
id "org.danilopianini.gradle-pre-commit-git-hooks" version "2.0.5"
}
rootProject.name = 'basic-api-boot'
include 'app'
include 'basic-auth'
......@@ -17,3 +22,33 @@ include 'basic-common:minio'
include 'basic-common:redis'
include 'basic-common:i18n'
gitHooks { extension ->
extension.with {
preCommit { context ->
context.with {
from("#!/bin/bash") {
"""
#set -x
./gradlew spotlessCheck
RESULT=\$?
exit \$RESULT
"""
}
}
}
commitMsg { context ->
context.with {
conventionalCommits { conventionalCommits ->
conventionalCommits.with {
defaultTypes()
}
}
}
}
createHooks(true)
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论