Fork me on GitHub
#clojure
<
2022-01-02
>
Alex Miller (Clojure team)00:01:25

maven versions are generally prefixes of major.minor.increment-qualifier but there are a lot of special rules about how qualifiers work and are compared, and they changed a bit from maven 2 to 3 to fix some problems. some useful links: • https://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-syntax.html#pom-reationships-sect-versionshttps://cwiki.apache.org/confluence/display/MAVENOLD/Versioninghttps://issues.apache.org/jira/browse/MNG-3010

emccue00:01:11

not just versions, but like when i declare a/b {:mvn/version "1.2.3"} what is the procedure for fetching it?

emccue00:01:22

apologies if that doesn’t make much sense as a question

emccue00:01:26

like from the perspective of if i wanted to make a ring server that worked as a maven repository i guess

hiredman00:01:16

Maven repos are pretty dumb file stores

hiredman00:01:03

Wagons are what maven calls the plugins that interact with the file stores

hiredman00:01:51

The main protocol this happens over is http(s) and the main API call wagons provide is just "download this file"

hiredman01:01:24

Here is a maven wagon for s3 written in clojure https://github.com/clojure/tools.deps.alpha/blob/master/src/main/clojure/clojure/tools/deps/alpha/util/s3_transporter.clj there is some stub java code in the main repo that calls into it

hiredman01:01:31

You can see the only thing it does is get objects

emccue01:01:39

ah yeah - thats pretty basic

emccue01:01:47

i wish there was an equivalent place for a java community where “things happened”

emccue01:01:03

might help me get some more of these ideas off the ground

emccue01:01:35

(or shot down so they dont live rent free in my head)

Alex Miller (Clojure team)02:01:24

wagons are the old protocol, the newer protocol are transporters

Alex Miller (Clojure team)02:01:48

that one above is only a partial impl (the full protocol does uploads too)

emccue05:01:29

/**
     * Create zip file containing contents of src dirs.
     *
     * @param srcDirs coll of source directories to include in zip
     * @param zipFile zip file to create
     */
    public void zip(List<String> srcDirs, String zipFile) {
        API_ZIP.invoke(HASH_MAP.invoke(
                Clojure.read(":src-dirs"), SEQ.invoke(srcDirs),
                Clojure.read(":zip-file"), zipFile
        ));
    }

Mutasem Hidmi11:01:37

Hi Everyone. I have a small question. Is this https://github.com/unbounce/clojure-dogstatsd-client the best library to integrate datadog with a clojure web application?

didibus21:01:39

I like to use Java clients directly most of the time, since it gives you mor control and has no limitations. Where as a wrapper might not have wrapped everything yet and so might not expose all options. But it means you need a bit more familiarity with Clojure interop and Java APIs.

emccue15:01:30

/**
     * Copy the contents of the src-dirs to the target-dir, optionally do text replacement.
     * @param targetDir dir to write files, will be created if it doesn't exist
     * @param srcDirs coll of dirs to copy from
     * @param options options
     */
    public void copyDir(String targetDir, List<String> srcDirs, CopyDirOptions options) {
        Objects.requireNonNull(targetDir);
        Objects.requireNonNull(srcDirs);

        var args = HASH_MAP.invoke(
                Clojure.read(":target-dir"), targetDir,
                Clojure.read(":src-dirs"), SEQ.invoke(srcDirs)
        );
        if (options.include != null) {
            args = ASSOC.invoke(args, Clojure.read(":include"), options.include);
        }
        if (options.ignores != null) {
            args = ASSOC.invoke(args, Clojure.read(":ignores"), SEQ.invoke(options.ignores));
        }
        if (options.replace != null) {
            args = ASSOC.invoke(args, Clojure.read(":replace"), INTO.invoke(Clojure.read("{}"), options.replace));
        }
        if (options.nonReplacedExts != null) {
            args = ASSOC.invoke(args, Clojure.read(":non-replaced-exts"), SEQ.invoke(options.nonReplacedExts));
        }
        API_COPY_DIR.invoke(args);
    }