Updated Branches: refs/heads/master 299872ab6 -> 28ac4b750
changing adding license header to not preserve backup files Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a977952e Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a977952e Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a977952e Branch: refs/heads/master Commit: a977952e6b724976ffbf689da6f65ca077c9a2cb Parents: 299872a Author: Suresh Marru <[email protected]> Authored: Sat Feb 8 18:46:46 2014 -0500 Committer: Suresh Marru <[email protected]> Committed: Sat Feb 8 18:46:46 2014 -0500 ---------------------------------------------------------------------- airavata-api/generate-thrift-files.sh | 37 +++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/a977952e/airavata-api/generate-thrift-files.sh ---------------------------------------------------------------------- diff --git a/airavata-api/generate-thrift-files.sh b/airavata-api/generate-thrift-files.sh index 3863bc5..95b1d64 100755 --- a/airavata-api/generate-thrift-files.sh +++ b/airavata-api/generate-thrift-files.sh @@ -43,8 +43,9 @@ add_license_header() { GENERATED_CODE_DIR=$1 # For all generated thrift code, add the suppress all warnings annotation - find $GENERATED_CODE_DIR -name '*.java' -print0 | xargs -0 sed -i.orig -e 's/public class /@SuppressWarnings("all") public class /' - find $GENERATED_CODE_DIR -name '*.java' -print0 | xargs -0 sed -i.orig -e 's/public enum /@SuppressWarnings("all") public enum /' + # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' + find $GENERATED_CODE_DIR -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' + find $GENERATED_CODE_DIR -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' # For each java file within the genrated directory, add the ASF V2 LICENSE header for f in $(find $GENERATED_CODE_DIR -name '*.java'); do @@ -66,6 +67,7 @@ add_license_header() { * limitations under the License. */ EOF + mv ${f}-with-license $f done } @@ -77,18 +79,21 @@ copy_changed_files() { # Read all the funcation arguments GENERATED_CODE_DIR=$1 - EXISTING_SRC_DIR=$2 - - SDIR="${GENERATED_CODE_DIR}/org/apache/airavata/model/experiment" - DDIR="${EXISTING_SRC_DIR}/org/apache/airavata/model/experiment" - mkdir -p "$DDIR" - for f in "$SDIR"/*.java; do - DEST="$DDIR/`basename $f`" - if ! cmp -s "${f}-with-license" "${DEST}" ; then - echo "Copying ${f}-with-license to ${DEST}" - cp -f "${f}-with-license" "${DEST}" || fail unable to copy files to java workspace - fi - done + WORKSPACE_SRC_DIR=$2 + + echo "Generated sources are in $GENERATED_CODE_DIR" + echo "Destination workspace is in $WORKSPACE_SRC_DIR" + +# SDIR="${GENERATED_CODE_DIR}/org/apache/airavata/model/experiment" +# DDIR="${EXISTING_SRC_DIR}/org/apache/airavata/model/experiment" +# mkdir -p "$DDIR" +# for f in "$SDIR"/*.java; do +# DEST="$DDIR/`basename $f`" +# if ! cmp -s "${f}-with-license" "${DEST}" ; then +# echo "Copying ${f}-with-license to ${DEST}" +# cp -f "${f}-with-license" "${DEST}" || fail unable to copy files to java workspace +# fi +# done } # Generation of thrift files will require installing Apache Thrift. Please add thrift to your path. @@ -127,10 +132,10 @@ thrift ${THRIFT_ARGS} --gen java $THRIFT_IDL_DIR/airavataAPI.thrift || fail unab add_license_header $JAVA_GEN_DIR # Compare the newly generated classes with existing server skelton sources and replace the changed ones. -copy_changed_files $JAVA_GEN_DIR $SERVER_SRC_DIR +#copy_changed_files $JAVA_GEN_DIR $SERVER_SRC_DIR # Compare the newly generated classes with existing java client stub sources and replace the changed ones. -copy_changed_files $JAVA_GEN_DIR $JAVA_CLIENT_SRC_DIR +#copy_changed_files $JAVA_GEN_DIR $JAVA_CLIENT_SRC_DIR ############################## # Update Airavata Data Model #
