Skip to content

Commit

Permalink
Rename to YADIC
Browse files Browse the repository at this point in the history
  • Loading branch information
ref-humbold committed Aug 15, 2024
1 parent b8b6013 commit c0a8e35
Show file tree
Hide file tree
Showing 108 changed files with 303 additions and 304 deletions.
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# YADIC
# YADIC (Yet Another Dependency Injection Container)

![GitHub Actions](https://github.com/ref-humbold/DI-Container/workflows/GitHub%20Actions/badge.svg?branch=master)
[![CircleCI](https://circleci.com/gh/ref-humbold/DI-Container/tree/master.svg?style=shield)](https://circleci.com/gh/ref-humbold/DI-Container/tree/master)

![Release](https://img.shields.io/github/v/release/ref-humbold/DI-Container?style=plastic)
![License](https://img.shields.io/github/license/ref-humbold/DI-Container?style=plastic)

YADIC - Yet Another Dependency Injection Container

Simple dependency injection container in Java

-----
Expand All @@ -20,7 +18,8 @@ Simple dependency injection container in Java
*Debian testing*
+ [Java](https://www.oracle.com/technetwork/java/javase/overview/index.html) \
*APT package `openjdk-17-jdk`, version 17 SE*
+ [Apache ANT](http://ant.apache.org/) \
+ [Gradle](https://gradle.org/) or [Apache ANT](http://ant.apache.org/) \
*SDK-Man `gradle`, version 8.10* \
*APT package `ant`, version 1.10.+*

## Dependencies
Expand All @@ -32,6 +31,20 @@ Simple dependency injection container in Java

-----

## How to build with Gradle?

YADIC can be built with **Gradle**. All dependencies are downloaded during build, so
make sure your Internet connection is working!

Possible Gradle tasks are:

+ `gradle build` - resolve dependencies & compile source files & create jar & run all tests
+ `gradle jar` - resolve dependencies & compile source files & create jar
+ `gradle test` - run all tests
+ `gradle javadoc` - generate Javadoc
+ `gradle rebuild` - remove additional build files & resolve dependencies & compile source files &
create jar & run all tests

## How to build with ANT?

YADIC can be built with **Apache ANT** using **Apache Ivy** to resolve all dependencies.
Expand All @@ -49,23 +62,9 @@ Possible ANT targets are:
+ `ant rebuild` - remove additional build files & resolve dependencies & compile source files &
create jar & run all tests

## How to build with Gradle?

YADIC can be built with **Gradle**. All dependencies are downloaded during build, so
make sure your Internet connection is working!

Possible Gradle tasks are:

+ `gradle build` - resolve dependencies & compile source files & create jar & run all tests
+ `gradle jar` - resolve dependencies & compile source files & create jar
+ `gradle test` - run all tests
+ `gradle javadoc` - generate Javadoc
+ `gradle rebuild` - remove additional build files & resolve dependencies & compile source files &
create jar & run all tests

## How to include it?

Simply add the *jar* file to your classpath from the directory:

+ `antBuild/dist` for ANT builds
+ `build/libs` for Gradle builds
+ `antBuild/dist` for ANT builds
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ plugins {
}

ext {
majorVersion = 4
majorVersion = 5
minorVersion = 0
dateVersion = new Date().format('yyMMdd')
specVersion = "${majorVersion}.${minorVersion}"
jarVersion = "${majorVersion}.${minorVersion}.${dateVersion}"
vendor = 'Rafał Kaleta'
mainPackage = 'dicontainer'
mainPackage = 'yadic'
}

version = project.jarVersion
Expand All @@ -32,7 +32,7 @@ tasks.jar {
manifest {
attributes(
'Built-By': project.vendor,
'Specification-Title': 'Dependency Injection Container',
'Specification-Title': 'Yet Another Dependency Injection Container',
'Specification-Version': project.specVersion,
'Specification-Vendor': project.vendor,
'Implementation-Title': project.mainPackage,
Expand Down
8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="DI-Container" basedir="." default="build">
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="YADIC" basedir="." default="build">
<tstamp>
<format property="date.version" pattern="yyMMdd" locale="en,GB" />
</tstamp>

<property name="major.version" value="4" />
<property name="major.version" value="5" />
<property name="minor.version" value="0" />
<property name="spec.version" value="${major.version}.${minor.version}" />
<property name="jar.version" value="${major.version}.${minor.version}.${date.version}" />
<property name="vendor" value="Rafał Kaleta" />

<property name="main.package" value="dicontainer" />
<property name="main.package" value="yadic" />
<property name="src.dir" value="src/main/java" />
<property name="resources.dir" value="src/main/resources" />
<property name="test.dir" value="src/test/java" />
Expand Down Expand Up @@ -76,7 +76,7 @@
<zipgroupfileset dir="${ivy.lib.dir}" includes="*.jar" />
<manifest>
<attribute name="Built-By" value="${vendor}" />
<attribute name="Specification-Title" value="Dependency Injection Container" />
<attribute name="Specification-Title" value="Yet Another Dependency Injection Container" />
<attribute name="Specification-Version" value="${spec.version}" />
<attribute name="Specification-Vendor" value="${vendor}" />
<attribute name="Implementation-Title" value="${main.package}" />
Expand Down
2 changes: 1 addition & 1 deletion ivy.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ivy-module version="2.0">
<info organisation="ref_humbold" module="di_coitainer" />
<info organisation="ref_humbold" module="yadic" />
<dependencies>
<dependency org="org.junit.jupiter" name="junit-jupiter-api" rev="5.+" />
<dependency org="org.junit.jupiter" name="junit-jupiter-engine" rev="5.+" />
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'DI-Container'
rootProject.name = 'YADIC'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dicontainer;
package yadic;

public enum ConstructionPolicy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dicontainer;
package yadic;

import dicontainer.annotation.Dependency;
import dicontainer.registry.DependencyRegistry;
import dicontainer.resolver.TypesResolver;
import yadic.annotation.Dependency;
import yadic.registry.DependencyRegistry;
import yadic.resolver.TypesResolver;

public final class DiContainer
implements DiResolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dicontainer;
package yadic;

import java.io.Serial;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dicontainer;
package yadic;

import dicontainer.annotation.Dependency;
import yadic.annotation.Dependency;

public interface DiResolver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dicontainer.annotation;
package yadic.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dicontainer.annotation;
package yadic.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import dicontainer.ConstructionPolicy;
import yadic.ConstructionPolicy;

@Documented
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dicontainer.annotation;
package yadic.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import dicontainer.ConstructionPolicy;
import yadic.ConstructionPolicy;

@Documented
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dicontainer.registry;
package yadic.registry;

import dicontainer.ConstructionPolicy;
import dicontainer.registry.exception.RegistrationException;
import dicontainer.registry.valuetypes.Instance;
import dicontainer.registry.valuetypes.TypeConstruction;
import yadic.ConstructionPolicy;
import yadic.registry.exception.RegistrationException;
import yadic.registry.valuetypes.Instance;
import yadic.registry.valuetypes.TypeConstruction;

public class DependencyRegistry
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dicontainer.registry;
package yadic.registry;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import dicontainer.registry.valuetypes.Instance;
import yadic.registry.valuetypes.Instance;

class InstancesDictionary
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package dicontainer.registry;
package yadic.registry;

import java.util.HashMap;
import java.util.Map;

import dicontainer.ConstructionPolicy;
import dicontainer.annotation.Register;
import dicontainer.annotation.SelfRegister;
import dicontainer.registry.exception.AbstractTypeException;
import dicontainer.registry.exception.AnnotatedTypeRegistrationException;
import dicontainer.registry.exception.MixingPoliciesException;
import dicontainer.registry.exception.NotDerivedTypeException;
import dicontainer.registry.valuetypes.Instance;
import dicontainer.registry.valuetypes.TypeConstruction;
import dicontainer.resolver.exception.MissingDependenciesException;
import yadic.ConstructionPolicy;
import yadic.annotation.Register;
import yadic.annotation.SelfRegister;
import yadic.registry.exception.AbstractTypeException;
import yadic.registry.exception.AnnotatedTypeRegistrationException;
import yadic.registry.exception.MixingPoliciesException;
import yadic.registry.exception.NotDerivedTypeException;
import yadic.registry.valuetypes.Instance;
import yadic.registry.valuetypes.TypeConstruction;
import yadic.resolver.exception.MissingDependenciesException;

class TypesDictionary
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dicontainer.registry;
package yadic.registry;

import java.lang.reflect.Modifier;

import dicontainer.annotation.Register;
import dicontainer.annotation.SelfRegister;
import yadic.annotation.Register;
import yadic.annotation.SelfRegister;

final class TypesUtils
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dicontainer.registry.exception;
package yadic.registry.exception;

import java.io.Serial;

import dicontainer.DiException;
import yadic.DiException;

public class AbstractTypeException
extends DiException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dicontainer.registry.exception;
package yadic.registry.exception;

import java.io.Serial;

import dicontainer.DiException;
import yadic.DiException;

public class AnnotatedTypeRegistrationException
extends DiException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dicontainer.registry.exception;
package yadic.registry.exception;

import java.io.Serial;

import dicontainer.DiException;
import yadic.DiException;

public class MixingPoliciesException
extends DiException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dicontainer.registry.exception;
package yadic.registry.exception;

import java.io.Serial;

import dicontainer.DiException;
import yadic.DiException;

public class NotDerivedTypeException
extends DiException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dicontainer.registry.exception;
package yadic.registry.exception;

import java.io.Serial;

import dicontainer.DiException;
import yadic.DiException;

public class RegistrationException
extends DiException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dicontainer.registry.valuetypes;
package yadic.registry.valuetypes;

import java.util.NoSuchElementException;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dicontainer.registry.valuetypes;
package yadic.registry.valuetypes;

import dicontainer.ConstructionPolicy;
import yadic.ConstructionPolicy;

public record TypeConstruction<T>(Class<T> type, ConstructionPolicy policy)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dicontainer.resolver;
package yadic.resolver;

import java.lang.reflect.Constructor;
import java.util.Comparator;

import dicontainer.annotation.Dependency;
import yadic.annotation.Dependency;

public class ConstructorComparator
implements Comparator<Constructor<?>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package dicontainer.resolver;
package yadic.resolver;

import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

import dicontainer.DiException;
import dicontainer.registry.valuetypes.Instance;
import dicontainer.resolver.exception.CircularDependenciesException;
import dicontainer.resolver.exception.MissingDependenciesException;
import dicontainer.resolver.exception.NoInstanceCreatedException;
import yadic.DiException;
import yadic.registry.valuetypes.Instance;
import yadic.resolver.exception.CircularDependenciesException;
import yadic.resolver.exception.MissingDependenciesException;
import yadic.resolver.exception.NoInstanceCreatedException;

class ConstructorResolver
{
Expand Down
Loading

0 comments on commit c0a8e35

Please sign in to comment.