Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated ConfigureUtil #826

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/docs/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ task testJar(type: Jar) {

shadowJar {
manifest {
inheritFrom project.tasks.testJar.manifest
inheritFrom(project, project.tasks.testJar.manifest)
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ShadowJavaPlugin implements Plugin<Project> {
}
}
}
shadow.manifest.inheritFrom project.tasks.jar.manifest
shadow.manifest.inheritFrom(project, project.tasks.jar.manifest)
def libsProvider = project.provider { -> [project.tasks.jar.manifest.attributes.get('Class-Path')] }
def files = project.objects.fileCollection().from { ->
project.configurations.findByName(ShadowBasePlugin.CONFIGURATION_NAME)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.github.jengelman.gradle.plugins.shadow.tasks

import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.java.archives.Attributes
import org.gradle.api.java.archives.Manifest
import org.gradle.api.java.archives.ManifestException
import org.gradle.api.java.archives.ManifestMergeSpec
import org.gradle.api.java.archives.internal.DefaultManifest
import org.gradle.api.java.archives.internal.DefaultManifestMergeSpec
import org.gradle.util.ConfigureUtil

class DefaultInheritManifest implements InheritManifest {

Expand All @@ -23,16 +23,16 @@ class DefaultInheritManifest implements InheritManifest {
this.fileResolver = fileResolver
}

InheritManifest inheritFrom(Object... inheritPaths) {
inheritFrom(inheritPaths, null)
InheritManifest inheritFrom(Project project, Object... inheritPaths) {
inheritFrom(project, inheritPaths, null)
return this
}

InheritManifest inheritFrom(Object inheritPaths, Closure closure) {
InheritManifest inheritFrom(Project project, Object inheritPaths, Closure closure) {
DefaultManifestMergeSpec mergeSpec = new DefaultManifestMergeSpec()
mergeSpec.from(inheritPaths)
inheritMergeSpecs.add(mergeSpec)
ConfigureUtil.configure(closure, mergeSpec)
project.configure(mergeSpec, closure)
return this
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.github.jengelman.gradle.plugins.shadow.tasks

import org.gradle.api.Project
import org.gradle.api.java.archives.Manifest

interface InheritManifest extends Manifest {

InheritManifest inheritFrom(Object... inheritPaths)
InheritManifest inheritFrom(Project project, Object... inheritPaths)

InheritManifest inheritFrom(Object inheritPaths, Closure closure)
InheritManifest inheritFrom(Project project, Object inheritPaths, Closure closure)
}