搜索Gradle插件

使用插件DSL

plugins {
  id("pub.ihub.plugin.ihub-git-hooks") version "1.6.6"
}

使用旧版插件应用

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org.cn/m2/")
    }
  }
  dependencies {
    classpath("pub.ihub.plugin:ihub-githooks:1.6.6")
  }
}

apply(plugin = "pub.ihub.plugin.ihub-git-hooks")

使用插件DSL

plugins {
  id "pub.ihub.plugin.ihub-git-hooks" version "1.6.6"
}

使用旧版插件应用

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org.cn/m2/"
    }
  }
  dependencies {
    classpath "pub.ihub.plugin:ihub-githooks:1.6.6"
  }
}

apply plugin: "pub.ihub.plugin.ihub-git-hooks"

学习如何将插件应用于子项目