maxonfjvipon / ineo-maven-plugin

EO Inliner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

Maven Central Javadoc License Hits-of-Code Lines of code codecov

INEO (stands for EO Inliner) is the tool to inline EO objects in order to get a faster and lighter EO code.

How to use

To run the plugin you need at least Maven 3.1.+ and Java 11+. The plugin provides two optimizations:

FUSE

The optimization scans the directory and checks if there's any.xmir file where the next code occurs:

<o base=".new">
  <o base="B"/>
  <o base=".new">
    <o base="A"/>
    <o base="int" data="bytes">
      <!-- BYTES HERE -->
    </o>
  </o>
</o>

The plugin adds new fused BA.xmir file into the directory and replaces the xmir above with the next one:

<o base=".new">
  <o base="BA"/>
  <o base="int" data="bytes">
    <!-- BYTES HERE -->
  </o>
</o>

STATICIZE

The optimization scans the directory and checks if there's any.xmir file where the next code occurs:

<o base=".get">
  <o base=".new">
    <o base="A"/>
    <o base="int" data="bytes">
      <!-- BYTES HERE -->
    </o>
  </o>
</o>

The plugin adds new staticized StaticizedA.xmir file into the directory and replaces the xmir above with the next one:

<o base=".get">
  <o base=".new">
    <o base="StaticizedA"/>
    <o base="int" data="bytes">
      <!-- BYTES HERE -->
    </o>
  </o>
</o>

Meantime StaticizedA will use static method instead of instance one.

Objects A and B must be from the same package and have the same prefix.

Here you may find a working example that uses the plugin with other optimization tools, like JEO and OPEO

Invoke the plugin from the Maven lifecycle

You can run the plugin from the Maven lifecycle by adding the following configuration to your pom.xml file:

<build>
  <plugins>
    <plugin>
      <groupId>org.eolang</groupId>
      <artifactId>ineo-maven-plugin</artifactId>
      <version>0.2.0</version>
      <executions>
        <execution>
          <id>fuse</id>
          <phase>generate-sources</phase>
          <goals>
            <goal>fuse</goal>
          </goals>
        </execution>
        <execution>
          <id>staticize</id>
          <phase>generate-sources</phase>
          <goals>
            <goal>fuse</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

More details about plugin usage you can find in our Maven site.

How to Contribute

Fork repository, make changes, then send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:

$ mvn clean install -Pqulice

You will need Maven 3.3+ and Java 11+ installed.

About

EO Inliner

License:MIT License


Languages

Language:Java 75.8%Language:Groovy 13.4%Language:XSLT 10.8%