/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

import org.elasticsearch.gradle.internal.AbstractDependenciesTask

apply plugin: 'elasticsearch.build'
apply plugin: 'elasticsearch.publish'
apply plugin: 'com.gradleup.shadow'

dependencies {
  implementation "org.opensaml:opensaml-security-api:${versions.opensaml}"
  compileOnly "org.opensaml:opensaml-core:${versions.opensaml}"
}

['jarHell', 'thirdPartyAudit', 'splitPackagesAudit', 'forbiddenApisMain', 'licenseHeaders' ].each {
  tasks.named(it).configure {
    enabled = false
  }
}

tasks.withType(AbstractDependenciesTask).configureEach {
  mapping from: /opensaml-.*/, to: 'shibboleth'
}

tasks.named("shadowJar").configure {
  manifest {
    attributes 'Automatic-Module-Name': 'org.opensaml.security'
  }
  exclude 'META-INF/services/org.opensaml.security.crypto.ec.NamedCurve'
}
