diet-engine

A demo for deployment to the Central Repository via OSSRH

License

License

GroupId

GroupId

org.codarama.diet
ArtifactId

ArtifactId

diet-engine
Last Version

Last Version

0.6.0
Release Date

Release Date

Type

Type

jar
Description

Description

diet-engine
A demo for deployment to the Central Repository via OSSRH

Download diet-engine

How to add to project

<!-- https://jarcasting.com/artifacts/org.codarama.diet/diet-engine/ -->
<dependency>
    <groupId>org.codarama.diet</groupId>
    <artifactId>diet-engine</artifactId>
    <version>0.6.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.codarama.diet/diet-engine/
implementation 'org.codarama.diet:diet-engine:0.6.0'
// https://jarcasting.com/artifacts/org.codarama.diet/diet-engine/
implementation ("org.codarama.diet:diet-engine:0.6.0")
'org.codarama.diet:diet-engine:jar:0.6.0'
<dependency org="org.codarama.diet" name="diet-engine" rev="0.6.0">
  <artifact name="diet-engine" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.codarama.diet', module='diet-engine', version='0.6.0')
)
libraryDependencies += "org.codarama.diet" % "diet-engine" % "0.6.0"
[org.codarama.diet/diet-engine "0.6.0"]

Dependencies

compile (15)

Group / Artifact Type Version
org.modeshape : modeshape-jcr jar
com.h2database : h2 jar 1.4.192
junit : junit jar 4.12
com.google.guava : guava jar 19.0
org.apache.bcel : bcel jar 5.2
org.springframework : spring-core jar 4.3.1.RELEASE
org.springframework : spring-expression jar 4.3.1.RELEASE
org.springframework : spring-beans jar 4.3.1.RELEASE
org.springframework : spring-aop jar 4.3.1.RELEASE
org.springframework : spring-context jar 4.3.1.RELEASE
org.springframework : spring-context-support jar 4.3.1.RELEASE
org.springframework : spring-tx jar 4.3.1.RELEASE
org.slf4j : slf4j-api jar 1.7.21
org.slf4j : slf4j-log4j12 jar 1.7.21
com.github.javaparser : javaparser-core jar 2.4.0

test (3)

Group / Artifact Type Version
org.mockito : mockito-all jar 1.10.19
io.takari.junit : takari-cpsuite jar 1.2.7
org.springframework : spring-test jar 4.3.1.RELEASE

Project Modules

There are no modules declared in this project.

Status: Build Status Coverage Status Static Code Analysis Status Dependency Status

Chat with us: Chat at https://gitter.im/Codarama/diet-engine

Diet

Diet tries to create a jar from all of the jars used by a project. The result jar should contain only classes the project actually uses, nothing else.

This is currently just a library, but it should evolve to a Maven plugin, an eclpse plugin and perhaps a web project.

It's main target group is currently android development as space conservation is mostly uneeded for web development.

Features

Source Dependency Resolution:

Diet can resolve the dependencies of .java source files. Currently like this:

final Set<ClassName> dependencies = Dependencies
    .ofSource(SourceFile.fromFilepath("/abs/path/to/Source.java"))
    .set();

Binary Class Dependency Resolution:

Diet can also resolve the dependencies of compiled binary .class files:

final Set<ClassName> dependencies = Dependencies
    .ofClass(ClassFile.fromFilepath("/abs/path/to/Class.class"))
    .set();

The Dependencies API can also work with the classpath or with Core API File objects (no streams yet though). For more info on the Dependencies API have a look at the wiki.

Library minimization:

This will try to find all the 'actual dependencies' that a set of sources use, package them in a Jar and return it.

final JarFile outJar = Minimizer
    .sources("/abs/path/to/src/dir")
    .libs("/abs/path/to/libs") // this can also be a Maven ~/.m2/repository
    .getJar();

You can also set the output dir for the minimizer, have a look at the wiki for info.

Component Events:

Diet can notify you for updates on what it is currently doing. For instanse if you want to get detailed info while resolving the dependencies of a binary class you can:

ListenerRegistrar.register(new EventListener<ComponentEvent>() {
    public void on(ComponentEvent event) {
        // will be called on any event
    }
});

There is a whole hierarchy of events you can listen to, there is a wiki page on this also.

Usage:

In order to use the library you can either:

You can also build the master branch (on your own risk) in the same way you build the latest tag.

Notes:

Keep in mind that we're currently in very early alpha and the API changes constantly and can change dramatically :) Also wildcard imports in source files like import com.something.*; are currently not supported. So calling source dependency resolution on such a file or on a set containing one will result in an exception.

Donations:

Fund me on Gittip

org.codarama.diet

Versions

Version
0.6.0