scripting: Add python support
Works with CQ for the python py4j:
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=20115
Change-Id: Ibbb3be94442c9852ee15352053e3bd714606cbf7
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/143391
Tested-by: CI Bot
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/146563
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
diff --git a/analyses/org.eclipse.tracecompass.incubator.scripting.python/.project b/analyses/org.eclipse.tracecompass.incubator.scripting.python/.project
new file mode 100644
index 0000000..05446c0
--- /dev/null
+++ b/analyses/org.eclipse.tracecompass.incubator.scripting.python/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tracecompass.incubator.scripting.python</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/analyses/org.eclipse.tracecompass.incubator.scripting.python/build.properties b/analyses/org.eclipse.tracecompass.incubator.scripting.python/build.properties
new file mode 100644
index 0000000..b49529e
--- /dev/null
+++ b/analyses/org.eclipse.tracecompass.incubator.scripting.python/build.properties
@@ -0,0 +1,11 @@
+###############################################################################
+# Copyright (c) 2019 Ecole Polytechnique de Montreal
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+
+bin.includes = feature.xml,\
+ feature.properties
\ No newline at end of file
diff --git a/analyses/org.eclipse.tracecompass.incubator.scripting.python/feature.properties b/analyses/org.eclipse.tracecompass.incubator.scripting.python/feature.properties
new file mode 100644
index 0000000..ca15d90
--- /dev/null
+++ b/analyses/org.eclipse.tracecompass.incubator.scripting.python/feature.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2019 Ecole Polytechnique de Montreal
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+
+featureName=Trace Compass Scripting Python (Incubation)
+
+description=This feature provides Python scripting capabilities to Trace Compass, using the EASE scripting framework.
+
+featureProvider=École Polytechnique de Montréal
+
+copyright=2019 École Polytechnique de Montréal
+
diff --git a/analyses/org.eclipse.tracecompass.incubator.scripting.python/feature.xml b/analyses/org.eclipse.tracecompass.incubator.scripting.python/feature.xml
new file mode 100644
index 0000000..1326942
--- /dev/null
+++ b/analyses/org.eclipse.tracecompass.incubator.scripting.python/feature.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.tracecompass.incubator.scripting.python"
+ label="%featureName"
+ version="0.0.1.qualifier"
+ provider-name="%featureProvider"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <includes
+ id="org.eclipse.tracecompass.incubator.scripting"
+ version="0.0.0"/>
+
+ <requires>
+ <import feature="org.eclipse.ease.lang.python.py4j.feature" version="0.6.0.I201801120620"/>
+ </requires>
+
+</feature>
diff --git a/analyses/pom.xml b/analyses/pom.xml
index 316ca76..4a58d76 100644
--- a/analyses/pom.xml
+++ b/analyses/pom.xml
@@ -45,6 +45,7 @@
<module>org.eclipse.tracecompass.incubator.filters.ui</module>
<module>org.eclipse.tracecompass.incubator.scripting</module>
<module>org.eclipse.tracecompass.incubator.scripting.javascript</module>
+ <module>org.eclipse.tracecompass.incubator.scripting.python</module>
<module>org.eclipse.tracecompass.incubator.scripting.core</module>
<module>org.eclipse.tracecompass.incubator.scripting.core.tests</module>
<module>org.eclipse.tracecompass.incubator.scripting.ui</module>
diff --git a/common/org.eclipse.tracecompass.incubator.releng-site/category.xml b/common/org.eclipse.tracecompass.incubator.releng-site/category.xml
index ebfc983..5521c13 100644
--- a/common/org.eclipse.tracecompass.incubator.releng-site/category.xml
+++ b/common/org.eclipse.tracecompass.incubator.releng-site/category.xml
@@ -54,6 +54,9 @@
<feature url="features/org.eclipse.tracecompass.incubator.scripting.javascript_0.0.0.qualifier.jar" id="org.eclipse.tracecompass.incubator.scripting.javascript" version="0.0.0">
<category name="analyses"/>
</feature>
+ <feature url="features/org.eclipse.tracecompass.incubator.scripting.python_0.0.1.qualifier.jar" id="org.eclipse.tracecompass.incubator.scripting.python" version="0.0.1.qualifier">
+ <category name="analyses"/>
+ </feature>
<bundle id="org.eclipse.tracecompass.incubator.analysis.core" version="0.0.0">
<category name="analyses"/>
</bundle>
diff --git a/common/org.eclipse.tracecompass.incubator.releng-site/pom.xml b/common/org.eclipse.tracecompass.incubator.releng-site/pom.xml
index b1ad8d6..e0d5392 100644
--- a/common/org.eclipse.tracecompass.incubator.releng-site/pom.xml
+++ b/common/org.eclipse.tracecompass.incubator.releng-site/pom.xml
@@ -44,6 +44,7 @@
<site>https://download.eclipse.org/webtools/downloads/drops/R3.13.0/I-latest/repository/</site>
<site>http://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/repository/</site>
<site>http://download.eclipse.org/ease/update/release</site>
+ <site>https://dl.bintray.com/py4j/py4j-eclipse/0.10.4</site>
</associateSites>
<skipBuildInfo>true</skipBuildInfo>
</configuration>
diff --git a/common/org.eclipse.tracecompass.incubator.target/tracecompass-incubator-master.target b/common/org.eclipse.tracecompass.incubator.target/tracecompass-incubator-master.target
index c311fa5..013a3c0 100644
--- a/common/org.eclipse.tracecompass.incubator.target/tracecompass-incubator-master.target
+++ b/common/org.eclipse.tracecompass.incubator.target/tracecompass-incubator-master.target
@@ -151,9 +151,14 @@
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.ease.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.ease.lang.javascript.feature.feature.group" version="0.0.0"/>
+<unit id="org.eclipse.ease.lang.python.py4j.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.ease.ui.feature.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/ease/update/release"/>
</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.py4j.feature.feature.group" version="0.0.0"/>
+<repository location="https://dl.bintray.com/py4j/py4j-eclipse/0.10.4"/>
+</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<launcherArgs>
diff --git a/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/User-Guide.mediawiki b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/User-Guide.mediawiki
index 7426684..be0c5c9 100644
--- a/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/User-Guide.mediawiki
+++ b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/User-Guide.mediawiki
@@ -27,6 +27,18 @@
After Trace Compass restart, the feature will be available.
+=== Python ===
+
+For Python, the feature is also available through the '''Tools''' -> '''Add-ons...''' under the ''Analyses'' category. You can search for the '''Trace Compass Scripting Python (Incubation)''' feature and click ``Finish``.
+
+[[Image:images/python_feature.png | Python feature]]
+
+It will automatically install the required '''Trace Compass Scripting (Incubation)''' feature and all related features to execute python with EASE.
+
+After Trace Compass restart, the feature will be available.
+
+This feature does not come with any python code editors, so the python code file won't have code completion or syntax highlighting directly in Trace Compass. But an editor can be installed separately. One such editor is [http://www.pydev.org PyDev], which can be [http://www.pydev.org/manual_101_install.html installed as an Eclipse plugin].
+
=== Others ===
For any other language, there is some additional steps to install the full support.
@@ -47,9 +59,9 @@
[[Image:images/install_new_software.png | Install New Software]]
-Then under the '''EASE Language Support''' category, select the appropriate feature. There are some duplicates, you should look at the Version of the feature, it should be the latest one (0.6.0.x). For instance, to add ''python'' support, you need to select the '''EASE Py4J Support (Incubation)'''. Then complete the installation.
+Then under the '''EASE Language Support''' category, select the appropriate feature. There are some duplicates, you should look at the Version of the feature, it should be the latest one (0.6.0.x). For instance, to add ''groovy'' support, you need to select the '''EASE Groovy Support (Incubation)'''. Then complete the installation.
-[[Image:images/py4j_feature.png | Py4J Feature Installation]]
+[[Image:images/other_ease_feature.png | Groovy Feature Installation]]
If an editor is not installed, the script files will be opened in an external text editor instead of in Trace Compass. That may be sufficient for small scripts, but having code completion, etc can be handy too. Follow the links in the [https://wiki.eclipse.org/EASE/Engines the supported engines/editors page] for the appropriate engine and follow the instructions to install its editor in Eclipse. They are external tools and sometimes, IDEs of their own, so they might add a lot of content and dependencies to Trace Compass.
diff --git a/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/other_ease_feature.png b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/other_ease_feature.png
new file mode 100644
index 0000000..fd175b3
--- /dev/null
+++ b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/other_ease_feature.png
Binary files differ
diff --git a/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/py4j_feature.png b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/py4j_feature.png
deleted file mode 100644
index be68654..0000000
--- a/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/py4j_feature.png
+++ /dev/null
Binary files differ
diff --git a/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/python_feature.png b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/python_feature.png
new file mode 100644
index 0000000..94d22ec
--- /dev/null
+++ b/doc/org.eclipse.tracecompass.incubator.scripting.doc.user/doc/images/python_feature.png
Binary files differ