blob: a1b59a50d5e7eaec985a4aa1f339bb81af8ad9a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
package org.jetbrains
import org.gradle.api.artifacts.Configuration
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Sync
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getValue
import java.io.File
@Suppress("LeakingThis")
open class SetupMaven : Sync() {
@get:Input
var mavenVersion = "3.5.0"
@get:Input
var mavenPluginToolsVersion = "3.5.2"
@get:Internal
val mavenBuildDir = "${project.buildDir}/maven"
@get:Internal
val mavenBinDir = "${project.buildDir}/maven-bin"
@get:Internal
val mvn = File(mavenBinDir, "apache-maven-$mavenVersion/bin/mvn")
private val mavenBinaryConfiguration: Configuration by project.configurations.creating {
project.dependencies {
this@creating.invoke(
group = "org.apache.maven",
name = "apache-maven",
version = mavenVersion,
classifier = "bin", ext = "zip"
)
}
}
init {
from(mavenBinaryConfiguration.map { file -> project.zipTree(file) })
into(mavenBinDir)
}
}
|