Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ecoCode to creedengo #96

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_ecocode-android
run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-android
4 changes: 2 additions & 2 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ on:

env:
# github.repository as <account>/<repo>
IMAGE_NAME: sonarqube-ecocode-android
IMAGE_NAME: sonarqube-creedengo-android
IMAGES: |
ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode-android
ghcr.io/${{ github.repository_owner }}/sonarqube-creedengo-android
PLATFORMS: linux/amd64,linux/arm64/v8
jobs:
Build:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
id: export_jar_files
uses: actions/upload-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: lib
- name: Export UPLOAD_URL
id: export_upload_url
Expand All @@ -60,7 +60,7 @@ jobs:
id: import_jar_files
uses: actions/download-artifact@v3
with:
name: ecocode-plugins
name: creedengo-plugins
path: lib
- name: Upload Release Asset - Android Plugin
id: upload-release-asset
Expand All @@ -69,7 +69,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.build.outputs.upload_url}}
asset_path: lib/ecocode-android-${{ github.ref_name }}.jar
asset_name: ecocode-android-${{ github.ref_name }}.jar
asset_path: lib/creedengo-android-${{ github.ref_name }}.jar
asset_name: creedengo-android-${{ github.ref_name }}.jar
asset_content_type: application/zip

2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ preferred-citation:
orcid: "https://orcid.org/0000-0001-5405-1688"
- family-names: "Hertout"
given-names: "Julien"
title: "ecoCode: A SonarQube Plugin to Remove Energy Smells from Android Projects"
title: "creedengo: A SonarQube Plugin to Remove Energy Smells from Android Projects"
doi: 10.1145/3551349.3559518
year: 2022
2 changes: 1 addition & 1 deletion CODE_STYLE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please read common [CODE_STYLE.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CODE_STYLE.md) in `ecoCode-common` repository.
Please read common [CODE_STYLE.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CODE_STYLE.md) in `creedengo-common` repository.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please read common [CONTRIBUTING.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/CONTRIBUTING.md) in `ecoCode-common` repository.
Please read common [CONTRIBUTING.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/CONTRIBUTING.md) in `creedengo-common` repository.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM maven:3.8-openjdk-11 AS builder

COPY . /usr/src/ecocode
COPY . /usr/src/creedengo

WORKDIR /usr/src/ecocode
WORKDIR /usr/src/creedengo
RUN ./tool_prepare-codenarc.sh
RUN ./tool_build.sh

