-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
76 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...oovy/com/github/jengelman/gradle/plugins/shadow/util/AppendableMavenFileRepository.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../groovy/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenFileModule.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ovy/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenFileRepository.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
...t/kotlin/com/github/jengelman/gradle/plugins/shadow/util/AppendableMavenFileRepository.kt
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
...Test/kotlin/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenFileModule.kt
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
.../kotlin/com/github/jengelman/gradle/plugins/shadow/util/repo/maven/MavenFileRepository.kt
This file was deleted.
Oops, something went wrong.