Maven plugin for J2ObjC library

In addition to standard J2ObjC conversion, this plugin supports dependencies conversion within the same projects.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

com.smoope.utils
Идентификатор

Идентификатор

j2objc-maven-plugin
Последняя версия

Последняя версия

1.1.4
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Maven plugin for J2ObjC library
In addition to standard J2ObjC conversion, this plugin supports dependencies conversion within the same projects.
Ссылка на сайт

Ссылка на сайт

https://www.smoope.com
Организация-разработчик

Организация-разработчик

smoope GmbH
Система контроля версий

Система контроля версий

https://github.com/smoope/j2objc-maven-plugin

Скачать j2objc-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>com.smoope.utils</groupId>
    <artifactId>j2objc-maven-plugin</artifactId>
    <version>1.1.4</version>
</plugin>

Зависимости

compile (8)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.3.9
org.apache.maven : maven-project jar 3.0-alpha-2
org.apache.maven : maven-aether-provider jar 3.3.9
org.eclipse.aether : aether-impl jar 1.0.2.v20150114
org.eclipse.aether : aether-connector-basic jar 1.0.2.v20150114
org.eclipse.aether : aether-transport-wagon jar 1.0.2.v20150114
org.eclipse.aether : aether-transport-file jar 1.0.2.v20150114
org.eclipse.aether : aether-transport-http jar 1.0.2.v20150114

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (2)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Maven plugin for J2ObjC library

Build Status Maven Central

Installation

Add the following plugin entry into your pom's plugins section:

<plugin>
    <groupId>com.smoope.utils</groupId>
    <artifactId>j2objc-maven-plugin</artifactId>
    <version>1.1.4</version>
    <configuration>
        <j2objcPath>path/to/j2objc</j2objcPath>
    </configuration>
</plugin>

In order to run the plugin, execute the following command: mvn j2objc:convert.

Once you want to try a snapshot version, don't forget to add the following section as well:

<pluginRepositories>
    <pluginRepository>
        <id>sonatype-nexus-snapshots</id>
        <name>sonatype-nexus-snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </pluginRepository>
</pluginRepositories>
...
<plugin>
    <groupId>com.smoope.utils</groupId>
    <artifactId>j2objc-maven-plugin</artifactId>
    <version>1.1.5-SNAPSHOT</version>
    <configuration>
        <j2objcPath>path/to/j2objc</j2objcPath>
    </configuration>
</plugin>

Please note, that plugin supports Maven versions >= 3.1.x.

Usage

After you added the plugin to project, the only required parameter you have to specify is j2objcPath, which is path to J2ObjC's executable file. All the other plugin's parameters are proxies of J2ObjC's original parameters.

<plugin>
    <groupId>com.smoope.utils</groupId>
    <artifactId>j2objc-maven-plugin</artifactId>
    <version>1.1.2</version>
    <configuration>
        <j2objcPath>${J2OBJC_DISTRIBUTION}/j2objc</j2objcPath>
        <useArc>true</useArc>
        <noPackageDirectories>true</noPackageDirectories>
        <!-- default value -->
        <sourcePath>${project.basedir}/src/main/java</sourcePath>
        <!-- default value -->
        <d>${project.build.directory}/j2objc</d>
    </configuration>
</plugin>

Full list of parameters you can find at J2ObjC library home page.

The example above shows how you can externalize the path to J2ObjC library. Don't forget to add the parameter definition to call: mvn j2objc:convert -DJ2OBJC_DISTRIBUTION=/folder/of/j2obc.

Sometimes, the code you want to convert to Objective-C contains dependencies, which should be converted as well. In this case you have to add all those dependencies into appropriate configuration section:

<plugin>
    <groupId>com.smoope.utils</groupId>
    <artifactId>j2objc-maven-plugin</artifactId>
    <version>1.1.2</version>
    <configuration>
        <j2objcPath>${J2OBJC_DISTRIBUTION}/j2objc</j2objcPath>
        <useArc>true</useArc>
        <noPackageDirectories>true</noPackageDirectories>
        <dependencies>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.3.1</version>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.8.1</version>
            </dependency>
        </dependencies>
    </configuration>
</plugin>

This mechanism doesn't support nested dependencies recognition which means you have to specify every nested dependency separately. For example, joda-time library depends on joda-convert, so in order to have all the necessary dependencies in your Xcode project, you have to specify it as well:

<plugin>
    <groupId>com.smoope.utils</groupId>
    <artifactId>j2objc-maven-plugin</artifactId>
    <version>1.1.2</version>
    <configuration>
        <j2objcPath>${J2OBJC_DISTRIBUTION}/j2objc</j2objcPath>
        <useArc>true</useArc>
        <noPackageDirectories>true</noPackageDirectories>
        <dependencies>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.3.1</version>
            </dependency>
            <dependency>
                <groupId>org.joda</groupId>
                <artifactId>joda-convert</artifactId>
                <version>1.8</version>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.8.1</version>
            </dependency>
        </dependencies>
    </configuration>
</plugin>

Please note, that in order to make it work your local repository must contain the sources version of every dependency.

Advanced Options

Skip parent project

The configuration <skipParent>true</skipParent> in parent pom can be used to only translate child projects.

Fail on errors

By default the plugin will throw the exception in case of any error occured during the conversion. The configuration <failOnErrors>false</skipParent> prevents such behavior.

Translate dependencies only

<dependenciesOnly>true</dependenciesOnly> configuration allows to translate dependencies only and ignore the parent project.

com.smoope.utils

Smoope

Версии библиотеки

Версия
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0