parent
3f2debce43
commit
d3fcd574a2
|
@ -34,7 +34,7 @@ object Extras {
|
|||
// set for the project
|
||||
const val description = "Gradle Plugin to manage various Gradle tasks, such as updating gradle and dependencies"
|
||||
const val group = "com.dorkbox"
|
||||
const val version = "3.14.1"
|
||||
const val version = "3.15"
|
||||
|
||||
// set as project.ext
|
||||
const val name = "Gradle Utils"
|
||||
|
|
|
@ -18,6 +18,7 @@ package dorkbox.gradle
|
|||
import dorkbox.gradle.deps.GetVersionInfoTask
|
||||
import org.gradle.api.*
|
||||
import org.gradle.api.file.SourceDirectorySet
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
||||
import java.io.*
|
||||
|
@ -181,3 +182,27 @@ fun JarFile.addFilesToJar(filesToAdd: List<Pair<File, String>>) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make sure that the creation of manifests happens AFTER task configuration, but before task execution.
|
||||
*
|
||||
* There are dependency issues if the manifest is configured during task configuration.
|
||||
*
|
||||
* These are NOT lambda's because of issues with gradle.
|
||||
*/
|
||||
fun org.gradle.jvm.tasks.Jar.safeManifest(action: Action<in org.gradle.api.java.archives.Manifest>) {
|
||||
val task = this
|
||||
|
||||
task.doFirst(object: Action<Task> {
|
||||
override fun execute(task: Task) {
|
||||
task as Jar
|
||||
|
||||
task.manifest(object : Action<org.gradle.api.java.archives.Manifest> {
|
||||
override fun execute(t: org.gradle.api.java.archives.Manifest) {
|
||||
action.execute(t)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue