Skip to content

fraunhoferfokus/Xtensions

Repository files navigation

Xtensions Library

License : EPL v2.0 Build Status Code Coverage Javadocs

Quality Gate Status Number of Vulnerabilities Number of Bugs Number of Code Smells

This library is mainly a collection of Xtend extension methods for classes in the Java 8 standard library and the Xtend standard library. A few goals are:

  • Adding extension methods to Java 8 JDK types to make them work more naturally with Xtend

  • Making a select few Java 9 methods available on Java 8

  • Providing support for iteration over primitive values without resort to boxing

  • Adding some useful additional methods to existing standard JDK and Xtend standard lib classes

Note that the policy of using functional interfaces is the following:

  • Generally, the Xtend interfaces defined in org.eclipse.xtext.xbase.lib.Functions are preferred over the ones defined in JDK 8 package. java.util.function

  • When primitive values are involved, the specialized interfaces from java.util.function are preferred.

  • When a shim over JDK 8 APIs is provided and Xtend interfaces would introduce unnecessary object allocations the JDK interfaces are preferred.

Usage

In the following, we will show how to add the Xtensions library to your build.

Current Release

If you are using Eclipse or a Maven Tycho build, you can use the p2 repository https://dl.bintray.com/boereck/xtensions-p2/Xtensions/1.2.0/. Here is the repository info you can add to your maven pom.xml file:

<repositories>
	<repository>
		<id>xtensions-p2</id>
		<layout>p2</layout>
		<url>https://dl.bintray.com/boereck/xtensions-p2/Xtensions/1.2.0/</url>
	</repository>
</repositories>

The zipped update site / p2 repository, can be downloaded here.

If you use a regular Maven build, simply add the following dependency. The library was added to maven central.

<dependencies>
	<dependency>
		<groupId>com.github.fraunhoferfokus.xtensions</groupId>
		<artifactId>de.fhg.fokus.xtensions</artifactId>
		<version>1.2.0</version>
	</dependency>
</dependencies>

If you are using gradle, add the following dependency:

compile 'com.github.fraunhoferfokus.xtensions:de.fhg.fokus.xtensions:1.2.0'

Using Snapshot Releases

Please add the following repository to your maven pom:

<repositories>
	<repository>
		<id>jfrog-snapshots</id>
		<url>http://oss.jfrog.org/oss-snapshot-local/</url>
	</repository>
</repositories>

Then add the following dependency:

<dependencies>
	<dependency>
		<groupId>com.github.fraunhoferfokus.xtensions</groupId>
		<artifactId>de.fhg.fokus.xtensions</artifactId>
		<version>1.3.0-SNAPSHOT</version>
	</dependency>
</dependencies>

When using gradle, add the repository like this:

  repositories {
        mavenCentral()
        maven {
            url "http://oss.jfrog.org/oss-snapshot-local/"
        }
    }

And add the following dependency:

compile 'com.github.fraunhoferfokus.xtensions:de.fhg.fokus.xtensions:1.3.0-SNAPSHOT'

Currently there is no snapshot p2 update site, we hope to provide this shortly.
Please have a look at the Build section if you want to build the library from source on your own.

Functionality and APIs

Most of the functionality provided by the library is described in a GitBook, based on the documentation files in this repository.
The latest release of the book can be found here. The current development version is available here.

An overview over the documentation files of the current release can be viewed directly on GitHub here. GitHub has better code highlighting for Xtend snippets, so you might prefer this.

JavaDocs for the current release can be found on javadocs.io here.

Development on the Library

Please have a look at the Development document on how to get started with the development on the library and some notes on contributing to the Xtensions project.

Status of the Project

The following tasks are the next goals for this project, roughly in this order:

  • ✓ Complete this README.adoc file

    • ✓ Complete Functionality section

    • ✓ Complete IDE Setup section

  • ✓ Complete JavaDocs for all public methods

  • ✓ Cover each public method with test cases

  • ✓ Add Jacoco test coverage to maven build

  • ✓ Add source bundle build to maven config

  • ✓ Add JavaDoc bundle build to maven config

  • ✓ Move to a public GitHub repository

  • ✓ Create CI build on travis.io

    • ✓ Add badge to this file when done

  • ✓ Publish Jacoco results to coveralls.io

    • ✓ Add badge to this file when done

  • ✓ Make Travis build push build results

    • ✓ Maven libs to JFrog snapshots

    • ✓ p2 repository to Bintray

  • ✓ Figure out how to best publish to Maven Central

  • ✓ Release version 1.0.0 and update this file

  • ✓ Add javadoc.io badge to this file

  • ❏ Provide snapshot p2 repository

  • ✓ Build GitBook in release build and push it to GitHub Pages

  • ✓ Create a CHANGES.adoc file