Skip to content

Instantly share code, notes, and snippets.

@jpcaruana
Last active December 2, 2017 14:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jpcaruana/774597 to your computer and use it in GitHub Desktop.
Save jpcaruana/774597 to your computer and use it in GitHub Desktop.
utiliser buildr pour créer un projet minimal
#!/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
#!/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
@jpcaruana
Copy link
Author

un argument : le nom du projet à créer
il faut ensuite répondre '1' à la question de buildr

@jpcaruana
Copy link
Author

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

@jpcaruana
Copy link
Author

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