Sheath

A small wrapper of Dagger to facilitate interaction with the object graph

License

License

GroupId

GroupId

io.pristine.sheath
ArtifactId

ArtifactId

sheath
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Sheath
A small wrapper of Dagger to facilitate interaction with the object graph
Project URL

Project URL

https://github.com/pristineio/sheath
Source Code Management

Source Code Management

https://github.com/pristineio/sheath

Download sheath

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
com.squareup.dagger : dagger jar 1.2.2
com.squareup.dagger : dagger-compiler jar 1.2.2

test (1)

Group / Artifact Type Version
junit : junit-dep jar 4.8.2

Project Modules

There are no modules declared in this project.

Sheath

A very very simple static wrapper for Dagger.

Usage

This was made with Android development in mind because I didn't like writing static getters for my Application contexts in order to inject new entities into the object graph.

First you must call holster with all your modules before you can inject anything.

public class MyApplication extends Application {
    public void onCreate() {
        super.onCreate();

        // You are now ready to wield your Dagger
        Sheath.holster(new ModuleOne(), new ModuleTwo());
    }
}

After holster is called you can now inject your objects

public class MyActivity extends Activity {
    public void onCreate() {
        super.onCreate();

        Sheath.inject(this);
    }
}

Download

Including Sheath in your project gives you Dagger so don't worry about including it unless you want a specific version of Dagger. If you are doing this be sure to exclude the version of Dagger included with Sheath.

Maven

<dependency>
	<groupId>io.pristine.sheath</groupId>
	<artifactId>sheath</artifactId>
	<version>{latest-version}</version>
</dependency>

Gradle

compile 'io.pristine.sheath:sheath:{latest-version}'

License

Copyright 2014-2015, Pristine Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

io.pristine.sheath

Pristine, Inc.

Pristine, Inc.

Versions

Version
1.0.0