Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Simple JAR/Library repository  (Read 800 times)
0 Members and 1 Guest are viewing this topic.
Offline actual

JGO Coder


Medals: 23



« Posted 2014-01-29 23:05:16 »

Like most people I have multiple projects going. Some of them use similar external libraries (e.g. libgdx, guava, etc) and some projects are common code intended to be used as resources for other projects. Currently, I simply try to store my libraries under a common root directory. There are a number of things I don't like about this set up:
1. When I download libraries, I have to manually set up consistent directories to store them in.
2. Every time I create a new project, I have to navigate up and down the repository directory hierarchy adding the jars I need and also attach the javadoc, source, and natives.
3. Exporting my own common libraries into my directory structure seems overly cumbersome

What I would like is a simple system that:

1. Allows me to add a library to my local laptop my specifying a descriptor and have it create the appropriate directories and copy the file(s) over. For instance something like:
1  
2  
3  
4  
5  
6  
7  
8  
add { 
   library-name: libGDX,
   version:0.9.9,
   source-dir: c:\users\actual\downloads\
   file:libgdx.9.9.jar,
   source:libgdx-source.jar,
   javadoc:libgdx-javadocs.jar
   }

2. IDE integration: Allow me to select libraries from a flat list of projects in the repository and import them. It would also automatically find and attach javadoc/sources/natives as appropriate.

3. Simplifies the exporting of libraries that I create by automatically adding them to the correct place in the repository, and including the javadoc/source attachments.


I have a feeling that what I am looking for already exists. I looked at Maven and Apache Ivy, but both seem intended to be used as entire build systems whereas I am looking for something much simpler. Maybe I am just not understanding them properly. Since I am a solo developer, I also do not need to run repository servers, etc. and I am fine with having to first download libraries to my machine.

Creating a simple repository API to add, remove, and query libraries doesn't seem like it would be too hard but the IDE integration would be trickier. I currently use intellij, but am also comfortable with eclipse and netbeans.

Does anyone have any suggestions or thoughts?

(EDIT: Removed a bunch of white space at the end)
Offline HeroesGraveDev

JGO Kernel


Medals: 246
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #1 - Posted 2014-01-29 23:12:37 »

