|
|
|
@ -21,6 +21,7 @@ import javax.inject.Inject; |
|
|
|
import org.gradle.api.DefaultTask; |
|
|
|
import org.gradle.api.DefaultTask; |
|
|
|
import org.gradle.api.Task; |
|
|
|
import org.gradle.api.Task; |
|
|
|
import org.gradle.api.artifacts.Configuration; |
|
|
|
import org.gradle.api.artifacts.Configuration; |
|
|
|
|
|
|
|
import org.gradle.api.file.ArchiveOperations; |
|
|
|
import org.gradle.api.file.DirectoryProperty; |
|
|
|
import org.gradle.api.file.DirectoryProperty; |
|
|
|
import org.gradle.api.file.FileSystemOperations; |
|
|
|
import org.gradle.api.file.FileSystemOperations; |
|
|
|
import org.gradle.api.provider.SetProperty; |
|
|
|
import org.gradle.api.provider.SetProperty; |
|
|
|
@ -37,9 +38,12 @@ public abstract class PrepareMavenBinaries extends DefaultTask { |
|
|
|
|
|
|
|
|
|
|
|
private final FileSystemOperations fileSystemOperations; |
|
|
|
private final FileSystemOperations fileSystemOperations; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ArchiveOperations archiveOperations; |
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
@Inject |
|
|
|
public PrepareMavenBinaries(FileSystemOperations fileSystemOperations) { |
|
|
|
public PrepareMavenBinaries(FileSystemOperations fileSystemOperations, ArchiveOperations archiveOperations) { |
|
|
|
this.fileSystemOperations = fileSystemOperations; |
|
|
|
this.fileSystemOperations = fileSystemOperations; |
|
|
|
|
|
|
|
this.archiveOperations = archiveOperations; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@OutputDirectory |
|
|
|
@OutputDirectory |
|
|
|
@ -53,10 +57,9 @@ public abstract class PrepareMavenBinaries extends DefaultTask { |
|
|
|
this.fileSystemOperations.sync((sync) -> { |
|
|
|
this.fileSystemOperations.sync((sync) -> { |
|
|
|
sync.into(getOutputDir()); |
|
|
|
sync.into(getOutputDir()); |
|
|
|
for (String version : getVersions().get()) { |
|
|
|
for (String version : getVersions().get()) { |
|
|
|
Configuration configuration = getProject().getConfigurations() |
|
|
|
Configuration configuration = getProject().getConfigurations().detachedConfiguration( |
|
|
|
.detachedConfiguration(getProject().getDependencies() |
|
|
|
getProject().getDependencies().create("org.apache.maven:apache-maven:" + version + ":bin@zip")); |
|
|
|
.create("org.apache.maven:apache-maven:" + version + ":bin@zip")); |
|
|
|
sync.from(this.archiveOperations.zipTree(configuration.getSingleFile())); |
|
|
|
sync.from(getProject().zipTree(configuration.getSingleFile())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|