Introduce smell generator plus some small fixes
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 15:58:35 +0000 (15:58 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 15:58:35 +0000 (15:58 +0000)
CMakeLists.txt
PWG2/CMakelibPWG2forward2.pkg
cmake/ALICE_CMake.cmake
cmake/CMakelinuxx8664gcc.cmake
cmake/FindRuleChecker.cmake

index b49429c..78d5f24 100644 (file)
@@ -215,6 +215,7 @@ add_custom_target(include-headers ALL)
 add_custom_target(DA-all)
 add_custom_target(check-all) 
 add_custom_target(check-hxml)
+add_custom_target(smell-all) 
 add_custom_target(par-all)
 add_custom_target(test-par-all)
 
index da9f483..2c2579d 100644 (file)
@@ -106,7 +106,6 @@ install ( FILES FORWARD/analysis2/AddTaskCentralMult.C
                 FORWARD/analysis2/AddTaskFMD.C
                FORWARD/analysis2/AddTaskFMDELoss.C
                FORWARD/analysis2/AddTaskForwarddNdeta.C
-               FORWARD/analysis2/AddTaskCentraldNdeta.C
                FORWARD/analysis2/DrawdNdeta.C
                 FORWARD/analysis2/MakeAOD.C
                FORWARD/analysis2/MakedNdeta.C
index 67e3fb8..5d04bad 100644 (file)
@@ -557,8 +557,8 @@ macro(ALICE_CopyHeaders)
     set(_headersdep)
     foreach(header ${HEADERS})
       add_custom_command(OUTPUT ${PEXPORTDEST}/${header}
-                         COMMAND ${CMAKE_COMMAND} -E copy ${ALICE_ROOT}/${MODULE}/${header} ${PEXPORTDEST}/${header}
-                        DEPENDS ${ALICE_ROOT}/${MODULE}/${header})
+                         COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/${MODULE}/${header} ${PEXPORTDEST}/${header}
+                        DEPENDS ${CMAKE_SOURCE_DIR}/${MODULE}/${header})
       list(APPEND _headersdep ${PEXPORTDEST}/${header})
       install(FILES ${header} DESTINATION include)
     endforeach(header)
@@ -586,7 +586,6 @@ endmacro(ALICE_GenerateLinkDef)
 
 macro(ALICE_BuildPAR)
   
-  # if(EXISTS ${ALICE_ROOT}/${MODULE}/PROOF-INF.${PACKAGE})
   if(EXISTS ${CMAKE_SOURCE_DIR}/${MODULE}/PROOF-INF.${PACKAGE})
     set(PARSRCS)
     foreach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR})
index c25cf29..8cd3a03 100644 (file)
@@ -1,3 +1,5 @@
+# -*- mode: cmake -*-
+
 #--------------------------------------------------------------------------------#
 # Linuxx8664gcc CMake System configuration file for the AliRoot Build System     #
 #                                                                                # 
index 64a78b0..d64902b 100644 (file)
@@ -24,11 +24,13 @@ if(IRST_INSTALLDIR)
   find_file(RULECHECKER_JAR NAMES NewRuleChecker.jar PATHS ${IRST_INSTALLDIR}/NewRuleChecker NO_DEFAULT_PATH)
   find_file(RULECHECKER_RULES NAMES CodingConventions.xml PATHS ${IRST_INSTALLDIR}/NewRuleChecker/config NO_DEFAULT_PATH)
   find_file(FACTEXTRACTOR_JAR NAMES FactExtractor.jar PATHS ${IRST_INSTALLDIR}/FactExtractor NO_DEFAULT_PATH)
-  if(RULECHECKER_JAR AND RULECHECKER_RULES AND RULECHECKER_SRCML AND JAVA_RUNTIME)
+  find_file(SMELLDETECTOR_JAR NAMES SmellDetector.jar PATHS ${IRST_INSTALLDIR} NO_DEFAULT_PATH)
+  if(RULECHECKER_JAR AND RULECHECKER_RULES AND RULECHECKER_SRCML AND JAVA_RUNTIME AND SMELLDETECTOR_JAR)
     set(RULECHECKER_FOUND TRUE)
-    message(STATUS "RuleChecker jar : ${RULECHECKER_JAR}")
-    message(STATUS "RuleChecker rules : ${RULECHECKER_RULES}")
+    message(STATUS "RuleChecker jar :           ${RULECHECKER_JAR}")
+    message(STATUS "RuleChecker rules :         ${RULECHECKER_RULES}")
     message(STATUS "RuleChecker factextractor : ${FACTEXTRACTOR_JAR}")
+    message(STATUS "RuleChecker smelldetector : ${SMELLDETECTOR_JAR}")
     message(STATUS "RuleChecker found on the system")
 
     if(NOT EXISTS ${CMAKE_BINARY_DIR}/check-hxml-touchfile)
@@ -55,7 +57,7 @@ if(IRST_INSTALLDIR)
     endforeach(_root_header ${_root_headers})
   else()
     message(STATUS "RuleChecker not found on this system")
-  endif(RULECHECKER_JAR AND RULECHECKER_RULES AND RULECHECKER_SRCML AND JAVA_RUNTIME)
+  endif(RULECHECKER_JAR AND RULECHECKER_RULES AND RULECHECKER_SRCML AND JAVA_RUNTIME AND SMELLDETECTOR_JAR)
 else()
   message(STATUS "RuleChecker not found on this system")
 endif(IRST_INSTALLDIR)
@@ -76,14 +78,17 @@ macro(ALICE_CheckModule)
     list(SORT _sources)
 
     set(_violfiles)
+    set(_smellfiles)
     set(_module_factfile_deps)
     foreach(_srcfile ${_sources})
       if(NOT _srcfile MATCHES "^.*LinkDef$" AND NOT _srcfile MATCHES ".*PYTHIA8/pythia8.*")
        set(_violdeps)
        string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" _srcfile_short ${_srcfile})
        set(_viol ${CHECKDIR}/${_srcfile_short}.viol)
+       set(_smell ${CHECKDIR}/${_srcfile_short}.smell)
        get_filename_component(_viol_path ${_viol} PATH)
        list(APPEND _violfiles ${_viol})
+       list(APPEND _smellfiles ${_smell})
        if(EXISTS ${_srcfile}.h)
          add_custom_command(OUTPUT ${CHECKDIR}/${_srcfile_short}.h.xml
                             COMMAND ${CMAKE_COMMAND} -E make_directory ${_viol_path}
@@ -104,15 +109,21 @@ macro(ALICE_CheckModule)
                             COMMAND ${JAVA_RUNTIME} -Xmx1024M -jar ${RULECHECKER_JAR} ${CHECKDIR}/${_srcfile_short}.cxx.xml ${CHECKDIR}/${_srcfile_short}.h.xml ${FACTFILE} ${RULECHECKER_RULES} > ${_viol}
                             DEPENDS ${_violdeps}
                             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+       add_custom_command( OUTPUT ${_smell}
+                            COMMAND ${JAVA_RUNTIME} -Xmx1024M -jar ${SMELLDETECTOR_JAR} ${CHECKDIR}/${_srcfile_short}.cxx.xml ${CHECKDIR}/${_srcfile_short}.h.xml > ${_smell}
+                            DEPENDS ${_violdeps}
+                            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
       endif(NOT _srcfile MATCHES "^.*LinkDef$" AND NOT _srcfile MATCHES ".*PYTHIA8/pythia8.*")
     endforeach(_srcfile ${_sources})
 
-
     if(_violfiles)
       add_custom_target(${MODULE}-check DEPENDS ${_violfiles})
       add_dependencies(${MODULE}-check factfile)
       add_dependencies(check-all ${MODULE}-check)
 
+      add_custom_target(${MODULE}-smell DEPENDS ${_smellfiles})
+      add_dependencies(smell-all ${MODULE}-smell)
+
       if(_module_factfile_deps)
        add_custom_target(${MODULE}-hxml DEPENDS ${_module_factfile_deps})
        add_dependencies(check-hxml ${MODULE}-hxml)