plugins {
  id 'groovy'
  id 'java-gradle-plugin'
  id "com.diffplug.spotless" version "5.6.1"
}

spotless {
  java {
    googleJavaFormat()
    licenseHeaderFile rootProject.file('../gradle/enforcement/spotless.license.java'), '(package|import|public)'
    target 'src/**/*.java'
  }
  groovy {
    licenseHeaderFile rootProject.file('../gradle/enforcement/spotless.license.java'), '(package|import|class)'
  }
}

gradlePlugin {
  plugins {
    create("muzzle-plugin") {
      id = "muzzle"
      implementationClass = "MuzzlePlugin"
    }
  }
}

repositories {
  mavenLocal()
  mavenCentral()
  jcenter()
}

dependencies {
  implementation(gradleApi())
  implementation(localGroovy())

  implementation group: "org.eclipse.aether", name: "aether-connector-basic", version: "1.1.0"
  implementation group: "org.eclipse.aether", name: "aether-transport-http", version: "1.1.0"
  implementation group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9"

  implementation group: "com.google.guava", name: "guava", version: "30.1-jre"
  implementation group: "org.ow2.asm", name: "asm", version: "7.0-beta"
  implementation group: "org.ow2.asm", name: "asm-tree", version: "7.0-beta"
  implementation group: "org.apache.httpcomponents", name: "httpclient", version: "4.5.10"
  implementation group: "net.bytebuddy", name: "byte-buddy-gradle-plugin", version: "1.10.18"

  testImplementation group: "org.spockframework", name: "spock-core", version: "1.3-groovy-2.5"
  testImplementation group: "org.codehaus.groovy", name: "groovy-all", version: "2.5.8"
}
