All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.kt Maven / Gradle / Ivy

Go to download

Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin.

There is a newer version: 9.0.0-beta4
Show newest version
package com.github.jengelman.gradle.plugins.shadow

import com.github.jengelman.gradle.plugins.shadow.tasks.KnowsTask
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.util.GradleVersion

public abstract class ShadowBasePlugin : Plugin {

  override fun apply(project: Project) {
    if (GradleVersion.current() < GradleVersion.version("8.3")) {
      throw GradleException("This version of Shadow supports Gradle 8.3+ only. Please upgrade.")
    }
    project.extensions.create(EXTENSION_NAME, ShadowExtension::class.java, project)
    project.configurations.create(CONFIGURATION_NAME)
    project.tasks.register(KnowsTask.NAME, KnowsTask::class.java) { knows ->
      knows.group = GROUP_NAME
      knows.description = KnowsTask.DESC
    }
  }

  public companion object {
    public const val SHADOW: String = "shadow"
    public const val GROUP_NAME: String = SHADOW
    public const val EXTENSION_NAME: String = SHADOW
    public const val CONFIGURATION_NAME: String = SHADOW
    public const val COMPONENT_NAME: String = SHADOW
    public const val DISTRIBUTION_NAME: String = SHADOW
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy