From 8d54cda286dacc0b1a518de55d3b9ea32cf9e91b Mon Sep 17 00:00:00 2001 From: Vincent COUVERT Date: Fri, 14 Mar 2014 11:43:42 +0100 Subject: [PATCH] Update Copyright + Do not generate files if propertiesMap not changed Change-Id: Ide0314822349901b118d47b6d2d32f330d939258 --- .../includes/graphicObjectProperties.h | 3 +- .../graphicObject/GraphicObjectProperties.java | 3 +- .../src/scripts/genPropertiesName.sh | 49 ++++++++++++-------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/scilab/modules/graphic_objects/includes/graphicObjectProperties.h b/scilab/modules/graphic_objects/includes/graphicObjectProperties.h index 48fa23a..b9dcfa9 100755 --- a/scilab/modules/graphic_objects/includes/graphicObjectProperties.h +++ b/scilab/modules/graphic_objects/includes/graphicObjectProperties.h @@ -1,6 +1,7 @@ /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET + * Copyright (C) 2010-2012 - DIGITEO - Bruno JOFRET + * Copyright (C) 2012-2014 - DIGITEO - Bruno JOFRET * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which diff --git a/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java b/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java index 10b69b6..745db30 100755 --- a/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java +++ b/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java @@ -1,6 +1,7 @@ /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET + * Copyright (C) 2010-2012 - DIGITEO - Bruno JOFRET + * Copyright (C) 2012-2014 - DIGITEO - Bruno JOFRET * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which diff --git a/scilab/modules/graphic_objects/src/scripts/genPropertiesName.sh b/scilab/modules/graphic_objects/src/scripts/genPropertiesName.sh index e4b3b8b..26dd70c 100755 --- a/scilab/modules/graphic_objects/src/scripts/genPropertiesName.sh +++ b/scilab/modules/graphic_objects/src/scripts/genPropertiesName.sh @@ -32,38 +32,47 @@ main() generateJavaFile() { - echo "-- Building includes/graphicObjectProperties.java --" - generateHeader - echo "package org.scilab.modules.graphic_objects.graphicObject;" >> $OutFile - echo "" >> $OutFile - echo "public class GraphicObjectProperties {" >> $OutFile - echo "" >> $OutFile + if test $PropertiesFile -nt $OutFile; then + echo "-- Building GraphicObjectProperties.java --" + generateHeader + echo "package org.scilab.modules.graphic_objects.graphicObject;" >> $OutFile + echo "" >> $OutFile + echo "public class GraphicObjectProperties {" >> $OutFile + echo "" >> $OutFile - awk 'BEGIN {num=0} (NF > 0) {printf " public static final int %s = %d;\n", $1, num; num++}' < $PropertiesFile >> $OutFile + awk 'BEGIN {num=0} (NF > 0) {printf " public static final int %s = %d;\n", $1, num; num++}' < $PropertiesFile >> $OutFile - echo "" >> $OutFile - echo "}" >> $OutFile + echo "" >> $OutFile + echo "}" >> $OutFile + else + echo "-- GraphicObjectProperties.java already up-to-date --" + fi } generateCFile() { - echo "-- Building GraphicObjectProperties.h --" - generateHeader - echo "#ifndef __GRAPHIC_OBJECT_PROPERTIES_H__" >> $OutFile - echo "#define __GRAPHIC_OBJECT_PROPERTIES_H__" >> $OutFile - echo "" >> $OutFile - - awk 'BEGIN {num=0} (NF > 0) {printf "#define %s %d\n", $1, num; num++}' < $PropertiesFile >> $OutFile - - echo "" >> $OutFile - echo "#endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */" >> $OutFile + if test $PropertiesFile -nt $OutFile; then + echo "-- Building GraphicObjectProperties.h --" + generateHeader + echo "#ifndef __GRAPHIC_OBJECT_PROPERTIES_H__" >> $OutFile + echo "#define __GRAPHIC_OBJECT_PROPERTIES_H__" >> $OutFile + echo "" >> $OutFile + + awk 'BEGIN {num=0} (NF > 0) {printf "#define %s %d\n", $1, num; num++}' < $PropertiesFile >> $OutFile + + echo "" >> $OutFile + echo "#endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */" >> $OutFile + else + echo "-- GraphicObjectProperties.h already up-to-date --" + fi } generateHeader() { echo "/*" > $OutFile echo " * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab" >> $OutFile - echo " * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET" >> $OutFile + echo " * Copyright (C) 2010-2012 - DIGITEO - Bruno JOFRET" >> $OutFile + echo " * Copyright (C) 2012-2014 - Scilab-Enterprises - Bruno JOFRET" >> $OutFile echo " *" >> $OutFile echo " * This file must be used under the terms of the CeCILL." >> $OutFile echo " * This source file is licensed as described in the file COPYING, which" >> $OutFile -- 1.7.9.5