Skip to content

Commit

Permalink
Reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Dec 10, 2024
1 parent 959289e commit 863600b
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 76 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.github.jengelman.gradle.plugins.shadow.util

import com.github.jengelman.gradle.plugins.shadow.util.repo.maven.MavenFileRepository
import groovy.transform.InheritConstructors

@InheritConstructors
class AppendableMavenFileRepository extends MavenFileRepository {

@Override
AppendableMavenFileModule module(String groupId, String artifactId, String version = '1.0') {
def artifactDir = rootDir.resolve("${groupId.replace('.', '/')}/$artifactId/$version")
return new AppendableMavenFileModule(artifactDir, groupId, artifactId, version as String)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.github.jengelman.gradle.plugins.shadow.util.repo.maven

import org.jetbrains.annotations.NotNull

class MavenFileModule extends AbstractMavenModule {
private boolean uniqueSnapshots = true

MavenFileModule(File moduleDir, String groupId, String artifactId, String version) {
super(moduleDir, groupId, artifactId, version)
}

@Override
boolean getUniqueSnapshots() {
return uniqueSnapshots
}

@Override
String getMetaDataFileContent() {
"""
<metadata>
<!-- ${getArtifactContent()} -->
<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>
""".stripIndent()
}

@Override
protected void onPublish(@NotNull File file) {
sha1File(file)
md5File(file)
}

@Override
protected boolean publishesMetaDataFile() {
uniqueSnapshots && version.endsWith("-SNAPSHOT")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.github.jengelman.gradle.plugins.shadow.util.repo.maven

/**
* A fixture for dealing with file Maven repositories.
*/
class MavenFileRepository implements MavenRepository {
final File rootDir

MavenFileRepository(File rootDir) {
this.rootDir = rootDir
}

@Override
URI getUri() {
return rootDir.toURI()
}

@Override
MavenFileModule module(String groupId, String artifactId, String version = '1.0') {
def artifactDir = rootDir.resolve("${groupId.replace('.', '/')}/$artifactId/$version")
return new MavenFileModule(artifactDir, groupId, artifactId, version as String)
}
}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 863600b

Please sign in to comment.