In Eclipse you can add projects to the classpath of other projects (This should be available in other IDEs, but I haven't used them), and if you put your libraries in the right place, attaching source and docs is easy.

Offline actual

JGO Coder


Medals: 23



« Reply #2 - Posted 2014-01-29 23:23:44 »

Yup, I can do that in IntelliJ too. I do like being able to deploy versions of even my internal projects rather than linking the source directly. This gives me more freedom to update the source without affecting downstream projects until I am ready to deploy. While attaching sources and docs are easy, it seems like something that a system could do for me.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline HeroesGraveDev

JGO Kernel


Medals: 246
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #3 - Posted 2014-01-29 23:35:45 »

Well, if you can work out how your IDE handles projects, then it would be quite easy.

In Eclipse for example, you could just make an application that generates the .project and .classpath files and copies files from the filesystem into the appropriate directories.

Offline Danny02
« Reply #4 - Posted 2014-01-29 23:43:07 »

Just use a standard build system like maven or grandle, it has everything you ever wanted.
Offline HeroesGraveDev

JGO Kernel


Medals: 246
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #5 - Posted 2014-01-30 00:13:06 »

Just use a standard build system like maven or grandle, it has everything you ever wanted.

Maybe it's just me, but I hate anything that requires me to use gradle or maven or similar.

It spends 1/2 the time downloading itself and it's dependencies that will never be used for anything else.

I like small, fast, efficient build systems.

Offline Danny02
« Reply #6 - Posted 2014-01-30 00:38:51 »

Yes it is just you, because every serious developer is using them.

I don't want to start a flame-war about what might be the best build system here, but ...
There are some matured systems out there, which are used by millions of developers, helping you immensely and are worth investigating/learning, because you probably will be required to use them in the future.


also back to the topic:
OP was asking for an solution and I gave him one which fits all his needs and isn't proprietary IDE specific.
Offline Drenius
« Reply #7 - Posted 2014-01-30 01:21:38 »

You are someone who takes good solutions from other people to reach your goals without wasting time. This is senseful.
Other people prefer to make their own stuff so they could understand it as completely as possible. This is also senseful.
Please accept that.
Offline actual

JGO Coder


Medals: 23



« Reply #8 - Posted 2014-01-30 02:10:11 »

I have been reading up more on Maven repositories and it looks like setting up an  "Internal Repository" may be what I want. There is a ton of documentation out there on Maven but so much of it seems impenetrable. My preference is to use something that already exists rather than write my own thing. From what I have been able to understand on how it is used, it might be worth writing a simple wrapper to interact with the repository outside of the scope of a project.

I know that Maven has those who love it and those who hate it. For me, my projects are small and simple enough that as long as the build system integrates into the IDE I think I will be fine.
Offline HeroesGraveDev

JGO Kernel


Medals: 246
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #9 - Posted 2014-01-30 02:28:56 »

I don't want to start a flame-war about what might be the best build system here, but ...
There are some matured systems out there, which are used by millions of developers, helping you immensely and are worth investigating/learning, because you probably will be required to use them in the future.

My problem is that to build a small application, I have to download a huge build system and loads of dependencies that will never be used for anything else. Now I wouldn't mind too much if I had to do it once or twice, but there are so many build systems in circulation that it just gets ridiculous.

It's like having a house with all the electrical sockets from different countries.

So in the end, I just make a script that does it for me. It usually takes up no more than a few kilobytes.

(Anyway, the best build system is
./configure; make; sudo make install
)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Danny02
« Reply #10 - Posted 2014-01-30 07:31:05 »

... setting up an  "Internal Repository" may be what I want.

There is no need to setup something like this, maven comes with a standard local repository. You also don't have to interact with this repository in any way. When you are using maven you don't need to download libraries from the web anymore, all IDEs have a library search function where you can find any lib from the maven central repository(nearly all libs in existence) and get maven to download them for you.

It is also the same for your own local projects, maven will copy your projects jars into the local repository after a successful build. So no more local copying of your own libs.
Offline gouessej
« Reply #11 - Posted 2014-01-30 09:08:29 »

Hi

You are someone who takes good solutions from other people to reach your goals without wasting time. This is senseful.
Other people prefer to make their own stuff so they could understand it as completely as possible. This is also senseful.
Please accept that.
Are you sure that Actual wants to make its own stuff? The both approaches you describe are "reasonable". There is a time to learn and there is another time to be efficient by avoiding to reinvent the wheel.

I agree with Danny02 about build tools. If Maven and Gradle are too much "heavy" for you, use Ant. When I use Maven, it helps me to use a library without needing to ship it in my project, I can use the specific version or use the latest version, this build system is often rigid but it's not always a problem. Ant is useful to write portable build scripts very quickly, it's extensible (I use Ant-Contrib, Antelope and Jsch), it helps me to automatize my whole build from the compilation to the upload onto an SFTP server.

Offline xsvenson
« Reply #12 - Posted 2014-01-30 09:25:50 »

I dislike maven as much as the next guy, on my personal projects I use ant and manual jar management and that is my conscious choice, knowing fully what that beholds.

However, I do use maven extensively at work, jar hell is a concept, we don't know, everything just works (well, not always..) .
Maven itself is 3mb, it's a single install and there is nothing more to download. All the downloads maven does, are project dependent, the dependencies come from the jar's not from maven.
In the end, whatever You build or however You manage Your system, You are doing the same thing, just manually.

As long as You are aware of those things and don't dismiss the tools as "bloat" (as do C developers dismiss java, cause its "slow" and "bloat" and "noone uses it" and "no real programmer would ever use java") etc, just because, then whatever choice You make is fine. Just be aware of Your choices and approach openmindedly.

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Offline SwampChicken
« Reply #13 - Posted 2014-01-30 09:42:38 »

Hmm, Some strange posts here. Maven doesn't need to become part of your project. It's more of a tool to assist you with creating your project (like using an IDE for example).
Offline junkdog
« Reply #14 - Posted 2014-01-30 10:11:37 »

Hmm, Some strange posts here. Maven doesn't need to become part of your project. It's more of a tool to assist you with creating your project (like using an IDE for example).


Well, to fully utilize maven's dependency management and whatever else you need, it's best to integrate it with your IDE. IDE-maven integration is pretty good with all major IDE:s at least, at least when keeping in line with maven's conventions/view of the world.

We also use maven extensively at work (and I use it for all my personal projects too); it's definitely a polar love/hate relationship. If you love it, embrace it - else find something more likeable.

artemis-odb: bugfixing and performance optimized fork of artemis ES
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (12 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (28 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!