FROM sonarqube:10.3.0-community
USER root
COPY --from=builder /usr/src/ecocode/lib/* /opt/sonarqube/extensions/plugins/
COPY --from=builder /usr/src/creedengo/lib/* /opt/sonarqube/extensions/plugins/

USER sonarqube
8 changes: 4 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- [Common installation notes / requirements](#common-installation-notes--requirements)
- [Special points for Android plugins](#special-points-for-android-plugins)
- [Project structure](#project-structure)
- [Howto build the SonarQube ecoCode plugins](#howto-build-the-sonarqube-ecocode-plugins)
- [Howto build the SonarQube creedengo plugins](#howto-build-the-sonarqube-creedengo-plugins)
- [Preliminary steps (only Android)](#preliminary-steps-only-android)
- [Others steps](#others-steps)

Common installation notes / requirements
========================================

Please read common [INSTALL.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md) in `ecoCode-common` repository.
Please read common [INSTALL.md](https://github.com/green-code-initiative/creedengo-common/blob/main/doc/INSTALL.md) in `creedengo-common` repository.

Special points for Android plugins
=================================
Expand All @@ -19,7 +19,7 @@ Project structure
Here is a preview of project tree :

```txt
ecocode-android # Root directory
creedengo-android # Root directory
|
+--android-plugin # Android
|
Expand All @@ -30,7 +30,7 @@ ecocode-android # Root directory

You will find more information about the plugins’ architecture in their folders

Howto build the SonarQube ecoCode plugins
Howto build the SonarQube creedengo plugins
-----------------------------------------

### Preliminary steps (only Android)
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
![Logo](docs/resources/5ekko.png)
======================================

Mobile apps running on top of battery-limited, android-powered devices are more than others concerned by the reduction of their environmental footprint. Hence, we created `ecoCode android`, the version of ecoCode project fully dedicated to the Android platform. It provides static code analyzers to highlight code structures that may have a negative ecological impact: energy over-consumption, "fatware", shortening devices' lifespan, etc.
Mobile apps running on top of battery-limited, android-powered devices are more than others concerned by the reduction of their environmental footprint. Hence, we created `creedengo android`, the version of creedengo project fully dedicated to the Android platform. It provides static code analyzers to highlight code structures that may have a negative ecological impact: energy over-consumption, "fatware", shortening devices' lifespan, etc.

ecoCode android is based on an evolving catalog of [best practices for Android](https://github.com/cnumr/best-practices-mobile#-android-platform). A SonarQube plugin then implements this catalog as rules for scanning your native Android projects **written in Java only**. To learn more, take a look at the [complete presentation](docs/resources/devfest-2022.pdf) (:fr:) or the [presentation in a nutshell](docs/resources/apidays-2022.pdf). A hands-on [tutorial](https://olegoaer.perso.univ-pau.fr/green-it-summer-school/ecoCode/lab.html) and free demo access is also available (:fr:).
creedengo android is based on an evolving catalog of [best practices for Android](https://github.com/cnumr/best-practices-mobile#-android-platform). A SonarQube plugin then implements this catalog as rules for scanning your native Android projects **written in Java only**. To learn more, take a look at the [complete presentation](docs/resources/devfest-2022.pdf) (:fr:) or the [presentation in a nutshell](docs/resources/apidays-2022.pdf). A hands-on [tutorial](https://olegoaer.perso.univ-pau.fr/green-it-summer-school/creedengo/lab.html) and free demo access is also available (:fr:).

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

Expand All @@ -17,15 +17,15 @@ ecoCode android is based on an evolving catalog of [best practices for Android](
🚀 Quickstart
-------------

A SonarQube container image with ecoCode Android embedded exists !
A SonarQube container image with creedengo Android embedded exists !

```bash
docker run -ti --rm \
-v sq_ecocode_android_logs:/opt/sonarqube/logs \
-v sq_ecocode_android_data:/opt/sonarqube/data \
-v sq_creedengo_android_logs:/opt/sonarqube/logs \
-v sq_creedengo_android_data:/opt/sonarqube/data \
-p 9000:9000 \
--name sonarqube-ecocode-android \
ghcr.io/green-code-initiative/sonarqube-ecocode-android:latest
--name sonarqube-creedengo-android \
ghcr.io/green-code-initiative/sonarqube-creedengo-android:latest
```

Wait a little bit during first start initialization, and go to [http://localhost:9000](http://localhost:9000). Default credentials are `admin`/`admin`
Expand All @@ -42,12 +42,12 @@ Wait a little bit during first start initialization, and go to [http://localhost
📢 Cite this work
------------------

If you use ecoCode in an academic work we would be really glad if you cite our seminal paper using the following bibtex entry:
If you use creedengo in an academic work we would be really glad if you cite our seminal paper using the following bibtex entry:

```bibtex
@inproceedings{10.1145/3551349.3559518,
author = {Le Goaer, Olivier and Hertout, Julien},
title = {ecoCode: A SonarQube Plugin to Remove Energy Smells from Android Projects},
title = {creedengo: A SonarQube Plugin to Remove Energy Smells from Android Projects},
year = {2023},
isbn = {9781450394758},
publisher = {Association for Computing Machinery},
Expand All @@ -66,7 +66,7 @@ If you use ecoCode in an academic work we would be really glad if you cite our s
🛒 Distribution
---------------

Ready to use binaries are available [from GitHub](https://github.com/green-code-initiative/ecocode-android/releases).
Ready to use binaries are available [from GitHub](https://github.com/green-code-initiative/creedengo-android/releases).

🧩 Plugins version compatibility
------------------
Expand Down
4 changes: 2 additions & 2 deletions android-plugin/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributing Guidelines
Contributions are welcome!

**Before spending lots of time on something, ask for feedback on your idea first.**
Contact us at <contact@ecocode.io> to be sure that we are interested with your contribution idea.
Contact us at <contact@green-code-initiative.org> to be sure that we are interested with your contribution idea.

To avoid frustration, please discuss before submitting any contributions.

Expand Down Expand Up @@ -36,4 +36,4 @@ Choose a rule within the [table of unimplemented android-specific rules](RULES.m
Before submitting an Android-specific SonarQube custom rule, please take a look at our [naming conventions](https://doc.rules.ecocode.io/#how-to-specify-rules).

### Avoid doing things the hard way
Idealy, take also a look at the [helpers fonctions](./src/main/java/io/ecocode/java/checks/helpers).
Idealy, take also a look at the [helpers fonctions](src/main/java/org/greencodeinitiative/creedengo/java/checks/helpers).
4 changes: 2 additions & 2 deletions android-plugin/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ecoCode SonarQube plugin
creedengo SonarQube plugin
Copyright (C) 2020-2021 Snapp' - Université de Pau et des Pays de l'Adour
mailto: contact@ecocode.io
mailto: contact@green-code-initiative.org
24 changes: 12 additions & 12 deletions android-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ecoCode Android SonarQube plugin
creedengo Android SonarQube plugin
================================

![Logo Ekko](docs/ekko-sonar.png)

ecoCode Android SonarQube plugin is an "eco-responsibility" static code analyzer for native Android projects written in Java (Kotlin unsupported yet). Its aim is to detect code smells to indicate weither the source code can be improved to reduce their environmental and social impact.
creedengo Android SonarQube plugin is an "eco-responsibility" static code analyzer for native Android projects written in Java (Kotlin unsupported yet). Its aim is to detect code smells to indicate weither the source code can be improved to reduce their environmental and social impact.

Build and deploy the plugin
---------------------------
Expand Down Expand Up @@ -39,8 +39,8 @@ where `FusedLocationCheckTest` is the test to run.

Tests are located under:

- [/src/test/java/io/ecocode/java](./src/test/java/io/ecocode/java)
- [/src/test/java/io/ecocode/xml](./src/test/java/io/ecocode/xml)
- [/src/test/java/org/greencodeinitiative/creedengo/java](./src/test/java/org/greencodeinitiative/creedengo/java)
- [/src/test/java/org/greencodeinitiative/creedengo/xml](./src/test/java/org/greencodeinitiative/creedengo/xml)

### Plugin build

Expand Down Expand Up @@ -90,7 +90,7 @@ Plugin usage
------------

The plugin contains two sets of rules, one for Java and one for XML. They can be found in the **Quality profiles** section of
SonarQube (*ecoCode* profiles).
SonarQube (*creedengo* profiles).
Do not forget to set them as "DEFAULT" or to configure your Android project on SonarQube to use these profiles before performing an
analysis.

Expand All @@ -103,16 +103,16 @@ Plugin development

For Java rules:

- Java rules’ code can be found in: [./src/main/java/io/ecocode/java](./src/main/java/io/ecocode/java)
- Java rules’ code can be found in: [./src/main/java/org/greencodeinitiative/creedengo/java](src/main/java/org/greencodeinitiative/creedengo/java)
- Java rules’ definition can be found in: [./src/main/resources/org/sonar/l10n/java/rules/squid](./src/main/resources/org/sonar/l10n/java/rules/squid).
Please do not add / or modify rules here since the code is generated. To update or add a rule, please reach us though our mail
<contact@ecocode.io>, prior to submitting any code change.
- Java rules’ tests can be found in: [./src/test/java/io/ecocode/java](./src/test/java/io/ecocode/java). One file = one rule.
<contact@green-code-initiative.org>, prior to submitting any code change.
- Java rules’ tests can be found in: [./src/test/java/org/greencodeinitiative/creedengo/java](./src/test/java/org/greencodeinitiative/creedengo/java). One file = one rule.

For XML rules:

- XML rules’ code can be found in: [./src/main/java/io/ecocode/xml](./src/main/java/io/ecocode/xml)
- XML rules’ definition can be found in: [./src/main/resources/io/ecocode/xml/rules](./src/main/resources/io/ecocode/xml/rules).
- XML rules’ code can be found in: [./src/main/java/org/greencodeinitiative/creedengo/xml](./src/main/java/org/greencodeinitiative/creedengo/xml)
- XML rules’ definition can be found in: [./src/main/resources/org/greencodeinitiative/creedengo/xml/rules](./src/main/resources/org/greencodeinitiative/creedengo/xml/rules).
Please do not add / or modifiy rules here since the code is generated. To update or add a rule, please reach us though our mail
<contact@ecocode.io>, prior to submitting any code change.
- XML rules’ tests can be found in: [./src/test/java/io/ecocode/xml](./src/test/java/io/ecocode/xml). One file = one rule.
<contact@green-code-initiative.org>, prior to submitting any code change.
- XML rules’ tests can be found in: [./src/test/java/org/greencodeinitiative/creedengo/xml](./src/test/java/org/greencodeinitiative/creedengo/xml). One file = one rule.
8 changes: 4 additions & 4 deletions android-plugin/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.3"
services:
sonar:
image: sonarqube:9.9-community
container_name: sonar_ecocode_android
container_name: sonar_creedengo_android
ports:
- "9000:9000"
networks:
Expand All @@ -16,14 +16,14 @@ services:
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: 'true'
volumes:
- type: bind
source: ./target/ecocode-android-1.1.1-SNAPSHOT.jar
target: /opt/sonarqube/extensions/plugins/ecocode-android-1.1.1-SNAPSHOT.jar
source: ./target/creedengo-android-1.1.1-SNAPSHOT.jar
target: /opt/sonarqube/extensions/plugins/creedengo-android-1.1.1-SNAPSHOT.jar
- "logs:/opt/sonarqube/logs"
- "data:/opt/sonarqube/data"

db:
image: postgres:12
container_name: postgresql_ecocode_android
container_name: postgresql_creedengo_android
networks:
- sonarnet
volumes:
Expand Down
16 changes: 8 additions & 8 deletions android-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.ecocode</groupId>
<artifactId>ecocode-android-parent</artifactId>
<groupId>org.green-code-initiative</groupId>
<artifactId>creedengo-android-parent</artifactId>
<version>1.1.1-SNAPSHOT</version>
</parent>

<artifactId>ecocode-android</artifactId>
<artifactId>creedengo-android</artifactId>
<packaging>sonar-plugin</packaging>

<name>ecoCode Android plugin</name>
<name>creedengo Android plugin</name>
<description>Help the earth, adopt this green plugin for your applications</description>
<inceptionYear>2020</inceptionYear>
<url>https://github.com/green-code-initiative/ecocode-android/tree/main/android-plugin</url>
<url>https://github.com/green-code-initiative/creedengo-android/tree/main/android-plugin</url>

<properties>
<sslr.version>1.21</sslr.version>
Expand Down Expand Up @@ -184,7 +184,7 @@
<dependency>
<groupId>org.codenarc</groupId>
<artifactId>CodeNarc</artifactId>
<version>2.2.5</version>
<version>3.5.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -222,9 +222,9 @@
<artifactId>sonar-packaging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<pluginKey>ecocodeandroid</pluginKey>
<pluginKey>creedengoandroid</pluginKey>
<pluginName>${project.name}</pluginName>
<pluginClass>io.ecocode.EcoCodeRulesPlugin</pluginClass>
<pluginClass>org.greencodeinitiative.creedengo.CreedengoRulesPlugin</pluginClass>
<sonarLintSupported>true</sonarLintSupported>
<sonarQubeMinVersion>${sonarqube.version}</sonarQubeMinVersion>
<jreMinVersion>${java.version}</jreMinVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode Android plugin - Provides rules to reduce the environmental footprint of your Android applications
* Copyright © 2020 Green Code Initiative (contact@ecocode.io)
* creedengo Android plugin - Provides rules to reduce the environmental footprint of your Android applications
* Copyright © 2020 Green Code Initiative (contact@green-code-initiative.org)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,14 +15,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode;
package org.greencodeinitiative.creedengo;

import io.ecocode.java.JavaEcoCodeProfile;
import io.ecocode.java.JavaFileCheckRegistrar;
import io.ecocode.java.JavaRulesDefinition;
import io.ecocode.xml.XmlEcoCodeProfile;
import io.ecocode.xml.XmlRulesDefinition;
import io.ecocode.xml.XmlSensor;
import org.greencodeinitiative.creedengo.java.JavaCreedengoProfile;
import org.greencodeinitiative.creedengo.java.JavaFileCheckRegistrar;
import org.greencodeinitiative.creedengo.java.JavaRulesDefinition;
import org.greencodeinitiative.creedengo.xml.XmlCreedengoProfile;
import org.greencodeinitiative.creedengo.xml.XmlRulesDefinition;
import org.greencodeinitiative.creedengo.xml.XmlSensor;
import org.sonar.api.Plugin;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;
Expand All @@ -33,9 +33,9 @@
/**
* Entry point of your plugin containing your custom rules
*/
public class EcoCodeRulesPlugin implements Plugin {
public class CreedengoRulesPlugin implements Plugin {

public static final String FILE_SUFFIXES_KEY = "ecocode.xml.file.suffixes";
public static final String FILE_SUFFIXES_KEY = "creedengo.xml.file.suffixes";

@Override
public void define(Context context) {
Expand All @@ -46,7 +46,7 @@ public void define(Context context) {
// batch extensions -> objects are instantiated during code analysis
context.addExtension(JavaFileCheckRegistrar.class);
// === Add Java rules profile ===
context.addExtension(JavaEcoCodeProfile.class);
context.addExtension(JavaCreedengoProfile.class);
// === Add XML rules extension ===
context.addExtensions(
PropertyDefinition.builder(FILE_SUFFIXES_KEY)
Expand All @@ -58,7 +58,7 @@ public void define(Context context) {
.onQualifiers(Qualifiers.PROJECT)
.build(),
XmlRulesDefinition.class,
XmlEcoCodeProfile.class,
XmlCreedengoProfile.class,
XmlSensor.class);
// === Add Groovy rules extension ===
context.addExtensions(Groovy.getExtensions())
Expand Down
Loading
Loading