diff options
author | LexManos <LexManos@gmail.com> | 2018-10-16 19:41:14 -0700 |
---|---|---|
committer | LexManos <LexManos@gmail.com> | 2018-10-16 19:41:14 -0700 |
commit | a2fe1761eade11c81a2bcc52ff8e930556dd9050 (patch) | |
tree | 4b4bc6bfa54aa21d4b380776ae26c02f4a59b66c /src/api | |
parent | 586ad9917fc3e0941d0cf3ed8192aeee9111fb66 (diff) | |
download | Artifactural-a2fe1761eade11c81a2bcc52ff8e930556dd9050.tar.gz Artifactural-a2fe1761eade11c81a2bcc52ff8e930556dd9050.tar.bz2 Artifactural-a2fe1761eade11c81a2bcc52ff8e930556dd9050.zip |
Work attempting to bypass gradle's crappy caching.
It caches FAILURES and uses those over the successes we provide in the custom repos!
Other work directed twards cleaning up the api, and moved to using maven local which bypasses SOME of the caching and prevents the artifacts from our custom repo from being copied to the gradle central cache.
Diffstat (limited to 'src/api')
4 files changed, 22 insertions, 5 deletions
diff --git a/src/api/java/com/amadornes/artifactural/api/artifact/Artifact.java b/src/api/java/com/amadornes/artifactural/api/artifact/Artifact.java index 7e797fb..4271d70 100644 --- a/src/api/java/com/amadornes/artifactural/api/artifact/Artifact.java +++ b/src/api/java/com/amadornes/artifactural/api/artifact/Artifact.java @@ -23,10 +23,10 @@ public interface Artifact { Artifact apply(ArtifactTransformer transformer); - Artifact.Cached cache(ArtifactCache cache, String specifier); + Artifact.Cached cache(ArtifactCache cache); - default Artifact.Cached optionallyCache(ArtifactCache cache, String specifier) { - return this instanceof Artifact.Cached ? (Artifact.Cached) this : cache(cache, specifier); + default Artifact.Cached optionallyCache(ArtifactCache cache) { + return this instanceof Artifact.Cached ? (Artifact.Cached) this : cache(cache); } boolean isPresent(); @@ -35,8 +35,10 @@ public interface Artifact { interface Cached extends Artifact { + // Gets the file location, AND writes the file to disc if it hasn't already. File asFile() throws IOException, MissingArtifactException; + // Gets the file location, but doesn't guarantee that it exists. As the wrapped Artifact may not of been written. What's the point of this? File getFileLocation() throws IOException, MissingArtifactException; } diff --git a/src/api/java/com/amadornes/artifactural/api/artifact/Internal.java b/src/api/java/com/amadornes/artifactural/api/artifact/Internal.java index c7fd883..321b4fc 100644 --- a/src/api/java/com/amadornes/artifactural/api/artifact/Internal.java +++ b/src/api/java/com/amadornes/artifactural/api/artifact/Internal.java @@ -35,9 +35,18 @@ final class Internal { return "missing"; } + @Override + public String toString() { + return "NO_IDENTIFIER"; + } + }; static final Artifact NO_ARTIFACT = new Artifact.Cached() { + @Override + public String toString() { + return "NO_ARTIFACT"; + } @Override public ArtifactIdentifier getIdentifier() { @@ -56,6 +65,11 @@ final class Internal { public String getHash() { return "ERROR"; } + + @Override + public String toString() { + return "NO_METADATA"; + } }; } @@ -75,7 +89,7 @@ final class Internal { } @Override - public Artifact.Cached cache(ArtifactCache cache, String specifier) { + public Artifact.Cached cache(ArtifactCache cache) { return this; } diff --git a/src/api/java/com/amadornes/artifactural/api/artifact/MissingArtifactException.java b/src/api/java/com/amadornes/artifactural/api/artifact/MissingArtifactException.java index 479909c..8ceef19 100644 --- a/src/api/java/com/amadornes/artifactural/api/artifact/MissingArtifactException.java +++ b/src/api/java/com/amadornes/artifactural/api/artifact/MissingArtifactException.java @@ -1,6 +1,7 @@ package com.amadornes.artifactural.api.artifact; public class MissingArtifactException extends RuntimeException { + private static final long serialVersionUID = 4902516963452435653L; public MissingArtifactException(ArtifactIdentifier identifier) { super("Could not find artifact: " + identifier); diff --git a/src/api/java/com/amadornes/artifactural/api/cache/ArtifactCache.java b/src/api/java/com/amadornes/artifactural/api/cache/ArtifactCache.java index 3209656..8099d30 100644 --- a/src/api/java/com/amadornes/artifactural/api/cache/ArtifactCache.java +++ b/src/api/java/com/amadornes/artifactural/api/cache/ArtifactCache.java @@ -4,6 +4,6 @@ import com.amadornes.artifactural.api.artifact.Artifact; public interface ArtifactCache { - Artifact.Cached store(Artifact artifact, String specifier); + Artifact.Cached store(Artifact artifact); } |