X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fappli%2FbbCreatePackage%2FbbCreatePackage.bat.in;h=18d6186fae6c07e74c5e5229cb128d377dba2020;hb=d2b20f96a780fa2441c9e1412860394f653e37b6;hp=c72ae29d930eab5528326814e92dbc397a86b9e2;hpb=a26195c366a89795288009cf7e20f11afa494970;p=bbtk.git diff --git a/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in b/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in index c72ae29..18d6186 100755 --- a/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in +++ b/kernel/appli/bbCreatePackage/bbCreatePackage.bat.in @@ -1,3 +1,29 @@ +rem # --------------------------------------------------------------------- +rem # +rem # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +rem # pour la SantÈ) +rem # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +rem # Previous Authors : Laurent Guigues, Jean-Pierre Roux +rem # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +rem # +rem # This software is governed by the CeCILL-B license under French law and +rem # abiding by the rules of distribution of free software. You can use, +rem # modify and/ or redistribute the software under the terms of the CeCILL-B +rem # license as circulated by CEA, CNRS and INRIA at the following URL +rem # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +rem # or in the file LICENSE.txt. +rem # +rem # As a counterpart to the access to the source code and rights to copy, +rem # modify and redistribute granted by the license, users are provided only +rem # with a limited warranty and the software's author, the holder of the +rem # economic rights, and the successive licensors have only limited +rem # liability. +rem # +rem # The fact that you are presently reading this means that you have had +rem # knowledge of the CeCILL-B license and that you accept its terms. +rem # ------------------------------------------------------------------------ */ +rem + @echo off echo creates the file architecture for a new user package @@ -6,43 +32,56 @@ echo creates the file architecture for a new user package if %0%1==%0 goto ERROR01 -set BBTKINPUT="@bbCreatePackage_DATA_PATH@" -set BBTKOUTPUT=%1 - - -echo "----- Creating black box package '%BBTKNAME%' in repository '%BBTKOUTPUT%' -----" +rem bbCreatePackage path +set BINPATH=%~dp0 +rem Input data path +set INPUT="%BINPATH%\@bbCreatePackage_DATA_REL_PATH_FROM_BIN@\void-Package" +set OUTPUT=%1 +set PACK=%2 +set AUTHOR=%3 +set DESCRIPTION=%4 +set PACK_DIRECTORY=bbtk_%PACK%_PKG -IF EXIST %BBTKOUTPUT% GOTO ERROR02 +echo output= %OUTPUT% +echo bin = %BINPATH% +echo input = %INPUT% +echo pack = %PACK% +echo author = %AUTHOR% +echo description = %DESCRIPTION% +echo pack_directory = %PACK_DIRECTORY% -echo "-> Packages repository '%BBTKOUTPUT%' does not exist : creating it" -mkdir %BBTKOUTPUT% +IF EXIST %OUTPUT%\%PACK_DIRECTORY% GOTO ERROR02 +echo "** Creating new black box package '%PACK%' in folder '%OUTPUT%'" +mkdir %OUTPUT%\%PACK_DIRECTORY% +xcopy %INPUT% %OUTPUT%\%PACK_DIRECTORY% /S +"%BINPATH%\bbSed" %OUTPUT%\%PACK_DIRECTORY%\CMakeLists.txt WITHOUT_NAME "%PACK%" > %OUTPUT%\%PACK_DIRECTORY%\CMakeLists2.txt +"%BINPATH%\bbSed" %OUTPUT%\%PACK_DIRECTORY%\CMakeLists2.txt WITHOUT_AUTHOR %AUTHOR% > %OUTPUT%\%PACK_DIRECTORY%\CMakeLists3.txt +"%BINPATH%\bbSed" %OUTPUT%\%PACK_DIRECTORY%\CMakeLists3.txt WITHOUT_DESCRIPTION %DESCRIPTION% > %OUTPUT%\%PACK_DIRECTORY%\CMakeLists.txt +del "%OUTPUT%\%PACK_DIRECTORY%\CMakeLists2.txt" +del "%OUTPUT%\%PACK_DIRECTORY%\CMakeLists3.txt" - echo "-> Creating file '%BBTKOUTPUT%/CMakeLists.txt' " - copy %BBTKINPUT%\PackageCMakeLists.txt %BBTKOUTPUT%\CMakeLists.txt - echo "-> Creating file directory '%BBTKOUTPUT%/cmake' " - mkdir %BBTKOUTPUT%\cmake - echo "-> Coping files in '%BBTKOUTPUT%/cmake' " - copy %BBTKINPUT%\cmake\*.cmake %BBTKOUTPUT%\cmake - copy %BBTKINPUT%\cmake\*.in %BBTKOUTPUT%\cmake - -echo "Done !" -echo "Edit the file '%BBTKOUTPUT%/CMakeLists.txt' to customize your package" +echo +echo "Package created !" +echo +echo ==> +echo "==> Edit the file '%OUTPUT%\%PACK_DIRECTORY%\CMakeLists.txt' to customize your package" +echo ==> +echo +echo goto END - - :ERROR01 -echo bbCreatePackage.bat "" +echo bbCreatePackage.bat " [author] [description] " goto END :ERROR02 -echo "ERROR : Directory '%BBTKOUTPUT%/%BBTKNAME%' already exists !" +echo "ERROR : Directory '%OUTPUT%/%PACK_DIRECTORY%' already exists !" goto end