Skip to content
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
The table of contents is too big for display.
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 @@ -65,4 +65,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

50 changes: 28 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Rebrand ecoCode to Creedengo across code, resources, build files, and docs
- Update contact email to `contact@green-code-initiative.org`
- Keep deprecated rule repository key as `ecocode-android-java`
- Align profile names for Java/XML/Gradle and update Java/XML profile JSON names
- Refine README rebranding wording and structure

### Deleted

## [1.2.0] - 2026-01-04
Expand Down Expand Up @@ -46,19 +52,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Home page URL for plugins (for display on SonarQube administration page)
- Add `eco-design` tag on all rules
- [#207](https://github.com/green-code-initiative/ecoCode/issues/207) Add release tag analyzis on SonarCloud
- [#207](https://github.com/green-code-initiative/Creedengo/issues/207) Add release tag analyzis on SonarCloud
- [#58](https://github.com/green-code-initiative/ecoCode-android/pull/58) Add Dark UI theme XML rule
- Support of SonarQube 10.3

### Changed

- Rename repository `ecoCode-mobile` to `ecoCode-android`
- Update the rules naming convention to have the same one as the others ecoCode plugin. Rules identifier now starts by `EC`.
- Update built-in profile names to `ecoCode (Android)`
- Rename repository `creedengo-mobile` to `ecoCode-android`
- Update the rules naming convention to have the same one as the others Creedengo plugin. Rules identifier now starts by `EC`.
- Update built-in profile names to `Creedengo (Android)`

### Deleted

- Moved iOS plugin to its [own repository](https://github.com/green-code-initiative/ecoCode-ios).
- Moved iOS plugin to its [own repository](https://github.com/green-code-initiative/creedengo-ios).

## [1.0.1] - 2023-03-10

Expand All @@ -70,30 +76,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [#5](https://github.com/green-code-initiative/ecocode-android/pull/5) Add IOS plugin delivery
- [#5](https://github.com/green-code-initiative/ecoCode-android/pull/5) Add IOS plugin delivery
- Add `CONTRIBUTING.md`
- Add `CODE_STYLE.md`
- move `INSTALL.md` to common doc in `ecoCode-common` repository
- move `INSTALL.md` to common doc in `creedengo-common` repository

### Changed

- upgrade SonarQube version to 9.9
- [#27](https://github.com/green-code-initiative/ecocode-android/pull/27) preparation for Plugin SonarSource Marketplace integration
- [#27](https://github.com/green-code-initiative/ecoCode-android/pull/27) preparation for Plugin SonarSource Marketplace integration
- docker / docker-compose upgrade
- update documentation
- upgrade RULES
- [#28](https://github.com/green-code-initiative/ecocode-android/pull/28) Add minSdk and targetSdk
- [#4](https://github.com/green-code-initiative/ecocode-android/pull/4) minSdk and targetSdk properties must be supported too
- [#23](https://github.com/green-code-initiative/ecocode-android/issues/23) Fix CodeNarc issue
- [#20](https://github.com/green-code-initiative/ecocode-android/issues/20) Refactoring `cnumr` to `greencodeinitiative`
- [#28](https://github.com/green-code-initiative/ecoCode-android/pull/28) Add minSdk and targetSdk
- [#4](https://github.com/green-code-initiative/ecoCode-android/pull/4) minSdk and targetSdk properties must be supported too
- [#23](https://github.com/green-code-initiative/ecoCode-android/issues/23) Fix CodeNarc issue
- [#20](https://github.com/green-code-initiative/ecoCode-android/issues/20) Refactoring `cnumr` to `greencodeinitiative`

## [0.1.0] - 2023-01-03

### Added

- [#13](https://github.com/green-code-initiative/ecocode-android/pull/13) Upgrade some versions + sonar version from 9.3
- [#13](https://github.com/green-code-initiative/ecoCode-android/pull/13) Upgrade some versions + sonar version from 9.3
to 9.8
- [#14](https://github.com/green-code-initiative/ecocode-android/issues/14) Improve release system
- [#14](https://github.com/green-code-initiative/ecoCode-android/issues/14) Improve release system

### Changed

Expand All @@ -105,18 +111,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- First official release of ecocode plugins : android plugin
- First official release of creedengo plugins : android plugin

[unreleased]: https://github.com/green-code-initiative/ecoCode/compare/v1.2.0...HEAD
[unreleased]: https://github.com/green-code-initiative/ecoCode-android/compare/v1.2.0...HEAD

[1.2.0]: https://github.com/green-code-initiative/ecoCode/releases/tag/v1.2.0
[1.2.0]: https://github.com/green-code-initiative/Creedengo/releases/tag/v1.2.0

[1.1.0]: https://github.com/green-code-initiative/ecoCode/releases/tag/v1.1.0
[1.1.0]: https://github.com/green-code-initiative/Creedengo/releases/tag/v1.1.0

[1.0.1]: https://github.com/green-code-initiative/ecoCode/releases/tag/v1.0.1
[1.0.1]: https://github.com/green-code-initiative/Creedengo/releases/tag/v1.0.1

[1.0.0]: https://github.com/green-code-initiative/ecoCode/releases/tag/v1.0.0
[1.0.0]: https://github.com/green-code-initiative/Creedengo/releases/tag/v1.0.0

[0.1.0]: https://github.com/green-code-initiative/ecoCode/releases/tag/v0.1.0
[0.1.0]: https://github.com/green-code-initiative/Creedengo/releases/tag/v0.1.0

[0.0.1]: https://github.com/green-code-initiative/ecoCode/releases/tag/v0.0.1
[0.0.1]: https://github.com/green-code-initiative/Creedengo/releases/tag/v0.0.1
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
91 changes: 54 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,77 @@
![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.

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 Java

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

🌿 SonarQube Plugin
Creedengo is a collective project aiming to reduce the environmental footprint of software at the code level. This repository hosts the Android-focused plugin, originally released as `ecoCode android` and now branded as **Creedengo Android Java**.

It provides static code analyzers to highlight code structures that may have a negative ecological impact: energy over-consumption, "fatware", shortening devices' lifespan, etc.

The project is based on an evolving catalog of [best practices for Android](https://github.com/cnumr/best-practices-mobile#-android-platform). A SonarQube plugin implements this catalog as rules for scanning native Android projects **written in Java only**.

Resources:
- [Complete presentation](docs/resources/devfest-2022.pdf) (FR)
- [Presentation in a nutshell](docs/resources/apidays-2022.pdf)
- [Hands-on tutorial](https://olegoaer.perso.univ-pau.fr/green-it-summer-school/ecoCode/lab.html) (FR, ecoCode name)

🌿 SonarQube plugin
-------------------

![Screenshot](android-plugin/docs/screenshot.png)

<sub>The custom GUI above is reserved to educational purpose only.</sub>

This plugin targets:
- Android Java source code
- Android XML configurations
- Gradle build files (Groovy)

🚀 Quickstart
-------------

A SonarQube container image with ecoCode Android embedded exists !
A SonarQube container image with Creedengo Android Java 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`

🛒 Distribution
---------------

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

🧩 Plugins version compatibility
------------------

| Plugins Version | SonarQube version |
|-----------------|-----------------------------|
| 0.0.+ | SonarQube 8.9.+ LTS to 9.3 |
| 0.1.+ | SonarQube 9.4.+ LTS to 9.9 |
| 1.0.+ | SonarQube 9.4.+ LTS to 9.9 |
| 1.1.+ | SonarQube 9.4.+ LTS to 10.3 |

☕ Plugin Java part compatibility
------------------

| Plugins Version | Java version |
|------------------|--------------|
| 0.0.+ | 11 / 17 |
| 0.1.+ | 11 / 17 |
| 1.0.+ | 11 / 17 |
| 1.1.+ | 11 / 17 |

🤝 Contributing
---------------

Have an idea or want to help? We welcome contributions. See `CONTRIBUTING.md` and the related guides.

🤝 Partners
------------
Expand All @@ -42,12 +84,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 @@ -62,28 +104,3 @@ If you use ecoCode in an academic work we would be really glad if you cite our s
series = {ASE22}
}
```

🛒 Distribution
---------------

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

🧩 Plugins version compatibility
------------------

| Plugins Version | SonarQube version |
|-----------------|-----------------------------|
| 0.0.+ | SonarQube 8.9.+ LTS to 9.3 |
| 0.1.+ | SonarQube 9.4.+ LTS to 9.9 |
| 1.0.+ | SonarQube 9.4.+ LTS to 9.9 |
| 1.1.+ | SonarQube 9.4.+ LTS to 10.3 |

☕ Plugin Java part compatibility
------------------

| Plugins Version | Java version |
|------------------|--------------|
| 0.0.+ | 11 / 17 |
| 0.1.+ | 11 / 17 |
| 1.0.+ | 11 / 17 |
| 1.1.+ | 11 / 17 |
6 changes: 3 additions & 3 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 @@ -33,7 +33,7 @@ Plugin-specific recommendations
Choose a rule within the [table of unimplemented android-specific rules](RULES.md). When submitting a *Pull Request* with your code, give it the following name: `[<id here>] <name of the rule here>`, along with both labels `android` and `rule` to ease the work of reviewers.

### Naming conventions
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).
Before submitting an Android-specific SonarQube custom rule, please take a look at our [naming conventions](https://doc.rules.creedengo.io/#how-to-specify-rules).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this URL doesn't exist. maybe ask for it to Olivier L.


### 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/io/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
Loading
Loading