Skip to content

Commit

Permalink
Convert MavenFileModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Dec 10, 2024
1 parent c15be97 commit dfe52c8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 46 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.github.jengelman.gradle.plugins.shadow.util.repo.maven

import java.io.File
import org.intellij.lang.annotations.Language
import org.jetbrains.annotations.NotNull

class MavenFileModule(
moduleDir: File,
groupId: String,
artifactId: String,
version: String,
) : AbstractMavenModule(moduleDir, groupId, artifactId, version) {

override fun getUniqueSnapshots(): Boolean = uniqueSnapshots

@Language("XML")
override fun getMetaDataFileContent(): String {
return """
<metadata>
<!-- $artifactContent -->
<groupId>$groupId</groupId>
<artifactId>$artifactId</artifactId>
<version>$version</version>
<versioning>
<snapshot>
<timestamp>${timestampFormat.format(publishTimestamp)}</timestamp>
<buildNumber>$publishCount</buildNumber>
</snapshot>
<lastUpdated>${updateFormat.format(publishTimestamp)}</lastUpdated>
</versioning>
</metadata>
""".trimIndent()
}

override fun onPublish(@NotNull file: File) {
sha1File(file)
md5File(file)
}

override fun publishesMetaDataFile(): Boolean {
return uniqueSnapshots && version.endsWith("-SNAPSHOT")
}
}

0 comments on commit dfe52c8

Please sign in to comment.