跳至主要內容

Groovy项目基础配置

Henry...小于 1 分钟

Groovy项目基础配置

Groovy项目配置,参见项目模板open in new window

配置 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"
}

配置 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"
    ))
}

配置 gradle.properties

配置项目名称以及group,其中nameihub-settings插件扩展属性group为原生项目属性

name=demo
group=pub.ihub.demo