Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ internal fun nmcpPublishFileByFileToFileSystem(
logger.info("Nmcp: copying files to $m2AbsolutePath")

File(m2AbsolutePath).mkdirs()
publishFileByFile(FilesystemTransport(m2AbsolutePath), inputFiles, parallelism)
publishFileByFile(FilesystemTransport(m2AbsolutePath, logger), inputFiles, parallelism)
}
3 changes: 3 additions & 0 deletions nmcp-tasks/src/main/kotlin/nmcp/transport/transport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ fun Content.toRequestBody(): RequestBody {

internal class FilesystemTransport(
private val basePath: String,
private val logger: GLogger,
) : Transport {
override fun get(path: String): BufferedSource? {
logger.info("Nmcp: read '$path'")
val file = File(basePath).resolve(path)
if (!file.exists()) {
return null
Expand All @@ -176,6 +178,7 @@ internal class FilesystemTransport(
}

override fun put(path: String, body: Content) {
logger.info("Nmcp: write '$path'")
File(basePath).resolve(path).apply {
parentFile.mkdirs()
sink().buffer().use {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ internal abstract class DefaultNmcpAggregationExtension(private val project: Pro
project.registerNmcpPublishFileByFileToFileSystemTask(
taskName = "nmcpPublishAggregationTo${options.name.get().capitalizeFirstLetter()}Repository",
inputFiles = allFiles,
m2AbsolutePath = project.provider { File(options.path.get()).absolutePath },
m2AbsolutePath = project.provider { project.file(options.path.get()).absolutePath },
parallelism = project.provider { 1 },
)
}

@Deprecated("Use the settings plugin or a convention plugin instead")
override fun publishAllProjectsProbablyBreakingProjectIsolation() {
check(project === project.rootProject) {
Expand Down
Loading