Using the jar created with lein in other Clojure project [duplicate] - jar

When using lein 2.2, trying to put jar files in /lib does not work.
I tried and it doesn't seems to work but plenty of docs out there says this way still works.

The lib directory functionality was removed in Leiningen v2.0, in favor of a repository (repeatability).
To add free floating jars to a project, you will need to either deploy your dependency to Clojars or a Maven repository. The Maven repository can be as simple as a directory in your project folder.
Please see the answer to this question if you need the jar in a project local folder:
How do I use checked-in jars with leiningen

You do not need to use maven to access a local jar file in Leiningen v2.0
Just use syntax like this in your project.clj:
:resource-paths [ "local-jars/*" ]
and then place your *.jar files in the local-jars subdirectory of your project.
Please see this blog: http://www.troyastorino.com/tidbits/lein2-local-jars

Related

Need google_play_service library for AdMob integration

I integrate my Qt5/Android app to AdMob with some open source library. In this library's README author tells following:
Copy google-play-services_lib/ folders from android-sdk/extras/google/google_play_services/libproject/ directory to your AndroidManifest.xml location
But I do not have libproject in my android-sdk/extras/google/google_play_services/ installation. Here in other threads I found recommendation unzip needed library from one of files located at /extras/google/m2repository/com/google/android/gms. Now I am weird - which one library I have to unzip and use from this folder. In this folder there are 41 library folders with 21 version subfolder in each one. Anybody help me with this. May be I need just download an old android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/ from somewhere? Where can I take this? I build app for min API 16, target API 23 but I'm going change to latest target API at summer.
I think the answer from this Qt forum should solve your problem:
Follow this guide https://developers.google.com/mobile-ads-sdk/docs/
Add reference to library project. Add project.properties file with:
#android.library.reference.1=../../../android/adt-bundle-mac-x86_64-20131030/sdk/extras/google/google_play_services/libproject/google-play-services_lib#
path must be relative not absolute
Prepare google-play-services_lib
Go to google-play-services_lib folder in sdk and run
Android update lib-project --path . ant clean ant release
Run project in Qt Creator

How to use extensions

Could someone please explain how one uses the premake extensions. I added the eclipse extension in a directory under my premake installation. And in the premake script I added recuire "eclipse".
Running the script with premake5 eclipse, I get an error module "eclipse.lua" not found.
I added the path of the modules directory to my environment variables.
I'm using premake (premake5) on Windows 8.
Thanks
addons need to reside in a folder. You need to create a "eclipse" folder, then copy all the files in it, and the "eclipse" folder should be located where premake can load it (either next the executable or some other place handled through environment variables)
I got this working by adding the full path to the require statement.
require "C:/premake/eclipse/eclipse"
and running the command as premake5 eclipse
Note: This plugin does not generate project files that one can import into Eclipse.

Clojurescript CSS in a JAR

I have a Clojurescript project (lib-project) which includes some CSS in resources/css/. When I do lein install the CSS is included in the JAR in /css/.
In another project (main-project) I have lib-project as a dependency. How do I access the CSS in lib-project's JAR?
My aim is to package lib-project so that it is complete and not dependent upon external resources.
Maybe not exactly what you asked for, but for the same goal: There's a Leiningen plugin for Twitter Bower, an web asset package manager
https://github.com/chlorinejs/lein-bower
lein-bower also supports resolving bower dependencies from jar dependencies.

Add external jars to Eclipse plugin classpath

In the manifest file for an eclipse plugin its possible to add jar files and
folders to the classpath (on the Runtime tab).
In the root of my plugin I have a folder lib containing a-1.0.1.jar, b-1.0.0-SNAPSHOT.jar. But only when I select each jar separately:
Bundle-ClassPath: .,
lib/a-1.0.1.jar,
lib/b-1.0.0-SNAPSHOT.jar
...can they be used inside my project. Why is it not possible to add them to the classpath by adding the common root folder only:
Bundle-ClassPath: .,
lib/
?
No, you can't. Eclipse is based on OSGi, which is the platform providing MANIFEST.MF support to build plugins.
When you set values under Bundle-ClassPath, OSGi search into each one to find class files. So you can put folders containing Java packages and class files. When you put a jar file, it is uncompressed in memory and viewed by OSGi as a regular folder, still searching for class files.
Unfortunately, there is no way to load all jar from a folder. No wildcard mechanism or something like that is allowed here.

warbler doesn't packages a standalone application in a jar file but instead in a war file

I've a JRuby-based standalone application with the following structure:
my_app
- bin
- my_app # that's a launcher script
- lib
- my_app.rb
And when I warble in the top level directory, it doesn't generates a jar file as expected but instead a generates a war file. And this war, as expected, follows the war file's standard structure.
I've followed the documentation to do it:
https://github.com/nicksieger/warbler
"If your project do not have a .gemspec, Warbler will attempt
to guess the launcher from the contents of the bin directory
and use the lib directory as the lone require path. All files
in the project will be included in the archive."
Anyone already did it?
Thanks a lot!
This functionality is in version 1.3.0 which unfortunately hasn't been released yet. Try the prerelease version on rubygems.org (gem install warbler --pre).

Resources