/**
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
 * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
 * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath 'com.github.jk1.dependency-license-report:com.github.jk1.dependency-license-report.gradle.plugin:2.0'
  }
}

apply plugin: LicenseReportPlugin

import com.github.jk1.license.LicenseReportPlugin
import com.github.jk1.license.filter.*
import com.github.jk1.license.render.*


def filter = new LicenseBundleNormalizer( ) as DependencyFilter
def fs = new ArrayList<DependencyFilter>()
fs.add(filter)

licenseReport {
  configurations = ['compileClasspath']
  excludeOwnGroup = true
  allowedLicensesFile = new File("$projectDir/gradle/allowed-licenses.json")
  filters = fs
  excludes = [
    'org.jetbrains.kotlinx:kotlinx-coroutines-core'
  ]
  excludeBoms = true
  def rs = new ArrayList<ReportRenderer>();
  def xml = new XmlReportRenderer() as ReportRenderer
  def csv = new CsvReportRenderer() as ReportRenderer
  def inventory = new InventoryHtmlReportRenderer() as ReportRenderer
  rs.add(xml)
  rs.add(csv)
  rs.add(inventory)
  renderers = rs
}
