🔒 Nettoyage du code
This commit is contained in:
parent
91906e2afb
commit
d42a020c63
Binary file not shown.
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 balocchi
|
Copyright (c) 2024 Juliette CHARPENTIER, Loris BALOCCHI, Luc DARTOIS
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
# Définir le chemin de base du projet
|
|
||||||
$projectPath = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA"
|
|
||||||
$binPath = "$projectPath\bin"
|
|
||||||
|
|
||||||
# Naviguer au répertoire racine du projet
|
|
||||||
cd $projectPath
|
|
||||||
|
|
||||||
# Afficher un message de lancement
|
|
||||||
Write-Host "Jeu lancé."
|
|
||||||
|
|
||||||
# Exécuter la classe principale
|
|
||||||
java -classpath $binPath com.charpentierbalocchi.dorfjavatik.main.DorfJavaTik
|
|
||||||
|
|
||||||
# Afficher un message de fin
|
|
||||||
Write-Host "Jeu fermé."
|
|
@ -1 +0,0 @@
|
|||||||
Main-Class: com.charpentierbalocchi.dorfjavatik.view.FenetreDemarrage
|
|
@ -1,29 +0,0 @@
|
|||||||
# Script de Compilation pour PowerShell
|
|
||||||
|
|
||||||
# Définir le chemin de base du projet
|
|
||||||
$projectPath = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\src"
|
|
||||||
$outputDir = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\bin" # Dossier pour les fichiers .class
|
|
||||||
$resourcesPath = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\src\com\charpentierbalocchi\dorfjavatik\resources\"
|
|
||||||
$resourcesOutputDir = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\bin\com\charpentierbalocchi\dorfjavatik\resources\" # Dossier pour les ressources
|
|
||||||
|
|
||||||
# Créer le dossier de sortie s'il n'existe pas
|
|
||||||
if (-not (Test-Path $outputDir)) {
|
|
||||||
New-Item -Path $outputDir -ItemType Directory
|
|
||||||
}
|
|
||||||
|
|
||||||
# Naviguer au répertoire racine du projet
|
|
||||||
Set-Location $projectPath
|
|
||||||
|
|
||||||
# Compiler tous les fichiers Java en spécifiant le dossier de sortie pour les fichiers .class et en utilisant UTF-8 pour l'encodage
|
|
||||||
# javac -d $outputDir -encoding UTF-8 (Get-ChildItem -Path $projectPath -Recurse -Filter *.java).FullName
|
|
||||||
|
|
||||||
# Copier les ressources dans le répertoire de sortie
|
|
||||||
if (-not (Test-Path $resourcesOutputDir)) {
|
|
||||||
New-Item -Path $resourcesOutputDir -ItemType Directory
|
|
||||||
}
|
|
||||||
Copy-Item -Path $resourcesPath* -Destination $resourcesOutputDir -Recurse -Force
|
|
||||||
|
|
||||||
# Afficher un message de fin
|
|
||||||
Write-Host "Compilation terminée avec succès. Les fichiers .class et les ressources sont dans le dossier '$outputDir'."
|
|
||||||
|
|
||||||
cd ..
|
|
@ -1,37 +0,0 @@
|
|||||||
# Script de Compilation pour PowerShell
|
|
||||||
|
|
||||||
# Définir le chemin de base du projet
|
|
||||||
$projectPath = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\src"
|
|
||||||
$outputDir = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\bin" # Dossier pour les fichiers .class
|
|
||||||
$resourcesPath = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\src\com\charpentierbalocchi\dorfjavatik\resources\"
|
|
||||||
$resourcesOutputDir = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\bin\com\charpentierbalocchi\dorfjavatik\resources\" # Dossier pour les ressources
|
|
||||||
$manifestPath = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\MANIFEST.MF"
|
|
||||||
$jarFile = "C:\Users\Loris\OneDrive - UPEC\Documents\DEV\SAE_DEV_JAVA\DorfJavaTik.jar"
|
|
||||||
$jdkBinPath = "C:\Program Files\Java\jdk-17\bin" # Remplacer par le chemin correct vers le dossier bin du JDK
|
|
||||||
|
|
||||||
# Créer le dossier de sortie s'il n'existe pas
|
|
||||||
if (-not (Test-Path $outputDir)) {
|
|
||||||
New-Item -Path $outputDir -ItemType Directory
|
|
||||||
}
|
|
||||||
|
|
||||||
# Naviguer au répertoire racine du projet
|
|
||||||
Set-Location $projectPath
|
|
||||||
|
|
||||||
# Compiler tous les fichiers Java en spécifiant le dossier de sortie pour les fichiers .class et en utilisant UTF-8 pour l'encodage
|
|
||||||
javac -d $outputDir -encoding UTF-8 (Get-ChildItem -Path $projectPath -Recurse -Filter *.java).FullName
|
|
||||||
|
|
||||||
# Copier les ressources dans le répertoire de sortie
|
|
||||||
if (-not (Test-Path $resourcesOutputDir)) {
|
|
||||||
New-Item -Path $resourcesOutputDir -ItemType Directory
|
|
||||||
}
|
|
||||||
Copy-Item -Path $resourcesPath* -Destination $resourcesOutputDir -Recurse -Force
|
|
||||||
|
|
||||||
# Créer le fichier JAR exécutable
|
|
||||||
Set-Location $outputDir
|
|
||||||
& "$jdkBinPath\jar.exe" cfm $jarFile $manifestPath -C $outputDir .
|
|
||||||
|
|
||||||
# Afficher un message de fin
|
|
||||||
Write-Host "Compilation terminée avec succès. Les fichiers .class et les ressources sont dans le dossier '$outputDir'."
|
|
||||||
Write-Host "Le fichier JAR exécutable a été créé : '$jarFile'."
|
|
||||||
|
|
||||||
cd ..
|
|
38
makefile
38
makefile
@ -1,27 +1,43 @@
|
|||||||
# Variables
|
# Variables
|
||||||
SRC_DIR = src
|
SRC_DIR = src
|
||||||
BIN_DIR = bin
|
BIN_DIR = bin
|
||||||
|
RES_DIR = $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/resources
|
||||||
|
JAR_FILE = $(BIN_DIR)/DorfJavaTik.jar
|
||||||
JAVAC = javac
|
JAVAC = javac
|
||||||
JAVA = java
|
JAVA = java
|
||||||
JAVADOC = javadoc
|
JAVADOC = javadoc
|
||||||
MAIN = com.charpentierbalocchi.dorfjavatik.view.FenetreDemarrage
|
MAIN = com.charpentierbalocchi.dorfjavatik.view.FenetreDemarrage
|
||||||
|
|
||||||
# Compilation flags
|
# Compilation flags
|
||||||
JFLAGS = -d $(BIN_DIR) -sourcepath $(SRC_DIR)
|
JFLAGS = -d $(BIN_DIR) -encoding UTF-8 -sourcepath $(SRC_DIR)
|
||||||
|
JARFLAGS = cfe
|
||||||
|
|
||||||
# Default rule
|
# Default rule
|
||||||
all: compile
|
all: clean compile copy-resources jar
|
||||||
|
|
||||||
# Rule to compile the java files
|
# Rule to compile the java files
|
||||||
compile:
|
compile:
|
||||||
@echo "Compiling Java source files..."
|
@echo "Compilation des fichiers source java..."
|
||||||
@mkdir -p $(BIN_DIR)
|
@if not exist "$(BIN_DIR)" mkdir $(BIN_DIR)
|
||||||
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/**/*.java
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/controller/*.java
|
||||||
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/model/*.java
|
||||||
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/util/*.java
|
||||||
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/view/*.java
|
||||||
|
|
||||||
|
# Rule to copy resources
|
||||||
|
copy-resources:
|
||||||
|
@echo "Copying resources..."
|
||||||
|
@xcopy /Y /I "$(RES_DIR)" "$(BIN_DIR)\com\charpentierbalocchi\dorfjavatik\resources\"
|
||||||
|
|
||||||
|
# Rule to create the jar file
|
||||||
|
jar: compile
|
||||||
|
@echo "Création du fichier .jar ..."
|
||||||
|
@jar $(JARFLAGS) $(JAR_FILE) $(MAIN) -C $(BIN_DIR) .
|
||||||
|
|
||||||
# Rule to run the application
|
# Rule to run the application
|
||||||
run: compile
|
run: jar
|
||||||
@echo "Running the application..."
|
@echo "Lancement du jeu..."
|
||||||
@$(JAVA) -cp $(BIN_DIR) $(MAIN)
|
@$(JAVA) -jar $(JAR_FILE)
|
||||||
|
|
||||||
# Rule to generate Javadoc
|
# Rule to generate Javadoc
|
||||||
javadoc:
|
javadoc:
|
||||||
@ -30,7 +46,7 @@ javadoc:
|
|||||||
|
|
||||||
# Rule to clean the project
|
# Rule to clean the project
|
||||||
clean:
|
clean:
|
||||||
@echo "Cleaning up..."
|
@echo "Nettoyage en cours..."
|
||||||
@rm -rf $(BIN_DIR)
|
@if exist "$(BIN_DIR)" rd /s /q $(BIN_DIR)
|
||||||
|
|
||||||
.PHONY: all compile run javadoc clean
|
.PHONY: all compile run jar javadoc clean copy-resources
|
||||||
|
@ -35,7 +35,7 @@ public class FenetreDemarrage extends JFrame {
|
|||||||
try {
|
try {
|
||||||
int taille = Integer.parseInt(textField.getText());
|
int taille = Integer.parseInt(textField.getText());
|
||||||
if (taille == 1) {
|
if (taille == 1) {
|
||||||
String gifPath = "src/com/charpentierbalocchi/dorfjavatik/resources/image.gif";
|
String gifPath = "/com/charpentierbalocchi/dorfjavatik/resources/image.gif";
|
||||||
|
|
||||||
ImageIcon gifIcon = new ImageIcon(gifPath);
|
ImageIcon gifIcon = new ImageIcon(gifPath);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user