Remove source file comments using IntelliJ?

后端 未结 6 1225
醉话见心
醉话见心 2020-11-29 16:47

Is there a plugin or tool in IntelliJ that will strip all comments out of your source .java files? I\'ve read about an ANT task that can do this.. was looking to do the sa

6条回答
  •  旧巷少年郎
    2020-11-29 17:25

    My solution is:

    find . -name *.java -type f -exec sh -c "perl -0pe 's#/\*(.|\n)*?\*/##g; s|//.*?\n|\n|g' '{}' > temp.java; cat temp.java > {} ; rm temp.java;" \;
    

提交回复
热议问题