diff --git a/.gitignore b/.gitignore index c9f1356..3d6d6b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,15 @@ # Maven target/ +# Files +.csv + +# IDEs # Eclipse .settings/ .project .classpath +# VSCode/VSCodium +.vscode/ +# IntelliJ +.idea/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e511d7..fc12dd9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,14 +6,14 @@ ## Etudiant Vous ne devez pas contribuer directement à ce projet mais devez en effectuer un fork. Une fois cela effectué vous devez: -- [ ] Ajouter votre identifiant de groupe au champs `groupId` du fichier [pom.xml](pom.xml) sous la forme de `fr.u-paris.gla.votreequipe` +- [X] Ajouter votre identifiant de groupe au champs `groupId` du fichier [pom.xml](pom.xml) sous la forme de `fr.u-paris.gla.votreequipe` - [ ] Modifier le package principal afin de refleter le nouveau nom de groupe. - [ ] Adapter le fichier [README](README.md) au contenu de votre projet specifique - [ ] Adapter ce fichier (CONTRIBUTING.md) à vos propres instructions de contribution, notamment: - [ ] Convention de style de codage - [ ] Convention d'utilisation de git - [ ] Lien avec d'autres projets et d'autres dépôts. -- [ ] Modifier le fichier `application.properties` au besoin. +- [X] Modifier le fichier `application.properties` au besoin. ## Enseignant diff --git a/README.md b/README.md index ea37af1..8278cc2 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,32 @@ # Projet de GLA + Version 2024 ## Description -Ceci est l'archetype de projet de Génie Logiciel Avancé (GLA). -Il s'agit d'un projet Java. Ce dépôt définit un système de build et une application simple. Il est nécéssaire de consulter le fichier [CONTRIBUTING.md](CONTRIBUTING.md) pour utiliser ce dépôt. +Ceci est l'archétype de projet de Génie Logiciel Avancé (GLA). + +Il s'agit d'un projet Java. Ce dépôt définit un système de build et une application simple. Il est nécessaire de consulter le fichier [CONTRIBUTING.md](CONTRIBUTING.md) pour utiliser ce dépôt. ## Lancement du programme -Ce projet utilise [maven](https://maven.apache.org/) de Apache pour la gestion de construction. -Afin de compiler et lancer les tests, éxecutez simplement -``` +Ce projet utilise [maven](https://maven.apache.org/) d'Apache pour la gestion de construction. + +Afin de compiler et lancer les tests, exécutez simplement + +```bash mvn verify ``` +Afin de vérifier les tests via JaCoCo. +Les résultats du test sont dans `target/site/jacoco/index.html`. + +```bash +mvn clean jacoco:prepare-agent install jacoco:report +``` + +Par la suite, `mvn jacoco:report` suffit. + Dans sa version initiale, le programme fournit est un simple code qui se lance en terminal ou en application graphique. Une fois le programme compilé, vous trouverez un jar executable dans le dossier target. Au nom de jar près (version changeante), vous pourrez l'exécuter avec: @@ -24,5 +37,3 @@ java -jar target/project-2024.1.0.0-SNAPSHOT.jar --info L'option de lancement `--info` causera l'affichage dans la console d'informations de l'application. L'option de lancement `--gui` causera l'ouverture d'une fenêtre affichant le logo de l'Université de Paris. - -mvn verify && java -jar target/project-2024.1.0.0-SNAPSHOT.jar prof.csv nous.csv diff --git a/pom.xml b/pom.xml index 5c9b0da..40af7f3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - fr.u-paris.gla + fr.u-paris.gla.pathfinder project 2024.1.0.0-SNAPSHOT - Project Base + Pathfinder UTF-8 diff --git a/src/main/java/fr/u_paris/gla/project/App.java b/src/main/java/fr/u_paris/gla/project/App.java index 9441ed7..08e16a4 100644 --- a/src/main/java/fr/u_paris/gla/project/App.java +++ b/src/main/java/fr/u_paris/gla/project/App.java @@ -65,26 +65,26 @@ public class App { /** @param out the output stream */ public static void printAppInfos(PrintStream out) { - Properties props = new Properties(); - try (InputStream is = App.class.getResourceAsStream("application.properties")) { //$NON-NLS-1$ - props.load(is); - } catch (IOException e) { - throw new RuntimeException("Unable to read application informations", e); //$NON-NLS-1$ - } + Properties props = readApplicationProperties(); out.println("Application: " + props.getProperty("app.name", UNSPECIFIED)); //$NON-NLS-1$ //$NON-NLS-2$ out.println("Version: " + props.getProperty("app.version", UNSPECIFIED)); //$NON-NLS-1$ //$NON-NLS-2$ out.println("By: " + props.getProperty("app.team", UNSPECIFIED)); //$NON-NLS-1$ //$NON-NLS-2$ } - /** Shows the logo in an image. */ - public static void showLogo() { + private static Properties readApplicationProperties() { Properties props = new Properties(); try (InputStream is = App.class.getResourceAsStream("application.properties")) { //$NON-NLS-1$ props.load(is); } catch (IOException e) { throw new RuntimeException("Unable to read application informations", e); //$NON-NLS-1$ } + return props; + } + + /** Shows the logo in an image. */ + public static void showLogo() { + Properties props = readApplicationProperties(); JFrame frame = new JFrame(props.getProperty("app.name")); //$NON-NLS-1$ frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); diff --git a/src/main/java/fr/u_paris/gla/project/utils/GPS.java b/src/main/java/fr/u_paris/gla/project/utils/GPS.java index 0eb7130..678fc3a 100644 --- a/src/main/java/fr/u_paris/gla/project/utils/GPS.java +++ b/src/main/java/fr/u_paris/gla/project/utils/GPS.java @@ -8,8 +8,10 @@ package fr.u_paris.gla.project.utils; * @author Emmanuel Bigeon */ public final class GPS { + /** The value of a flat angle, in degrees. */ + private static final int FLAT_ANGLE_DEGREE = 180; /** The (approximated) earth radius in km. */ - private static final double EARTH_RADIUS = 6_370.0; + private static final double EARTH_RADIUS = 6_370.0; /** Hidden constructor for tool class */ private GPS() { @@ -20,8 +22,8 @@ public final class GPS { * * @param degree the degree value * @return the radian value */ - private static final double degreeToRadian(double degree) { - return degree / 180 * Math.PI; + private static double degreeToRadian(double degree) { + return degree / FLAT_ANGLE_DEGREE * Math.PI; } /** Compute the flying distance between two GPS positions. diff --git a/src/main/resources-filtered/fr/u_paris/gla/project/application.properties b/src/main/resources-filtered/fr/u_paris/gla/project/application.properties index 7436703..c5f9333 100644 --- a/src/main/resources-filtered/fr/u_paris/gla/project/application.properties +++ b/src/main/resources-filtered/fr/u_paris/gla/project/application.properties @@ -1,3 +1,3 @@ app.name=${name} app.version=${version} -app.team=No team \ No newline at end of file +app.team=Team 3 \ No newline at end of file