Last active
December 2, 2017 14:51
-
-
Save jpcaruana/774597 to your computer and use it in GitHub Desktop.
utiliser buildr pour créer un projet minimal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
projectName=$1 | |
if [[ $projectName == '' ]]; then | |
echo "usage: $0 nameOfTheProjectToCreate" | |
exit 1 | |
fi | |
mkdir $projectName | |
cd $projectName | |
mkdir -p src/main/java src/test/java | |
echo "class Empty{}" > src/main/java/Empty.java | |
echo "class EmptyTest{}" > src/test/java/EmptyTest.java | |
echo "Please answer '1' to the next question" | |
buildr | |
cd $projectName | |
buildr eclipse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
nomProjet=$1 | |
if [[ $nomProjet == '' ]]; then | |
echo "usage: $0 nomDuProjetACreer" | |
exit 1 | |
fi | |
mkdir $nomProjet | |
cd $nomProjet | |
mkdir -p src/main/java src/test/java | |
echo "class Vide{}" > src/main/java/Vide.java | |
echo "class VideTest{}" > src/test/java/VideTest.java | |
echo "Repondez '1' a la prochaine question" | |
buildr | |
cd $nomProjet | |
buildr eclipse |
si je crée 'monProjet', j'aurais l'arborescence suivante :
monProjet/ |-- .classpath |-- .project |-- buildfile |-- src | |-- main | | `-- java | | `-- Vide.java | `-- test | `-- java `-- target `-- classes `-- Vide.class 7 directories, 5 files
je ne sais pas pourquoi il faut faire une 2ème fois "cd $nomProjet" (avant dernière ligne) car normalement on doit déjà être au bon endroit...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
un argument : le nom du projet à créer
il faut ensuite répondre '1' à la question de buildr