Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions doc/org.eclipse.tracecompass.maven.example/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions doc/org.eclipse.tracecompass.maven.example/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.tracecompass.maven.example</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
10 changes: 10 additions & 0 deletions doc/org.eclipse.tracecompass.maven.example/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Example using maven dependencies build with b3 aggregator in
project org.eclipse.tracecompass.aggregation. Right now the maven repository
is expected to be in ${user.home}/build/final

Note: Fix TODOs The pom.xml and MyTest.java to build and run example.

To build:
> mvn clean install
To run
> mvn exec:exec
107 changes: 107 additions & 0 deletions doc/org.eclipse.tracecompass.maven.example/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<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>
<groupId>org.eclipse.tracecompass</groupId>
<artifactId>org.eclipse.tracecompass.maven.example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Trace Compass Maven Example</name>

<repositories>
<repository>
<id>my-repo</id>
<!-- TODO fix path -->
<url>file:/home/user/git/org.eclipse.tracecompass/releng/org.eclipse.tracecompass.aggregation/target/final/</url>
</repository>
</repositories>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.eclipse.tracecompass.maven.example.MyTest</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Xms512m</argument>
<argument>-Xmx512m</argument>
<argument>-classpath</argument>
<classpath/>
<argument>org.eclipse.tracecompass.maven.example.MyTest</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.eclipse.tracecompass</groupId>
<artifactId>org.eclipse.tracecompass.ctf.core</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.0-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.18.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.17.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.tracecompass</groupId>
<artifactId>org.eclipse.tracecompass.ctf.core</artifactId>
<version>4.7.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2023 Ericsson
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.maven.example;

import org.eclipse.tracecompass.ctf.core.CTFException;
import org.eclipse.tracecompass.ctf.core.event.IEventDefinition;
import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
import org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader;

public class MyTest {
public static void main(String[] args) {
try {
// TODO Fix path
CTFTrace trace = new CTFTrace("/home/user/git/tracecompass-test-traces/ctf/src/main/resources/trace2/");
try (CTFTraceReader traceReader = new CTFTraceReader(trace);) {

while (traceReader.hasMoreEvents()) {
IEventDefinition ed = traceReader.getCurrentEventDef();
/* Do something with the event */
System.out.println(ed.toString());
traceReader.advance();
}
}
} catch (CTFException e) {
e.printStackTrace();
}
}
}
11 changes: 11 additions & 0 deletions releng/org.eclipse.tracecompass.aggregation/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.tracecompass.aggregation</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
16 changes: 16 additions & 0 deletions releng/org.eclipse.tracecompass.aggregation/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This project creates an maven repository with all dependencies needed for
Trace Compass CTF core and parser plug-in installed. The location of the
generated maven repository by default is
releng/org.eclipse.tracecompass.aggregation/target/final.

This can be changed in the tracecompass.aggr file.

Install Eclipse CBI aggregator, e.g. using update site (or later version):
http://download.eclipse.org/cbi/updates/aggregator/ide/4.13/

It can be separately built by the following commands:
cd releng/org.eclipse.tracecompass.aggregation
mvn clean install

Follow instructions on:
https://wiki.eclipse.org/CBI/aggregator/manual
86 changes: 86 additions & 0 deletions releng/org.eclipse.tracecompass.aggregation/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
/*******************************************************************************
* Copyright (c) 2015, 2019 Efficios Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-->
<modelVersion>4.0.0</modelVersion>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<parent>
<artifactId>org.eclipse.tracecompass.releng-parent</artifactId>
<groupId>org.eclipse.tracecompass</groupId>
<version>10.3.0-SNAPSHOT</version>
</parent>

<artifactId>org.eclipse.tracecompass.aggregation</artifactId>
<packaging>pom</packaging>

<build>
<defaultGoal>clean resources:resources verify</defaultGoal>
<resources>
<resource>
<directory>aggr</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>eclipse-run</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<!-- DO NOT FORMAT THE FOLLOWING LINE, IT MUST BE ON ONE LINE -->
<appArgLine>-application org.eclipse.cbi.p2repo.cli.headless aggregate --buildModel tracecompass.aggr</appArgLine>
<dependencies>
<dependency>
<artifactId>org.eclipse.cbi.p2repo.aggregator.engine.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.core.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.core.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>cbi-aggregator</id>
<layout>p2</layout>
<url>https://download.eclipse.org/cbi/updates/p2-aggregator/products/nightly/latest</url>
</repository>
</repositories>
<executionEnvironment>JavaSE-17</executionEnvironment>
</configuration>
</plugin>
</plugins>
</build>

</project>
17 changes: 17 additions & 0 deletions releng/org.eclipse.tracecompass.aggregation/tracecompass.aggr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<aggregator:Aggregation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:aggregator="http://www.eclipse.org/cbi/p2repo/2011/aggregator/1.1.0" label="Trace Compass Aggregation" buildRoot="./target" packedStrategy="SKIP" type="R" mavenResult="true" versionFormat="MavenRelease">
<validationSets label="main">
<contributions label="Trace Compass TMF">
<repositories location="https://download.eclipse.org/tracecompass/releases/10.3.0/repository/">
<bundles name="org.eclipse.tracecompass.ctf.core" versionRange="0.1.0"/>
<bundles name="org.eclipse.tracecompass.ctf.parser" versionRange="0.1.0"/>
</repositories>
</contributions>
<validationRepositories location="https://download.eclipse.org/releases/2025-03"/>
</validationSets>
<configurations architecture="x86_64"/>
<configurations operatingSystem="linux" windowSystem="gtk" architecture="x86_64"/>
<configurations operatingSystem="linux" windowSystem="gtk" architecture="aarch64"/>
<configurations operatingSystem="macosx" windowSystem="cocoa" architecture="x86_64"/>
<configurations operatingSystem="macosx" windowSystem="cocoa" architecture="aarch64"/>
</aggregator:Aggregation>
1 change: 1 addition & 0 deletions releng/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
<module>org.eclipse.tracecompass.releng-site</module>
<module>org.eclipse.tracecompass.slf4j.binding.simple.properties</module>
<module>org.eclipse.tracecompass.testing</module>
<!-- <module>org.eclipse.tracecompass.aggregation</module> -->
</modules>
</project>
Loading