Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[tools] Re-implement sarlc tool with Bootique.
see #843

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Jul 18, 2018
1 parent de16e28 commit 6846806
Show file tree
Hide file tree
Showing 39 changed files with 3,605 additions and 472 deletions.
Expand Up @@ -81,6 +81,10 @@ public final class SARLConfig {
*/
public static final String FOLDER_BIN = "target/classes"; //$NON-NLS-1$

/** Path of the temporary files.
*/
public static final String FOLDER_TMP = "target/sarl-build"; //$NON-NLS-1$

/** URL of the Javadoc for SARL API.
*/
public static final String JAVADOC_URL = "http://www.sarl.io/docs/api/"; //$NON-NLS-1$
Expand Down
Expand Up @@ -58,6 +58,35 @@ public static Injector doSetup(Module... modules) {
return new SARLStandaloneSetup().createInjectorAndDoEMFRegistration(modules);
}

/** Run the pre-setup task.
*
* <p>This function is provided in order to let the caller to create the injector by hand.
* It is recommended to invoke {@link #doSetup()} in place of this function.
*
* @since 0.8
* @see #doSetup()
* @see #doSetup(Module...)
*/
public static void doPreSetup() {
XtendStandaloneSetup.doSetup();
}

/** Run the post-setup task.
*
* <p>This function is provided in order to let the caller to create the injector by hand.
* It is recommended to invoke {@link #doSetup()} in place of this function.
*
* @param injector the injector to be used.
* @return the injector.
* @since 0.8
* @see #doSetup()
* @see #doSetup(Module...)
*/
public static Injector doPostSetup(Injector injector) {
new SARLStandaloneSetup().register(injector);
return injector;
}

/** Create the injector based on the given set of modules and prepare the EMF infrastructure.
*
* @param modules the injection modules that are overriding the standard SARL module.
Expand All @@ -66,7 +95,7 @@ public static Injector doSetup(Module... modules) {
* @see SARLRuntimeModule
*/
public Injector createInjectorAndDoEMFRegistration(Module... modules) {
XtendStandaloneSetup.doSetup();
doPreSetup();
final Injector injector = createInjector(modules);
register(injector);
return injector;
Expand Down
4 changes: 0 additions & 4 deletions main/internalmaven/io.sarl.maven.batchcompiler/pom.xml
Expand Up @@ -26,10 +26,6 @@
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
</dependencies>

<!-- ======================================= -->
Expand Down
77 changes: 77 additions & 0 deletions main/internalmaven/io.sarl.maven.bqextension/pom.xml
@@ -0,0 +1,77 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.sarl.maven</groupId>
<artifactId>io.sarl.maven.internal</artifactId>
<version>0.8.0-SNAPSHOT</version>
</parent>

<artifactId>io.sarl.maven.bqextension</artifactId>
<name>Extension of Bootique</name>
<description>Extension of the Bootique API.</description>

<dependencies>
<dependency>
<groupId>io.bootique</groupId>
<artifactId>bootique</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
</sourceDirectories>
</configuration>
</plugin>
</plugins>
</build>

<!-- ======================================= -->
<!-- ==== Release Management === -->
<!-- ======================================= -->
<profiles>
<profile>
<id>maven-release-of-sarl-maven-plugin</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.arakhne.afc.maven</groupId>
<artifactId>tag-replacer</artifactId>
<configuration>
<sources>
<source>${project.basedir}/src/main/java</source>
</sources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<sourcepath>${project.build.directory}/generated-sources/java</sourcepath>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>

</project>
@@ -0,0 +1,50 @@
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2018 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.sarl.maven.bqextension;

/** Main entry point for the SARL batch compiler.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.5
*/
public final class Constants {

/** A conversion pattern for the logger.
*/
public static final String LOGGER_PATTERN = "%-5p %m%n"; //$NON-NLS-1$

/** Return code when success.
*/
public static final int SUCCESS_CODE = 0;

/** Return code when failure.
*/
public static final int ERROR_CODE = 255;

private Constants() {
//
}

}
@@ -0,0 +1,47 @@
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2018 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.sarl.maven.bqextension.configs;

import io.bootique.annotation.BQConfig;

/**
* Represents a config that could provide an object representation of itself that
* could be serialized with Yaml exporter.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.8
*/
@BQConfig("Configuration of the class paths")
public interface Config {

/** Replies the identifier of the Yaml section.
*
* @return the section name.
*/
default String getSectionName() {
return Configs.getSectionName(getClass());
}

}

0 comments on commit 6846806

Please sign in to comment.