Groovy项目基础配置
...小于 1 分钟
Groovy项目基础配置
Groovy项目配置,参见项目模板
配置 wrapper
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
配置 setting.gradle
Kotlin
plugins {
id("pub.ihub.plugin.ihub-settings") version "1.6.2"
}
Groovy
plugins {
id 'pub.ihub.plugin.ihub-settings' version '1.6.2'
}
配置 build.gradle
引入Groovy插件(ihub-groovy)、测试插件(ihub-test)以及验证插件(ihub-verification),配置ihub-git-hooks插件钩子命令:
Kotlin
plugins {
id("pub.ihub.plugin.ihub-groovy")
id("pub.ihub.plugin.ihub-test")
id("pub.ihub.plugin.ihub-verification")
id("pub.ihub.plugin.ihub-git-hooks")
}
iHubGitHooks {
hooks.set(mapOf(
"pre-commit" to "./gradlew build",
"commit-msg" to "./gradlew commitCheck"
))
}
Groovy
plugins {
id 'pub.ihub.plugin.ihub-groovy'
id 'pub.ihub.plugin.ihub-test'
id 'pub.ihub.plugin.ihub-verification'
id 'pub.ihub.plugin.ihub-git-hooks'
}
iHubGitHooks {
hooks = [
'pre-commit': './gradlew build',
'commit-msg': './gradlew commitCheck'
]
}
配置 gradle.properties
配置项目名称以及group,其中name
为ihub-settings插件扩展属性,group
为原生项目属性
name=demo
group=pub.ihub.demo