Repository: incubator-distributedlog Updated Branches: refs/heads/master ea3c1143f -> 7fab246d9
DL-4: Add repackaging script this pull request only contains the script to repackage files. run it at the root directory of the project - **./scripts/dev/repackage.sh** once the script is done, run "**mvn clean apache-rat:check package windbags:check**" to verify everything work. then you can commit the changes with the modified files. /cc leighst sijie Author: Khurrum Nasim <khurrumnas...@gmail.com> Reviewers: Sijie Guo <si...@apache.org> Closes #95 from khurrumnasimm/kn/repackaging_script Project: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/commit/7fab246d Tree: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/tree/7fab246d Diff: http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/diff/7fab246d Branch: refs/heads/master Commit: 7fab246d96a20c6ae3f7086e2890a42eb7eaf6fb Parents: ea3c114 Author: Khurrum Nasim <khurrumnas...@gmail.com> Authored: Wed Jan 4 16:12:52 2017 -0800 Committer: Sijie Guo <sij...@twitter.com> Committed: Wed Jan 4 16:12:52 2017 -0800 ---------------------------------------------------------------------- .../resources/distributedlog/checkstyle.xml | 8 +++- scripts/dev/repackage.sh | 40 ++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/7fab246d/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml ---------------------------------------------------------------------- diff --git a/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml b/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml index db3549f..e520b2c 100644 --- a/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml +++ b/distributedlog-build-tools/src/main/resources/distributedlog/checkstyle.xml @@ -87,16 +87,22 @@ page at http://checkstyle.sourceforge.net/config.html --> value="Redundant import {0}."/> </module> + <!-- TODO: disable checkstyle for sort imports for repacking. re-enable it after the packages are renamed. + {@link https://issues.apache.org/jira/browse/DL-168} <module name="ImportOrder"> - <!-- Checks for out of order import statements. --> + --><!-- Checks for out of order import statements. --> + <!-- <property name="severity" value="error"/> + --> <!-- This ensures that static imports go first. --> + <!-- <property name="option" value="top"/> <property name="sortStaticImportsAlphabetically" value="true"/> <property name="tokens" value="STATIC_IMPORT, IMPORT"/> <message key="import.ordering" value="Import {0} appears after other imports that it should precede"/> </module> + --> <module name="AvoidStarImport"> <property name="severity" value="error"/> http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/7fab246d/scripts/dev/repackage.sh ---------------------------------------------------------------------- diff --git a/scripts/dev/repackage.sh b/scripts/dev/repackage.sh new file mode 100755 index 0000000..cb55399 --- /dev/null +++ b/scripts/dev/repackage.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +for module in distributedlog-benchmark distributedlog-client distributedlog-core distributedlog-protocol distributedlog-service distributedlog-tutorials/distributedlog-basic distributedlog-tutorials/distributedlog-kafka distributedlog-tutorials/distributedlog-messaging distributedlog-tutorials/distributedlog-mapreduce; do + echo "Repackaging module ${module}" + if [[ -d "${module}/src/main/java/com/twitter/distributedlog" ]]; then + mkdir -p ${module}/src/main/java/org/apache/distributedlog + git mv ${module}/src/main/java/com/twitter/distributedlog/* ${module}/src/main/java/org/apache/distributedlog/ + fi + if [[ -d "${module}/src/test/java/com/twitter/distributedlog" ]]; then + mkdir -p ${module}/src/test/java/org/apache/distributedlog + git mv ${module}/src/test/java/com/twitter/distributedlog/* ${module}/src/test/java/org/apache/distributedlog/ + fi +done + +for file in `find . -type f -name '*.*'`; do + echo ${file} + sed -i "" 's/com\.twitter\.distributedlog/org.apache.distributedlog/g' ${file} +done + +for file in `find . -type f -name 'findbugsExclude.xml'`; do + echo ${file} + sed -i "" 's/com\\\.twitter\\\.distributedlog/org\\\.apache\\\.distributedlog/g' ${file} +done