FutureConfig - maven plugin

FutureConfig format plugin for generating config classes.

License

License

Categories

Categories

Maven Build Tools config Application Layer Libs Configuration Ninja User Interface Web Frameworks
GroupId

GroupId

ninja.fido.config
ArtifactId

ArtifactId

config-maven-plugin
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

FutureConfig - maven plugin
FutureConfig format plugin for generating config classes.
Project URL

Project URL

https://github.com/F-I-D-O/Future-Config
Source Code Management

Source Code Management

https://github.com/F-I-D-O/Future-Config

Download config-maven-plugin

How to add to project

<plugin>
    <groupId>ninja.fido.config</groupId>
    <artifactId>config-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.5.0
org.apache.maven : maven-project jar 2.2.1
ninja.fido.config : core jar 1.0
commons-io : commons-io jar 2.5
com.squareup : javapoet jar 1.8.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
ninja.fido.debug » test-resources jar 1.0-SNAPSHOT

Project Modules

There are no modules declared in this project.

Future-Config

Future config is a configuration format and a set of libraries to use the config files. Currently supported languages are Python and Java.

Why another config format?

Future-Config is designed for complicated projects with dozens or hundereds configurable properties that needs to be appropriately structured. If you want simple config files, you should opt for some well-established alternative. The differenc ebetween Future-Config and other config/text formats is displayed in table bellow:

Future-Config ini XML YAML TOML JSON
Simple Datatypes yes yes yes yes yes yes
Objects yes yes yes yes yes yes
Arrays yes no yes yes yes yes
Variables yes no no no no no
Comments yes yes yes yes yes no
Config Inheritance yes no no no no no
Config Class Generation yes no yes yes no yes
Unlimited Hierarchy yes no yes yes yes yes

Usage

Python

  1. pip install fconfig
  2. Create your master config file in your project's resources
  3. Generate config classes:
    from fconfig import configuration
    configuration.generate_config()
    
  4. Use the generated config classes:
    import yourproject.confi.zourproject_config.config
    

Java

Syntax

Base Types

string: "String"

int: 1

float: 1.0

boolean: true

negative_int: -3

negative_float: -2.0

Objects

object:
{
	string: 'test'
	integer: 9
	float: 1.23
}

Arrays

array:
[
	1
	5
	6
]

Variables

string: 'string'

composed_string: 'composed ' + $string

Complex Example

object_hierarchy:
{
	inner_object:
	{
		integer: 987654
		composed: $string + ' is funny to compose'
		inner_inner_object:
		{
			float: 9.87654
			composed: $object_hierarchy.inner_object.composed + ' multiple times'
			array:
			[
				1
				2
				3
			]
		}
		boolean: false
	}
	another_string: 'another_string'

	array_of_objects:
	[
		{
			animal: "bear"
			legs: 4
		}
		{
			animal: "chicken"
			legs: 2
		}
	]
}

Versions

Version
1.0