noprompt / frak

Transform collections of strings into regular expressions.
1.13k stars 39 forks source link

Add frak to a public repository #6

Closed breun closed 11 years ago

breun commented 11 years ago

It would be nice if frak builds were available from a public repository, so I could easily add a dependency on frak in my projects.

Here is a guide that explains how to upload artifacts to Maven Central: http://maven.apache.org/guides/mini/guide-central-repository-upload.html

Update: Maybe Clojars is a more natural fit for a Clojure library: https://clojars.org

I've created a pull request for Maven support: https://github.com/noprompt/frak/pull/5

noprompt commented 11 years ago

@breun Sorry for my slow response. I'm not ignoring this. My plan is to cut a new jar in the next couple of days so we'll probably want to wait until then before we move on anything here or in #5. I don't know much about Maven but I do know that leiningen does generate pom.xml files. Could we edit and use that or am I totally off the mark here?

breun commented 11 years ago

I don't really know much about Clojure or leiningen, so we're speaking from different worlds to each other here. :)

I just knew that since Clojure runs on the JVM I should be able to use frak from Java code and I wanted to give that a try. Actually I managed to hack up a little project yesterday where I exposed frak's functionality via an HTTP server (RaaS, Regex as a Service?).

Actually it was a bit harder than I thought it would be to call frak from Java, but http://stackoverflow.com/a/6410926/2702713 got me a solution that didn't require modifying frak code to generate a class. It's not very pretty, but since there's only one method to call, it's fine.

Adding frak to the Maven Central repository as is is maybe not a great idea, as users will need to jump through the same hoop to be able to use frak. It might be better to add a :gen-class statement to frak as per http://stackoverflow.com/a/2187427/2702713, so from for instance Java I could just access frak/pattern like a static method on an importable class.

But in the end I totally understand if you don't feel like going through all this trouble.

I don't intend to build further on my little personal hacking project, but I do love cool libraries being available from a central repository, so people can easily add a dependency on them in their projects without having to build and put them in a local repository (which makes de project depending on it not very portable/sharable) or having to include the library in its entirety in their project. I also don't know if build tools in the Clojure world have anything resembling Maven repositories, but even the other build tools in the Java world (Gradle, etc.) are compatible with Maven repositories and I love the way code can be easily used by anyone via Maven Central, so that's why I tend to create requests like these. :)

breun commented 11 years ago

Oh, and if leiningen can generate pom.xml files then you might want to use that instead of the one I created by hand to avoid having to maintain two build files.

breun commented 11 years ago

Here's frak-server, Regex as a Service: https://github.com/breun/frak-server :)

breun commented 11 years ago

You could also add frak to Clojars, which might be easier and a more natural fit for Clojure libraries: https://clojars.org/

And Maven can use Clojars as a repository as well.

noprompt commented 11 years ago

@breun frak is available on Clojars. Also, I think if you clone this library and run lein pom it will generate the pom.xml file you are looking for.

noprompt commented 11 years ago

@breun Here it is on Clojars: https://clojars.org/frak. I have no idea why it doesn't appear in the search. It also looks like it has what you need for Maven too.

noprompt commented 11 years ago

@breun If this is satisfactory could we close this issue and #5?

breun commented 11 years ago

I actually installed leiningen today and ran lein pom, but the resulting pom.xml doesn't work. I guess because of the additional processing required by cljx introduced in 0.1.3.

noprompt commented 11 years ago

Do the Maven instructions from Clojars work?

breun commented 11 years ago

Ah, I searched for frak on Clojars, but I indeed couldn't find it. It seems to work though. I'll be updating my frak-server project to depend directly on the jar from Clojars.

I think you can close both this issue and #5.

breun commented 11 years ago

Done: https://github.com/breun/frak-server/commit/9443d1fead8e88ec3740d8a29e162b7ace17aa9a

breun commented 11 years ago

Closing because the frak jar is already available from a public repository: https://clojars.org/frak

noprompt commented 11 years ago

Alright! Glad you were able to get everything working!

BTW, you might be interested in trying out the HTML example shown in the README. With a few extra tweaks you could have a standalone frak pattern generator w/o the need for a server.

breun commented 11 years ago

I thought that RaaS (Regex as a Service) was a fun idea. Of course it's better to embed frak into your project in most cases.