Skip to content
Merged
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
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IDE Config and Code Style

This project has a strictly enforced code style. Code formatting is done by the Eclipse code
formatter, using the config files found in the `build-tools` directory. By
formatter, using the config files found in the `contributing` directory. By
default when you run `mvn install` the code will be formatted automatically. When submitting a
pull request the CI build will fail if running the formatter results in any code changes, so it is
recommended that you always run a full Maven build before submitting a pull request.
Expand All @@ -11,7 +11,7 @@ If you want to run the formatting without doing a full build, you can run `mvn p
#### Eclipse Setup

Open the *Preferences* window, and then navigate to _Java_ -> _Code Style_ -> _Formatter_. Click _
Import_ and then select the `eclipse-format.xml` file in the `build-tools`
Import_ and then select the `eclipse-format.xml` file in the `contributing`
directory.

Next navigate to _Java_ -> _Code Style_ -> _Organize Imports_. Click _Import_ and select
Expand All @@ -29,11 +29,11 @@ Settings_ -> _Eclipse Code Formatter_.

Select _Use the Eclipse Code Formatter_, then change the _Eclipse Java Formatter Config File_ to
point to the
`eclipse-format.xml` file in the `build-tools` directory. Make sure the _
`eclipse-format.xml` file in the `contributing` directory. Make sure the _
Optimize Imports_ box is ticked, and select the `eclipse.importorder` file as the import order
config file.

Next, disable wildcard imports:
navigate to _Editor_ -> _Code Style_ -> _Java_ -> _Imports_
and set _Class count to use import with '\*'_ to `999`. Do the same with _Names count to use static
import with '\*'_.
import with '\*'_.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ without further processing.

This project uses [Quarkus](https://quarkus.io), the Supersonic Subatomic Java Framework and comprises 3 modules:

- `build-tools`, which contains formatting configuration that you can use to set your IDE up to contribute to this
project
- `analysis`, which contains utilities helpful to analyze power measures (computations, statistics, histograms, etc…)
- `if-manifest-export`, which provides a means to export a stopped measure as a [Green Software Foundation](https://greensoftware.foundation/) [Impact Framework](https://if.greensoftware.foundation/) manifest
- `measure`, which provides classes to help record and process measures in client applications
- `metadata`, which contains the metadata API that the RESTful server uses to provide information about what is returned
by the power sensors. This artifact contains classes that can be reused in client projects.
- `server` contains the RESTful server, listening by default on port `20432` (as specified
Expand Down Expand Up @@ -69,4 +70,4 @@ Once build, you can run the server as follows:

- JVM mode: `sudo java -jar server/target/quarkus-app/quarkus-run.jar` from the project root
- Dev mode: `cd server; sudo mvn quarkus:dev` or `cd server; sudo quarkus dev` (will only work if `root` has Java properly configured)
- Native mode: `sudo ./server/target/*-runner`
- Native mode: `sudo ./server/target/*-runner`
24 changes: 9 additions & 15 deletions analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,15 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.laprun.sustainability</groupId>
<artifactId>build-tools</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<configuration>
<configFile>../contributing/eclipse-format.xml</configFile>
</configuration>
</plugin>
</plugins>
</build>

</project>
15 changes: 0 additions & 15 deletions build-tools/pom.xml

This file was deleted.

10 changes: 3 additions & 7 deletions if-manifest-export/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.laprun.sustainability</groupId>
<artifactId>build-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
<configFile>../contributing/eclipse-format.xml</configFile>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
24 changes: 9 additions & 15 deletions measure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,14 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.laprun.sustainability</groupId>
<artifactId>build-tools</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<configuration>
<configFile>../contributing/eclipse-format.xml</configFile>
</configuration>
</plugin>
</plugins>
</build>
</project>

This file was deleted.

12 changes: 3 additions & 9 deletions metadata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,14 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.laprun.sustainability</groupId>
<artifactId>build-tools</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<configuration>
<configFile>../contributing/eclipse-format.xml</configFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
138 changes: 80 additions & 58 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<skipITs>true</skipITs>
<format.skip>false</format.skip>

<quarkus.platform.version>3.17.4</quarkus.platform.version>
<assertj.version>3.26.3</assertj.version>
Expand All @@ -68,7 +69,6 @@
</properties>

<modules>
<module>build-tools</module>
<module>metadata</module>
<module>measure</module>
<module>server</module>
Expand Down Expand Up @@ -121,7 +121,7 @@
<artifactId>formatter-maven-plugin</artifactId>
<version>${formatter-plugin.version}</version>
<configuration>
<configFile>eclipse-format.xml</configFile>
<configFile>contributing/eclipse-format.xml</configFile>
<lineEnding>LF</lineEnding>
<skip>${format.skip}</skip>
</configuration>
Expand All @@ -137,84 +137,106 @@
<skip>${format.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<dependencies>
<dependency>
<groupId>me.fabriciorby</groupId>
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
<configuration>
<reportFormat>plain</reportFormat>
<consoleOutputReporter>
<disable>true</disable>
</consoleOutputReporter>
<statelessTestsetInfoReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
<theme>UNICODE</theme>
</statelessTestsetInfoReporter>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager
</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<dependencies>
<dependency>
<groupId>me.fabriciorby</groupId>
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
<configuration>
<reportFormat>plain</reportFormat>
<consoleOutputReporter>
<disable>true</disable>
</consoleOutputReporter>
<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
<theme>UNICODE</theme>
</statelessTestsetInfoReporter>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
Expand Down
Loading
Loading