Skip to content

Instantly share code, notes, and snippets.

@myok12
Created May 10, 2018 00:59
Show Gist options
  • Save myok12/4623f2a22eed3626c15b5a89d9a2f7da to your computer and use it in GitHub Desktop.
Save myok12/4623f2a22eed3626c15b5a89d9a2f7da to your computer and use it in GitHub Desktop.
Add package_info.java files to project
find . -name '*.java' | grep -v "\/target\/" | grep java | rev | cut -f "2-" -d "/" | rev | sort | uniq | xargs -I{} sh -c 'echo "$1" | grep -o "java\/.*" | cut -f "2-" -d "/" | tr "/" "." | awk '"'"'{print "package "$1";"}'"'"' > "$1/package-info.java" ' -- {}
git status | grep package-info | xargs -I{} sh -c 'echo "@javax.annotation.ParametersAreNonnullByDefault" | cat - "$1" > /tmp/tttt ; mv /tmp/tttt "$1"' -- {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment