This repository contains a tool that generates / updates CloudSlang .sl files based on Java Actions.
This tool will offer the possibility to convert Java Actions from the project Cloudslang/cs-actions and generate/update the .sl files that will be added in Cloudslang/cloud-slang-content
To run the tool:
Java 8 installed in order to run the tool.
Maven 3.3.9 installed in order to build the tool.
-
Clone this repository and build it, by running (mvn clean install). Copy 'cs-content-generator-<version>.jar' to a folder of your choice.
-
Download from Maven Central any of the packages available in Cloudslang/cs-actions or clone the repository, build locally using Maven 3.3.9 and copy cs-packageName-0.0.*.jar to a location from which it will be used as the --source argument. The path can be, either relative or absolute.
Example: -s C:\Users\yourUsername\.m2\repository\io\cloudslang\content\cs-ssh-0.0.36\cs-ssh-0.0.36.jar -s cs-ssh-0.0.38.jar - If the package is in the same folder as the tool. -d C:\Users\yourUsername\cloudslang\cloud-slang-content\content -d content - If you want to save the generated content in the same folder as the tool.
-
Open command prompt in Windows or a terminal in Linux, go to the location where cs-content-generator-.jar is located and run the following command:
java -jar cs-content-generator-<version>.jar -s javaPackage -d folderName -s, --source The source file/folder of the Actions that will be converted. -d, --destination Absolute path to the location where the .sl files will be created. -h, --help
-
Copy the newly created .sl files to your CloudSlang content folder or set -d <path_to>..\cloud-slang-content\content.
Note: If the files already exist, they will be updated with the new values. At the moment, only the gav: section is updated.
NEW: cs-content-generator-plugin
This plugin can also be added as another step in a Maven build to generate content.
Maven plugin example:
[...]
<plugins>
<plugin>
<groupId>io.cloudslang.tools</groupId>
<artifactId>cs-content-generator-plugin</artifactId>
<version>${version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
[...]
The plugin can run independent from the build: 'mvn package' which will generate the .sl files as long as there is a .jar in the ${project.build.directory} of the project.
Read our Contribution Guide here.