diff --git a/.credo.exs b/.credo.exs index 59e5550feac..a983db7cd0d 100644 --- a/.credo.exs +++ b/.credo.exs @@ -22,25 +22,7 @@ # In the latter case `**/*.{ex,exs}` will be used. # included: ["lib/", "src/", "test/", "web/", "apps/"], - excluded: [ - ~r"/_build/", - ~r"/node_modules/", - ~r"/src/certifi/", - ~r"/src/excoveralls/", - ~r"/src/jason", - ~r"/src/hackney", - ~r"/src/httpotion", - ~r"/src/file_system", - ~r"/src/credo", - ~r"/src/idna", - ~r"/src/junit_formatter", - ~r"/src/bunt", - ~r"/src/metrics", - ~r"/src/minerl", - ~r"/src/parse_trans", - ~r"/src/ssl_verify_fun", - ~r"/test/elixir/deps/" - ] + excluded: [~r"/_build/"] }, # # If you create your own checks, you must specify the source files for diff --git a/.formatter.exs b/.formatter.exs index 28b883d5471..1129a796725 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -2,7 +2,7 @@ [ inputs: [ "{mix,.formatter}.exs", - "{config,src}/*/test/exunit/*.{ex,exs}" + "{config,apps}/*/test/exunit/*.{ex,exs}" ], line_length: 90, rename_deprecated_at: "1.5.0" diff --git a/.gitignore b/.gitignore index 4a02f57ceae..b017d6dbbc5 100644 --- a/.gitignore +++ b/.gitignore @@ -39,97 +39,102 @@ rel/tmpdata share/server/main-coffee.js share/server/main.js share/www -src/b64url/ -src/bear/ -src/certifi/ -src/config/ -src/couch/priv/couch_js/**/config.h -src/couch/priv/couchjs -src/couch/priv/couchspawnkillable -src/couch/priv/couch_ejson_compare/couch_ejson_compare.d -src/couch/priv/couch_js/**/*.d -src/couch/priv/icu_driver/couch_icu_driver.d -src/mango/src/mango_cursor_text.nocompile -src/docs/ -src/ets_lru/ -src/excoveralls/ -src/fauxton/ -src/folsom/ -src/hackney/ -src/hqueue/ -src/hyper/ -src/ibrowse/ -src/idna/ -src/jiffy/ -src/khash/ -src/meck/ -src/metrics/ -src/mimerl/ -src/mochiweb/ -src/oauth/ -src/parse_trans/ -src/proper/ -src/rebar/ -src/recon/ -src/snappy/ -src/ssl_verify_fun/ -src/triq/ -src/unicode_util_compat/ -src/file_system/ -src/rebar3/ -src/erlfmt/ +apps/b64url/ +apps/bear/ +apps/certifi/ +apps/config/ +apps/couch/priv/couch_js/**/config.h +apps/couch/priv/couchjs +apps/couch/priv/couchspawnkillable +apps/couch/priv/couch_ejson_compare/couch_ejson_compare.d +apps/couch/priv/couch_js/**/*.d +apps/couch/priv/icu_driver/couch_icu_driver.d +apps/mango/src/mango_cursor_text.nocompile +apps/docs/ +apps/ets_lru/ +apps/excoveralls/ +apps/fauxton/ +apps/folsom/ +apps/hackney/ +apps/hqueue/ +apps/hyper/ +apps/ibrowse/ +apps/idna/ +apps/jiffy/ +apps/khash/ +apps/meck/ +apps/metrics/ +apps/mimerl/ +apps/mochiweb/ +apps/oauth/ +apps/parse_trans/ +apps/proper/ +apps/rebar/ +apps/recon/ +apps/snappy/ +apps/ssl_verify_fun/ +apps/triq/ +apps/unicode_util_compat/ +apps/file_system/ +apps/rebar3/ +apps/erlfmt/ tmp/ -src/couch/*.o -src/couch/*.so -src/couch/ebin/ -src/couch/priv/couch_js/config.h -src/couch/priv/couchjs -src/couch/priv/couchspawnkillable -src/couch/priv/*.exp -src/couch/priv/*.lib -src/couch/priv/*.dll -src/couch/priv/*.exe -src/couch/vc120.pdb -src/couch_epi/ebin -src/couch_epi/erl_crash.dump -src/couch_event/deps/ -src/couch_event/ebin/ -src/couch_index/ebin -src/couch_log/ebin -src/couch_peruser/doc -src/couch_peruser/ebin -src/couch_peruser/deps -src/couch_peruser/couchperuser-* -src/couch_peruser/erl_crash.dump -src/couch_peruser/TEST-*.xml -src/couch_peruser/*.beam -src/couch_replicator/*.beam -src/couch_replicator/ebin/replicator.app -src/couch_replicator/.DS_Store -src/couch_stats/*~ -src/couch_stats/*.beam -src/couch_stats/deps -src/couch_stats/ebin -src/couch_stats/doc -src/couch_stats/.project -src/couch_tests/*.o -src/couch_tests/*.so -src/couch_tests/ebin/ -src/global_changes/ebin/ -src/mango/ebin/ -src/mango/test/*.pyc -src/mango/nosetests.xml -src/mango/venv/ -src/jwtf/.rebar3/ +apps/couch/*.o +apps/couch/*.so +apps/couch/ebin/ +apps/couch/priv/couch_js/config.h +apps/couch/priv/couchjs +apps/couch/priv/couchspawnkillable +apps/couch/priv/*.exp +apps/couch/priv/*.lib +apps/couch/priv/*.dll +apps/couch/priv/*.exe +apps/couch/vc120.pdb +apps/couch_epi/ebin +apps/couch_epi/erl_crash.dump +apps/couch_event/deps/ +apps/couch_event/ebin/ +apps/couch_index/ebin +apps/couch_log/ebin +apps/couch_peruser/doc +apps/couch_peruser/ebin +apps/couch_peruser/deps +apps/couch_peruser/couchperuser-* +apps/couch_peruser/erl_crash.dump +apps/couch_peruser/TEST-*.xml +apps/couch_peruser/*.beam +apps/couch_replicator/*.beam +apps/couch_replicator/ebin/replicator.app +apps/couch_replicator/.DS_Store +apps/couch_stats/*~ +apps/couch_stats/*.beam +apps/couch_stats/deps +apps/couch_stats/ebin +apps/couch_stats/doc +apps/couch_stats/.project +apps/couch_tests/*.o +apps/couch_tests/*.so +apps/couch_tests/ebin/ +apps/global_changes/ebin/ +apps/mango/ebin/ +apps/mango/test/*.pyc +apps/mango/nosetests.xml +apps/mango/venv/ +apps/jwtf/.rebar3/ test/javascript/junit.xml /_build/ -/src/bunt -/src/credo/ -/src/httpotion/ -/src/jason/ -/src/junit_formatter/ +/apps/bunt +/apps/credo/ +/apps/httpotion/ +/apps/jason/ +/apps/junit_formatter/ .idea +_build +*.iml *.lock +*.log +*.xml +*.crashdump diff --git a/LICENSE b/LICENSE index 048ee41a581..cc82e96eb44 100644 --- a/LICENSE +++ b/LICENSE @@ -221,7 +221,7 @@ For the share/www/favicon.ico component from https://github.com/BigBlueHat/futon Version 2.0, January 2004 http://www.apache.org/licenses/ -For the src/mochiweb component: +For the apps/mochiweb component: Copyright (c) 2007 Mochi Media, Inc. @@ -244,7 +244,7 @@ For the src/mochiweb component: OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For the src/ibrowse component: +For the apps/ibrowse component: Copyright (c) 2006, Chandrashekhar Mullaparthi All rights reserved. @@ -272,8 +272,8 @@ For the src/ibrowse component: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -For the src/couch_log/src/couch_log_trunc_io.erl and - the src/couch_log/src/couch_log_trunc_io_fmt.erl components +For the apps/couch_log/src/couch_log_trunc_io.erl and + the apps/couch_log/src/couch_log_trunc_io_fmt.erl components ERLANG PUBLIC LICENSE Version 1.1 @@ -563,7 +563,7 @@ Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings AB. All Rights Reserved.'' -For the src/ejson/yajl component +For the apps/ejson/yajl component Copyright 2010, Lloyd Hilaiel. @@ -595,7 +595,7 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -For the src/ejson/erl_nif_compat.h file +For the apps/ejson/erl_nif_compat.h file Copyright (c) 2010-2011 Basho Technologies, Inc. With some minor modifications for Apache CouchDB. @@ -614,7 +614,7 @@ For the src/ejson/erl_nif_compat.h file specific language governing permissions and limitations under the License. -For the src/snappy/google-snappy component +For the apps/snappy/google-snappy component Copyright 2005 and onwards Google Inc. @@ -708,7 +708,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -for src/fauxton/assets/js/libs/bootstrap.js +for apps/fauxton/assets/js/libs/bootstrap.js for share/www/js/require* Apache License @@ -716,7 +716,7 @@ for share/www/js/require* http://www.apache.org/licenses/ -for src/fauxton/assets/js/plugins/prettify.js +for apps/fauxton/assets/js/plugins/prettify.js for share/www/js/require* Apache License @@ -724,7 +724,7 @@ for share/www/js/require* http://www.apache.org/licenses/ -for src/fauxton/assets/js/plugins/beautify.js +for apps/fauxton/assets/js/plugins/beautify.js for share/www/js/require* The MIT License (MIT) @@ -751,7 +751,7 @@ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -for src/fauxton/assets/js/plugins/cloudant.pagingcollection.js +for apps/fauxton/assets/js/plugins/cloudant.pagingcollection.js for share/www/js/require* Apache License @@ -759,7 +759,7 @@ Apache License http://www.apache.org/licenses/ -for src/fauxton/assets/fonts/fontawesome +for apps/fauxton/assets/fonts/fontawesome for share/www/fonts/* SIL OPEN FONT LICENSE @@ -905,7 +905,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -for src/fauxton/assets/less/bootstrap/font-awesome/* +for apps/fauxton/assets/less/bootstrap/font-awesome/* for share/www/css/* The MIT License (MIT) @@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -for src/fauxton/test/nightwatch_tests/custom-commands/waitForAttribute.js: +for apps/fauxton/test/nightwatch_tests/custom-commands/waitForAttribute.js: The MIT License (MIT) @@ -2213,7 +2213,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For the src/hyper component: +For the apps/hyper component: The MIT License (MIT) @@ -2237,7 +2237,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For the src/recon component: +For the apps/recon component: Copyright (c) 2012-2017, Frédéric Trottier-Hébert All rights reserved. diff --git a/Makefile b/Makefile index 82c2b335b35..30d732c0442 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ include version.mk -REBAR?=$(shell echo `pwd`/bin/rebar) +REBAR3?=$(shell echo `pwd`/bin/rebar3) ERLFMT?=$(shell echo `pwd`/bin/erlfmt) # Handle the following scenarios: @@ -77,18 +77,6 @@ skip_deps=folsom,meck,mochiweb,triq,proper,snappy,bcrypt,hyper,ibrowse suites= tests= -COMPILE_OPTS=$(shell echo "\ - apps=$(apps) \ - " | sed -e 's/[a-z_]\{1,\}= / /g') -EUNIT_OPTS=$(shell echo "\ - skip_deps=$(skip_deps) \ - suites=$(suites) \ - tests=$(tests) \ - " | sed -e 's/[a-z]\{1,\}= / /g') -DIALYZE_OPTS=$(shell echo "\ - apps=$(apps) \ - skip_deps=$(skip_deps) \ - " | sed -e 's/[a-z]\{1,\}= / /g') EXUNIT_OPTS=$(subst $(comma),$(space),$(tests)) TEST_OPTS="-c 'startup_jitter=0' -c 'default_security=admin_local'" @@ -120,8 +108,8 @@ help: .PHONY: couch # target: couch - Build CouchDB core, use ERL_COMPILER_OPTIONS to provide custom compiler's options couch: config.erl - @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR) compile $(COMPILE_OPTS) - @cp src/couch/priv/couchjs bin/ + @[ -e bin/couchjs ] || COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR3) compile + @cp apps/couch/priv/couchjs bin/ .PHONY: docs @@ -129,7 +117,7 @@ couch: config.erl ifeq ($(IN_RELEASE), true) docs: share/docs/html else -docs: src/docs/build +docs: apps/docs/build endif .PHONY: fauxton @@ -140,8 +128,8 @@ fauxton: share/www .PHONY: escriptize # target: escriptize - Build CLI tools escriptize: couch - @$(REBAR) -r escriptize apps=weatherreport - @cp src/weatherreport/weatherreport bin/weatherreport + @[ -e bin/weatherreport ] || COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR3) escriptize -a weatherreport + @cp _build/default/bin/weatherreport bin/weatherreport ################################################################################ @@ -158,30 +146,32 @@ check: all python-black @$(MAKE) elixir-suite @$(MAKE) weatherreport-test -ifdef apps -subdirs = $(apps) -else -subdirs=$(shell ls src) -endif - .PHONY: eunit -# target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options +# target: eunit - Run EUnit tests, use apps to provide custom options eunit: export BUILDDIR = $(shell pwd) eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell pwd)/share/server/main.js eunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 eunit: couch - @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR) setup_eunit 2> /dev/null - @for dir in $(subdirs); do \ - COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir || exit 1; \ - done + @[ -d $(shell pwd)/apps/b64url ] || cp -r $(shell pwd)/_build/default/lib/b64url $(shell pwd)/apps + @[ -d $(shell pwd)/apps/config ] || cp -r $(shell pwd)/_build/default/lib/config $(shell pwd)/apps + @[ -d $(shell pwd)/apps/ets_lru ] || cp -r $(shell pwd)/_build/default/lib/ets_lru $(shell pwd)/apps + @[ -d $(shell pwd)/apps/jiffy ] || cp -r $(shell pwd)/_build/default/lib/jiffy $(shell pwd)/apps + @[ -d $(shell pwd)/apps/khash ] || cp -r $(shell pwd)/_build/default/lib/khash $(shell pwd)/apps + @[ -d $(shell pwd)/apps/recon ] || cp -r $(shell pwd)/_build/default/lib/recon $(shell pwd)/apps + @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR3) ic setup_eunit 2> /dev/null +ifdef apps + @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR3) eunit --app $(apps) || exit 1 +else + @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR3) eunit || exit 1 +endif .PHONY: exunit # target: exunit - Run ExUnit tests exunit: export BUILDDIR = $(shell pwd) exunit: export MIX_ENV=test -exunit: export ERL_LIBS = $(shell pwd)/src +exunit: export ERL_LIBS = $(shell pwd)/_build/default/lib exunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell pwd)/share/server/main.js exunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 @@ -191,19 +181,19 @@ exunit: couch elixir-init setup-eunit elixir-check-formatted elixir-credo setup-eunit: export BUILDDIR = $(shell pwd) setup-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config setup-eunit: - @$(REBAR) setup_eunit 2> /dev/null + @$(REBAR3) ic setup_eunit 2> /dev/null just-eunit: export BUILDDIR = $(shell pwd) just-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config just-eunit: - @$(REBAR) -r eunit $(EUNIT_OPTS) + @$(REBAR3) eunit .PHONY: soak-eunit soak-eunit: export BUILDDIR = $(shell pwd) soak-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config soak-eunit: couch - @$(REBAR) setup_eunit 2> /dev/null - while [ $$? -eq 0 ] ; do $(REBAR) -r eunit $(EUNIT_OPTS) ; done + @$(REBAR3) ic setup_eunit 2> /dev/null + while [ $$? -eq 0 ] ; do $(REBAR3) eunit ; done erlfmt-check: ERLFMT_PATH=$(ERLFMT) python3 dev/format_check.py @@ -221,16 +211,16 @@ python-black: .venv/bin/black echo "Python formatter not supported on Python < 3.6; check results on a newer platform" @python3 -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \ LC_ALL=C.UTF-8 LANG=C.UTF-8 .venv/bin/black --check \ - --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/erlfmt|src/jiffy|src/rebar/pr2relnotes.py|src/fauxton" \ - build-aux/*.py dev/run dev/format_*.py src/mango/test/*.py src/docs/src/conf.py src/docs/ext/*.py . + --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|apps/erlfmt|apps/jiffy|apps/rebar/pr2relnotes.py|apps/fauxton" \ + build-aux/*.py dev/run dev/format_*.py apps/mango/test/*.py _build/default/lib/docs/src/conf.py _build/default/lib/docs/ext/*.py . python-black-update: .venv/bin/black @python3 -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \ echo "Python formatter not supported on Python < 3.6; check results on a newer platform" @python3 -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \ LC_ALL=C.UTF-8 LANG=C.UTF-8 .venv/bin/black \ - --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/rebar/pr2relnotes.py|src/fauxton" \ - build-aux/*.py dev/run src/mango/test/*.py src/docs/src/conf.py src/docs/ext/*.py . + --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|apps/rebar/pr2relnotes.py|apps/fauxton" \ + build-aux/*.py dev/run apps/mango/test/*.py _build/default/lib/docs/src/conf.py _build/default/lib/docs/ext/*.py . .PHONY: elixir elixir: export MIX_ENV=integration @@ -296,7 +286,7 @@ check-qs: .PHONY: list-eunit-apps # target: list-eunit-apps - List EUnit target apps list-eunit-apps: - @find ./src/ -type f -name *_test.erl -o -name *_tests.erl \ + @find ./apps/ -type f -name *_test.erl -o -name *_tests.erl \ | cut -d '/' -f 3 \ | sort -u @@ -304,7 +294,7 @@ list-eunit-apps: .PHONY: list-eunit-suites # target: list-eunit-suites - List EUnit target test suites list-eunit-suites: - @find ./src/ -type f -name *_test.erl -o -name *_tests.erl -exec basename {} \; \ + @find ./apps/ -type f -name *_test.erl -o -name *_tests.erl -exec basename {} \; \ | cut -d '.' -f -1 \ | sort @@ -319,10 +309,10 @@ build-test: # target: mango-test - Run Mango tests mango-test: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 mango-test: devclean all - @cd src/mango && \ + @cd apps/mango && \ python3 -m venv .venv && \ .venv/bin/python3 -m pip install -r requirements.txt - @cd src/mango && ../../dev/run "$(TEST_OPTS)" -n 1 --admin=testuser:testpass '.venv/bin/python3 -m nose2' + @cd apps/mango && ../../dev/run "$(TEST_OPTS)" -n 1 --admin=testuser:testpass '.venv/bin/python3 -m nose2' .PHONY: weatherreport-test @@ -336,28 +326,16 @@ weatherreport-test: devclean escriptize ################################################################################ -.PHONY: build-plt -# target: build-plt - Build project-specific PLT -build-plt: - @$(REBAR) -r build-plt $(DIALYZE_OPTS) - - -.PHONY: check-plt -# target: check-plt - Check the PLT for consistency and rebuild it if it is not up-to-date -check-plt: - @$(REBAR) -r check-plt $(DIALYZE_OPTS) - - .PHONY: dialyze # target: dialyze - Analyze the code for discrepancies -dialyze: .rebar - @$(REBAR) -r dialyze $(DIALYZE_OPTS) +dialyze: + @$(REBAR3) dialyzer .PHONY: introspect # target: introspect - Check for commits difference between rebar.config and repository introspect: - @$(REBAR) -r update-deps + @$(REBAR3) upgrade --all @build-aux/introspect ################################################################################ @@ -370,12 +348,12 @@ introspect: dist: all derived @./build-aux/couchdb-build-release.sh $(COUCHDB_VERSION) - @cp -r share/www apache-couchdb-$(COUCHDB_VERSION)/share/ + @cp -r _build/default/share/www apache-couchdb-$(COUCHDB_VERSION)/share/ @mkdir -p apache-couchdb-$(COUCHDB_VERSION)/share/docs/html - @cp -r src/docs/build/html apache-couchdb-$(COUCHDB_VERSION)/share/docs/ + @cp -r _build/default/lib/docs/build/html apache-couchdb-$(COUCHDB_VERSION)/share/docs/ @mkdir -p apache-couchdb-$(COUCHDB_VERSION)/share/docs/man - @cp src/docs/build/man/apachecouchdb.1 apache-couchdb-$(COUCHDB_VERSION)/share/docs/man/ + @cp _build/default/lib/docs/build/man/apachecouchdb.1 apache-couchdb-$(COUCHDB_VERSION)/share/docs/man/ @tar czf apache-couchdb-$(COUCHDB_VERSION)$(IN_RC).tar.gz apache-couchdb-$(COUCHDB_VERSION) @echo "Done: apache-couchdb-$(COUCHDB_VERSION)$(IN_RC).tar.gz" @@ -387,12 +365,12 @@ dist: all derived release: all @echo "Installing CouchDB into rel/couchdb/ ..." @rm -rf rel/couchdb - @$(REBAR) generate # make full erlang release - @cp bin/weatherreport rel/couchdb/bin/weatherreport + @$(REBAR3) release # make full erlang release + @cp -r _build/default/rel/couchdb rel/couchdb ifeq ($(with_fauxton), 1) @mkdir -p rel/couchdb/share/ - @cp -R share/www rel/couchdb/share/ + @cp -R _build/default/share/www rel/couchdb/share/ endif ifeq ($(with_docs), 1) @@ -404,8 +382,8 @@ ifeq ($(IN_RELEASE), true) else @mkdir -p rel/couchdb/share/www/docs/ @mkdir -p rel/couchdb/share/docs/ - @cp -R src/docs/build/html/ rel/couchdb/share/www/docs - @cp src/docs/build/man/apachecouchdb.1 rel/couchdb/share/docs/couchdb.1 + @cp -R _build/default/lib/docs/build/html/ rel/couchdb/share/www/docs + @cp _build/default/lib/docs/build/man/apachecouchdb.1 rel/couchdb/share/docs/couchdb.1 endif endif @@ -438,15 +416,15 @@ clean: @rm -rf .rebar/ @rm -f bin/couchjs @rm -f bin/weatherreport - @rm -rf src/*/ebin - @rm -rf src/*/.rebar - @rm -rf src/*/priv/*.so - @rm -rf src/couch/priv/{couchspawnkillable,couchjs} + @rm -rf apps/*/ebin + @rm -rf apps/*/.rebar + @rm -rf apps/*/priv/*.so + @rm -rf apps/couch/priv/{couchspawnkillable,couchjs} @rm -rf share/server/main.js share/server/main-coffee.js @rm -rf tmp dev/data dev/lib dev/logs - @rm -rf src/mango/.venv - @rm -f src/couch/priv/couchspawnkillable - @rm -f src/couch/priv/couch_js/config.h + @rm -rf apps/mango/.venv + @rm -f apps/couch/priv/couchspawnkillable + @rm -f apps/couch/priv/couch_js/config.h @rm -f dev/*.beam dev/devnode.* dev/pbkdf2.pyc log/crash.log @rm -f dev/erlserver.pem dev/couch_ssl_dist.conf @@ -462,7 +440,7 @@ ifneq ($(IN_RELEASE), true) # copied sources, generated docs, or fauxton @rm -rf rel/couchdb @rm -rf share/www - @rm -rf src/docs + @rm -rf apps/docs endif @@ -486,16 +464,16 @@ config.erl: @false -src/docs/build: +apps/docs/build: ifeq ($(with_docs), 1) - @cd src/docs; $(MAKE) + @cd _build/default/lib/docs; $(MAKE) endif share/www: ifeq ($(with_fauxton), 1) @echo "Building Fauxton" - @cd src/fauxton && npm install && ./node_modules/grunt-cli/bin/grunt couchdb + @cd _build/default/lib/fauxton && npm install && ./node_modules/grunt-cli/bin/grunt couchdb endif diff --git a/Makefile.win b/Makefile.win index 5bbfeead9b7..08f1a844c9e 100644 --- a/Makefile.win +++ b/Makefile.win @@ -109,7 +109,7 @@ all: couch fauxton docs # target: couch - Build CouchDB core, use ERL_COMPILER_OPTIONS to provide custom compiler's options couch: config.erl @set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) compile $(COMPILE_OPTS) - @copy src\couch\priv\couchjs.exe bin + @copy apps\couch\priv\couchjs.exe bin .PHONY: docs @@ -117,7 +117,7 @@ couch: config.erl ifeq ($(IN_RELEASE), true) docs: share\docs\html else -docs: src\docs\build +docs: apps\docs\build endif .PHONY: fauxton @@ -140,7 +140,7 @@ check: all python-black ifdef apps subdirs = $(apps) else -subdirs=$(shell dir /b src) +subdirs=$(shell dir /b apps) endif .PHONY: eunit @@ -157,7 +157,7 @@ eunit: couch # target: exunit - Run ExUnit tests exunit: export BUILDDIR = $(shell echo %cd%) exunit: export MIX_ENV=test -exunit: export ERL_LIBS = $(shell echo %cd%)\src +exunit: export ERL_LIBS = $(shell echo %cd%)\apps exunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config") exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs $(shell echo %cd%)/share/server/main.js exunit: couch elixir-init setup-eunit elixir-check-formatted elixir-credo @@ -191,16 +191,16 @@ python-black: .venv/bin/black echo 'Python formatter not supported on Python < 3.6; check results on a newer platform' @$(PYTHON) -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \ .venv\Scripts\black.exe --check \ - --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/erlfmt|src/rebar/pr2relnotes.py|src/fauxton" \ - build-aux dev\run dev\format_*.py src\mango\test src\docs\src\conf.py src\docs\ext . + --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|apps/erlfmt|apps/rebar/pr2relnotes.py|apps/fauxton" \ + build-aux dev\run dev\format_*.py apps\mango\test apps\docs\src\conf.py apps\docs\ext . python-black-update: .venv/bin/black @$(PYTHON) -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \ echo 'Python formatter not supported on Python < 3.6; check results on a newer platform' @$(PYTHON) -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \ .venv\Scripts\black.exe \ - --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/erlfmt|src/rebar/pr2relnotes.py|src/fauxton" \ - build-aux dev\run dev\format_*.py src\mango\test src\docs\src\conf.py src\docs\ext . + --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|apps/erlfmt|apps/rebar/pr2relnotes.py|apps/fauxton" \ + build-aux dev\run dev\format_*.py apps\mango\test apps\docs\src\conf.py apps\docs\ext . .PHONY: elixir elixir: export MIX_ENV=integration @@ -259,10 +259,10 @@ check-qs: .PHONY: mango-test mango-test: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 mango-test: devclean all - @cd src\mango && \ + @cd apps\mango && \ python.exe -m venv .venv && \ .venv\Scripts\pip.exe install -r requirements.txt - @cd src\mango && .venv\Scripts\python.exe ..\..\dev\run -n 1 --admin=testuser:testpass .venv\Scripts\nose2 + @cd apps\mango && .venv\Scripts\python.exe ..\..\dev\run -n 1 --admin=testuser:testpass .venv\Scripts\nose2 ################################################################################ @@ -307,10 +307,10 @@ dist: all derived @copy -r share\www apache-couchdb-$(COUCHDB_VERSION)\share @mkdir apache-couchdb-$(COUCHDB_VERSION)\share\docs\html - @copy -r src\docs\build\html apache-couchdb-$(COUCHDB_VERSION)\share\docs + @copy -r apps\docs\build\html apache-couchdb-$(COUCHDB_VERSION)\share\docs @mkdir apache-couchdb-$(COUCHDB_VERSION)\share\docs\man - @copy src\docs\build\man\apachecouchdb.1 apache-couchdb-$(COUCHDB_VERSION)\share\docs\man + @copy apps\docs\build\man\apachecouchdb.1 apache-couchdb-$(COUCHDB_VERSION)\share\docs\man @tar czf apache-couchdb-$(COUCHDB_VERSION).tar.gz apache-couchdb-$(COUCHDB_VERSION) @echo 'Done: apache-couchdb-$(COUCHDB_VERSION).tar.gz' @@ -323,7 +323,7 @@ release: all @echo 'Installing CouchDB into rel\couchdb\ ...' -@rmdir /s/q rel\couchdb @$(REBAR) generate - @copy src\couch\priv\couchjs.exe rel\couchdb\bin + @copy apps\couch\priv\couchjs.exe rel\couchdb\bin ifeq ($(with_fauxton), 1) -@mkdir rel\couchdb\share @@ -337,8 +337,8 @@ ifeq ($(IN_RELEASE), true) @xcopy share\docs\html rel\couchdb\share\www\docs /E /I @copy share\docs\man\apachecouchdb.1 rel\couchdb\share\docs\couchdb.1 else - @xcopy src\docs\build\html rel\couchdb\share\www\docs /E /I - @copy src\docs\build\man\apachecouchdb.1 rel\couchdb\share\docs\couchdb.1 + @xcopy apps\docs\build\html rel\couchdb\share\www\docs /E /I + @copy apps\docs\build\man\apachecouchdb.1 rel\couchdb\share\docs\couchdb.1 endif endif @@ -370,17 +370,17 @@ clean: @$(REBAR) -r clean -@rmdir /s/q .rebar -@del /f/q bin\couchjs.exe - -@rmdir /s/q src\*\ebin - -@rmdir /s/q src\*\.rebar - -@del /f/q/s src\*.dll - -@del /f/q src\couch\priv\*.exe + -@rmdir /s/q apps\*\ebin + -@rmdir /s/q apps\*\.rebar + -@del /f/q/s apps\*.dll + -@del /f/q apps\couch\priv\*.exe -@del /f/q share\server\main.js share\server\main-coffee.js -@rmdir /s/q tmp -@rmdir /s/q dev\data -@rmdir /s/q dev\lib -@rmdir /s/q dev\logs - -@rmdir /s/q src\mango\.venv - -@del /f/q src\couch\priv\couch_js\config.h + -@rmdir /s/q apps\mango\.venv + -@del /f/q apps\couch\priv\couch_js\config.h -@del /f/q dev\boot_node.beam dev\pbkdf2.pyc log\crash.log @@ -395,7 +395,7 @@ ifneq ($(IN_RELEASE), true) # copied sources, generated docs, or fauxton -@rmdir /s/q rel\couchdb -@rmdir /s/q share\www - -@rmdir /s/q src\docs + -@rmdir /s/q apps\docs endif @@ -425,17 +425,17 @@ config.erl: @false -src\docs\build: +apps\docs\build: @echo 'Building docs...' ifeq ($(with_docs), 1) - @cd src\docs && make.bat html && make.bat man + @cd apps\docs && make.bat html && make.bat man endif share\www: ifeq ($(with_fauxton), 1) @echo 'Building Fauxton' - @cd src\fauxton && npm install && .\node_modules\.bin\grunt couchdb + @cd apps\fauxton && npm install && .\node_modules\.bin\grunt couchdb endif derived: diff --git a/NOTICE b/NOTICE index 8fd1befd26b..9d326610226 100644 --- a/NOTICE +++ b/NOTICE @@ -126,7 +126,7 @@ This product also includes the following third-party components: Copyright (c) 2010, Ajax.org B.V. - * src/fauxton/asserts/js/plugins/cloudant.pagingcollection.js + * apps/fauxton/asserts/js/plugins/cloudant.pagingcollection.js Copyright (c) 2014, Cloudant http://cloudant.com @@ -142,7 +142,7 @@ This product also includes the following third-party components: Copyright (C) 2004-2006 Mickaël Rémond, Richard Carlsson -* src/fauxton/test/nightwatch_tests/custom-commands/waitForAttribute.js +* apps/fauxton/test/nightwatch_tests/custom-commands/waitForAttribute.js Copyright (c) 2014 Dave Koo diff --git a/README-DEV.rst b/README-DEV.rst index 863218de92a..5e62ba6c71f 100644 --- a/README-DEV.rst +++ b/README-DEV.rst @@ -46,7 +46,7 @@ However, you do not need them if: If you intend to build Fauxton, you will also need to install its dependencies. After running ``./configure`` to download all of the dependent repositories, you can read about required dependencies in -`src/fauxton/readme.md`. Typically, installing npm and node.js are +`apps/fauxton/readme.md`. Typically, installing npm and node.js are sufficient to enable a Fauxton build. Here is a list of *optional* dependencies for various operating systems. @@ -146,9 +146,9 @@ Developing Formatting ~~~~~~~~~~ -The ``erl`` files in ``src`` are formatted using erlfmt_. The checks are run +The ``erl`` files in ``apps`` are formatted using erlfmt_. The checks are run for every PR in the CI. To run the checks locally, run ``make erlfmt-check``. -To format the ``erl`` files in ``src``, run ``make erlfmt-format``. +To format the ``erl`` files in ``apps``, run ``make erlfmt-format``. To use ``erlfmt`` for specific files only, use the executable ``bin/erlfmt`` that is installed by ``configure``. diff --git a/src/chttpd/LICENSE b/apps/chttpd/LICENSE similarity index 100% rename from src/chttpd/LICENSE rename to apps/chttpd/LICENSE diff --git a/src/chttpd/include/chttpd.hrl b/apps/chttpd/include/chttpd.hrl similarity index 100% rename from src/chttpd/include/chttpd.hrl rename to apps/chttpd/include/chttpd.hrl diff --git a/src/chttpd/include/chttpd_cors.hrl b/apps/chttpd/include/chttpd_cors.hrl similarity index 100% rename from src/chttpd/include/chttpd_cors.hrl rename to apps/chttpd/include/chttpd_cors.hrl diff --git a/src/chttpd/priv/stats_descriptions.cfg b/apps/chttpd/priv/stats_descriptions.cfg similarity index 100% rename from src/chttpd/priv/stats_descriptions.cfg rename to apps/chttpd/priv/stats_descriptions.cfg diff --git a/src/chttpd/rebar.config b/apps/chttpd/rebar.config similarity index 100% rename from src/chttpd/rebar.config rename to apps/chttpd/rebar.config diff --git a/src/chttpd/src/chttpd.app.src b/apps/chttpd/src/chttpd.app.src similarity index 100% rename from src/chttpd/src/chttpd.app.src rename to apps/chttpd/src/chttpd.app.src diff --git a/src/chttpd/src/chttpd.erl b/apps/chttpd/src/chttpd.erl similarity index 100% rename from src/chttpd/src/chttpd.erl rename to apps/chttpd/src/chttpd.erl diff --git a/src/chttpd/src/chttpd_app.erl b/apps/chttpd/src/chttpd_app.erl similarity index 100% rename from src/chttpd/src/chttpd_app.erl rename to apps/chttpd/src/chttpd_app.erl diff --git a/src/chttpd/src/chttpd_auth.erl b/apps/chttpd/src/chttpd_auth.erl similarity index 100% rename from src/chttpd/src/chttpd_auth.erl rename to apps/chttpd/src/chttpd_auth.erl diff --git a/src/chttpd/src/chttpd_auth_cache.erl b/apps/chttpd/src/chttpd_auth_cache.erl similarity index 100% rename from src/chttpd/src/chttpd_auth_cache.erl rename to apps/chttpd/src/chttpd_auth_cache.erl diff --git a/src/chttpd/src/chttpd_auth_request.erl b/apps/chttpd/src/chttpd_auth_request.erl similarity index 100% rename from src/chttpd/src/chttpd_auth_request.erl rename to apps/chttpd/src/chttpd_auth_request.erl diff --git a/src/chttpd/src/chttpd_cors.erl b/apps/chttpd/src/chttpd_cors.erl similarity index 100% rename from src/chttpd/src/chttpd_cors.erl rename to apps/chttpd/src/chttpd_cors.erl diff --git a/src/chttpd/src/chttpd_db.erl b/apps/chttpd/src/chttpd_db.erl similarity index 100% rename from src/chttpd/src/chttpd_db.erl rename to apps/chttpd/src/chttpd_db.erl diff --git a/src/chttpd/src/chttpd_epi.erl b/apps/chttpd/src/chttpd_epi.erl similarity index 100% rename from src/chttpd/src/chttpd_epi.erl rename to apps/chttpd/src/chttpd_epi.erl diff --git a/src/chttpd/src/chttpd_external.erl b/apps/chttpd/src/chttpd_external.erl similarity index 100% rename from src/chttpd/src/chttpd_external.erl rename to apps/chttpd/src/chttpd_external.erl diff --git a/src/chttpd/src/chttpd_handlers.erl b/apps/chttpd/src/chttpd_handlers.erl similarity index 100% rename from src/chttpd/src/chttpd_handlers.erl rename to apps/chttpd/src/chttpd_handlers.erl diff --git a/src/chttpd/src/chttpd_httpd_handlers.erl b/apps/chttpd/src/chttpd_httpd_handlers.erl similarity index 100% rename from src/chttpd/src/chttpd_httpd_handlers.erl rename to apps/chttpd/src/chttpd_httpd_handlers.erl diff --git a/src/chttpd/src/chttpd_misc.erl b/apps/chttpd/src/chttpd_misc.erl similarity index 100% rename from src/chttpd/src/chttpd_misc.erl rename to apps/chttpd/src/chttpd_misc.erl diff --git a/src/chttpd/src/chttpd_node.erl b/apps/chttpd/src/chttpd_node.erl similarity index 100% rename from src/chttpd/src/chttpd_node.erl rename to apps/chttpd/src/chttpd_node.erl diff --git a/src/chttpd/src/chttpd_plugin.erl b/apps/chttpd/src/chttpd_plugin.erl similarity index 100% rename from src/chttpd/src/chttpd_plugin.erl rename to apps/chttpd/src/chttpd_plugin.erl diff --git a/src/chttpd/src/chttpd_prefer_header.erl b/apps/chttpd/src/chttpd_prefer_header.erl similarity index 100% rename from src/chttpd/src/chttpd_prefer_header.erl rename to apps/chttpd/src/chttpd_prefer_header.erl diff --git a/src/chttpd/src/chttpd_rewrite.erl b/apps/chttpd/src/chttpd_rewrite.erl similarity index 100% rename from src/chttpd/src/chttpd_rewrite.erl rename to apps/chttpd/src/chttpd_rewrite.erl diff --git a/src/chttpd/src/chttpd_show.erl b/apps/chttpd/src/chttpd_show.erl similarity index 100% rename from src/chttpd/src/chttpd_show.erl rename to apps/chttpd/src/chttpd_show.erl diff --git a/src/chttpd/src/chttpd_stats.erl b/apps/chttpd/src/chttpd_stats.erl similarity index 100% rename from src/chttpd/src/chttpd_stats.erl rename to apps/chttpd/src/chttpd_stats.erl diff --git a/src/chttpd/src/chttpd_sup.erl b/apps/chttpd/src/chttpd_sup.erl similarity index 100% rename from src/chttpd/src/chttpd_sup.erl rename to apps/chttpd/src/chttpd_sup.erl diff --git a/src/chttpd/src/chttpd_test_util.erl b/apps/chttpd/src/chttpd_test_util.erl similarity index 100% rename from src/chttpd/src/chttpd_test_util.erl rename to apps/chttpd/src/chttpd_test_util.erl diff --git a/src/chttpd/src/chttpd_util.erl b/apps/chttpd/src/chttpd_util.erl similarity index 100% rename from src/chttpd/src/chttpd_util.erl rename to apps/chttpd/src/chttpd_util.erl diff --git a/src/chttpd/src/chttpd_view.erl b/apps/chttpd/src/chttpd_view.erl similarity index 100% rename from src/chttpd/src/chttpd_view.erl rename to apps/chttpd/src/chttpd_view.erl diff --git a/src/chttpd/src/chttpd_xframe_options.erl b/apps/chttpd/src/chttpd_xframe_options.erl similarity index 100% rename from src/chttpd/src/chttpd_xframe_options.erl rename to apps/chttpd/src/chttpd_xframe_options.erl diff --git a/src/chttpd/test/eunit/chttpd_auth_tests.erl b/apps/chttpd/test/eunit/chttpd_auth_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_auth_tests.erl rename to apps/chttpd/test/eunit/chttpd_auth_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_cors_test.erl b/apps/chttpd/test/eunit/chttpd_cors_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_cors_test.erl rename to apps/chttpd/test/eunit/chttpd_cors_test.erl diff --git a/src/chttpd/test/eunit/chttpd_csp_tests.erl b/apps/chttpd/test/eunit/chttpd_csp_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_csp_tests.erl rename to apps/chttpd/test/eunit/chttpd_csp_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_db_attachment_size_tests.erl b/apps/chttpd/test/eunit/chttpd_db_attachment_size_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_db_attachment_size_tests.erl rename to apps/chttpd/test/eunit/chttpd_db_attachment_size_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_db_bulk_get_multipart_test.erl b/apps/chttpd/test/eunit/chttpd_db_bulk_get_multipart_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_db_bulk_get_multipart_test.erl rename to apps/chttpd/test/eunit/chttpd_db_bulk_get_multipart_test.erl diff --git a/src/chttpd/test/eunit/chttpd_db_bulk_get_test.erl b/apps/chttpd/test/eunit/chttpd_db_bulk_get_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_db_bulk_get_test.erl rename to apps/chttpd/test/eunit/chttpd_db_bulk_get_test.erl diff --git a/src/chttpd/test/eunit/chttpd_db_doc_size_tests.erl b/apps/chttpd/test/eunit/chttpd_db_doc_size_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_db_doc_size_tests.erl rename to apps/chttpd/test/eunit/chttpd_db_doc_size_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_db_test.erl b/apps/chttpd/test/eunit/chttpd_db_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_db_test.erl rename to apps/chttpd/test/eunit/chttpd_db_test.erl diff --git a/src/chttpd/test/eunit/chttpd_dbs_info_test.erl b/apps/chttpd/test/eunit/chttpd_dbs_info_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_dbs_info_test.erl rename to apps/chttpd/test/eunit/chttpd_dbs_info_test.erl diff --git a/src/chttpd/test/eunit/chttpd_delayed_test.erl b/apps/chttpd/test/eunit/chttpd_delayed_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_delayed_test.erl rename to apps/chttpd/test/eunit/chttpd_delayed_test.erl diff --git a/src/chttpd/test/eunit/chttpd_error_info_tests.erl b/apps/chttpd/test/eunit/chttpd_error_info_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_error_info_tests.erl rename to apps/chttpd/test/eunit/chttpd_error_info_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_external_test.erl b/apps/chttpd/test/eunit/chttpd_external_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_external_test.erl rename to apps/chttpd/test/eunit/chttpd_external_test.erl diff --git a/src/chttpd/test/eunit/chttpd_handlers_tests.erl b/apps/chttpd/test/eunit/chttpd_handlers_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_handlers_tests.erl rename to apps/chttpd/test/eunit/chttpd_handlers_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_open_revs_error_test.erl b/apps/chttpd/test/eunit/chttpd_open_revs_error_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_open_revs_error_test.erl rename to apps/chttpd/test/eunit/chttpd_open_revs_error_test.erl diff --git a/src/chttpd/test/eunit/chttpd_plugin_tests.erl b/apps/chttpd/test/eunit/chttpd_plugin_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_plugin_tests.erl rename to apps/chttpd/test/eunit/chttpd_plugin_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_prefer_header_test.erl b/apps/chttpd/test/eunit/chttpd_prefer_header_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_prefer_header_test.erl rename to apps/chttpd/test/eunit/chttpd_prefer_header_test.erl diff --git a/src/chttpd/test/eunit/chttpd_purge_tests.erl b/apps/chttpd/test/eunit/chttpd_purge_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_purge_tests.erl rename to apps/chttpd/test/eunit/chttpd_purge_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_revs_diff_tests.erl b/apps/chttpd/test/eunit/chttpd_revs_diff_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_revs_diff_tests.erl rename to apps/chttpd/test/eunit/chttpd_revs_diff_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_security_tests.erl b/apps/chttpd/test/eunit/chttpd_security_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_security_tests.erl rename to apps/chttpd/test/eunit/chttpd_security_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_session_tests.erl b/apps/chttpd/test/eunit/chttpd_session_tests.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_session_tests.erl rename to apps/chttpd/test/eunit/chttpd_session_tests.erl diff --git a/src/chttpd/test/eunit/chttpd_socket_buffer_size_test.erl b/apps/chttpd/test/eunit/chttpd_socket_buffer_size_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_socket_buffer_size_test.erl rename to apps/chttpd/test/eunit/chttpd_socket_buffer_size_test.erl diff --git a/src/chttpd/test/eunit/chttpd_test.hrl b/apps/chttpd/test/eunit/chttpd_test.hrl similarity index 100% rename from src/chttpd/test/eunit/chttpd_test.hrl rename to apps/chttpd/test/eunit/chttpd_test.hrl diff --git a/src/chttpd/test/eunit/chttpd_util_test.erl b/apps/chttpd/test/eunit/chttpd_util_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_util_test.erl rename to apps/chttpd/test/eunit/chttpd_util_test.erl diff --git a/src/chttpd/test/eunit/chttpd_view_test.erl b/apps/chttpd/test/eunit/chttpd_view_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_view_test.erl rename to apps/chttpd/test/eunit/chttpd_view_test.erl diff --git a/src/chttpd/test/eunit/chttpd_welcome_test.erl b/apps/chttpd/test/eunit/chttpd_welcome_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_welcome_test.erl rename to apps/chttpd/test/eunit/chttpd_welcome_test.erl diff --git a/src/chttpd/test/eunit/chttpd_xframe_test.erl b/apps/chttpd/test/eunit/chttpd_xframe_test.erl similarity index 100% rename from src/chttpd/test/eunit/chttpd_xframe_test.erl rename to apps/chttpd/test/eunit/chttpd_xframe_test.erl diff --git a/src/couch/.gitignore b/apps/couch/.gitignore similarity index 100% rename from src/couch/.gitignore rename to apps/couch/.gitignore diff --git a/src/couch/LICENSE b/apps/couch/LICENSE similarity index 100% rename from src/couch/LICENSE rename to apps/couch/LICENSE diff --git a/src/couch/include/couch_db.hrl b/apps/couch/include/couch_db.hrl similarity index 100% rename from src/couch/include/couch_db.hrl rename to apps/couch/include/couch_db.hrl diff --git a/src/couch/include/couch_eunit.hrl b/apps/couch/include/couch_eunit.hrl similarity index 94% rename from src/couch/include/couch_eunit.hrl rename to apps/couch/include/couch_eunit.hrl index 18852489380..37367a41a9f 100644 --- a/src/couch/include/couch_eunit.hrl +++ b/apps/couch/include/couch_eunit.hrl @@ -28,11 +28,11 @@ filename:join([?BUILDDIR(), "tmp", "etc", "local_eunit.ini"]), filename:join([?BUILDDIR(), "tmp", "etc", "eunit.ini"])]). -define(FIXTURESDIR, - filename:join([?BUILDDIR(), "src", "couch", "test", "eunit", "fixtures"])). + filename:join([?BUILDDIR(), "apps", "couch", "test", "eunit", "fixtures"])). -define(TEMPDIR, filename:join([?BUILDDIR(), "tmp", "tmp_data"])). --define(APPDIR, filename:dirname(element(2, file:get_cwd()))). +-define(APPDIR, element(2, file:get_cwd())). %% Account for the fact that source files are in src//.eunit/.erl %% when run from eunit -define(ABS_PATH(File), %% src//.eunit/.erl diff --git a/src/couch/include/couch_eunit_proper.hrl b/apps/couch/include/couch_eunit_proper.hrl similarity index 100% rename from src/couch/include/couch_eunit_proper.hrl rename to apps/couch/include/couch_eunit_proper.hrl diff --git a/src/couch/include/couch_js_functions.hrl b/apps/couch/include/couch_js_functions.hrl similarity index 100% rename from src/couch/include/couch_js_functions.hrl rename to apps/couch/include/couch_js_functions.hrl diff --git a/src/couch/priv/couch_ejson_compare/couch_ejson_compare.c b/apps/couch/priv/couch_ejson_compare/couch_ejson_compare.c similarity index 100% rename from src/couch/priv/couch_ejson_compare/couch_ejson_compare.c rename to apps/couch/priv/couch_ejson_compare/couch_ejson_compare.c diff --git a/src/couch/priv/couch_js/1.8.5/help.h b/apps/couch/priv/couch_js/1.8.5/help.h similarity index 100% rename from src/couch/priv/couch_js/1.8.5/help.h rename to apps/couch/priv/couch_js/1.8.5/help.h diff --git a/src/couch/priv/couch_js/1.8.5/main.c b/apps/couch/priv/couch_js/1.8.5/main.c similarity index 100% rename from src/couch/priv/couch_js/1.8.5/main.c rename to apps/couch/priv/couch_js/1.8.5/main.c diff --git a/src/couch/priv/couch_js/1.8.5/utf8.c b/apps/couch/priv/couch_js/1.8.5/utf8.c similarity index 100% rename from src/couch/priv/couch_js/1.8.5/utf8.c rename to apps/couch/priv/couch_js/1.8.5/utf8.c diff --git a/src/couch/priv/couch_js/1.8.5/utf8.h b/apps/couch/priv/couch_js/1.8.5/utf8.h similarity index 100% rename from src/couch/priv/couch_js/1.8.5/utf8.h rename to apps/couch/priv/couch_js/1.8.5/utf8.h diff --git a/src/couch/priv/couch_js/1.8.5/util.c b/apps/couch/priv/couch_js/1.8.5/util.c similarity index 100% rename from src/couch/priv/couch_js/1.8.5/util.c rename to apps/couch/priv/couch_js/1.8.5/util.c diff --git a/src/couch/priv/couch_js/1.8.5/util.h b/apps/couch/priv/couch_js/1.8.5/util.h similarity index 100% rename from src/couch/priv/couch_js/1.8.5/util.h rename to apps/couch/priv/couch_js/1.8.5/util.h diff --git a/src/couch/priv/couch_js/60/help.h b/apps/couch/priv/couch_js/60/help.h similarity index 100% rename from src/couch/priv/couch_js/60/help.h rename to apps/couch/priv/couch_js/60/help.h diff --git a/src/couch/priv/couch_js/60/main.cpp b/apps/couch/priv/couch_js/60/main.cpp similarity index 100% rename from src/couch/priv/couch_js/60/main.cpp rename to apps/couch/priv/couch_js/60/main.cpp diff --git a/src/couch/priv/couch_js/60/util.cpp b/apps/couch/priv/couch_js/60/util.cpp similarity index 100% rename from src/couch/priv/couch_js/60/util.cpp rename to apps/couch/priv/couch_js/60/util.cpp diff --git a/src/couch/priv/couch_js/60/util.h b/apps/couch/priv/couch_js/60/util.h similarity index 100% rename from src/couch/priv/couch_js/60/util.h rename to apps/couch/priv/couch_js/60/util.h diff --git a/src/couch/priv/couch_js/68/help.h b/apps/couch/priv/couch_js/68/help.h similarity index 100% rename from src/couch/priv/couch_js/68/help.h rename to apps/couch/priv/couch_js/68/help.h diff --git a/src/couch/priv/couch_js/68/main.cpp b/apps/couch/priv/couch_js/68/main.cpp similarity index 100% rename from src/couch/priv/couch_js/68/main.cpp rename to apps/couch/priv/couch_js/68/main.cpp diff --git a/src/couch/priv/couch_js/68/util.cpp b/apps/couch/priv/couch_js/68/util.cpp similarity index 100% rename from src/couch/priv/couch_js/68/util.cpp rename to apps/couch/priv/couch_js/68/util.cpp diff --git a/src/couch/priv/couch_js/68/util.h b/apps/couch/priv/couch_js/68/util.h similarity index 100% rename from src/couch/priv/couch_js/68/util.h rename to apps/couch/priv/couch_js/68/util.h diff --git a/src/couch/priv/couch_js/86/help.h b/apps/couch/priv/couch_js/86/help.h similarity index 100% rename from src/couch/priv/couch_js/86/help.h rename to apps/couch/priv/couch_js/86/help.h diff --git a/src/couch/priv/couch_js/86/main.cpp b/apps/couch/priv/couch_js/86/main.cpp similarity index 100% rename from src/couch/priv/couch_js/86/main.cpp rename to apps/couch/priv/couch_js/86/main.cpp diff --git a/src/couch/priv/couch_js/86/util.cpp b/apps/couch/priv/couch_js/86/util.cpp similarity index 100% rename from src/couch/priv/couch_js/86/util.cpp rename to apps/couch/priv/couch_js/86/util.cpp diff --git a/src/couch/priv/couch_js/86/util.h b/apps/couch/priv/couch_js/86/util.h similarity index 100% rename from src/couch/priv/couch_js/86/util.h rename to apps/couch/priv/couch_js/86/util.h diff --git a/src/couch/priv/spawnkillable/couchspawnkillable.sh b/apps/couch/priv/spawnkillable/couchspawnkillable.sh similarity index 100% rename from src/couch/priv/spawnkillable/couchspawnkillable.sh rename to apps/couch/priv/spawnkillable/couchspawnkillable.sh diff --git a/src/couch/priv/spawnkillable/couchspawnkillable_win.c b/apps/couch/priv/spawnkillable/couchspawnkillable_win.c similarity index 100% rename from src/couch/priv/spawnkillable/couchspawnkillable_win.c rename to apps/couch/priv/spawnkillable/couchspawnkillable_win.c diff --git a/src/couch/priv/stats_descriptions.cfg b/apps/couch/priv/stats_descriptions.cfg similarity index 100% rename from src/couch/priv/stats_descriptions.cfg rename to apps/couch/priv/stats_descriptions.cfg diff --git a/src/couch/rebar.config.script b/apps/couch/rebar.config.script similarity index 74% rename from src/couch/rebar.config.script rename to apps/couch/rebar.config.script index ba907b0a2f6..2ae9cb9e57d 100644 --- a/src/couch/rebar.config.script +++ b/apps/couch/rebar.config.script @@ -10,6 +10,12 @@ %% License for the specific language governing permissions and limitations under %% the License. +Rebar3MixPath = + case erlang:function_exported(rebar3, main, 1) of + true -> "apps/couch/"; % rebar3 + false -> "" % mix + end. + CopyIfDifferent = fun(Path, Contents) -> case filelib:is_file(Path) of true -> @@ -90,11 +96,11 @@ ConfigH = [ CouchJSConfig = case SMVsn of "78" -> - "priv/couch_js/86/config.h"; + Rebar3MixPath ++ "priv/couch_js/86/config.h"; "91" -> - "priv/couch_js/86/config.h"; + Rebar3MixPath ++ "priv/couch_js/86/config.h"; _ -> - "priv/couch_js/" ++ SMVsn ++ "/config.h" + Rebar3MixPath ++ "priv/couch_js/" ++ SMVsn ++ "/config.h" end. ConfigSrc = [["#define ", K, " ", V, $\n] || {K, V} <- ConfigH]. ConfigBin = iolist_to_binary(ConfigSrc). @@ -107,6 +113,7 @@ MD5Config = case lists:keyfind(erlang_md5, 1, CouchConfig) of [] end. +code:add_path("_build/default/lib/proper/ebin"). ProperConfig = case code:lib_dir(proper) of {error, bad_name} -> []; _ -> [{d, 'WITH_PROPER'}] @@ -210,7 +217,7 @@ BaseSpecs = [ ]. SpawnSpec = [ - {"priv/couchspawnkillable", ["priv/spawnkillable/*.c"]} + {Rebar3MixPath ++ "priv/couchspawnkillable", [Rebar3MixPath ++ "priv/spawnkillable/*.c"]} ]. %% hack required until switch to enc/rebar3 @@ -223,15 +230,69 @@ PortSpecs = case os:type() of {win32, _} -> BaseSpecs ++ SpawnSpec; _ -> - {ok, CSK} = file:read_file("priv/spawnkillable/couchspawnkillable.sh"), - ok = CopyIfDifferent("priv/couchspawnkillable", CSK), - os:cmd("chmod +x priv/couchspawnkillable"), + {ok, CSK} = file:read_file(Rebar3MixPath ++ "priv/spawnkillable/couchspawnkillable.sh"), + ok = CopyIfDifferent(Rebar3MixPath ++ "priv/couchspawnkillable", CSK), + os:cmd("chmod +x " ++ Rebar3MixPath ++ "priv/couchspawnkillable"), BaseSpecs end. PlatformDefines = [ {platform_define, "win32", 'WINDOWS'} ]. + +DepDescs = [ +%% Independent Apps +{config, {url, "https://github.com/jiahuili430/couchdb-config.git"}, {branch, "82-rebar3"}}, +{b64url, "b64url", {tag, "1.0.3"}}, +{ets_lru, "ets-lru", {tag, "1.1.0"}}, +{khash, {url, "https://github.com/jiahuili430/couchdb-khash"}, {branch, "82-rebar3"}}, +{snappy, {url, "https://github.com/jiahuili430/couchdb-snappy"}, {branch, "82-rebar3"}}, + +%% Non-Erlang deps +{docs, {url, "https://github.com/apache/couchdb-documentation"}, {branch, "main"}}, +{fauxton, {url, "https://github.com/apache/couchdb-fauxton.git"}, {branch, "rebar3-bogus-app"}}, + +%% Third party deps +{folsom, {url, "https://github.com/jiahuili430/couchdb-folsom"}, {branch, "82-rebar3"}}, +{hyper, {url, "https://github.com/jiahuili430/couchdb-hyper"}, {branch, "82-rebar3"}}, +{ibrowse, "ibrowse", {tag, "CouchDB-4.4.2-5"}}, +{jiffy, "jiffy", {tag, "1.1.1"}}, +{mochiweb, "mochiweb", {tag, "v3.0.0"}}, +{recon, "recon", {tag, "2.5.2"}} +]. + +WithProper = lists:keyfind(with_proper, 1, CouchConfig) == {with_proper, true}. + +OptionalDeps = case WithProper of + true -> + [{proper, {url, "https://github.com/proper-testing/proper"}, {tag, "v1.4"}}]; + false -> + [] +end. + +BaseUrl = "https://github.com/apache/". + +MakeDep = fun + ({AppName, {url, Url}, Version}) -> + {AppName, {git, Url, Version}}; + ({AppName, RepoName, Version}) -> + Url = BaseUrl ++ "couchdb-" ++ RepoName ++ ".git", + {AppName, {git, Url, Version}} +end. + AddConfig = [ + {deps, lists:map(MakeDep, DepDescs ++ OptionalDeps)}, + {plugins, [{pc, "~> 1.0"}]}, + {artifacts, [ + "priv/couch_ejson_compare.so", + "priv/couchjs", + "priv/couchspawnkillable" + ]}, + {provider_hooks, [ + {post, [ + {compile, {pc, compile}}, + {clean, {pc, clean}} + ]} + ]}, {port_specs, PortSpecs}, {erl_opts, PlatformDefines ++ [ {d, 'COUCHDB_VERSION', Version}, diff --git a/src/couch/src/couch.app.src b/apps/couch/src/couch.app.src similarity index 100% rename from src/couch/src/couch.app.src rename to apps/couch/src/couch.app.src diff --git a/src/couch/src/couch.erl b/apps/couch/src/couch.erl similarity index 100% rename from src/couch/src/couch.erl rename to apps/couch/src/couch.erl diff --git a/src/couch/src/couch_app.erl b/apps/couch/src/couch_app.erl similarity index 100% rename from src/couch/src/couch_app.erl rename to apps/couch/src/couch_app.erl diff --git a/src/couch/src/couch_att.erl b/apps/couch/src/couch_att.erl similarity index 100% rename from src/couch/src/couch_att.erl rename to apps/couch/src/couch_att.erl diff --git a/src/couch/src/couch_auth_cache.erl b/apps/couch/src/couch_auth_cache.erl similarity index 100% rename from src/couch/src/couch_auth_cache.erl rename to apps/couch/src/couch_auth_cache.erl diff --git a/src/couch/src/couch_base32.erl b/apps/couch/src/couch_base32.erl similarity index 100% rename from src/couch/src/couch_base32.erl rename to apps/couch/src/couch_base32.erl diff --git a/src/couch/src/couch_bt_engine.erl b/apps/couch/src/couch_bt_engine.erl similarity index 100% rename from src/couch/src/couch_bt_engine.erl rename to apps/couch/src/couch_bt_engine.erl diff --git a/src/couch/src/couch_bt_engine.hrl b/apps/couch/src/couch_bt_engine.hrl similarity index 100% rename from src/couch/src/couch_bt_engine.hrl rename to apps/couch/src/couch_bt_engine.hrl diff --git a/src/couch/src/couch_bt_engine_compactor.erl b/apps/couch/src/couch_bt_engine_compactor.erl similarity index 100% rename from src/couch/src/couch_bt_engine_compactor.erl rename to apps/couch/src/couch_bt_engine_compactor.erl diff --git a/src/couch/src/couch_bt_engine_header.erl b/apps/couch/src/couch_bt_engine_header.erl similarity index 100% rename from src/couch/src/couch_bt_engine_header.erl rename to apps/couch/src/couch_bt_engine_header.erl diff --git a/src/couch/src/couch_bt_engine_stream.erl b/apps/couch/src/couch_bt_engine_stream.erl similarity index 100% rename from src/couch/src/couch_bt_engine_stream.erl rename to apps/couch/src/couch_bt_engine_stream.erl diff --git a/src/couch/src/couch_btree.erl b/apps/couch/src/couch_btree.erl similarity index 100% rename from src/couch/src/couch_btree.erl rename to apps/couch/src/couch_btree.erl diff --git a/src/couch/src/couch_changes.erl b/apps/couch/src/couch_changes.erl similarity index 100% rename from src/couch/src/couch_changes.erl rename to apps/couch/src/couch_changes.erl diff --git a/src/couch/src/couch_compress.erl b/apps/couch/src/couch_compress.erl similarity index 100% rename from src/couch/src/couch_compress.erl rename to apps/couch/src/couch_compress.erl diff --git a/src/couch/src/couch_db.erl b/apps/couch/src/couch_db.erl similarity index 100% rename from src/couch/src/couch_db.erl rename to apps/couch/src/couch_db.erl diff --git a/src/couch/src/couch_db_engine.erl b/apps/couch/src/couch_db_engine.erl similarity index 100% rename from src/couch/src/couch_db_engine.erl rename to apps/couch/src/couch_db_engine.erl diff --git a/src/couch/src/couch_db_epi.erl b/apps/couch/src/couch_db_epi.erl similarity index 100% rename from src/couch/src/couch_db_epi.erl rename to apps/couch/src/couch_db_epi.erl diff --git a/src/couch/src/couch_db_header.erl b/apps/couch/src/couch_db_header.erl similarity index 100% rename from src/couch/src/couch_db_header.erl rename to apps/couch/src/couch_db_header.erl diff --git a/src/couch/src/couch_db_int.hrl b/apps/couch/src/couch_db_int.hrl similarity index 100% rename from src/couch/src/couch_db_int.hrl rename to apps/couch/src/couch_db_int.hrl diff --git a/src/couch/src/couch_db_plugin.erl b/apps/couch/src/couch_db_plugin.erl similarity index 100% rename from src/couch/src/couch_db_plugin.erl rename to apps/couch/src/couch_db_plugin.erl diff --git a/src/couch/src/couch_db_split.erl b/apps/couch/src/couch_db_split.erl similarity index 100% rename from src/couch/src/couch_db_split.erl rename to apps/couch/src/couch_db_split.erl diff --git a/src/couch/src/couch_db_updater.erl b/apps/couch/src/couch_db_updater.erl similarity index 100% rename from src/couch/src/couch_db_updater.erl rename to apps/couch/src/couch_db_updater.erl diff --git a/src/couch/src/couch_debug.erl b/apps/couch/src/couch_debug.erl similarity index 100% rename from src/couch/src/couch_debug.erl rename to apps/couch/src/couch_debug.erl diff --git a/src/couch/src/couch_doc.erl b/apps/couch/src/couch_doc.erl similarity index 100% rename from src/couch/src/couch_doc.erl rename to apps/couch/src/couch_doc.erl diff --git a/src/couch/src/couch_ejson_compare.erl b/apps/couch/src/couch_ejson_compare.erl similarity index 100% rename from src/couch/src/couch_ejson_compare.erl rename to apps/couch/src/couch_ejson_compare.erl diff --git a/src/couch/src/couch_ejson_size.erl b/apps/couch/src/couch_ejson_size.erl similarity index 100% rename from src/couch/src/couch_ejson_size.erl rename to apps/couch/src/couch_ejson_size.erl diff --git a/src/couch/src/couch_emsort.erl b/apps/couch/src/couch_emsort.erl similarity index 100% rename from src/couch/src/couch_emsort.erl rename to apps/couch/src/couch_emsort.erl diff --git a/src/couch/src/couch_event_sup.erl b/apps/couch/src/couch_event_sup.erl similarity index 100% rename from src/couch/src/couch_event_sup.erl rename to apps/couch/src/couch_event_sup.erl diff --git a/src/couch/src/couch_file.erl b/apps/couch/src/couch_file.erl similarity index 100% rename from src/couch/src/couch_file.erl rename to apps/couch/src/couch_file.erl diff --git a/src/couch/src/couch_flags.erl b/apps/couch/src/couch_flags.erl similarity index 100% rename from src/couch/src/couch_flags.erl rename to apps/couch/src/couch_flags.erl diff --git a/src/couch/src/couch_flags_config.erl b/apps/couch/src/couch_flags_config.erl similarity index 100% rename from src/couch/src/couch_flags_config.erl rename to apps/couch/src/couch_flags_config.erl diff --git a/src/couch/src/couch_hash.erl b/apps/couch/src/couch_hash.erl similarity index 100% rename from src/couch/src/couch_hash.erl rename to apps/couch/src/couch_hash.erl diff --git a/src/couch/src/couch_hotp.erl b/apps/couch/src/couch_hotp.erl similarity index 100% rename from src/couch/src/couch_hotp.erl rename to apps/couch/src/couch_hotp.erl diff --git a/src/couch/src/couch_httpd.erl b/apps/couch/src/couch_httpd.erl similarity index 100% rename from src/couch/src/couch_httpd.erl rename to apps/couch/src/couch_httpd.erl diff --git a/src/couch/src/couch_httpd_auth.erl b/apps/couch/src/couch_httpd_auth.erl similarity index 100% rename from src/couch/src/couch_httpd_auth.erl rename to apps/couch/src/couch_httpd_auth.erl diff --git a/src/couch/src/couch_httpd_db.erl b/apps/couch/src/couch_httpd_db.erl similarity index 100% rename from src/couch/src/couch_httpd_db.erl rename to apps/couch/src/couch_httpd_db.erl diff --git a/src/couch/src/couch_httpd_handlers.erl b/apps/couch/src/couch_httpd_handlers.erl similarity index 100% rename from src/couch/src/couch_httpd_handlers.erl rename to apps/couch/src/couch_httpd_handlers.erl diff --git a/src/couch/src/couch_httpd_misc_handlers.erl b/apps/couch/src/couch_httpd_misc_handlers.erl similarity index 100% rename from src/couch/src/couch_httpd_misc_handlers.erl rename to apps/couch/src/couch_httpd_misc_handlers.erl diff --git a/src/couch/src/couch_httpd_multipart.erl b/apps/couch/src/couch_httpd_multipart.erl similarity index 100% rename from src/couch/src/couch_httpd_multipart.erl rename to apps/couch/src/couch_httpd_multipart.erl diff --git a/src/couch/src/couch_httpd_rewrite.erl b/apps/couch/src/couch_httpd_rewrite.erl similarity index 100% rename from src/couch/src/couch_httpd_rewrite.erl rename to apps/couch/src/couch_httpd_rewrite.erl diff --git a/src/couch/src/couch_httpd_vhost.erl b/apps/couch/src/couch_httpd_vhost.erl similarity index 100% rename from src/couch/src/couch_httpd_vhost.erl rename to apps/couch/src/couch_httpd_vhost.erl diff --git a/src/couch/src/couch_io_logger.erl b/apps/couch/src/couch_io_logger.erl similarity index 100% rename from src/couch/src/couch_io_logger.erl rename to apps/couch/src/couch_io_logger.erl diff --git a/src/couch/src/couch_key_tree.erl b/apps/couch/src/couch_key_tree.erl similarity index 100% rename from src/couch/src/couch_key_tree.erl rename to apps/couch/src/couch_key_tree.erl diff --git a/src/couch/src/couch_lru.erl b/apps/couch/src/couch_lru.erl similarity index 100% rename from src/couch/src/couch_lru.erl rename to apps/couch/src/couch_lru.erl diff --git a/src/couch/src/couch_multidb_changes.erl b/apps/couch/src/couch_multidb_changes.erl similarity index 100% rename from src/couch/src/couch_multidb_changes.erl rename to apps/couch/src/couch_multidb_changes.erl diff --git a/src/couch/src/couch_native_process.erl b/apps/couch/src/couch_native_process.erl similarity index 100% rename from src/couch/src/couch_native_process.erl rename to apps/couch/src/couch_native_process.erl diff --git a/src/couch/src/couch_os_process.erl b/apps/couch/src/couch_os_process.erl similarity index 100% rename from src/couch/src/couch_os_process.erl rename to apps/couch/src/couch_os_process.erl diff --git a/src/couch/src/couch_partition.erl b/apps/couch/src/couch_partition.erl similarity index 100% rename from src/couch/src/couch_partition.erl rename to apps/couch/src/couch_partition.erl diff --git a/src/couch/src/couch_passwords.erl b/apps/couch/src/couch_passwords.erl similarity index 100% rename from src/couch/src/couch_passwords.erl rename to apps/couch/src/couch_passwords.erl diff --git a/src/couch/src/couch_primary_sup.erl b/apps/couch/src/couch_primary_sup.erl similarity index 100% rename from src/couch/src/couch_primary_sup.erl rename to apps/couch/src/couch_primary_sup.erl diff --git a/src/couch/src/couch_proc_manager.erl b/apps/couch/src/couch_proc_manager.erl similarity index 100% rename from src/couch/src/couch_proc_manager.erl rename to apps/couch/src/couch_proc_manager.erl diff --git a/src/couch/src/couch_query_servers.erl b/apps/couch/src/couch_query_servers.erl similarity index 100% rename from src/couch/src/couch_query_servers.erl rename to apps/couch/src/couch_query_servers.erl diff --git a/src/couch/src/couch_rand.erl b/apps/couch/src/couch_rand.erl similarity index 100% rename from src/couch/src/couch_rand.erl rename to apps/couch/src/couch_rand.erl diff --git a/src/couch/src/couch_secondary_sup.erl b/apps/couch/src/couch_secondary_sup.erl similarity index 100% rename from src/couch/src/couch_secondary_sup.erl rename to apps/couch/src/couch_secondary_sup.erl diff --git a/src/couch/src/couch_server.erl b/apps/couch/src/couch_server.erl similarity index 100% rename from src/couch/src/couch_server.erl rename to apps/couch/src/couch_server.erl diff --git a/src/couch/src/couch_server_int.hrl b/apps/couch/src/couch_server_int.hrl similarity index 100% rename from src/couch/src/couch_server_int.hrl rename to apps/couch/src/couch_server_int.hrl diff --git a/src/couch/src/couch_stream.erl b/apps/couch/src/couch_stream.erl similarity index 100% rename from src/couch/src/couch_stream.erl rename to apps/couch/src/couch_stream.erl diff --git a/src/couch/src/couch_sup.erl b/apps/couch/src/couch_sup.erl similarity index 100% rename from src/couch/src/couch_sup.erl rename to apps/couch/src/couch_sup.erl diff --git a/src/couch/src/couch_task_status.erl b/apps/couch/src/couch_task_status.erl similarity index 100% rename from src/couch/src/couch_task_status.erl rename to apps/couch/src/couch_task_status.erl diff --git a/src/couch/src/couch_totp.erl b/apps/couch/src/couch_totp.erl similarity index 100% rename from src/couch/src/couch_totp.erl rename to apps/couch/src/couch_totp.erl diff --git a/src/couch/src/couch_users_db.erl b/apps/couch/src/couch_users_db.erl similarity index 100% rename from src/couch/src/couch_users_db.erl rename to apps/couch/src/couch_users_db.erl diff --git a/src/couch/src/couch_util.erl b/apps/couch/src/couch_util.erl similarity index 100% rename from src/couch/src/couch_util.erl rename to apps/couch/src/couch_util.erl diff --git a/src/couch/src/couch_uuids.erl b/apps/couch/src/couch_uuids.erl similarity index 100% rename from src/couch/src/couch_uuids.erl rename to apps/couch/src/couch_uuids.erl diff --git a/src/couch/src/couch_work_queue.erl b/apps/couch/src/couch_work_queue.erl similarity index 100% rename from src/couch/src/couch_work_queue.erl rename to apps/couch/src/couch_work_queue.erl diff --git a/src/couch/src/test_request.erl b/apps/couch/src/test_request.erl similarity index 100% rename from src/couch/src/test_request.erl rename to apps/couch/src/test_request.erl diff --git a/src/couch/src/test_util.erl b/apps/couch/src/test_util.erl similarity index 100% rename from src/couch/src/test_util.erl rename to apps/couch/src/test_util.erl diff --git a/src/couch/test/eunit/chttpd_endpoints_tests.erl b/apps/couch/test/eunit/chttpd_endpoints_tests.erl similarity index 100% rename from src/couch/test/eunit/chttpd_endpoints_tests.erl rename to apps/couch/test/eunit/chttpd_endpoints_tests.erl diff --git a/src/couch/test/eunit/couch_auth_cache_tests.erl b/apps/couch/test/eunit/couch_auth_cache_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_auth_cache_tests.erl rename to apps/couch/test/eunit/couch_auth_cache_tests.erl diff --git a/src/couch/test/eunit/couch_base32_tests.erl b/apps/couch/test/eunit/couch_base32_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_base32_tests.erl rename to apps/couch/test/eunit/couch_base32_tests.erl diff --git a/src/couch/test/eunit/couch_bt_engine_compactor_ev.erl b/apps/couch/test/eunit/couch_bt_engine_compactor_ev.erl similarity index 100% rename from src/couch/test/eunit/couch_bt_engine_compactor_ev.erl rename to apps/couch/test/eunit/couch_bt_engine_compactor_ev.erl diff --git a/src/couch/test/eunit/couch_bt_engine_compactor_ev_tests.erl b/apps/couch/test/eunit/couch_bt_engine_compactor_ev_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_bt_engine_compactor_ev_tests.erl rename to apps/couch/test/eunit/couch_bt_engine_compactor_ev_tests.erl diff --git a/src/couch/test/eunit/couch_bt_engine_compactor_tests.erl b/apps/couch/test/eunit/couch_bt_engine_compactor_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_bt_engine_compactor_tests.erl rename to apps/couch/test/eunit/couch_bt_engine_compactor_tests.erl diff --git a/src/couch/test/eunit/couch_bt_engine_tests.erl b/apps/couch/test/eunit/couch_bt_engine_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_bt_engine_tests.erl rename to apps/couch/test/eunit/couch_bt_engine_tests.erl diff --git a/src/couch/test/eunit/couch_bt_engine_upgrade_tests.erl b/apps/couch/test/eunit/couch_bt_engine_upgrade_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_bt_engine_upgrade_tests.erl rename to apps/couch/test/eunit/couch_bt_engine_upgrade_tests.erl diff --git a/src/couch/test/eunit/couch_btree_tests.erl b/apps/couch/test/eunit/couch_btree_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_btree_tests.erl rename to apps/couch/test/eunit/couch_btree_tests.erl diff --git a/src/couch/test/eunit/couch_changes_tests.erl b/apps/couch/test/eunit/couch_changes_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_changes_tests.erl rename to apps/couch/test/eunit/couch_changes_tests.erl diff --git a/src/couch/test/eunit/couch_db_doc_tests.erl b/apps/couch/test/eunit/couch_db_doc_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_db_doc_tests.erl rename to apps/couch/test/eunit/couch_db_doc_tests.erl diff --git a/src/couch/test/eunit/couch_db_mpr_tests.erl b/apps/couch/test/eunit/couch_db_mpr_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_db_mpr_tests.erl rename to apps/couch/test/eunit/couch_db_mpr_tests.erl diff --git a/src/couch/test/eunit/couch_db_plugin_tests.erl b/apps/couch/test/eunit/couch_db_plugin_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_db_plugin_tests.erl rename to apps/couch/test/eunit/couch_db_plugin_tests.erl diff --git a/src/couch/test/eunit/couch_db_props_upgrade_tests.erl b/apps/couch/test/eunit/couch_db_props_upgrade_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_db_props_upgrade_tests.erl rename to apps/couch/test/eunit/couch_db_props_upgrade_tests.erl diff --git a/src/couch/test/eunit/couch_db_split_tests.erl b/apps/couch/test/eunit/couch_db_split_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_db_split_tests.erl rename to apps/couch/test/eunit/couch_db_split_tests.erl diff --git a/src/couch/test/eunit/couch_db_tests.erl b/apps/couch/test/eunit/couch_db_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_db_tests.erl rename to apps/couch/test/eunit/couch_db_tests.erl diff --git a/src/couch/test/eunit/couch_doc_json_tests.erl b/apps/couch/test/eunit/couch_doc_json_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_doc_json_tests.erl rename to apps/couch/test/eunit/couch_doc_json_tests.erl diff --git a/src/couch/test/eunit/couch_doc_tests.erl b/apps/couch/test/eunit/couch_doc_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_doc_tests.erl rename to apps/couch/test/eunit/couch_doc_tests.erl diff --git a/src/couch/test/eunit/couch_ejson_compare_tests.erl b/apps/couch/test/eunit/couch_ejson_compare_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_ejson_compare_tests.erl rename to apps/couch/test/eunit/couch_ejson_compare_tests.erl diff --git a/src/couch/test/eunit/couch_ejson_size_tests.erl b/apps/couch/test/eunit/couch_ejson_size_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_ejson_size_tests.erl rename to apps/couch/test/eunit/couch_ejson_size_tests.erl diff --git a/src/couch/test/eunit/couch_etag_tests.erl b/apps/couch/test/eunit/couch_etag_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_etag_tests.erl rename to apps/couch/test/eunit/couch_etag_tests.erl diff --git a/src/couch/test/eunit/couch_file_tests.erl b/apps/couch/test/eunit/couch_file_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_file_tests.erl rename to apps/couch/test/eunit/couch_file_tests.erl diff --git a/src/couch/test/eunit/couch_flags_config_tests.erl b/apps/couch/test/eunit/couch_flags_config_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_flags_config_tests.erl rename to apps/couch/test/eunit/couch_flags_config_tests.erl diff --git a/src/couch/test/eunit/couch_flags_tests.erl b/apps/couch/test/eunit/couch_flags_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_flags_tests.erl rename to apps/couch/test/eunit/couch_flags_tests.erl diff --git a/src/couch/test/eunit/couch_hotp_tests.erl b/apps/couch/test/eunit/couch_hotp_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_hotp_tests.erl rename to apps/couch/test/eunit/couch_hotp_tests.erl diff --git a/src/couch/test/eunit/couch_index_tests.erl b/apps/couch/test/eunit/couch_index_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_index_tests.erl rename to apps/couch/test/eunit/couch_index_tests.erl diff --git a/src/couch/test/eunit/couch_js_tests.erl b/apps/couch/test/eunit/couch_js_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_js_tests.erl rename to apps/couch/test/eunit/couch_js_tests.erl diff --git a/src/couch/test/eunit/couch_key_tree_prop_tests.erl b/apps/couch/test/eunit/couch_key_tree_prop_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_key_tree_prop_tests.erl rename to apps/couch/test/eunit/couch_key_tree_prop_tests.erl diff --git a/src/couch/test/eunit/couch_key_tree_tests.erl b/apps/couch/test/eunit/couch_key_tree_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_key_tree_tests.erl rename to apps/couch/test/eunit/couch_key_tree_tests.erl diff --git a/src/couch/test/eunit/couch_passwords_tests.erl b/apps/couch/test/eunit/couch_passwords_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_passwords_tests.erl rename to apps/couch/test/eunit/couch_passwords_tests.erl diff --git a/src/couch/test/eunit/couch_query_servers_tests.erl b/apps/couch/test/eunit/couch_query_servers_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_query_servers_tests.erl rename to apps/couch/test/eunit/couch_query_servers_tests.erl diff --git a/src/couch/test/eunit/couch_server_tests.erl b/apps/couch/test/eunit/couch_server_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_server_tests.erl rename to apps/couch/test/eunit/couch_server_tests.erl diff --git a/src/couch/test/eunit/couch_stream_tests.erl b/apps/couch/test/eunit/couch_stream_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_stream_tests.erl rename to apps/couch/test/eunit/couch_stream_tests.erl diff --git a/src/couch/test/eunit/couch_task_status_tests.erl b/apps/couch/test/eunit/couch_task_status_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_task_status_tests.erl rename to apps/couch/test/eunit/couch_task_status_tests.erl diff --git a/src/couch/test/eunit/couch_totp_tests.erl b/apps/couch/test/eunit/couch_totp_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_totp_tests.erl rename to apps/couch/test/eunit/couch_totp_tests.erl diff --git a/src/couch/test/eunit/couch_util_tests.erl b/apps/couch/test/eunit/couch_util_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_util_tests.erl rename to apps/couch/test/eunit/couch_util_tests.erl diff --git a/src/couch/test/eunit/couch_uuids_tests.erl b/apps/couch/test/eunit/couch_uuids_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_uuids_tests.erl rename to apps/couch/test/eunit/couch_uuids_tests.erl diff --git a/src/couch/test/eunit/couch_work_queue_tests.erl b/apps/couch/test/eunit/couch_work_queue_tests.erl similarity index 100% rename from src/couch/test/eunit/couch_work_queue_tests.erl rename to apps/couch/test/eunit/couch_work_queue_tests.erl diff --git a/src/couch/test/eunit/couchdb_attachments_tests.erl b/apps/couch/test/eunit/couchdb_attachments_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_attachments_tests.erl rename to apps/couch/test/eunit/couchdb_attachments_tests.erl diff --git a/src/couch/test/eunit/couchdb_auth_tests.erl b/apps/couch/test/eunit/couchdb_auth_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_auth_tests.erl rename to apps/couch/test/eunit/couchdb_auth_tests.erl diff --git a/src/couch/test/eunit/couchdb_cookie_domain_tests.erl b/apps/couch/test/eunit/couchdb_cookie_domain_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_cookie_domain_tests.erl rename to apps/couch/test/eunit/couchdb_cookie_domain_tests.erl diff --git a/src/couch/test/eunit/couchdb_cors_tests.erl b/apps/couch/test/eunit/couchdb_cors_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_cors_tests.erl rename to apps/couch/test/eunit/couchdb_cors_tests.erl diff --git a/src/couch/test/eunit/couchdb_db_tests.erl b/apps/couch/test/eunit/couchdb_db_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_db_tests.erl rename to apps/couch/test/eunit/couchdb_db_tests.erl diff --git a/src/couch/test/eunit/couchdb_design_doc_tests.erl b/apps/couch/test/eunit/couchdb_design_doc_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_design_doc_tests.erl rename to apps/couch/test/eunit/couchdb_design_doc_tests.erl diff --git a/src/couch/test/eunit/couchdb_file_compression_tests.erl b/apps/couch/test/eunit/couchdb_file_compression_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_file_compression_tests.erl rename to apps/couch/test/eunit/couchdb_file_compression_tests.erl diff --git a/src/couch/test/eunit/couchdb_location_header_tests.erl b/apps/couch/test/eunit/couchdb_location_header_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_location_header_tests.erl rename to apps/couch/test/eunit/couchdb_location_header_tests.erl diff --git a/src/couch/test/eunit/couchdb_mrview_cors_tests.erl b/apps/couch/test/eunit/couchdb_mrview_cors_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_mrview_cors_tests.erl rename to apps/couch/test/eunit/couchdb_mrview_cors_tests.erl diff --git a/src/couch/test/eunit/couchdb_mrview_tests.erl b/apps/couch/test/eunit/couchdb_mrview_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_mrview_tests.erl rename to apps/couch/test/eunit/couchdb_mrview_tests.erl diff --git a/src/couch/test/eunit/couchdb_os_proc_pool.erl b/apps/couch/test/eunit/couchdb_os_proc_pool.erl similarity index 100% rename from src/couch/test/eunit/couchdb_os_proc_pool.erl rename to apps/couch/test/eunit/couchdb_os_proc_pool.erl diff --git a/src/couch/test/eunit/couchdb_update_conflicts_tests.erl b/apps/couch/test/eunit/couchdb_update_conflicts_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_update_conflicts_tests.erl rename to apps/couch/test/eunit/couchdb_update_conflicts_tests.erl diff --git a/src/couch/test/eunit/couchdb_vhosts_tests.erl b/apps/couch/test/eunit/couchdb_vhosts_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_vhosts_tests.erl rename to apps/couch/test/eunit/couchdb_vhosts_tests.erl diff --git a/src/couch/test/eunit/couchdb_views_tests.erl b/apps/couch/test/eunit/couchdb_views_tests.erl similarity index 100% rename from src/couch/test/eunit/couchdb_views_tests.erl rename to apps/couch/test/eunit/couchdb_views_tests.erl diff --git a/src/couch/test/eunit/fixtures/15a5cb17365a99cd9ddc7327c82bbd0d.view b/apps/couch/test/eunit/fixtures/15a5cb17365a99cd9ddc7327c82bbd0d.view similarity index 100% rename from src/couch/test/eunit/fixtures/15a5cb17365a99cd9ddc7327c82bbd0d.view rename to apps/couch/test/eunit/fixtures/15a5cb17365a99cd9ddc7327c82bbd0d.view diff --git a/src/couch/test/eunit/fixtures/1f2c24bc334d701c2048f85e7438eef1.view b/apps/couch/test/eunit/fixtures/1f2c24bc334d701c2048f85e7438eef1.view similarity index 100% rename from src/couch/test/eunit/fixtures/1f2c24bc334d701c2048f85e7438eef1.view rename to apps/couch/test/eunit/fixtures/1f2c24bc334d701c2048f85e7438eef1.view diff --git a/src/couch/test/eunit/fixtures/6cf2c2f766f87b618edf6630b00f8736.view b/apps/couch/test/eunit/fixtures/6cf2c2f766f87b618edf6630b00f8736.view similarity index 100% rename from src/couch/test/eunit/fixtures/6cf2c2f766f87b618edf6630b00f8736.view rename to apps/couch/test/eunit/fixtures/6cf2c2f766f87b618edf6630b00f8736.view diff --git a/src/couch/test/eunit/fixtures/colltest1.couch b/apps/couch/test/eunit/fixtures/colltest1.couch similarity index 100% rename from src/couch/test/eunit/fixtures/colltest1.couch rename to apps/couch/test/eunit/fixtures/colltest1.couch diff --git a/src/couch/test/eunit/fixtures/couch_stats_aggregates.cfg b/apps/couch/test/eunit/fixtures/couch_stats_aggregates.cfg similarity index 100% rename from src/couch/test/eunit/fixtures/couch_stats_aggregates.cfg rename to apps/couch/test/eunit/fixtures/couch_stats_aggregates.cfg diff --git a/src/couch/test/eunit/fixtures/couch_stats_aggregates.ini b/apps/couch/test/eunit/fixtures/couch_stats_aggregates.ini similarity index 100% rename from src/couch/test/eunit/fixtures/couch_stats_aggregates.ini rename to apps/couch/test/eunit/fixtures/couch_stats_aggregates.ini diff --git a/src/couch/test/eunit/fixtures/db321.couch b/apps/couch/test/eunit/fixtures/db321.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db321.couch rename to apps/couch/test/eunit/fixtures/db321.couch diff --git a/src/couch/test/eunit/fixtures/db_non_partitioned.couch b/apps/couch/test/eunit/fixtures/db_non_partitioned.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_non_partitioned.couch rename to apps/couch/test/eunit/fixtures/db_non_partitioned.couch diff --git a/src/couch/test/eunit/fixtures/db_v6_with_1_purge_req.couch b/apps/couch/test/eunit/fixtures/db_v6_with_1_purge_req.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v6_with_1_purge_req.couch rename to apps/couch/test/eunit/fixtures/db_v6_with_1_purge_req.couch diff --git a/src/couch/test/eunit/fixtures/db_v6_with_1_purge_req_for_2_docs.couch b/apps/couch/test/eunit/fixtures/db_v6_with_1_purge_req_for_2_docs.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v6_with_1_purge_req_for_2_docs.couch rename to apps/couch/test/eunit/fixtures/db_v6_with_1_purge_req_for_2_docs.couch diff --git a/src/couch/test/eunit/fixtures/db_v6_with_2_purge_req.couch b/apps/couch/test/eunit/fixtures/db_v6_with_2_purge_req.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v6_with_2_purge_req.couch rename to apps/couch/test/eunit/fixtures/db_v6_with_2_purge_req.couch diff --git a/src/couch/test/eunit/fixtures/db_v6_without_purge_req.couch b/apps/couch/test/eunit/fixtures/db_v6_without_purge_req.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v6_without_purge_req.couch rename to apps/couch/test/eunit/fixtures/db_v6_without_purge_req.couch diff --git a/src/couch/test/eunit/fixtures/db_v7_with_1_purge_req.couch b/apps/couch/test/eunit/fixtures/db_v7_with_1_purge_req.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v7_with_1_purge_req.couch rename to apps/couch/test/eunit/fixtures/db_v7_with_1_purge_req.couch diff --git a/src/couch/test/eunit/fixtures/db_v7_with_1_purge_req_for_2_docs.couch b/apps/couch/test/eunit/fixtures/db_v7_with_1_purge_req_for_2_docs.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v7_with_1_purge_req_for_2_docs.couch rename to apps/couch/test/eunit/fixtures/db_v7_with_1_purge_req_for_2_docs.couch diff --git a/src/couch/test/eunit/fixtures/db_v7_with_2_purge_req.couch b/apps/couch/test/eunit/fixtures/db_v7_with_2_purge_req.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v7_with_2_purge_req.couch rename to apps/couch/test/eunit/fixtures/db_v7_with_2_purge_req.couch diff --git a/src/couch/test/eunit/fixtures/db_v7_without_purge_req.couch b/apps/couch/test/eunit/fixtures/db_v7_without_purge_req.couch similarity index 100% rename from src/couch/test/eunit/fixtures/db_v7_without_purge_req.couch rename to apps/couch/test/eunit/fixtures/db_v7_without_purge_req.couch diff --git a/src/couch/test/eunit/fixtures/logo.png b/apps/couch/test/eunit/fixtures/logo.png similarity index 100% rename from src/couch/test/eunit/fixtures/logo.png rename to apps/couch/test/eunit/fixtures/logo.png diff --git a/src/couch/test/eunit/fixtures/multipart.http b/apps/couch/test/eunit/fixtures/multipart.http similarity index 100% rename from src/couch/test/eunit/fixtures/multipart.http rename to apps/couch/test/eunit/fixtures/multipart.http diff --git a/src/couch/test/eunit/fixtures/os_daemon_bad_perm.sh b/apps/couch/test/eunit/fixtures/os_daemon_bad_perm.sh similarity index 100% rename from src/couch/test/eunit/fixtures/os_daemon_bad_perm.sh rename to apps/couch/test/eunit/fixtures/os_daemon_bad_perm.sh diff --git a/src/couch/test/eunit/fixtures/os_daemon_can_reboot.sh b/apps/couch/test/eunit/fixtures/os_daemon_can_reboot.sh similarity index 100% rename from src/couch/test/eunit/fixtures/os_daemon_can_reboot.sh rename to apps/couch/test/eunit/fixtures/os_daemon_can_reboot.sh diff --git a/src/couch/test/eunit/fixtures/os_daemon_configer.escript b/apps/couch/test/eunit/fixtures/os_daemon_configer.escript similarity index 100% rename from src/couch/test/eunit/fixtures/os_daemon_configer.escript rename to apps/couch/test/eunit/fixtures/os_daemon_configer.escript diff --git a/src/couch/test/eunit/fixtures/os_daemon_die_on_boot.sh b/apps/couch/test/eunit/fixtures/os_daemon_die_on_boot.sh similarity index 100% rename from src/couch/test/eunit/fixtures/os_daemon_die_on_boot.sh rename to apps/couch/test/eunit/fixtures/os_daemon_die_on_boot.sh diff --git a/src/couch/test/eunit/fixtures/os_daemon_die_quickly.sh b/apps/couch/test/eunit/fixtures/os_daemon_die_quickly.sh similarity index 100% rename from src/couch/test/eunit/fixtures/os_daemon_die_quickly.sh rename to apps/couch/test/eunit/fixtures/os_daemon_die_quickly.sh diff --git a/src/couch/test/eunit/fixtures/os_daemon_looper.escript b/apps/couch/test/eunit/fixtures/os_daemon_looper.escript similarity index 100% rename from src/couch/test/eunit/fixtures/os_daemon_looper.escript rename to apps/couch/test/eunit/fixtures/os_daemon_looper.escript diff --git a/src/couch/test/eunit/fixtures/test.couch b/apps/couch/test/eunit/fixtures/test.couch similarity index 100% rename from src/couch/test/eunit/fixtures/test.couch rename to apps/couch/test/eunit/fixtures/test.couch diff --git a/src/couch/test/eunit/global_changes_tests.erl b/apps/couch/test/eunit/global_changes_tests.erl similarity index 100% rename from src/couch/test/eunit/global_changes_tests.erl rename to apps/couch/test/eunit/global_changes_tests.erl diff --git a/src/couch/test/eunit/json_stream_parse_tests.erl b/apps/couch/test/eunit/json_stream_parse_tests.erl similarity index 100% rename from src/couch/test/eunit/json_stream_parse_tests.erl rename to apps/couch/test/eunit/json_stream_parse_tests.erl diff --git a/src/couch/test/eunit/test_web.erl b/apps/couch/test/eunit/test_web.erl similarity index 100% rename from src/couch/test/eunit/test_web.erl rename to apps/couch/test/eunit/test_web.erl diff --git a/src/couch/test/exunit/couch_compress_tests.exs b/apps/couch/test/exunit/couch_compress_tests.exs similarity index 100% rename from src/couch/test/exunit/couch_compress_tests.exs rename to apps/couch/test/exunit/couch_compress_tests.exs diff --git a/src/couch/test/exunit/fabric_test.exs b/apps/couch/test/exunit/fabric_test.exs similarity index 100% rename from src/couch/test/exunit/fabric_test.exs rename to apps/couch/test/exunit/fabric_test.exs diff --git a/src/couch/test/exunit/same_site_cookie_tests.exs b/apps/couch/test/exunit/same_site_cookie_tests.exs similarity index 100% rename from src/couch/test/exunit/same_site_cookie_tests.exs rename to apps/couch/test/exunit/same_site_cookie_tests.exs diff --git a/src/couch/test/exunit/test_helper.exs b/apps/couch/test/exunit/test_helper.exs similarity index 100% rename from src/couch/test/exunit/test_helper.exs rename to apps/couch/test/exunit/test_helper.exs diff --git a/src/couch_dist/LICENSE b/apps/couch_dist/LICENSE similarity index 100% rename from src/couch_dist/LICENSE rename to apps/couch_dist/LICENSE diff --git a/src/couch_dist/rebar.config b/apps/couch_dist/rebar.config similarity index 100% rename from src/couch_dist/rebar.config rename to apps/couch_dist/rebar.config diff --git a/src/couch_dist/src/couch_dist.app.src b/apps/couch_dist/src/couch_dist.app.src similarity index 100% rename from src/couch_dist/src/couch_dist.app.src rename to apps/couch_dist/src/couch_dist.app.src diff --git a/src/couch_dist/src/couch_dist.erl b/apps/couch_dist/src/couch_dist.erl similarity index 100% rename from src/couch_dist/src/couch_dist.erl rename to apps/couch_dist/src/couch_dist.erl diff --git a/src/couch_dist/test/eunit/couch_dist_tests.erl b/apps/couch_dist/test/eunit/couch_dist_tests.erl similarity index 100% rename from src/couch_dist/test/eunit/couch_dist_tests.erl rename to apps/couch_dist/test/eunit/couch_dist_tests.erl diff --git a/src/couch_epi/.gitignore b/apps/couch_epi/.gitignore similarity index 100% rename from src/couch_epi/.gitignore rename to apps/couch_epi/.gitignore diff --git a/src/couch_epi/LICENSE b/apps/couch_epi/LICENSE similarity index 100% rename from src/couch_epi/LICENSE rename to apps/couch_epi/LICENSE diff --git a/src/couch_epi/README.md b/apps/couch_epi/README.md similarity index 100% rename from src/couch_epi/README.md rename to apps/couch_epi/README.md diff --git a/src/couch_epi/rebar.config b/apps/couch_epi/rebar.config similarity index 100% rename from src/couch_epi/rebar.config rename to apps/couch_epi/rebar.config diff --git a/src/couch_epi/src/couch_epi.app.src.script b/apps/couch_epi/src/couch_epi.app.src.script similarity index 100% rename from src/couch_epi/src/couch_epi.app.src.script rename to apps/couch_epi/src/couch_epi.app.src.script diff --git a/src/couch_epi/src/couch_epi.erl b/apps/couch_epi/src/couch_epi.erl similarity index 100% rename from src/couch_epi/src/couch_epi.erl rename to apps/couch_epi/src/couch_epi.erl diff --git a/src/couch_epi/src/couch_epi.hrl b/apps/couch_epi/src/couch_epi.hrl similarity index 100% rename from src/couch_epi/src/couch_epi.hrl rename to apps/couch_epi/src/couch_epi.hrl diff --git a/src/couch_epi/src/couch_epi_app.erl b/apps/couch_epi/src/couch_epi_app.erl similarity index 100% rename from src/couch_epi/src/couch_epi_app.erl rename to apps/couch_epi/src/couch_epi_app.erl diff --git a/src/couch_epi/src/couch_epi_codechange_monitor.erl b/apps/couch_epi/src/couch_epi_codechange_monitor.erl similarity index 100% rename from src/couch_epi/src/couch_epi_codechange_monitor.erl rename to apps/couch_epi/src/couch_epi_codechange_monitor.erl diff --git a/src/couch_epi/src/couch_epi_codegen.erl b/apps/couch_epi/src/couch_epi_codegen.erl similarity index 100% rename from src/couch_epi/src/couch_epi_codegen.erl rename to apps/couch_epi/src/couch_epi_codegen.erl diff --git a/src/couch_epi/src/couch_epi_data.erl b/apps/couch_epi/src/couch_epi_data.erl similarity index 100% rename from src/couch_epi/src/couch_epi_data.erl rename to apps/couch_epi/src/couch_epi_data.erl diff --git a/src/couch_epi/src/couch_epi_data_gen.erl b/apps/couch_epi/src/couch_epi_data_gen.erl similarity index 100% rename from src/couch_epi/src/couch_epi_data_gen.erl rename to apps/couch_epi/src/couch_epi_data_gen.erl diff --git a/src/couch_epi/src/couch_epi_functions.erl b/apps/couch_epi/src/couch_epi_functions.erl similarity index 100% rename from src/couch_epi/src/couch_epi_functions.erl rename to apps/couch_epi/src/couch_epi_functions.erl diff --git a/src/couch_epi/src/couch_epi_functions_gen.erl b/apps/couch_epi/src/couch_epi_functions_gen.erl similarity index 100% rename from src/couch_epi/src/couch_epi_functions_gen.erl rename to apps/couch_epi/src/couch_epi_functions_gen.erl diff --git a/src/couch_epi/src/couch_epi_module_keeper.erl b/apps/couch_epi/src/couch_epi_module_keeper.erl similarity index 100% rename from src/couch_epi/src/couch_epi_module_keeper.erl rename to apps/couch_epi/src/couch_epi_module_keeper.erl diff --git a/src/couch_epi/src/couch_epi_plugin.erl b/apps/couch_epi/src/couch_epi_plugin.erl similarity index 100% rename from src/couch_epi/src/couch_epi_plugin.erl rename to apps/couch_epi/src/couch_epi_plugin.erl diff --git a/src/couch_epi/src/couch_epi_sup.erl b/apps/couch_epi/src/couch_epi_sup.erl similarity index 100% rename from src/couch_epi/src/couch_epi_sup.erl rename to apps/couch_epi/src/couch_epi_sup.erl diff --git a/src/couch_epi/src/couch_epi_util.erl b/apps/couch_epi/src/couch_epi_util.erl similarity index 100% rename from src/couch_epi/src/couch_epi_util.erl rename to apps/couch_epi/src/couch_epi_util.erl diff --git a/src/couch_epi/test/eunit/couch_epi_basic_test.erl b/apps/couch_epi/test/eunit/couch_epi_basic_test.erl similarity index 100% rename from src/couch_epi/test/eunit/couch_epi_basic_test.erl rename to apps/couch_epi/test/eunit/couch_epi_basic_test.erl diff --git a/src/couch_epi/test/eunit/couch_epi_tests.erl b/apps/couch_epi/test/eunit/couch_epi_tests.erl similarity index 99% rename from src/couch_epi/test/eunit/couch_epi_tests.erl rename to apps/couch_epi/test/eunit/couch_epi_tests.erl index 796af13461a..fb8565b5022 100644 --- a/src/couch_epi/test/eunit/couch_epi_tests.erl +++ b/apps/couch_epi/test/eunit/couch_epi_tests.erl @@ -14,8 +14,8 @@ -include_lib("couch/include/couch_eunit.hrl"). --define(DATA_FILE1, ?ABS_PATH("test/eunit/fixtures/app_data1.cfg")). --define(DATA_FILE2, ?ABS_PATH("test/eunit/fixtures/app_data2.cfg")). +-define(DATA_FILE1, ?ABS_PATH("apps/couch_epi/test/eunit/fixtures/app_data1.cfg")). +-define(DATA_FILE2, ?ABS_PATH("apps/couch_epi/test/eunit/fixtures/app_data2.cfg")). -export([notify_cb/4, save/3, get/2]). diff --git a/src/couch_epi/test/eunit/fixtures/app_data1.cfg b/apps/couch_epi/test/eunit/fixtures/app_data1.cfg similarity index 100% rename from src/couch_epi/test/eunit/fixtures/app_data1.cfg rename to apps/couch_epi/test/eunit/fixtures/app_data1.cfg diff --git a/src/couch_epi/test/eunit/fixtures/app_data2.cfg b/apps/couch_epi/test/eunit/fixtures/app_data2.cfg similarity index 100% rename from src/couch_epi/test/eunit/fixtures/app_data2.cfg rename to apps/couch_epi/test/eunit/fixtures/app_data2.cfg diff --git a/src/couch_event/.gitignore b/apps/couch_event/.gitignore similarity index 100% rename from src/couch_event/.gitignore rename to apps/couch_event/.gitignore diff --git a/src/couch_event/LICENSE b/apps/couch_event/LICENSE similarity index 100% rename from src/couch_event/LICENSE rename to apps/couch_event/LICENSE diff --git a/src/couch_event/README.md b/apps/couch_event/README.md similarity index 100% rename from src/couch_event/README.md rename to apps/couch_event/README.md diff --git a/src/couch_event/rebar.config b/apps/couch_event/rebar.config similarity index 100% rename from src/couch_event/rebar.config rename to apps/couch_event/rebar.config diff --git a/src/couch_event/src/couch_event.app.src b/apps/couch_event/src/couch_event.app.src similarity index 100% rename from src/couch_event/src/couch_event.app.src rename to apps/couch_event/src/couch_event.app.src diff --git a/src/couch_event/src/couch_event.erl b/apps/couch_event/src/couch_event.erl similarity index 100% rename from src/couch_event/src/couch_event.erl rename to apps/couch_event/src/couch_event.erl diff --git a/src/couch_event/src/couch_event_app.erl b/apps/couch_event/src/couch_event_app.erl similarity index 100% rename from src/couch_event/src/couch_event_app.erl rename to apps/couch_event/src/couch_event_app.erl diff --git a/src/couch_event/src/couch_event_int.hrl b/apps/couch_event/src/couch_event_int.hrl similarity index 100% rename from src/couch_event/src/couch_event_int.hrl rename to apps/couch_event/src/couch_event_int.hrl diff --git a/src/couch_event/src/couch_event_listener.erl b/apps/couch_event/src/couch_event_listener.erl similarity index 100% rename from src/couch_event/src/couch_event_listener.erl rename to apps/couch_event/src/couch_event_listener.erl diff --git a/src/couch_event/src/couch_event_listener_mfa.erl b/apps/couch_event/src/couch_event_listener_mfa.erl similarity index 100% rename from src/couch_event/src/couch_event_listener_mfa.erl rename to apps/couch_event/src/couch_event_listener_mfa.erl diff --git a/src/couch_event/src/couch_event_os_listener.erl b/apps/couch_event/src/couch_event_os_listener.erl similarity index 100% rename from src/couch_event/src/couch_event_os_listener.erl rename to apps/couch_event/src/couch_event_os_listener.erl diff --git a/src/couch_event/src/couch_event_server.erl b/apps/couch_event/src/couch_event_server.erl similarity index 100% rename from src/couch_event/src/couch_event_server.erl rename to apps/couch_event/src/couch_event_server.erl diff --git a/src/couch_event/src/couch_event_sup2.erl b/apps/couch_event/src/couch_event_sup2.erl similarity index 100% rename from src/couch_event/src/couch_event_sup2.erl rename to apps/couch_event/src/couch_event_sup2.erl diff --git a/src/couch_index/.gitignore b/apps/couch_index/.gitignore similarity index 100% rename from src/couch_index/.gitignore rename to apps/couch_index/.gitignore diff --git a/src/couch_index/LICENSE b/apps/couch_index/LICENSE similarity index 100% rename from src/couch_index/LICENSE rename to apps/couch_index/LICENSE diff --git a/src/couch_index/rebar.config b/apps/couch_index/rebar.config similarity index 100% rename from src/couch_index/rebar.config rename to apps/couch_index/rebar.config diff --git a/src/couch_index/src/couch_index.app.src b/apps/couch_index/src/couch_index.app.src similarity index 100% rename from src/couch_index/src/couch_index.app.src rename to apps/couch_index/src/couch_index.app.src diff --git a/src/couch_index/src/couch_index.erl b/apps/couch_index/src/couch_index.erl similarity index 100% rename from src/couch_index/src/couch_index.erl rename to apps/couch_index/src/couch_index.erl diff --git a/src/couch_index/src/couch_index_app.erl b/apps/couch_index/src/couch_index_app.erl similarity index 100% rename from src/couch_index/src/couch_index_app.erl rename to apps/couch_index/src/couch_index_app.erl diff --git a/src/couch_index/src/couch_index_compactor.erl b/apps/couch_index/src/couch_index_compactor.erl similarity index 100% rename from src/couch_index/src/couch_index_compactor.erl rename to apps/couch_index/src/couch_index_compactor.erl diff --git a/src/couch_index/src/couch_index_debug.erl b/apps/couch_index/src/couch_index_debug.erl similarity index 100% rename from src/couch_index/src/couch_index_debug.erl rename to apps/couch_index/src/couch_index_debug.erl diff --git a/src/couch_index/src/couch_index_epi.erl b/apps/couch_index/src/couch_index_epi.erl similarity index 100% rename from src/couch_index/src/couch_index_epi.erl rename to apps/couch_index/src/couch_index_epi.erl diff --git a/src/couch_index/src/couch_index_plugin.erl b/apps/couch_index/src/couch_index_plugin.erl similarity index 100% rename from src/couch_index/src/couch_index_plugin.erl rename to apps/couch_index/src/couch_index_plugin.erl diff --git a/src/couch_index/src/couch_index_plugin_couch_db.erl b/apps/couch_index/src/couch_index_plugin_couch_db.erl similarity index 100% rename from src/couch_index/src/couch_index_plugin_couch_db.erl rename to apps/couch_index/src/couch_index_plugin_couch_db.erl diff --git a/src/couch_index/src/couch_index_server.erl b/apps/couch_index/src/couch_index_server.erl similarity index 100% rename from src/couch_index/src/couch_index_server.erl rename to apps/couch_index/src/couch_index_server.erl diff --git a/src/couch_index/src/couch_index_sup.erl b/apps/couch_index/src/couch_index_sup.erl similarity index 100% rename from src/couch_index/src/couch_index_sup.erl rename to apps/couch_index/src/couch_index_sup.erl diff --git a/src/couch_index/src/couch_index_updater.erl b/apps/couch_index/src/couch_index_updater.erl similarity index 100% rename from src/couch_index/src/couch_index_updater.erl rename to apps/couch_index/src/couch_index_updater.erl diff --git a/src/couch_index/src/couch_index_util.erl b/apps/couch_index/src/couch_index_util.erl similarity index 100% rename from src/couch_index/src/couch_index_util.erl rename to apps/couch_index/src/couch_index_util.erl diff --git a/src/couch_index/test/eunit/couch_index_compaction_tests.erl b/apps/couch_index/test/eunit/couch_index_compaction_tests.erl similarity index 100% rename from src/couch_index/test/eunit/couch_index_compaction_tests.erl rename to apps/couch_index/test/eunit/couch_index_compaction_tests.erl diff --git a/src/couch_index/test/eunit/couch_index_ddoc_updated_tests.erl b/apps/couch_index/test/eunit/couch_index_ddoc_updated_tests.erl similarity index 100% rename from src/couch_index/test/eunit/couch_index_ddoc_updated_tests.erl rename to apps/couch_index/test/eunit/couch_index_ddoc_updated_tests.erl diff --git a/src/couch_log/.gitignore b/apps/couch_log/.gitignore similarity index 100% rename from src/couch_log/.gitignore rename to apps/couch_log/.gitignore diff --git a/src/couch_log/LICENSE b/apps/couch_log/LICENSE similarity index 100% rename from src/couch_log/LICENSE rename to apps/couch_log/LICENSE diff --git a/src/couch_log/include/couch_log.hrl b/apps/couch_log/include/couch_log.hrl similarity index 100% rename from src/couch_log/include/couch_log.hrl rename to apps/couch_log/include/couch_log.hrl diff --git a/src/couch_log/priv/stats_descriptions.cfg b/apps/couch_log/priv/stats_descriptions.cfg similarity index 100% rename from src/couch_log/priv/stats_descriptions.cfg rename to apps/couch_log/priv/stats_descriptions.cfg diff --git a/src/couch_log/rebar.config b/apps/couch_log/rebar.config similarity index 100% rename from src/couch_log/rebar.config rename to apps/couch_log/rebar.config diff --git a/src/couch_log/src/couch_log.app.src b/apps/couch_log/src/couch_log.app.src similarity index 100% rename from src/couch_log/src/couch_log.app.src rename to apps/couch_log/src/couch_log.app.src diff --git a/src/couch_log/src/couch_log.erl b/apps/couch_log/src/couch_log.erl similarity index 100% rename from src/couch_log/src/couch_log.erl rename to apps/couch_log/src/couch_log.erl diff --git a/src/couch_log/src/couch_log_app.erl b/apps/couch_log/src/couch_log_app.erl similarity index 100% rename from src/couch_log/src/couch_log_app.erl rename to apps/couch_log/src/couch_log_app.erl diff --git a/src/couch_log/src/couch_log_config.erl b/apps/couch_log/src/couch_log_config.erl similarity index 100% rename from src/couch_log/src/couch_log_config.erl rename to apps/couch_log/src/couch_log_config.erl diff --git a/src/couch_log/src/couch_log_config_dyn.erl b/apps/couch_log/src/couch_log_config_dyn.erl similarity index 100% rename from src/couch_log/src/couch_log_config_dyn.erl rename to apps/couch_log/src/couch_log_config_dyn.erl diff --git a/src/couch_log/src/couch_log_error_logger_h.erl b/apps/couch_log/src/couch_log_error_logger_h.erl similarity index 100% rename from src/couch_log/src/couch_log_error_logger_h.erl rename to apps/couch_log/src/couch_log_error_logger_h.erl diff --git a/src/couch_log/src/couch_log_formatter.erl b/apps/couch_log/src/couch_log_formatter.erl similarity index 100% rename from src/couch_log/src/couch_log_formatter.erl rename to apps/couch_log/src/couch_log_formatter.erl diff --git a/src/couch_log/src/couch_log_monitor.erl b/apps/couch_log/src/couch_log_monitor.erl similarity index 100% rename from src/couch_log/src/couch_log_monitor.erl rename to apps/couch_log/src/couch_log_monitor.erl diff --git a/src/couch_log/src/couch_log_server.erl b/apps/couch_log/src/couch_log_server.erl similarity index 100% rename from src/couch_log/src/couch_log_server.erl rename to apps/couch_log/src/couch_log_server.erl diff --git a/src/couch_log/src/couch_log_sup.erl b/apps/couch_log/src/couch_log_sup.erl similarity index 100% rename from src/couch_log/src/couch_log_sup.erl rename to apps/couch_log/src/couch_log_sup.erl diff --git a/src/couch_log/src/couch_log_trunc_io.erl b/apps/couch_log/src/couch_log_trunc_io.erl similarity index 100% rename from src/couch_log/src/couch_log_trunc_io.erl rename to apps/couch_log/src/couch_log_trunc_io.erl diff --git a/src/couch_log/src/couch_log_trunc_io_fmt.erl b/apps/couch_log/src/couch_log_trunc_io_fmt.erl similarity index 100% rename from src/couch_log/src/couch_log_trunc_io_fmt.erl rename to apps/couch_log/src/couch_log_trunc_io_fmt.erl diff --git a/src/couch_log/src/couch_log_util.erl b/apps/couch_log/src/couch_log_util.erl similarity index 100% rename from src/couch_log/src/couch_log_util.erl rename to apps/couch_log/src/couch_log_util.erl diff --git a/src/couch_log/src/couch_log_writer.erl b/apps/couch_log/src/couch_log_writer.erl similarity index 100% rename from src/couch_log/src/couch_log_writer.erl rename to apps/couch_log/src/couch_log_writer.erl diff --git a/src/couch_log/src/couch_log_writer_file.erl b/apps/couch_log/src/couch_log_writer_file.erl similarity index 100% rename from src/couch_log/src/couch_log_writer_file.erl rename to apps/couch_log/src/couch_log_writer_file.erl diff --git a/src/couch_log/src/couch_log_writer_journald.erl b/apps/couch_log/src/couch_log_writer_journald.erl similarity index 100% rename from src/couch_log/src/couch_log_writer_journald.erl rename to apps/couch_log/src/couch_log_writer_journald.erl diff --git a/src/couch_log/src/couch_log_writer_stderr.erl b/apps/couch_log/src/couch_log_writer_stderr.erl similarity index 100% rename from src/couch_log/src/couch_log_writer_stderr.erl rename to apps/couch_log/src/couch_log_writer_stderr.erl diff --git a/src/couch_log/src/couch_log_writer_syslog.erl b/apps/couch_log/src/couch_log_writer_syslog.erl similarity index 100% rename from src/couch_log/src/couch_log_writer_syslog.erl rename to apps/couch_log/src/couch_log_writer_syslog.erl diff --git a/src/couch_log/test/eunit/couch_log_config_listener_test.erl b/apps/couch_log/test/eunit/couch_log_config_listener_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_config_listener_test.erl rename to apps/couch_log/test/eunit/couch_log_config_listener_test.erl diff --git a/src/couch_log/test/eunit/couch_log_config_test.erl b/apps/couch_log/test/eunit/couch_log_config_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_config_test.erl rename to apps/couch_log/test/eunit/couch_log_config_test.erl diff --git a/src/couch_log/test/eunit/couch_log_error_logger_h_test.erl b/apps/couch_log/test/eunit/couch_log_error_logger_h_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_error_logger_h_test.erl rename to apps/couch_log/test/eunit/couch_log_error_logger_h_test.erl diff --git a/src/couch_log/test/eunit/couch_log_formatter_test.erl b/apps/couch_log/test/eunit/couch_log_formatter_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_formatter_test.erl rename to apps/couch_log/test/eunit/couch_log_formatter_test.erl diff --git a/src/couch_log/test/eunit/couch_log_monitor_test.erl b/apps/couch_log/test/eunit/couch_log_monitor_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_monitor_test.erl rename to apps/couch_log/test/eunit/couch_log_monitor_test.erl diff --git a/src/couch_log/test/eunit/couch_log_server_test.erl b/apps/couch_log/test/eunit/couch_log_server_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_server_test.erl rename to apps/couch_log/test/eunit/couch_log_server_test.erl diff --git a/src/couch_log/test/eunit/couch_log_test.erl b/apps/couch_log/test/eunit/couch_log_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_test.erl rename to apps/couch_log/test/eunit/couch_log_test.erl diff --git a/src/couch_log/test/eunit/couch_log_test_util.erl b/apps/couch_log/test/eunit/couch_log_test_util.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_test_util.erl rename to apps/couch_log/test/eunit/couch_log_test_util.erl diff --git a/src/couch_log/test/eunit/couch_log_trunc_io_fmt_test.erl b/apps/couch_log/test/eunit/couch_log_trunc_io_fmt_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_trunc_io_fmt_test.erl rename to apps/couch_log/test/eunit/couch_log_trunc_io_fmt_test.erl diff --git a/src/couch_log/test/eunit/couch_log_util_test.erl b/apps/couch_log/test/eunit/couch_log_util_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_util_test.erl rename to apps/couch_log/test/eunit/couch_log_util_test.erl diff --git a/src/couch_log/test/eunit/couch_log_writer_ets.erl b/apps/couch_log/test/eunit/couch_log_writer_ets.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_writer_ets.erl rename to apps/couch_log/test/eunit/couch_log_writer_ets.erl diff --git a/src/couch_log/test/eunit/couch_log_writer_file_test.erl b/apps/couch_log/test/eunit/couch_log_writer_file_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_writer_file_test.erl rename to apps/couch_log/test/eunit/couch_log_writer_file_test.erl diff --git a/src/couch_log/test/eunit/couch_log_writer_stderr_test.erl b/apps/couch_log/test/eunit/couch_log_writer_stderr_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_writer_stderr_test.erl rename to apps/couch_log/test/eunit/couch_log_writer_stderr_test.erl diff --git a/src/couch_log/test/eunit/couch_log_writer_syslog_test.erl b/apps/couch_log/test/eunit/couch_log_writer_syslog_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_writer_syslog_test.erl rename to apps/couch_log/test/eunit/couch_log_writer_syslog_test.erl diff --git a/src/couch_log/test/eunit/couch_log_writer_test.erl b/apps/couch_log/test/eunit/couch_log_writer_test.erl similarity index 100% rename from src/couch_log/test/eunit/couch_log_writer_test.erl rename to apps/couch_log/test/eunit/couch_log_writer_test.erl diff --git a/src/couch_mrview/LICENSE b/apps/couch_mrview/LICENSE similarity index 100% rename from src/couch_mrview/LICENSE rename to apps/couch_mrview/LICENSE diff --git a/src/couch_mrview/include/couch_mrview.hrl b/apps/couch_mrview/include/couch_mrview.hrl similarity index 100% rename from src/couch_mrview/include/couch_mrview.hrl rename to apps/couch_mrview/include/couch_mrview.hrl diff --git a/src/couch_mrview/priv/stats_descriptions.cfg b/apps/couch_mrview/priv/stats_descriptions.cfg similarity index 100% rename from src/couch_mrview/priv/stats_descriptions.cfg rename to apps/couch_mrview/priv/stats_descriptions.cfg diff --git a/src/couch_mrview/rebar.config b/apps/couch_mrview/rebar.config similarity index 100% rename from src/couch_mrview/rebar.config rename to apps/couch_mrview/rebar.config diff --git a/src/couch_mrview/src/couch_mrview.app.src b/apps/couch_mrview/src/couch_mrview.app.src similarity index 100% rename from src/couch_mrview/src/couch_mrview.app.src rename to apps/couch_mrview/src/couch_mrview.app.src diff --git a/src/couch_mrview/src/couch_mrview.erl b/apps/couch_mrview/src/couch_mrview.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview.erl rename to apps/couch_mrview/src/couch_mrview.erl diff --git a/src/couch_mrview/src/couch_mrview_cleanup.erl b/apps/couch_mrview/src/couch_mrview_cleanup.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_cleanup.erl rename to apps/couch_mrview/src/couch_mrview_cleanup.erl diff --git a/src/couch_mrview/src/couch_mrview_compactor.erl b/apps/couch_mrview/src/couch_mrview_compactor.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_compactor.erl rename to apps/couch_mrview/src/couch_mrview_compactor.erl diff --git a/src/couch_mrview/src/couch_mrview_debug.erl b/apps/couch_mrview/src/couch_mrview_debug.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_debug.erl rename to apps/couch_mrview/src/couch_mrview_debug.erl diff --git a/src/couch_mrview/src/couch_mrview_http.erl b/apps/couch_mrview/src/couch_mrview_http.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_http.erl rename to apps/couch_mrview/src/couch_mrview_http.erl diff --git a/src/couch_mrview/src/couch_mrview_index.erl b/apps/couch_mrview/src/couch_mrview_index.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_index.erl rename to apps/couch_mrview/src/couch_mrview_index.erl diff --git a/src/couch_mrview/src/couch_mrview_show.erl b/apps/couch_mrview/src/couch_mrview_show.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_show.erl rename to apps/couch_mrview/src/couch_mrview_show.erl diff --git a/src/couch_mrview/src/couch_mrview_test_util.erl b/apps/couch_mrview/src/couch_mrview_test_util.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_test_util.erl rename to apps/couch_mrview/src/couch_mrview_test_util.erl diff --git a/src/couch_mrview/src/couch_mrview_update_notifier.erl b/apps/couch_mrview/src/couch_mrview_update_notifier.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_update_notifier.erl rename to apps/couch_mrview/src/couch_mrview_update_notifier.erl diff --git a/src/couch_mrview/src/couch_mrview_updater.erl b/apps/couch_mrview/src/couch_mrview_updater.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_updater.erl rename to apps/couch_mrview/src/couch_mrview_updater.erl diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/apps/couch_mrview/src/couch_mrview_util.erl similarity index 100% rename from src/couch_mrview/src/couch_mrview_util.erl rename to apps/couch_mrview/src/couch_mrview_util.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_all_docs_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_all_docs_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_all_docs_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_all_docs_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_collation_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_collation_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_collation_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_collation_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_compact_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_compact_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_compact_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_compact_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_ddoc_updated_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_ddoc_updated_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_ddoc_updated_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_ddoc_updated_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_ddoc_validation_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_ddoc_validation_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_ddoc_validation_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_ddoc_validation_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_design_docs_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_design_docs_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_design_docs_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_design_docs_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_http_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_http_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_http_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_http_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_index_info_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_local_docs_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_local_docs_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_local_docs_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_local_docs_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_map_views_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_map_views_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_map_views_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_map_views_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_purge_docs_fabric_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_purge_docs_fabric_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_purge_docs_fabric_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_purge_docs_fabric_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_purge_docs_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_purge_docs_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_purge_docs_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_purge_docs_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_red_views_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_red_views_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_red_views_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_red_views_tests.erl diff --git a/src/couch_mrview/test/eunit/couch_mrview_util_tests.erl b/apps/couch_mrview/test/eunit/couch_mrview_util_tests.erl similarity index 100% rename from src/couch_mrview/test/eunit/couch_mrview_util_tests.erl rename to apps/couch_mrview/test/eunit/couch_mrview_util_tests.erl diff --git a/src/couch_peruser/.gitignore b/apps/couch_peruser/.gitignore similarity index 100% rename from src/couch_peruser/.gitignore rename to apps/couch_peruser/.gitignore diff --git a/src/couch_peruser/LICENSE b/apps/couch_peruser/LICENSE similarity index 100% rename from src/couch_peruser/LICENSE rename to apps/couch_peruser/LICENSE diff --git a/src/couch_peruser/README.md b/apps/couch_peruser/README.md similarity index 100% rename from src/couch_peruser/README.md rename to apps/couch_peruser/README.md diff --git a/src/couch_peruser/src/couch_peruser.app.src b/apps/couch_peruser/src/couch_peruser.app.src similarity index 100% rename from src/couch_peruser/src/couch_peruser.app.src rename to apps/couch_peruser/src/couch_peruser.app.src diff --git a/src/couch_peruser/src/couch_peruser.erl b/apps/couch_peruser/src/couch_peruser.erl similarity index 100% rename from src/couch_peruser/src/couch_peruser.erl rename to apps/couch_peruser/src/couch_peruser.erl diff --git a/src/couch_peruser/src/couch_peruser_app.erl b/apps/couch_peruser/src/couch_peruser_app.erl similarity index 100% rename from src/couch_peruser/src/couch_peruser_app.erl rename to apps/couch_peruser/src/couch_peruser_app.erl diff --git a/src/couch_peruser/src/couch_peruser_sup.erl b/apps/couch_peruser/src/couch_peruser_sup.erl similarity index 100% rename from src/couch_peruser/src/couch_peruser_sup.erl rename to apps/couch_peruser/src/couch_peruser_sup.erl diff --git a/src/couch_peruser/test/eunit/couch_peruser_test.erl b/apps/couch_peruser/test/eunit/couch_peruser_test.erl similarity index 100% rename from src/couch_peruser/test/eunit/couch_peruser_test.erl rename to apps/couch_peruser/test/eunit/couch_peruser_test.erl diff --git a/src/couch_plugins/LICENSE b/apps/couch_plugins/LICENSE similarity index 100% rename from src/couch_plugins/LICENSE rename to apps/couch_plugins/LICENSE diff --git a/src/couch_plugins/Makefile.am b/apps/couch_plugins/Makefile.am similarity index 100% rename from src/couch_plugins/Makefile.am rename to apps/couch_plugins/Makefile.am diff --git a/src/couch_plugins/README.md b/apps/couch_plugins/README.md similarity index 100% rename from src/couch_plugins/README.md rename to apps/couch_plugins/README.md diff --git a/src/couch_plugins/src/couch_plugins.app.src b/apps/couch_plugins/src/couch_plugins.app.src similarity index 100% rename from src/couch_plugins/src/couch_plugins.app.src rename to apps/couch_plugins/src/couch_plugins.app.src diff --git a/src/couch_plugins/src/couch_plugins.erl b/apps/couch_plugins/src/couch_plugins.erl similarity index 100% rename from src/couch_plugins/src/couch_plugins.erl rename to apps/couch_plugins/src/couch_plugins.erl diff --git a/src/couch_plugins/src/couch_plugins_httpd.erl b/apps/couch_plugins/src/couch_plugins_httpd.erl similarity index 100% rename from src/couch_plugins/src/couch_plugins_httpd.erl rename to apps/couch_plugins/src/couch_plugins_httpd.erl diff --git a/src/couch_prometheus/src/couch_prometheus.app.src b/apps/couch_prometheus/src/couch_prometheus.app.src similarity index 100% rename from src/couch_prometheus/src/couch_prometheus.app.src rename to apps/couch_prometheus/src/couch_prometheus.app.src diff --git a/src/couch_prometheus/src/couch_prometheus.hrl b/apps/couch_prometheus/src/couch_prometheus.hrl similarity index 100% rename from src/couch_prometheus/src/couch_prometheus.hrl rename to apps/couch_prometheus/src/couch_prometheus.hrl diff --git a/src/couch_prometheus/src/couch_prometheus_app.erl b/apps/couch_prometheus/src/couch_prometheus_app.erl similarity index 100% rename from src/couch_prometheus/src/couch_prometheus_app.erl rename to apps/couch_prometheus/src/couch_prometheus_app.erl diff --git a/src/couch_prometheus/src/couch_prometheus_http.erl b/apps/couch_prometheus/src/couch_prometheus_http.erl similarity index 100% rename from src/couch_prometheus/src/couch_prometheus_http.erl rename to apps/couch_prometheus/src/couch_prometheus_http.erl diff --git a/src/couch_prometheus/src/couch_prometheus_server.erl b/apps/couch_prometheus/src/couch_prometheus_server.erl similarity index 100% rename from src/couch_prometheus/src/couch_prometheus_server.erl rename to apps/couch_prometheus/src/couch_prometheus_server.erl diff --git a/src/couch_prometheus/src/couch_prometheus_sup.erl b/apps/couch_prometheus/src/couch_prometheus_sup.erl similarity index 100% rename from src/couch_prometheus/src/couch_prometheus_sup.erl rename to apps/couch_prometheus/src/couch_prometheus_sup.erl diff --git a/src/couch_prometheus/src/couch_prometheus_util.erl b/apps/couch_prometheus/src/couch_prometheus_util.erl similarity index 100% rename from src/couch_prometheus/src/couch_prometheus_util.erl rename to apps/couch_prometheus/src/couch_prometheus_util.erl diff --git a/src/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl b/apps/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl similarity index 100% rename from src/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl rename to apps/couch_prometheus/test/eunit/couch_prometheus_e2e_tests.erl diff --git a/src/couch_prometheus/test/eunit/couch_prometheus_util_tests.erl b/apps/couch_prometheus/test/eunit/couch_prometheus_util_tests.erl similarity index 100% rename from src/couch_prometheus/test/eunit/couch_prometheus_util_tests.erl rename to apps/couch_prometheus/test/eunit/couch_prometheus_util_tests.erl diff --git a/src/couch_pse_tests/src/couch_pse_tests.app.src b/apps/couch_pse_tests/src/couch_pse_tests.app.src similarity index 100% rename from src/couch_pse_tests/src/couch_pse_tests.app.src rename to apps/couch_pse_tests/src/couch_pse_tests.app.src diff --git a/src/couch_pse_tests/src/cpse_gather.erl b/apps/couch_pse_tests/src/cpse_gather.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_gather.erl rename to apps/couch_pse_tests/src/cpse_gather.erl diff --git a/src/couch_pse_tests/src/cpse_test_attachments.erl b/apps/couch_pse_tests/src/cpse_test_attachments.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_attachments.erl rename to apps/couch_pse_tests/src/cpse_test_attachments.erl diff --git a/src/couch_pse_tests/src/cpse_test_compaction.erl b/apps/couch_pse_tests/src/cpse_test_compaction.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_compaction.erl rename to apps/couch_pse_tests/src/cpse_test_compaction.erl diff --git a/src/couch_pse_tests/src/cpse_test_copy_purge_infos.erl b/apps/couch_pse_tests/src/cpse_test_copy_purge_infos.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_copy_purge_infos.erl rename to apps/couch_pse_tests/src/cpse_test_copy_purge_infos.erl diff --git a/src/couch_pse_tests/src/cpse_test_fold_changes.erl b/apps/couch_pse_tests/src/cpse_test_fold_changes.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_fold_changes.erl rename to apps/couch_pse_tests/src/cpse_test_fold_changes.erl diff --git a/src/couch_pse_tests/src/cpse_test_fold_docs.erl b/apps/couch_pse_tests/src/cpse_test_fold_docs.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_fold_docs.erl rename to apps/couch_pse_tests/src/cpse_test_fold_docs.erl diff --git a/src/couch_pse_tests/src/cpse_test_fold_purge_infos.erl b/apps/couch_pse_tests/src/cpse_test_fold_purge_infos.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_fold_purge_infos.erl rename to apps/couch_pse_tests/src/cpse_test_fold_purge_infos.erl diff --git a/src/couch_pse_tests/src/cpse_test_get_set_props.erl b/apps/couch_pse_tests/src/cpse_test_get_set_props.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_get_set_props.erl rename to apps/couch_pse_tests/src/cpse_test_get_set_props.erl diff --git a/src/couch_pse_tests/src/cpse_test_open_close_delete.erl b/apps/couch_pse_tests/src/cpse_test_open_close_delete.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_open_close_delete.erl rename to apps/couch_pse_tests/src/cpse_test_open_close_delete.erl diff --git a/src/couch_pse_tests/src/cpse_test_purge_bad_checkpoints.erl b/apps/couch_pse_tests/src/cpse_test_purge_bad_checkpoints.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_purge_bad_checkpoints.erl rename to apps/couch_pse_tests/src/cpse_test_purge_bad_checkpoints.erl diff --git a/src/couch_pse_tests/src/cpse_test_purge_docs.erl b/apps/couch_pse_tests/src/cpse_test_purge_docs.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_purge_docs.erl rename to apps/couch_pse_tests/src/cpse_test_purge_docs.erl diff --git a/src/couch_pse_tests/src/cpse_test_purge_replication.erl b/apps/couch_pse_tests/src/cpse_test_purge_replication.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_purge_replication.erl rename to apps/couch_pse_tests/src/cpse_test_purge_replication.erl diff --git a/src/couch_pse_tests/src/cpse_test_purge_seqs.erl b/apps/couch_pse_tests/src/cpse_test_purge_seqs.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_purge_seqs.erl rename to apps/couch_pse_tests/src/cpse_test_purge_seqs.erl diff --git a/src/couch_pse_tests/src/cpse_test_read_write_docs.erl b/apps/couch_pse_tests/src/cpse_test_read_write_docs.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_read_write_docs.erl rename to apps/couch_pse_tests/src/cpse_test_read_write_docs.erl diff --git a/src/couch_pse_tests/src/cpse_test_ref_counting.erl b/apps/couch_pse_tests/src/cpse_test_ref_counting.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_test_ref_counting.erl rename to apps/couch_pse_tests/src/cpse_test_ref_counting.erl diff --git a/src/couch_pse_tests/src/cpse_util.erl b/apps/couch_pse_tests/src/cpse_util.erl similarity index 100% rename from src/couch_pse_tests/src/cpse_util.erl rename to apps/couch_pse_tests/src/cpse_util.erl diff --git a/src/couch_replicator/.gitignore b/apps/couch_replicator/.gitignore similarity index 100% rename from src/couch_replicator/.gitignore rename to apps/couch_replicator/.gitignore diff --git a/src/couch_replicator/LICENSE b/apps/couch_replicator/LICENSE similarity index 100% rename from src/couch_replicator/LICENSE rename to apps/couch_replicator/LICENSE diff --git a/src/couch_replicator/README.md b/apps/couch_replicator/README.md similarity index 100% rename from src/couch_replicator/README.md rename to apps/couch_replicator/README.md diff --git a/src/couch_replicator/include/couch_replicator_api_wrap.hrl b/apps/couch_replicator/include/couch_replicator_api_wrap.hrl similarity index 100% rename from src/couch_replicator/include/couch_replicator_api_wrap.hrl rename to apps/couch_replicator/include/couch_replicator_api_wrap.hrl diff --git a/src/couch_replicator/priv/stats_descriptions.cfg b/apps/couch_replicator/priv/stats_descriptions.cfg similarity index 100% rename from src/couch_replicator/priv/stats_descriptions.cfg rename to apps/couch_replicator/priv/stats_descriptions.cfg diff --git a/src/couch_replicator/src/couch_replicator.app.src b/apps/couch_replicator/src/couch_replicator.app.src similarity index 100% rename from src/couch_replicator/src/couch_replicator.app.src rename to apps/couch_replicator/src/couch_replicator.app.src diff --git a/src/couch_replicator/src/couch_replicator.erl b/apps/couch_replicator/src/couch_replicator.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator.erl rename to apps/couch_replicator/src/couch_replicator.erl diff --git a/src/couch_replicator/src/couch_replicator.hrl b/apps/couch_replicator/src/couch_replicator.hrl similarity index 100% rename from src/couch_replicator/src/couch_replicator.hrl rename to apps/couch_replicator/src/couch_replicator.hrl diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/apps/couch_replicator/src/couch_replicator_api_wrap.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_api_wrap.erl rename to apps/couch_replicator/src/couch_replicator_api_wrap.erl diff --git a/src/couch_replicator/src/couch_replicator_app.erl b/apps/couch_replicator/src/couch_replicator_app.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_app.erl rename to apps/couch_replicator/src/couch_replicator_app.erl diff --git a/src/couch_replicator/src/couch_replicator_auth.erl b/apps/couch_replicator/src/couch_replicator_auth.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_auth.erl rename to apps/couch_replicator/src/couch_replicator_auth.erl diff --git a/src/couch_replicator/src/couch_replicator_auth_noop.erl b/apps/couch_replicator/src/couch_replicator_auth_noop.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_auth_noop.erl rename to apps/couch_replicator/src/couch_replicator_auth_noop.erl diff --git a/src/couch_replicator/src/couch_replicator_auth_session.erl b/apps/couch_replicator/src/couch_replicator_auth_session.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_auth_session.erl rename to apps/couch_replicator/src/couch_replicator_auth_session.erl diff --git a/src/couch_replicator/src/couch_replicator_changes_reader.erl b/apps/couch_replicator/src/couch_replicator_changes_reader.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_changes_reader.erl rename to apps/couch_replicator/src/couch_replicator_changes_reader.erl diff --git a/src/couch_replicator/src/couch_replicator_clustering.erl b/apps/couch_replicator/src/couch_replicator_clustering.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_clustering.erl rename to apps/couch_replicator/src/couch_replicator_clustering.erl diff --git a/src/couch_replicator/src/couch_replicator_connection.erl b/apps/couch_replicator/src/couch_replicator_connection.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_connection.erl rename to apps/couch_replicator/src/couch_replicator_connection.erl diff --git a/src/couch_replicator/src/couch_replicator_db_changes.erl b/apps/couch_replicator/src/couch_replicator_db_changes.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_db_changes.erl rename to apps/couch_replicator/src/couch_replicator_db_changes.erl diff --git a/src/couch_replicator/src/couch_replicator_doc_processor.erl b/apps/couch_replicator/src/couch_replicator_doc_processor.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_doc_processor.erl rename to apps/couch_replicator/src/couch_replicator_doc_processor.erl diff --git a/src/couch_replicator/src/couch_replicator_doc_processor_worker.erl b/apps/couch_replicator/src/couch_replicator_doc_processor_worker.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_doc_processor_worker.erl rename to apps/couch_replicator/src/couch_replicator_doc_processor_worker.erl diff --git a/src/couch_replicator/src/couch_replicator_docs.erl b/apps/couch_replicator/src/couch_replicator_docs.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_docs.erl rename to apps/couch_replicator/src/couch_replicator_docs.erl diff --git a/src/couch_replicator/src/couch_replicator_fabric.erl b/apps/couch_replicator/src/couch_replicator_fabric.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_fabric.erl rename to apps/couch_replicator/src/couch_replicator_fabric.erl diff --git a/src/couch_replicator/src/couch_replicator_fabric_rpc.erl b/apps/couch_replicator/src/couch_replicator_fabric_rpc.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_fabric_rpc.erl rename to apps/couch_replicator/src/couch_replicator_fabric_rpc.erl diff --git a/src/couch_replicator/src/couch_replicator_filters.erl b/apps/couch_replicator/src/couch_replicator_filters.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_filters.erl rename to apps/couch_replicator/src/couch_replicator_filters.erl diff --git a/src/couch_replicator/src/couch_replicator_httpc.erl b/apps/couch_replicator/src/couch_replicator_httpc.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_httpc.erl rename to apps/couch_replicator/src/couch_replicator_httpc.erl diff --git a/src/couch_replicator/src/couch_replicator_httpc_pool.erl b/apps/couch_replicator/src/couch_replicator_httpc_pool.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_httpc_pool.erl rename to apps/couch_replicator/src/couch_replicator_httpc_pool.erl diff --git a/src/couch_replicator/src/couch_replicator_httpd.erl b/apps/couch_replicator/src/couch_replicator_httpd.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_httpd.erl rename to apps/couch_replicator/src/couch_replicator_httpd.erl diff --git a/src/couch_replicator/src/couch_replicator_httpd_util.erl b/apps/couch_replicator/src/couch_replicator_httpd_util.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_httpd_util.erl rename to apps/couch_replicator/src/couch_replicator_httpd_util.erl diff --git a/src/couch_replicator/src/couch_replicator_ids.erl b/apps/couch_replicator/src/couch_replicator_ids.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_ids.erl rename to apps/couch_replicator/src/couch_replicator_ids.erl diff --git a/src/couch_replicator/src/couch_replicator_job_sup.erl b/apps/couch_replicator/src/couch_replicator_job_sup.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_job_sup.erl rename to apps/couch_replicator/src/couch_replicator_job_sup.erl diff --git a/src/couch_replicator/src/couch_replicator_js_functions.hrl b/apps/couch_replicator/src/couch_replicator_js_functions.hrl similarity index 100% rename from src/couch_replicator/src/couch_replicator_js_functions.hrl rename to apps/couch_replicator/src/couch_replicator_js_functions.hrl diff --git a/src/couch_replicator/src/couch_replicator_notifier.erl b/apps/couch_replicator/src/couch_replicator_notifier.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_notifier.erl rename to apps/couch_replicator/src/couch_replicator_notifier.erl diff --git a/src/couch_replicator/src/couch_replicator_rate_limiter.erl b/apps/couch_replicator/src/couch_replicator_rate_limiter.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_rate_limiter.erl rename to apps/couch_replicator/src/couch_replicator_rate_limiter.erl diff --git a/src/couch_replicator/src/couch_replicator_rate_limiter_tables.erl b/apps/couch_replicator/src/couch_replicator_rate_limiter_tables.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_rate_limiter_tables.erl rename to apps/couch_replicator/src/couch_replicator_rate_limiter_tables.erl diff --git a/src/couch_replicator/src/couch_replicator_scheduler.erl b/apps/couch_replicator/src/couch_replicator_scheduler.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_scheduler.erl rename to apps/couch_replicator/src/couch_replicator_scheduler.erl diff --git a/src/couch_replicator/src/couch_replicator_scheduler_job.erl b/apps/couch_replicator/src/couch_replicator_scheduler_job.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_scheduler_job.erl rename to apps/couch_replicator/src/couch_replicator_scheduler_job.erl diff --git a/src/couch_replicator/src/couch_replicator_scheduler_sup.erl b/apps/couch_replicator/src/couch_replicator_scheduler_sup.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_scheduler_sup.erl rename to apps/couch_replicator/src/couch_replicator_scheduler_sup.erl diff --git a/src/couch_replicator/src/couch_replicator_share.erl b/apps/couch_replicator/src/couch_replicator_share.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_share.erl rename to apps/couch_replicator/src/couch_replicator_share.erl diff --git a/src/couch_replicator/src/couch_replicator_stats.erl b/apps/couch_replicator/src/couch_replicator_stats.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_stats.erl rename to apps/couch_replicator/src/couch_replicator_stats.erl diff --git a/src/couch_replicator/src/couch_replicator_sup.erl b/apps/couch_replicator/src/couch_replicator_sup.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_sup.erl rename to apps/couch_replicator/src/couch_replicator_sup.erl diff --git a/src/couch_replicator/src/couch_replicator_utils.erl b/apps/couch_replicator/src/couch_replicator_utils.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_utils.erl rename to apps/couch_replicator/src/couch_replicator_utils.erl diff --git a/src/couch_replicator/src/couch_replicator_worker.erl b/apps/couch_replicator/src/couch_replicator_worker.erl similarity index 100% rename from src/couch_replicator/src/couch_replicator_worker.erl rename to apps/couch_replicator/src/couch_replicator_worker.erl diff --git a/src/couch_replicator/src/json_stream_parse.erl b/apps/couch_replicator/src/json_stream_parse.erl similarity index 100% rename from src/couch_replicator/src/json_stream_parse.erl rename to apps/couch_replicator/src/json_stream_parse.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_attachments_too_large.erl b/apps/couch_replicator/test/eunit/couch_replicator_attachments_too_large.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_attachments_too_large.erl rename to apps/couch_replicator/test/eunit/couch_replicator_attachments_too_large.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_compact_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_compact_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_compact_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_compact_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_connection_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_connection_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_connection_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_connection_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_create_target_with_options_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_create_target_with_options_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_create_target_with_options_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_create_target_with_options_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_error_reporting_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_error_reporting_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_error_reporting_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_error_reporting_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_httpc_pool_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_httpc_pool_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_httpc_pool_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_httpc_pool_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_id_too_long_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_id_too_long_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_id_too_long_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_id_too_long_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_large_atts_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_large_atts_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_large_atts_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_large_atts_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_many_leaves_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_many_leaves_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_many_leaves_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_many_leaves_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_missing_stubs_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_missing_stubs_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_missing_stubs_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_missing_stubs_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_proxy_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_proxy_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_proxy_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_proxy_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_rate_limiter_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_rate_limiter_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_rate_limiter_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_rate_limiter_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl b/apps/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl rename to apps/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_selector_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_selector_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_selector_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_selector_tests.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_small_max_request_size_target.erl b/apps/couch_replicator/test/eunit/couch_replicator_small_max_request_size_target.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_small_max_request_size_target.erl rename to apps/couch_replicator/test/eunit/couch_replicator_small_max_request_size_target.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_test.hrl b/apps/couch_replicator/test/eunit/couch_replicator_test.hrl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_test.hrl rename to apps/couch_replicator/test/eunit/couch_replicator_test.hrl diff --git a/src/couch_replicator/test/eunit/couch_replicator_test_helper.erl b/apps/couch_replicator/test/eunit/couch_replicator_test_helper.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_test_helper.erl rename to apps/couch_replicator/test/eunit/couch_replicator_test_helper.erl diff --git a/src/couch_replicator/test/eunit/couch_replicator_use_checkpoints_tests.erl b/apps/couch_replicator/test/eunit/couch_replicator_use_checkpoints_tests.erl similarity index 100% rename from src/couch_replicator/test/eunit/couch_replicator_use_checkpoints_tests.erl rename to apps/couch_replicator/test/eunit/couch_replicator_use_checkpoints_tests.erl diff --git a/src/couch_stats/.gitignore b/apps/couch_stats/.gitignore similarity index 100% rename from src/couch_stats/.gitignore rename to apps/couch_stats/.gitignore diff --git a/src/couch_stats/LICENSE b/apps/couch_stats/LICENSE similarity index 100% rename from src/couch_stats/LICENSE rename to apps/couch_stats/LICENSE diff --git a/src/couch_stats/README.md b/apps/couch_stats/README.md similarity index 100% rename from src/couch_stats/README.md rename to apps/couch_stats/README.md diff --git a/src/couch_stats/priv/sample_descriptions.cfg b/apps/couch_stats/priv/sample_descriptions.cfg similarity index 100% rename from src/couch_stats/priv/sample_descriptions.cfg rename to apps/couch_stats/priv/sample_descriptions.cfg diff --git a/src/couch_stats/src/couch_stats.app.src b/apps/couch_stats/src/couch_stats.app.src similarity index 100% rename from src/couch_stats/src/couch_stats.app.src rename to apps/couch_stats/src/couch_stats.app.src diff --git a/src/couch_stats/src/couch_stats.erl b/apps/couch_stats/src/couch_stats.erl similarity index 100% rename from src/couch_stats/src/couch_stats.erl rename to apps/couch_stats/src/couch_stats.erl diff --git a/src/couch_stats/src/couch_stats.hrl b/apps/couch_stats/src/couch_stats.hrl similarity index 100% rename from src/couch_stats/src/couch_stats.hrl rename to apps/couch_stats/src/couch_stats.hrl diff --git a/src/couch_stats/src/couch_stats_aggregator.erl b/apps/couch_stats/src/couch_stats_aggregator.erl similarity index 100% rename from src/couch_stats/src/couch_stats_aggregator.erl rename to apps/couch_stats/src/couch_stats_aggregator.erl diff --git a/src/couch_stats/src/couch_stats_app.erl b/apps/couch_stats/src/couch_stats_app.erl similarity index 100% rename from src/couch_stats/src/couch_stats_app.erl rename to apps/couch_stats/src/couch_stats_app.erl diff --git a/src/couch_stats/src/couch_stats_httpd.erl b/apps/couch_stats/src/couch_stats_httpd.erl similarity index 100% rename from src/couch_stats/src/couch_stats_httpd.erl rename to apps/couch_stats/src/couch_stats_httpd.erl diff --git a/src/couch_stats/src/couch_stats_process_tracker.erl b/apps/couch_stats/src/couch_stats_process_tracker.erl similarity index 100% rename from src/couch_stats/src/couch_stats_process_tracker.erl rename to apps/couch_stats/src/couch_stats_process_tracker.erl diff --git a/src/couch_stats/src/couch_stats_sup.erl b/apps/couch_stats/src/couch_stats_sup.erl similarity index 100% rename from src/couch_stats/src/couch_stats_sup.erl rename to apps/couch_stats/src/couch_stats_sup.erl diff --git a/src/couch_tests/.gitignore b/apps/couch_tests/.gitignore similarity index 100% rename from src/couch_tests/.gitignore rename to apps/couch_tests/.gitignore diff --git a/src/couch_tests/include/couch_tests.hrl b/apps/couch_tests/include/couch_tests.hrl similarity index 100% rename from src/couch_tests/include/couch_tests.hrl rename to apps/couch_tests/include/couch_tests.hrl diff --git a/src/couch_tests/rebar.config b/apps/couch_tests/rebar.config similarity index 100% rename from src/couch_tests/rebar.config rename to apps/couch_tests/rebar.config diff --git a/src/couch_tests/setups/couch_epi_dispatch.erl b/apps/couch_tests/setups/couch_epi_dispatch.erl similarity index 100% rename from src/couch_tests/setups/couch_epi_dispatch.erl rename to apps/couch_tests/setups/couch_epi_dispatch.erl diff --git a/src/couch_tests/src/couch_tests.app.src b/apps/couch_tests/src/couch_tests.app.src similarity index 100% rename from src/couch_tests/src/couch_tests.app.src rename to apps/couch_tests/src/couch_tests.app.src diff --git a/src/couch_tests/src/couch_tests.erl b/apps/couch_tests/src/couch_tests.erl similarity index 100% rename from src/couch_tests/src/couch_tests.erl rename to apps/couch_tests/src/couch_tests.erl diff --git a/src/couch_tests/src/couch_tests_combinatorics.erl b/apps/couch_tests/src/couch_tests_combinatorics.erl similarity index 100% rename from src/couch_tests/src/couch_tests_combinatorics.erl rename to apps/couch_tests/src/couch_tests_combinatorics.erl diff --git a/src/couch_tests/test/couch_tests_app_tests.erl b/apps/couch_tests/test/couch_tests_app_tests.erl similarity index 100% rename from src/couch_tests/test/couch_tests_app_tests.erl rename to apps/couch_tests/test/couch_tests_app_tests.erl diff --git a/src/custodian/README b/apps/custodian/README similarity index 100% rename from src/custodian/README rename to apps/custodian/README diff --git a/src/custodian/rebar.config.script b/apps/custodian/rebar.config.script similarity index 100% rename from src/custodian/rebar.config.script rename to apps/custodian/rebar.config.script diff --git a/src/custodian/src/custodian.app.src.script b/apps/custodian/src/custodian.app.src.script similarity index 100% rename from src/custodian/src/custodian.app.src.script rename to apps/custodian/src/custodian.app.src.script diff --git a/src/custodian/src/custodian.erl b/apps/custodian/src/custodian.erl similarity index 100% rename from src/custodian/src/custodian.erl rename to apps/custodian/src/custodian.erl diff --git a/src/custodian/src/custodian_app.erl b/apps/custodian/src/custodian_app.erl similarity index 100% rename from src/custodian/src/custodian_app.erl rename to apps/custodian/src/custodian_app.erl diff --git a/src/custodian/src/custodian_db_checker.erl b/apps/custodian/src/custodian_db_checker.erl similarity index 100% rename from src/custodian/src/custodian_db_checker.erl rename to apps/custodian/src/custodian_db_checker.erl diff --git a/src/custodian/src/custodian_monitor.erl b/apps/custodian/src/custodian_monitor.erl similarity index 100% rename from src/custodian/src/custodian_monitor.erl rename to apps/custodian/src/custodian_monitor.erl diff --git a/src/custodian/src/custodian_noop_monitor.erl b/apps/custodian/src/custodian_noop_monitor.erl similarity index 100% rename from src/custodian/src/custodian_noop_monitor.erl rename to apps/custodian/src/custodian_noop_monitor.erl diff --git a/src/custodian/src/custodian_server.erl b/apps/custodian/src/custodian_server.erl similarity index 100% rename from src/custodian/src/custodian_server.erl rename to apps/custodian/src/custodian_server.erl diff --git a/src/custodian/src/custodian_sup.erl b/apps/custodian/src/custodian_sup.erl similarity index 100% rename from src/custodian/src/custodian_sup.erl rename to apps/custodian/src/custodian_sup.erl diff --git a/src/custodian/src/custodian_util.erl b/apps/custodian/src/custodian_util.erl similarity index 100% rename from src/custodian/src/custodian_util.erl rename to apps/custodian/src/custodian_util.erl diff --git a/src/ddoc_cache/LICENSE b/apps/ddoc_cache/LICENSE similarity index 100% rename from src/ddoc_cache/LICENSE rename to apps/ddoc_cache/LICENSE diff --git a/src/ddoc_cache/README.md b/apps/ddoc_cache/README.md similarity index 100% rename from src/ddoc_cache/README.md rename to apps/ddoc_cache/README.md diff --git a/src/ddoc_cache/priv/stats_descriptions.cfg b/apps/ddoc_cache/priv/stats_descriptions.cfg similarity index 100% rename from src/ddoc_cache/priv/stats_descriptions.cfg rename to apps/ddoc_cache/priv/stats_descriptions.cfg diff --git a/src/ddoc_cache/src/ddoc_cache.app.src b/apps/ddoc_cache/src/ddoc_cache.app.src similarity index 100% rename from src/ddoc_cache/src/ddoc_cache.app.src rename to apps/ddoc_cache/src/ddoc_cache.app.src diff --git a/src/ddoc_cache/src/ddoc_cache.erl b/apps/ddoc_cache/src/ddoc_cache.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache.erl rename to apps/ddoc_cache/src/ddoc_cache.erl diff --git a/src/ddoc_cache/src/ddoc_cache.hrl b/apps/ddoc_cache/src/ddoc_cache.hrl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache.hrl rename to apps/ddoc_cache/src/ddoc_cache.hrl diff --git a/src/ddoc_cache/src/ddoc_cache_app.erl b/apps/ddoc_cache/src/ddoc_cache_app.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_app.erl rename to apps/ddoc_cache/src/ddoc_cache_app.erl diff --git a/src/ddoc_cache/src/ddoc_cache_entry.erl b/apps/ddoc_cache/src/ddoc_cache_entry.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_entry.erl rename to apps/ddoc_cache/src/ddoc_cache_entry.erl diff --git a/src/ddoc_cache/src/ddoc_cache_entry_custom.erl b/apps/ddoc_cache/src/ddoc_cache_entry_custom.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_entry_custom.erl rename to apps/ddoc_cache/src/ddoc_cache_entry_custom.erl diff --git a/src/ddoc_cache/src/ddoc_cache_entry_ddocid.erl b/apps/ddoc_cache/src/ddoc_cache_entry_ddocid.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_entry_ddocid.erl rename to apps/ddoc_cache/src/ddoc_cache_entry_ddocid.erl diff --git a/src/ddoc_cache/src/ddoc_cache_entry_ddocid_rev.erl b/apps/ddoc_cache/src/ddoc_cache_entry_ddocid_rev.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_entry_ddocid_rev.erl rename to apps/ddoc_cache/src/ddoc_cache_entry_ddocid_rev.erl diff --git a/src/ddoc_cache/src/ddoc_cache_entry_validation_funs.erl b/apps/ddoc_cache/src/ddoc_cache_entry_validation_funs.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_entry_validation_funs.erl rename to apps/ddoc_cache/src/ddoc_cache_entry_validation_funs.erl diff --git a/src/ddoc_cache/src/ddoc_cache_lru.erl b/apps/ddoc_cache/src/ddoc_cache_lru.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_lru.erl rename to apps/ddoc_cache/src/ddoc_cache_lru.erl diff --git a/src/ddoc_cache/src/ddoc_cache_sup.erl b/apps/ddoc_cache/src/ddoc_cache_sup.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_sup.erl rename to apps/ddoc_cache/src/ddoc_cache_sup.erl diff --git a/src/ddoc_cache/src/ddoc_cache_value.erl b/apps/ddoc_cache/src/ddoc_cache_value.erl similarity index 100% rename from src/ddoc_cache/src/ddoc_cache_value.erl rename to apps/ddoc_cache/src/ddoc_cache_value.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_basic_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_basic_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_basic_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_basic_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_disabled_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_disabled_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_disabled_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_disabled_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_ev.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_ev.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_ev.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_ev.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_eviction_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_eviction_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_eviction_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_eviction_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_no_cache_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_no_cache_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_no_cache_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_no_cache_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_open_error_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_open_error_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_open_error_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_open_error_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_open_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_open_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_open_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_open_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_refresh_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_refresh_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_refresh_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_refresh_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_remove_test.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_remove_test.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_remove_test.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_remove_test.erl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_test.hrl b/apps/ddoc_cache/test/eunit/ddoc_cache_test.hrl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_test.hrl rename to apps/ddoc_cache/test/eunit/ddoc_cache_test.hrl diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_tutil.erl b/apps/ddoc_cache/test/eunit/ddoc_cache_tutil.erl similarity index 100% rename from src/ddoc_cache/test/eunit/ddoc_cache_tutil.erl rename to apps/ddoc_cache/test/eunit/ddoc_cache_tutil.erl diff --git a/src/dreyfus/.gitignore b/apps/dreyfus/.gitignore similarity index 100% rename from src/dreyfus/.gitignore rename to apps/dreyfus/.gitignore diff --git a/src/dreyfus/LICENSE.txt b/apps/dreyfus/LICENSE.txt similarity index 100% rename from src/dreyfus/LICENSE.txt rename to apps/dreyfus/LICENSE.txt diff --git a/src/dreyfus/README.md b/apps/dreyfus/README.md similarity index 100% rename from src/dreyfus/README.md rename to apps/dreyfus/README.md diff --git a/src/dreyfus/include/dreyfus.hrl b/apps/dreyfus/include/dreyfus.hrl similarity index 100% rename from src/dreyfus/include/dreyfus.hrl rename to apps/dreyfus/include/dreyfus.hrl diff --git a/src/dreyfus/priv/stats_descriptions.cfg b/apps/dreyfus/priv/stats_descriptions.cfg similarity index 100% rename from src/dreyfus/priv/stats_descriptions.cfg rename to apps/dreyfus/priv/stats_descriptions.cfg diff --git a/src/dreyfus/src/clouseau_rpc.erl b/apps/dreyfus/src/clouseau_rpc.erl similarity index 100% rename from src/dreyfus/src/clouseau_rpc.erl rename to apps/dreyfus/src/clouseau_rpc.erl diff --git a/src/dreyfus/src/dreyfus.app.src b/apps/dreyfus/src/dreyfus.app.src similarity index 100% rename from src/dreyfus/src/dreyfus.app.src rename to apps/dreyfus/src/dreyfus.app.src diff --git a/src/dreyfus/src/dreyfus.erl b/apps/dreyfus/src/dreyfus.erl similarity index 100% rename from src/dreyfus/src/dreyfus.erl rename to apps/dreyfus/src/dreyfus.erl diff --git a/src/dreyfus/src/dreyfus_app.erl b/apps/dreyfus/src/dreyfus_app.erl similarity index 100% rename from src/dreyfus/src/dreyfus_app.erl rename to apps/dreyfus/src/dreyfus_app.erl diff --git a/src/dreyfus/src/dreyfus_bookmark.erl b/apps/dreyfus/src/dreyfus_bookmark.erl similarity index 100% rename from src/dreyfus/src/dreyfus_bookmark.erl rename to apps/dreyfus/src/dreyfus_bookmark.erl diff --git a/src/dreyfus/src/dreyfus_config.erl b/apps/dreyfus/src/dreyfus_config.erl similarity index 100% rename from src/dreyfus/src/dreyfus_config.erl rename to apps/dreyfus/src/dreyfus_config.erl diff --git a/src/dreyfus/src/dreyfus_epi.erl b/apps/dreyfus/src/dreyfus_epi.erl similarity index 100% rename from src/dreyfus/src/dreyfus_epi.erl rename to apps/dreyfus/src/dreyfus_epi.erl diff --git a/src/dreyfus/src/dreyfus_fabric.erl b/apps/dreyfus/src/dreyfus_fabric.erl similarity index 100% rename from src/dreyfus/src/dreyfus_fabric.erl rename to apps/dreyfus/src/dreyfus_fabric.erl diff --git a/src/dreyfus/src/dreyfus_fabric_cleanup.erl b/apps/dreyfus/src/dreyfus_fabric_cleanup.erl similarity index 100% rename from src/dreyfus/src/dreyfus_fabric_cleanup.erl rename to apps/dreyfus/src/dreyfus_fabric_cleanup.erl diff --git a/src/dreyfus/src/dreyfus_fabric_group1.erl b/apps/dreyfus/src/dreyfus_fabric_group1.erl similarity index 100% rename from src/dreyfus/src/dreyfus_fabric_group1.erl rename to apps/dreyfus/src/dreyfus_fabric_group1.erl diff --git a/src/dreyfus/src/dreyfus_fabric_group2.erl b/apps/dreyfus/src/dreyfus_fabric_group2.erl similarity index 100% rename from src/dreyfus/src/dreyfus_fabric_group2.erl rename to apps/dreyfus/src/dreyfus_fabric_group2.erl diff --git a/src/dreyfus/src/dreyfus_fabric_info.erl b/apps/dreyfus/src/dreyfus_fabric_info.erl similarity index 100% rename from src/dreyfus/src/dreyfus_fabric_info.erl rename to apps/dreyfus/src/dreyfus_fabric_info.erl diff --git a/src/dreyfus/src/dreyfus_fabric_search.erl b/apps/dreyfus/src/dreyfus_fabric_search.erl similarity index 100% rename from src/dreyfus/src/dreyfus_fabric_search.erl rename to apps/dreyfus/src/dreyfus_fabric_search.erl diff --git a/src/dreyfus/src/dreyfus_httpd.erl b/apps/dreyfus/src/dreyfus_httpd.erl similarity index 100% rename from src/dreyfus/src/dreyfus_httpd.erl rename to apps/dreyfus/src/dreyfus_httpd.erl diff --git a/src/dreyfus/src/dreyfus_httpd_handlers.erl b/apps/dreyfus/src/dreyfus_httpd_handlers.erl similarity index 100% rename from src/dreyfus/src/dreyfus_httpd_handlers.erl rename to apps/dreyfus/src/dreyfus_httpd_handlers.erl diff --git a/src/dreyfus/src/dreyfus_index.erl b/apps/dreyfus/src/dreyfus_index.erl similarity index 100% rename from src/dreyfus/src/dreyfus_index.erl rename to apps/dreyfus/src/dreyfus_index.erl diff --git a/src/dreyfus/src/dreyfus_index_manager.erl b/apps/dreyfus/src/dreyfus_index_manager.erl similarity index 100% rename from src/dreyfus/src/dreyfus_index_manager.erl rename to apps/dreyfus/src/dreyfus_index_manager.erl diff --git a/src/dreyfus/src/dreyfus_index_updater.erl b/apps/dreyfus/src/dreyfus_index_updater.erl similarity index 100% rename from src/dreyfus/src/dreyfus_index_updater.erl rename to apps/dreyfus/src/dreyfus_index_updater.erl diff --git a/src/dreyfus/src/dreyfus_plugin_couch_db.erl b/apps/dreyfus/src/dreyfus_plugin_couch_db.erl similarity index 100% rename from src/dreyfus/src/dreyfus_plugin_couch_db.erl rename to apps/dreyfus/src/dreyfus_plugin_couch_db.erl diff --git a/src/dreyfus/src/dreyfus_rpc.erl b/apps/dreyfus/src/dreyfus_rpc.erl similarity index 100% rename from src/dreyfus/src/dreyfus_rpc.erl rename to apps/dreyfus/src/dreyfus_rpc.erl diff --git a/src/dreyfus/src/dreyfus_sup.erl b/apps/dreyfus/src/dreyfus_sup.erl similarity index 100% rename from src/dreyfus/src/dreyfus_sup.erl rename to apps/dreyfus/src/dreyfus_sup.erl diff --git a/src/dreyfus/src/dreyfus_util.erl b/apps/dreyfus/src/dreyfus_util.erl similarity index 100% rename from src/dreyfus/src/dreyfus_util.erl rename to apps/dreyfus/src/dreyfus_util.erl diff --git a/src/dreyfus/test/dreyfus_blacklist_await_test.erl b/apps/dreyfus/test/dreyfus_blacklist_await_test.erl similarity index 100% rename from src/dreyfus/test/dreyfus_blacklist_await_test.erl rename to apps/dreyfus/test/dreyfus_blacklist_await_test.erl diff --git a/src/dreyfus/test/dreyfus_blacklist_request_test.erl b/apps/dreyfus/test/dreyfus_blacklist_request_test.erl similarity index 100% rename from src/dreyfus/test/dreyfus_blacklist_request_test.erl rename to apps/dreyfus/test/dreyfus_blacklist_request_test.erl diff --git a/src/dreyfus/test/dreyfus_config_test.erl b/apps/dreyfus/test/dreyfus_config_test.erl similarity index 100% rename from src/dreyfus/test/dreyfus_config_test.erl rename to apps/dreyfus/test/dreyfus_config_test.erl diff --git a/src/dreyfus/test/dreyfus_purge_test.erl b/apps/dreyfus/test/dreyfus_purge_test.erl similarity index 100% rename from src/dreyfus/test/dreyfus_purge_test.erl rename to apps/dreyfus/test/dreyfus_purge_test.erl diff --git a/src/dreyfus/test/dreyfus_test_util.erl b/apps/dreyfus/test/dreyfus_test_util.erl similarity index 100% rename from src/dreyfus/test/dreyfus_test_util.erl rename to apps/dreyfus/test/dreyfus_test_util.erl diff --git a/src/dreyfus/test/elixir/mix.exs b/apps/dreyfus/test/elixir/mix.exs similarity index 100% rename from src/dreyfus/test/elixir/mix.exs rename to apps/dreyfus/test/elixir/mix.exs diff --git a/src/dreyfus/test/elixir/run b/apps/dreyfus/test/elixir/run similarity index 100% rename from src/dreyfus/test/elixir/run rename to apps/dreyfus/test/elixir/run diff --git a/src/dreyfus/test/elixir/test/partition_search_test.exs b/apps/dreyfus/test/elixir/test/partition_search_test.exs similarity index 100% rename from src/dreyfus/test/elixir/test/partition_search_test.exs rename to apps/dreyfus/test/elixir/test/partition_search_test.exs diff --git a/src/dreyfus/test/elixir/test/search_test.exs b/apps/dreyfus/test/elixir/test/search_test.exs similarity index 100% rename from src/dreyfus/test/elixir/test/search_test.exs rename to apps/dreyfus/test/elixir/test/search_test.exs diff --git a/src/dreyfus/test/elixir/test/test_helper.exs b/apps/dreyfus/test/elixir/test/test_helper.exs similarity index 100% rename from src/dreyfus/test/elixir/test/test_helper.exs rename to apps/dreyfus/test/elixir/test/test_helper.exs diff --git a/src/fabric/LICENSE b/apps/fabric/LICENSE similarity index 100% rename from src/fabric/LICENSE rename to apps/fabric/LICENSE diff --git a/src/fabric/README.md b/apps/fabric/README.md similarity index 100% rename from src/fabric/README.md rename to apps/fabric/README.md diff --git a/src/fabric/include/fabric.hrl b/apps/fabric/include/fabric.hrl similarity index 100% rename from src/fabric/include/fabric.hrl rename to apps/fabric/include/fabric.hrl diff --git a/src/fabric/priv/stats_descriptions.cfg b/apps/fabric/priv/stats_descriptions.cfg similarity index 100% rename from src/fabric/priv/stats_descriptions.cfg rename to apps/fabric/priv/stats_descriptions.cfg diff --git a/src/fabric/rebar.config b/apps/fabric/rebar.config similarity index 100% rename from src/fabric/rebar.config rename to apps/fabric/rebar.config diff --git a/src/fabric/src/fabric.app.src b/apps/fabric/src/fabric.app.src similarity index 100% rename from src/fabric/src/fabric.app.src rename to apps/fabric/src/fabric.app.src diff --git a/src/fabric/src/fabric.erl b/apps/fabric/src/fabric.erl similarity index 100% rename from src/fabric/src/fabric.erl rename to apps/fabric/src/fabric.erl diff --git a/src/fabric/src/fabric_db_create.erl b/apps/fabric/src/fabric_db_create.erl similarity index 100% rename from src/fabric/src/fabric_db_create.erl rename to apps/fabric/src/fabric_db_create.erl diff --git a/src/fabric/src/fabric_db_delete.erl b/apps/fabric/src/fabric_db_delete.erl similarity index 100% rename from src/fabric/src/fabric_db_delete.erl rename to apps/fabric/src/fabric_db_delete.erl diff --git a/src/fabric/src/fabric_db_doc_count.erl b/apps/fabric/src/fabric_db_doc_count.erl similarity index 100% rename from src/fabric/src/fabric_db_doc_count.erl rename to apps/fabric/src/fabric_db_doc_count.erl diff --git a/src/fabric/src/fabric_db_info.erl b/apps/fabric/src/fabric_db_info.erl similarity index 100% rename from src/fabric/src/fabric_db_info.erl rename to apps/fabric/src/fabric_db_info.erl diff --git a/src/fabric/src/fabric_db_meta.erl b/apps/fabric/src/fabric_db_meta.erl similarity index 100% rename from src/fabric/src/fabric_db_meta.erl rename to apps/fabric/src/fabric_db_meta.erl diff --git a/src/fabric/src/fabric_db_partition_info.erl b/apps/fabric/src/fabric_db_partition_info.erl similarity index 100% rename from src/fabric/src/fabric_db_partition_info.erl rename to apps/fabric/src/fabric_db_partition_info.erl diff --git a/src/fabric/src/fabric_db_update_listener.erl b/apps/fabric/src/fabric_db_update_listener.erl similarity index 100% rename from src/fabric/src/fabric_db_update_listener.erl rename to apps/fabric/src/fabric_db_update_listener.erl diff --git a/src/fabric/src/fabric_db_uuids.erl b/apps/fabric/src/fabric_db_uuids.erl similarity index 100% rename from src/fabric/src/fabric_db_uuids.erl rename to apps/fabric/src/fabric_db_uuids.erl diff --git a/src/fabric/src/fabric_design_doc_count.erl b/apps/fabric/src/fabric_design_doc_count.erl similarity index 100% rename from src/fabric/src/fabric_design_doc_count.erl rename to apps/fabric/src/fabric_design_doc_count.erl diff --git a/src/fabric/src/fabric_dict.erl b/apps/fabric/src/fabric_dict.erl similarity index 100% rename from src/fabric/src/fabric_dict.erl rename to apps/fabric/src/fabric_dict.erl diff --git a/src/fabric/src/fabric_doc_atts.erl b/apps/fabric/src/fabric_doc_atts.erl similarity index 100% rename from src/fabric/src/fabric_doc_atts.erl rename to apps/fabric/src/fabric_doc_atts.erl diff --git a/src/fabric/src/fabric_doc_missing_revs.erl b/apps/fabric/src/fabric_doc_missing_revs.erl similarity index 100% rename from src/fabric/src/fabric_doc_missing_revs.erl rename to apps/fabric/src/fabric_doc_missing_revs.erl diff --git a/src/fabric/src/fabric_doc_open.erl b/apps/fabric/src/fabric_doc_open.erl similarity index 100% rename from src/fabric/src/fabric_doc_open.erl rename to apps/fabric/src/fabric_doc_open.erl diff --git a/src/fabric/src/fabric_doc_open_revs.erl b/apps/fabric/src/fabric_doc_open_revs.erl similarity index 100% rename from src/fabric/src/fabric_doc_open_revs.erl rename to apps/fabric/src/fabric_doc_open_revs.erl diff --git a/src/fabric/src/fabric_doc_purge.erl b/apps/fabric/src/fabric_doc_purge.erl similarity index 100% rename from src/fabric/src/fabric_doc_purge.erl rename to apps/fabric/src/fabric_doc_purge.erl diff --git a/src/fabric/src/fabric_doc_update.erl b/apps/fabric/src/fabric_doc_update.erl similarity index 100% rename from src/fabric/src/fabric_doc_update.erl rename to apps/fabric/src/fabric_doc_update.erl diff --git a/src/fabric/src/fabric_group_info.erl b/apps/fabric/src/fabric_group_info.erl similarity index 100% rename from src/fabric/src/fabric_group_info.erl rename to apps/fabric/src/fabric_group_info.erl diff --git a/src/fabric/src/fabric_ring.erl b/apps/fabric/src/fabric_ring.erl similarity index 100% rename from src/fabric/src/fabric_ring.erl rename to apps/fabric/src/fabric_ring.erl diff --git a/src/fabric/src/fabric_rpc.erl b/apps/fabric/src/fabric_rpc.erl similarity index 100% rename from src/fabric/src/fabric_rpc.erl rename to apps/fabric/src/fabric_rpc.erl diff --git a/src/fabric/src/fabric_streams.erl b/apps/fabric/src/fabric_streams.erl similarity index 100% rename from src/fabric/src/fabric_streams.erl rename to apps/fabric/src/fabric_streams.erl diff --git a/src/fabric/src/fabric_util.erl b/apps/fabric/src/fabric_util.erl similarity index 100% rename from src/fabric/src/fabric_util.erl rename to apps/fabric/src/fabric_util.erl diff --git a/src/fabric/src/fabric_view.erl b/apps/fabric/src/fabric_view.erl similarity index 100% rename from src/fabric/src/fabric_view.erl rename to apps/fabric/src/fabric_view.erl diff --git a/src/fabric/src/fabric_view_all_docs.erl b/apps/fabric/src/fabric_view_all_docs.erl similarity index 100% rename from src/fabric/src/fabric_view_all_docs.erl rename to apps/fabric/src/fabric_view_all_docs.erl diff --git a/src/fabric/src/fabric_view_changes.erl b/apps/fabric/src/fabric_view_changes.erl similarity index 100% rename from src/fabric/src/fabric_view_changes.erl rename to apps/fabric/src/fabric_view_changes.erl diff --git a/src/fabric/src/fabric_view_map.erl b/apps/fabric/src/fabric_view_map.erl similarity index 100% rename from src/fabric/src/fabric_view_map.erl rename to apps/fabric/src/fabric_view_map.erl diff --git a/src/fabric/src/fabric_view_reduce.erl b/apps/fabric/src/fabric_view_reduce.erl similarity index 100% rename from src/fabric/src/fabric_view_reduce.erl rename to apps/fabric/src/fabric_view_reduce.erl diff --git a/src/fabric/test/eunit/fabric_db_create_tests.erl b/apps/fabric/test/eunit/fabric_db_create_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_db_create_tests.erl rename to apps/fabric/test/eunit/fabric_db_create_tests.erl diff --git a/src/fabric/test/eunit/fabric_db_info_tests.erl b/apps/fabric/test/eunit/fabric_db_info_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_db_info_tests.erl rename to apps/fabric/test/eunit/fabric_db_info_tests.erl diff --git a/src/fabric/test/eunit/fabric_db_uuids_tests.erl b/apps/fabric/test/eunit/fabric_db_uuids_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_db_uuids_tests.erl rename to apps/fabric/test/eunit/fabric_db_uuids_tests.erl diff --git a/src/fabric/test/eunit/fabric_moved_shards_seq_tests.erl b/apps/fabric/test/eunit/fabric_moved_shards_seq_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_moved_shards_seq_tests.erl rename to apps/fabric/test/eunit/fabric_moved_shards_seq_tests.erl diff --git a/src/fabric/test/eunit/fabric_rpc_purge_tests.erl b/apps/fabric/test/eunit/fabric_rpc_purge_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_rpc_purge_tests.erl rename to apps/fabric/test/eunit/fabric_rpc_purge_tests.erl diff --git a/src/fabric/test/eunit/fabric_rpc_tests.erl b/apps/fabric/test/eunit/fabric_rpc_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_rpc_tests.erl rename to apps/fabric/test/eunit/fabric_rpc_tests.erl diff --git a/src/fabric/test/eunit/fabric_tests.erl b/apps/fabric/test/eunit/fabric_tests.erl similarity index 100% rename from src/fabric/test/eunit/fabric_tests.erl rename to apps/fabric/test/eunit/fabric_tests.erl diff --git a/src/global_changes/.gitignore b/apps/global_changes/.gitignore similarity index 100% rename from src/global_changes/.gitignore rename to apps/global_changes/.gitignore diff --git a/src/global_changes/LICENSE b/apps/global_changes/LICENSE similarity index 100% rename from src/global_changes/LICENSE rename to apps/global_changes/LICENSE diff --git a/src/global_changes/README.md b/apps/global_changes/README.md similarity index 100% rename from src/global_changes/README.md rename to apps/global_changes/README.md diff --git a/src/global_changes/priv/stats_descriptions.cfg b/apps/global_changes/priv/stats_descriptions.cfg similarity index 100% rename from src/global_changes/priv/stats_descriptions.cfg rename to apps/global_changes/priv/stats_descriptions.cfg diff --git a/src/global_changes/src/global_changes.app.src b/apps/global_changes/src/global_changes.app.src similarity index 100% rename from src/global_changes/src/global_changes.app.src rename to apps/global_changes/src/global_changes.app.src diff --git a/src/global_changes/src/global_changes_app.erl b/apps/global_changes/src/global_changes_app.erl similarity index 100% rename from src/global_changes/src/global_changes_app.erl rename to apps/global_changes/src/global_changes_app.erl diff --git a/src/global_changes/src/global_changes_epi.erl b/apps/global_changes/src/global_changes_epi.erl similarity index 100% rename from src/global_changes/src/global_changes_epi.erl rename to apps/global_changes/src/global_changes_epi.erl diff --git a/src/global_changes/src/global_changes_httpd.erl b/apps/global_changes/src/global_changes_httpd.erl similarity index 100% rename from src/global_changes/src/global_changes_httpd.erl rename to apps/global_changes/src/global_changes_httpd.erl diff --git a/src/global_changes/src/global_changes_httpd_handlers.erl b/apps/global_changes/src/global_changes_httpd_handlers.erl similarity index 100% rename from src/global_changes/src/global_changes_httpd_handlers.erl rename to apps/global_changes/src/global_changes_httpd_handlers.erl diff --git a/src/global_changes/src/global_changes_listener.erl b/apps/global_changes/src/global_changes_listener.erl similarity index 100% rename from src/global_changes/src/global_changes_listener.erl rename to apps/global_changes/src/global_changes_listener.erl diff --git a/src/global_changes/src/global_changes_plugin.erl b/apps/global_changes/src/global_changes_plugin.erl similarity index 100% rename from src/global_changes/src/global_changes_plugin.erl rename to apps/global_changes/src/global_changes_plugin.erl diff --git a/src/global_changes/src/global_changes_server.erl b/apps/global_changes/src/global_changes_server.erl similarity index 100% rename from src/global_changes/src/global_changes_server.erl rename to apps/global_changes/src/global_changes_server.erl diff --git a/src/global_changes/src/global_changes_sup.erl b/apps/global_changes/src/global_changes_sup.erl similarity index 100% rename from src/global_changes/src/global_changes_sup.erl rename to apps/global_changes/src/global_changes_sup.erl diff --git a/src/global_changes/src/global_changes_util.erl b/apps/global_changes/src/global_changes_util.erl similarity index 100% rename from src/global_changes/src/global_changes_util.erl rename to apps/global_changes/src/global_changes_util.erl diff --git a/src/global_changes/test/eunit/global_changes_hooks_tests.erl b/apps/global_changes/test/eunit/global_changes_hooks_tests.erl similarity index 100% rename from src/global_changes/test/eunit/global_changes_hooks_tests.erl rename to apps/global_changes/test/eunit/global_changes_hooks_tests.erl diff --git a/src/ioq/.gitignore b/apps/ioq/.gitignore similarity index 100% rename from src/ioq/.gitignore rename to apps/ioq/.gitignore diff --git a/src/ioq/src/ioq.app.src b/apps/ioq/src/ioq.app.src similarity index 100% rename from src/ioq/src/ioq.app.src rename to apps/ioq/src/ioq.app.src diff --git a/src/ioq/src/ioq.erl b/apps/ioq/src/ioq.erl similarity index 100% rename from src/ioq/src/ioq.erl rename to apps/ioq/src/ioq.erl diff --git a/src/ioq/src/ioq_app.erl b/apps/ioq/src/ioq_app.erl similarity index 100% rename from src/ioq/src/ioq_app.erl rename to apps/ioq/src/ioq_app.erl diff --git a/src/ioq/src/ioq_sup.erl b/apps/ioq/src/ioq_sup.erl similarity index 100% rename from src/ioq/src/ioq_sup.erl rename to apps/ioq/src/ioq_sup.erl diff --git a/src/jwtf/.gitignore b/apps/jwtf/.gitignore similarity index 100% rename from src/jwtf/.gitignore rename to apps/jwtf/.gitignore diff --git a/src/jwtf/LICENSE b/apps/jwtf/LICENSE similarity index 100% rename from src/jwtf/LICENSE rename to apps/jwtf/LICENSE diff --git a/src/jwtf/README.md b/apps/jwtf/README.md similarity index 100% rename from src/jwtf/README.md rename to apps/jwtf/README.md diff --git a/src/jwtf/rebar.config b/apps/jwtf/rebar.config similarity index 100% rename from src/jwtf/rebar.config rename to apps/jwtf/rebar.config diff --git a/src/jwtf/src/jwtf.app.src b/apps/jwtf/src/jwtf.app.src similarity index 100% rename from src/jwtf/src/jwtf.app.src rename to apps/jwtf/src/jwtf.app.src diff --git a/src/jwtf/src/jwtf.erl b/apps/jwtf/src/jwtf.erl similarity index 100% rename from src/jwtf/src/jwtf.erl rename to apps/jwtf/src/jwtf.erl diff --git a/src/jwtf/src/jwtf_app.erl b/apps/jwtf/src/jwtf_app.erl similarity index 100% rename from src/jwtf/src/jwtf_app.erl rename to apps/jwtf/src/jwtf_app.erl diff --git a/src/jwtf/src/jwtf_keystore.erl b/apps/jwtf/src/jwtf_keystore.erl similarity index 100% rename from src/jwtf/src/jwtf_keystore.erl rename to apps/jwtf/src/jwtf_keystore.erl diff --git a/src/jwtf/src/jwtf_sup.erl b/apps/jwtf/src/jwtf_sup.erl similarity index 100% rename from src/jwtf/src/jwtf_sup.erl rename to apps/jwtf/src/jwtf_sup.erl diff --git a/src/jwtf/test/jwtf_keystore_tests.erl b/apps/jwtf/test/jwtf_keystore_tests.erl similarity index 100% rename from src/jwtf/test/jwtf_keystore_tests.erl rename to apps/jwtf/test/jwtf_keystore_tests.erl diff --git a/src/jwtf/test/jwtf_tests.erl b/apps/jwtf/test/jwtf_tests.erl similarity index 100% rename from src/jwtf/test/jwtf_tests.erl rename to apps/jwtf/test/jwtf_tests.erl diff --git a/src/ken/README.md b/apps/ken/README.md similarity index 100% rename from src/ken/README.md rename to apps/ken/README.md diff --git a/src/ken/rebar.config.script b/apps/ken/rebar.config.script similarity index 100% rename from src/ken/rebar.config.script rename to apps/ken/rebar.config.script diff --git a/src/ken/src/ken.app.src.script b/apps/ken/src/ken.app.src.script similarity index 100% rename from src/ken/src/ken.app.src.script rename to apps/ken/src/ken.app.src.script diff --git a/src/ken/src/ken.erl b/apps/ken/src/ken.erl similarity index 100% rename from src/ken/src/ken.erl rename to apps/ken/src/ken.erl diff --git a/src/ken/src/ken_app.erl b/apps/ken/src/ken_app.erl similarity index 100% rename from src/ken/src/ken_app.erl rename to apps/ken/src/ken_app.erl diff --git a/src/ken/src/ken_event_handler.erl b/apps/ken/src/ken_event_handler.erl similarity index 100% rename from src/ken/src/ken_event_handler.erl rename to apps/ken/src/ken_event_handler.erl diff --git a/src/ken/src/ken_server.erl b/apps/ken/src/ken_server.erl similarity index 100% rename from src/ken/src/ken_server.erl rename to apps/ken/src/ken_server.erl diff --git a/src/ken/src/ken_sup.erl b/apps/ken/src/ken_sup.erl similarity index 100% rename from src/ken/src/ken_sup.erl rename to apps/ken/src/ken_sup.erl diff --git a/src/ken/test/config.ini b/apps/ken/test/config.ini similarity index 100% rename from src/ken/test/config.ini rename to apps/ken/test/config.ini diff --git a/src/ken/test/ken_server_test.erl b/apps/ken/test/ken_server_test.erl similarity index 100% rename from src/ken/test/ken_server_test.erl rename to apps/ken/test/ken_server_test.erl diff --git a/src/mango/.gitignore b/apps/mango/.gitignore similarity index 100% rename from src/mango/.gitignore rename to apps/mango/.gitignore diff --git a/src/mango/LICENSE.txt b/apps/mango/LICENSE.txt similarity index 100% rename from src/mango/LICENSE.txt rename to apps/mango/LICENSE.txt diff --git a/src/mango/README.md b/apps/mango/README.md similarity index 100% rename from src/mango/README.md rename to apps/mango/README.md diff --git a/src/mango/TODO.md b/apps/mango/TODO.md similarity index 100% rename from src/mango/TODO.md rename to apps/mango/TODO.md diff --git a/src/mango/rebar.config.script b/apps/mango/rebar.config.script similarity index 100% rename from src/mango/rebar.config.script rename to apps/mango/rebar.config.script diff --git a/src/mango/requirements.txt b/apps/mango/requirements.txt similarity index 100% rename from src/mango/requirements.txt rename to apps/mango/requirements.txt diff --git a/src/mango/src/mango.app.src b/apps/mango/src/mango.app.src similarity index 100% rename from src/mango/src/mango.app.src rename to apps/mango/src/mango.app.src diff --git a/src/mango/src/mango.hrl b/apps/mango/src/mango.hrl similarity index 100% rename from src/mango/src/mango.hrl rename to apps/mango/src/mango.hrl diff --git a/src/mango/src/mango_app.erl b/apps/mango/src/mango_app.erl similarity index 100% rename from src/mango/src/mango_app.erl rename to apps/mango/src/mango_app.erl diff --git a/src/mango/src/mango_crud.erl b/apps/mango/src/mango_crud.erl similarity index 100% rename from src/mango/src/mango_crud.erl rename to apps/mango/src/mango_crud.erl diff --git a/src/mango/src/mango_cursor.erl b/apps/mango/src/mango_cursor.erl similarity index 100% rename from src/mango/src/mango_cursor.erl rename to apps/mango/src/mango_cursor.erl diff --git a/src/mango/src/mango_cursor.hrl b/apps/mango/src/mango_cursor.hrl similarity index 100% rename from src/mango/src/mango_cursor.hrl rename to apps/mango/src/mango_cursor.hrl diff --git a/src/mango/src/mango_cursor_special.erl b/apps/mango/src/mango_cursor_special.erl similarity index 100% rename from src/mango/src/mango_cursor_special.erl rename to apps/mango/src/mango_cursor_special.erl diff --git a/src/mango/src/mango_cursor_text.erl b/apps/mango/src/mango_cursor_text.erl similarity index 100% rename from src/mango/src/mango_cursor_text.erl rename to apps/mango/src/mango_cursor_text.erl diff --git a/src/mango/src/mango_cursor_view.erl b/apps/mango/src/mango_cursor_view.erl similarity index 100% rename from src/mango/src/mango_cursor_view.erl rename to apps/mango/src/mango_cursor_view.erl diff --git a/src/mango/src/mango_doc.erl b/apps/mango/src/mango_doc.erl similarity index 100% rename from src/mango/src/mango_doc.erl rename to apps/mango/src/mango_doc.erl diff --git a/src/mango/src/mango_epi.erl b/apps/mango/src/mango_epi.erl similarity index 100% rename from src/mango/src/mango_epi.erl rename to apps/mango/src/mango_epi.erl diff --git a/src/mango/src/mango_error.erl b/apps/mango/src/mango_error.erl similarity index 100% rename from src/mango/src/mango_error.erl rename to apps/mango/src/mango_error.erl diff --git a/src/mango/src/mango_execution_stats.erl b/apps/mango/src/mango_execution_stats.erl similarity index 100% rename from src/mango/src/mango_execution_stats.erl rename to apps/mango/src/mango_execution_stats.erl diff --git a/src/mango/src/mango_execution_stats.hrl b/apps/mango/src/mango_execution_stats.hrl similarity index 100% rename from src/mango/src/mango_execution_stats.hrl rename to apps/mango/src/mango_execution_stats.hrl diff --git a/src/mango/src/mango_fields.erl b/apps/mango/src/mango_fields.erl similarity index 100% rename from src/mango/src/mango_fields.erl rename to apps/mango/src/mango_fields.erl diff --git a/src/mango/src/mango_httpd.erl b/apps/mango/src/mango_httpd.erl similarity index 100% rename from src/mango/src/mango_httpd.erl rename to apps/mango/src/mango_httpd.erl diff --git a/src/mango/src/mango_httpd_handlers.erl b/apps/mango/src/mango_httpd_handlers.erl similarity index 100% rename from src/mango/src/mango_httpd_handlers.erl rename to apps/mango/src/mango_httpd_handlers.erl diff --git a/src/mango/src/mango_idx.erl b/apps/mango/src/mango_idx.erl similarity index 100% rename from src/mango/src/mango_idx.erl rename to apps/mango/src/mango_idx.erl diff --git a/src/mango/src/mango_idx.hrl b/apps/mango/src/mango_idx.hrl similarity index 100% rename from src/mango/src/mango_idx.hrl rename to apps/mango/src/mango_idx.hrl diff --git a/src/mango/src/mango_idx_special.erl b/apps/mango/src/mango_idx_special.erl similarity index 100% rename from src/mango/src/mango_idx_special.erl rename to apps/mango/src/mango_idx_special.erl diff --git a/src/mango/src/mango_idx_text.erl b/apps/mango/src/mango_idx_text.erl similarity index 100% rename from src/mango/src/mango_idx_text.erl rename to apps/mango/src/mango_idx_text.erl diff --git a/src/mango/src/mango_idx_view.erl b/apps/mango/src/mango_idx_view.erl similarity index 100% rename from src/mango/src/mango_idx_view.erl rename to apps/mango/src/mango_idx_view.erl diff --git a/src/mango/src/mango_idx_view.hrl b/apps/mango/src/mango_idx_view.hrl similarity index 100% rename from src/mango/src/mango_idx_view.hrl rename to apps/mango/src/mango_idx_view.hrl diff --git a/src/mango/src/mango_json.erl b/apps/mango/src/mango_json.erl similarity index 100% rename from src/mango/src/mango_json.erl rename to apps/mango/src/mango_json.erl diff --git a/src/mango/src/mango_json_bookmark.erl b/apps/mango/src/mango_json_bookmark.erl similarity index 100% rename from src/mango/src/mango_json_bookmark.erl rename to apps/mango/src/mango_json_bookmark.erl diff --git a/src/mango/src/mango_native_proc.erl b/apps/mango/src/mango_native_proc.erl similarity index 100% rename from src/mango/src/mango_native_proc.erl rename to apps/mango/src/mango_native_proc.erl diff --git a/src/mango/src/mango_opts.erl b/apps/mango/src/mango_opts.erl similarity index 100% rename from src/mango/src/mango_opts.erl rename to apps/mango/src/mango_opts.erl diff --git a/src/mango/src/mango_selector.erl b/apps/mango/src/mango_selector.erl similarity index 100% rename from src/mango/src/mango_selector.erl rename to apps/mango/src/mango_selector.erl diff --git a/src/mango/src/mango_selector_text.erl b/apps/mango/src/mango_selector_text.erl similarity index 100% rename from src/mango/src/mango_selector_text.erl rename to apps/mango/src/mango_selector_text.erl diff --git a/src/mango/src/mango_sort.erl b/apps/mango/src/mango_sort.erl similarity index 100% rename from src/mango/src/mango_sort.erl rename to apps/mango/src/mango_sort.erl diff --git a/src/mango/src/mango_sup.erl b/apps/mango/src/mango_sup.erl similarity index 100% rename from src/mango/src/mango_sup.erl rename to apps/mango/src/mango_sup.erl diff --git a/src/mango/src/mango_util.erl b/apps/mango/src/mango_util.erl similarity index 100% rename from src/mango/src/mango_util.erl rename to apps/mango/src/mango_util.erl diff --git a/src/mango/test/01-index-crud-test.py b/apps/mango/test/01-index-crud-test.py similarity index 100% rename from src/mango/test/01-index-crud-test.py rename to apps/mango/test/01-index-crud-test.py diff --git a/src/mango/test/02-basic-find-test.py b/apps/mango/test/02-basic-find-test.py similarity index 100% rename from src/mango/test/02-basic-find-test.py rename to apps/mango/test/02-basic-find-test.py diff --git a/src/mango/test/03-operator-test.py b/apps/mango/test/03-operator-test.py similarity index 100% rename from src/mango/test/03-operator-test.py rename to apps/mango/test/03-operator-test.py diff --git a/src/mango/test/04-key-tests.py b/apps/mango/test/04-key-tests.py similarity index 100% rename from src/mango/test/04-key-tests.py rename to apps/mango/test/04-key-tests.py diff --git a/src/mango/test/05-index-selection-test.py b/apps/mango/test/05-index-selection-test.py similarity index 100% rename from src/mango/test/05-index-selection-test.py rename to apps/mango/test/05-index-selection-test.py diff --git a/src/mango/test/06-basic-text-test.py b/apps/mango/test/06-basic-text-test.py similarity index 100% rename from src/mango/test/06-basic-text-test.py rename to apps/mango/test/06-basic-text-test.py diff --git a/src/mango/test/06-text-default-field-test.py b/apps/mango/test/06-text-default-field-test.py similarity index 100% rename from src/mango/test/06-text-default-field-test.py rename to apps/mango/test/06-text-default-field-test.py diff --git a/src/mango/test/07-text-custom-field-list-test.py b/apps/mango/test/07-text-custom-field-list-test.py similarity index 100% rename from src/mango/test/07-text-custom-field-list-test.py rename to apps/mango/test/07-text-custom-field-list-test.py diff --git a/src/mango/test/08-text-limit-test.py b/apps/mango/test/08-text-limit-test.py similarity index 100% rename from src/mango/test/08-text-limit-test.py rename to apps/mango/test/08-text-limit-test.py diff --git a/src/mango/test/09-text-sort-test.py b/apps/mango/test/09-text-sort-test.py similarity index 100% rename from src/mango/test/09-text-sort-test.py rename to apps/mango/test/09-text-sort-test.py diff --git a/src/mango/test/10-disable-array-length-field-test.py b/apps/mango/test/10-disable-array-length-field-test.py similarity index 100% rename from src/mango/test/10-disable-array-length-field-test.py rename to apps/mango/test/10-disable-array-length-field-test.py diff --git a/src/mango/test/11-ignore-design-docs-test.py b/apps/mango/test/11-ignore-design-docs-test.py similarity index 100% rename from src/mango/test/11-ignore-design-docs-test.py rename to apps/mango/test/11-ignore-design-docs-test.py diff --git a/src/mango/test/12-use-correct-index-test.py b/apps/mango/test/12-use-correct-index-test.py similarity index 100% rename from src/mango/test/12-use-correct-index-test.py rename to apps/mango/test/12-use-correct-index-test.py diff --git a/src/mango/test/13-stable-update-test.py b/apps/mango/test/13-stable-update-test.py similarity index 100% rename from src/mango/test/13-stable-update-test.py rename to apps/mango/test/13-stable-update-test.py diff --git a/src/mango/test/13-users-db-find-test.py b/apps/mango/test/13-users-db-find-test.py similarity index 100% rename from src/mango/test/13-users-db-find-test.py rename to apps/mango/test/13-users-db-find-test.py diff --git a/src/mango/test/14-json-pagination-test.py b/apps/mango/test/14-json-pagination-test.py similarity index 100% rename from src/mango/test/14-json-pagination-test.py rename to apps/mango/test/14-json-pagination-test.py diff --git a/src/mango/test/15-execution-stats-test.py b/apps/mango/test/15-execution-stats-test.py similarity index 100% rename from src/mango/test/15-execution-stats-test.py rename to apps/mango/test/15-execution-stats-test.py diff --git a/src/mango/test/16-index-selectors-test.py b/apps/mango/test/16-index-selectors-test.py similarity index 100% rename from src/mango/test/16-index-selectors-test.py rename to apps/mango/test/16-index-selectors-test.py diff --git a/src/mango/test/17-multi-type-value-test.py b/apps/mango/test/17-multi-type-value-test.py similarity index 100% rename from src/mango/test/17-multi-type-value-test.py rename to apps/mango/test/17-multi-type-value-test.py diff --git a/src/mango/test/18-json-sort.py b/apps/mango/test/18-json-sort.py similarity index 100% rename from src/mango/test/18-json-sort.py rename to apps/mango/test/18-json-sort.py diff --git a/src/mango/test/19-find-conflicts.py b/apps/mango/test/19-find-conflicts.py similarity index 100% rename from src/mango/test/19-find-conflicts.py rename to apps/mango/test/19-find-conflicts.py diff --git a/src/mango/test/20-no-timeout-test.py b/apps/mango/test/20-no-timeout-test.py similarity index 100% rename from src/mango/test/20-no-timeout-test.py rename to apps/mango/test/20-no-timeout-test.py diff --git a/src/mango/test/21-empty-selector-tests.py b/apps/mango/test/21-empty-selector-tests.py similarity index 100% rename from src/mango/test/21-empty-selector-tests.py rename to apps/mango/test/21-empty-selector-tests.py diff --git a/src/mango/test/README.md b/apps/mango/test/README.md similarity index 100% rename from src/mango/test/README.md rename to apps/mango/test/README.md diff --git a/src/mango/test/friend_docs.py b/apps/mango/test/friend_docs.py similarity index 100% rename from src/mango/test/friend_docs.py rename to apps/mango/test/friend_docs.py diff --git a/src/mango/test/limit_docs.py b/apps/mango/test/limit_docs.py similarity index 100% rename from src/mango/test/limit_docs.py rename to apps/mango/test/limit_docs.py diff --git a/src/mango/test/mango.py b/apps/mango/test/mango.py similarity index 100% rename from src/mango/test/mango.py rename to apps/mango/test/mango.py diff --git a/src/mango/test/user_docs.py b/apps/mango/test/user_docs.py similarity index 100% rename from src/mango/test/user_docs.py rename to apps/mango/test/user_docs.py diff --git a/src/mango/unittest.cfg b/apps/mango/unittest.cfg similarity index 100% rename from src/mango/unittest.cfg rename to apps/mango/unittest.cfg diff --git a/src/mem3/LICENSE b/apps/mem3/LICENSE similarity index 100% rename from src/mem3/LICENSE rename to apps/mem3/LICENSE diff --git a/src/mem3/README.md b/apps/mem3/README.md similarity index 100% rename from src/mem3/README.md rename to apps/mem3/README.md diff --git a/src/mem3/README_reshard.md b/apps/mem3/README_reshard.md similarity index 100% rename from src/mem3/README_reshard.md rename to apps/mem3/README_reshard.md diff --git a/src/mem3/include/mem3.hrl b/apps/mem3/include/mem3.hrl similarity index 100% rename from src/mem3/include/mem3.hrl rename to apps/mem3/include/mem3.hrl diff --git a/src/mem3/priv/stats_descriptions.cfg b/apps/mem3/priv/stats_descriptions.cfg similarity index 100% rename from src/mem3/priv/stats_descriptions.cfg rename to apps/mem3/priv/stats_descriptions.cfg diff --git a/src/mem3/rebar.config b/apps/mem3/rebar.config similarity index 100% rename from src/mem3/rebar.config rename to apps/mem3/rebar.config diff --git a/src/mem3/rebar.config.script b/apps/mem3/rebar.config.script similarity index 100% rename from src/mem3/rebar.config.script rename to apps/mem3/rebar.config.script diff --git a/src/mem3/src/mem3.app.src b/apps/mem3/src/mem3.app.src similarity index 100% rename from src/mem3/src/mem3.app.src rename to apps/mem3/src/mem3.app.src diff --git a/src/mem3/src/mem3.erl b/apps/mem3/src/mem3.erl similarity index 100% rename from src/mem3/src/mem3.erl rename to apps/mem3/src/mem3.erl diff --git a/src/mem3/src/mem3_app.erl b/apps/mem3/src/mem3_app.erl similarity index 100% rename from src/mem3/src/mem3_app.erl rename to apps/mem3/src/mem3_app.erl diff --git a/src/mem3/src/mem3_bdu.erl b/apps/mem3/src/mem3_bdu.erl similarity index 100% rename from src/mem3/src/mem3_bdu.erl rename to apps/mem3/src/mem3_bdu.erl diff --git a/src/mem3/src/mem3_cluster.erl b/apps/mem3/src/mem3_cluster.erl similarity index 100% rename from src/mem3/src/mem3_cluster.erl rename to apps/mem3/src/mem3_cluster.erl diff --git a/src/mem3/src/mem3_epi.erl b/apps/mem3/src/mem3_epi.erl similarity index 100% rename from src/mem3/src/mem3_epi.erl rename to apps/mem3/src/mem3_epi.erl diff --git a/src/mem3/src/mem3_hash.erl b/apps/mem3/src/mem3_hash.erl similarity index 100% rename from src/mem3/src/mem3_hash.erl rename to apps/mem3/src/mem3_hash.erl diff --git a/src/mem3/src/mem3_httpd.erl b/apps/mem3/src/mem3_httpd.erl similarity index 100% rename from src/mem3/src/mem3_httpd.erl rename to apps/mem3/src/mem3_httpd.erl diff --git a/src/mem3/src/mem3_httpd_handlers.erl b/apps/mem3/src/mem3_httpd_handlers.erl similarity index 100% rename from src/mem3/src/mem3_httpd_handlers.erl rename to apps/mem3/src/mem3_httpd_handlers.erl diff --git a/src/mem3/src/mem3_nodes.erl b/apps/mem3/src/mem3_nodes.erl similarity index 100% rename from src/mem3/src/mem3_nodes.erl rename to apps/mem3/src/mem3_nodes.erl diff --git a/src/mem3/src/mem3_plugin_couch_db.erl b/apps/mem3/src/mem3_plugin_couch_db.erl similarity index 100% rename from src/mem3/src/mem3_plugin_couch_db.erl rename to apps/mem3/src/mem3_plugin_couch_db.erl diff --git a/src/mem3/src/mem3_rep.erl b/apps/mem3/src/mem3_rep.erl similarity index 100% rename from src/mem3/src/mem3_rep.erl rename to apps/mem3/src/mem3_rep.erl diff --git a/src/mem3/src/mem3_reshard.erl b/apps/mem3/src/mem3_reshard.erl similarity index 100% rename from src/mem3/src/mem3_reshard.erl rename to apps/mem3/src/mem3_reshard.erl diff --git a/src/mem3/src/mem3_reshard.hrl b/apps/mem3/src/mem3_reshard.hrl similarity index 100% rename from src/mem3/src/mem3_reshard.hrl rename to apps/mem3/src/mem3_reshard.hrl diff --git a/src/mem3/src/mem3_reshard_api.erl b/apps/mem3/src/mem3_reshard_api.erl similarity index 100% rename from src/mem3/src/mem3_reshard_api.erl rename to apps/mem3/src/mem3_reshard_api.erl diff --git a/src/mem3/src/mem3_reshard_dbdoc.erl b/apps/mem3/src/mem3_reshard_dbdoc.erl similarity index 100% rename from src/mem3/src/mem3_reshard_dbdoc.erl rename to apps/mem3/src/mem3_reshard_dbdoc.erl diff --git a/src/mem3/src/mem3_reshard_httpd.erl b/apps/mem3/src/mem3_reshard_httpd.erl similarity index 100% rename from src/mem3/src/mem3_reshard_httpd.erl rename to apps/mem3/src/mem3_reshard_httpd.erl diff --git a/src/mem3/src/mem3_reshard_index.erl b/apps/mem3/src/mem3_reshard_index.erl similarity index 100% rename from src/mem3/src/mem3_reshard_index.erl rename to apps/mem3/src/mem3_reshard_index.erl diff --git a/src/mem3/src/mem3_reshard_job.erl b/apps/mem3/src/mem3_reshard_job.erl similarity index 100% rename from src/mem3/src/mem3_reshard_job.erl rename to apps/mem3/src/mem3_reshard_job.erl diff --git a/src/mem3/src/mem3_reshard_job_sup.erl b/apps/mem3/src/mem3_reshard_job_sup.erl similarity index 100% rename from src/mem3/src/mem3_reshard_job_sup.erl rename to apps/mem3/src/mem3_reshard_job_sup.erl diff --git a/src/mem3/src/mem3_reshard_store.erl b/apps/mem3/src/mem3_reshard_store.erl similarity index 100% rename from src/mem3/src/mem3_reshard_store.erl rename to apps/mem3/src/mem3_reshard_store.erl diff --git a/src/mem3/src/mem3_reshard_sup.erl b/apps/mem3/src/mem3_reshard_sup.erl similarity index 100% rename from src/mem3/src/mem3_reshard_sup.erl rename to apps/mem3/src/mem3_reshard_sup.erl diff --git a/src/mem3/src/mem3_reshard_validate.erl b/apps/mem3/src/mem3_reshard_validate.erl similarity index 100% rename from src/mem3/src/mem3_reshard_validate.erl rename to apps/mem3/src/mem3_reshard_validate.erl diff --git a/src/mem3/src/mem3_rpc.erl b/apps/mem3/src/mem3_rpc.erl similarity index 100% rename from src/mem3/src/mem3_rpc.erl rename to apps/mem3/src/mem3_rpc.erl diff --git a/src/mem3/src/mem3_seeds.erl b/apps/mem3/src/mem3_seeds.erl similarity index 100% rename from src/mem3/src/mem3_seeds.erl rename to apps/mem3/src/mem3_seeds.erl diff --git a/src/mem3/src/mem3_shards.erl b/apps/mem3/src/mem3_shards.erl similarity index 100% rename from src/mem3/src/mem3_shards.erl rename to apps/mem3/src/mem3_shards.erl diff --git a/src/mem3/src/mem3_sup.erl b/apps/mem3/src/mem3_sup.erl similarity index 100% rename from src/mem3/src/mem3_sup.erl rename to apps/mem3/src/mem3_sup.erl diff --git a/src/mem3/src/mem3_sync.erl b/apps/mem3/src/mem3_sync.erl similarity index 100% rename from src/mem3/src/mem3_sync.erl rename to apps/mem3/src/mem3_sync.erl diff --git a/src/mem3/src/mem3_sync_event.erl b/apps/mem3/src/mem3_sync_event.erl similarity index 100% rename from src/mem3/src/mem3_sync_event.erl rename to apps/mem3/src/mem3_sync_event.erl diff --git a/src/mem3/src/mem3_sync_event_listener.erl b/apps/mem3/src/mem3_sync_event_listener.erl similarity index 100% rename from src/mem3/src/mem3_sync_event_listener.erl rename to apps/mem3/src/mem3_sync_event_listener.erl diff --git a/src/mem3/src/mem3_sync_nodes.erl b/apps/mem3/src/mem3_sync_nodes.erl similarity index 100% rename from src/mem3/src/mem3_sync_nodes.erl rename to apps/mem3/src/mem3_sync_nodes.erl diff --git a/src/mem3/src/mem3_sync_security.erl b/apps/mem3/src/mem3_sync_security.erl similarity index 100% rename from src/mem3/src/mem3_sync_security.erl rename to apps/mem3/src/mem3_sync_security.erl diff --git a/src/mem3/src/mem3_util.erl b/apps/mem3/src/mem3_util.erl similarity index 100% rename from src/mem3/src/mem3_util.erl rename to apps/mem3/src/mem3_util.erl diff --git a/src/mem3/test/eunit/mem3_bdu_test.erl b/apps/mem3/test/eunit/mem3_bdu_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_bdu_test.erl rename to apps/mem3/test/eunit/mem3_bdu_test.erl diff --git a/src/mem3/test/eunit/mem3_cluster_test.erl b/apps/mem3/test/eunit/mem3_cluster_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_cluster_test.erl rename to apps/mem3/test/eunit/mem3_cluster_test.erl diff --git a/src/mem3/test/eunit/mem3_hash_test.erl b/apps/mem3/test/eunit/mem3_hash_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_hash_test.erl rename to apps/mem3/test/eunit/mem3_hash_test.erl diff --git a/src/mem3/test/eunit/mem3_rep_test.erl b/apps/mem3/test/eunit/mem3_rep_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_rep_test.erl rename to apps/mem3/test/eunit/mem3_rep_test.erl diff --git a/src/mem3/test/eunit/mem3_reshard_api_test.erl b/apps/mem3/test/eunit/mem3_reshard_api_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_reshard_api_test.erl rename to apps/mem3/test/eunit/mem3_reshard_api_test.erl diff --git a/src/mem3/test/eunit/mem3_reshard_changes_feed_test.erl b/apps/mem3/test/eunit/mem3_reshard_changes_feed_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_reshard_changes_feed_test.erl rename to apps/mem3/test/eunit/mem3_reshard_changes_feed_test.erl diff --git a/src/mem3/test/eunit/mem3_reshard_test.erl b/apps/mem3/test/eunit/mem3_reshard_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_reshard_test.erl rename to apps/mem3/test/eunit/mem3_reshard_test.erl diff --git a/src/mem3/test/eunit/mem3_ring_prop_tests.erl b/apps/mem3/test/eunit/mem3_ring_prop_tests.erl similarity index 100% rename from src/mem3/test/eunit/mem3_ring_prop_tests.erl rename to apps/mem3/test/eunit/mem3_ring_prop_tests.erl diff --git a/src/mem3/test/eunit/mem3_seeds_test.erl b/apps/mem3/test/eunit/mem3_seeds_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_seeds_test.erl rename to apps/mem3/test/eunit/mem3_seeds_test.erl diff --git a/src/mem3/test/eunit/mem3_shards_test.erl b/apps/mem3/test/eunit/mem3_shards_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_shards_test.erl rename to apps/mem3/test/eunit/mem3_shards_test.erl diff --git a/src/mem3/test/eunit/mem3_sync_security_test.erl b/apps/mem3/test/eunit/mem3_sync_security_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_sync_security_test.erl rename to apps/mem3/test/eunit/mem3_sync_security_test.erl diff --git a/src/mem3/test/eunit/mem3_util_test.erl b/apps/mem3/test/eunit/mem3_util_test.erl similarity index 100% rename from src/mem3/test/eunit/mem3_util_test.erl rename to apps/mem3/test/eunit/mem3_util_test.erl diff --git a/src/rexi/README.md b/apps/rexi/README.md similarity index 100% rename from src/rexi/README.md rename to apps/rexi/README.md diff --git a/src/rexi/include/rexi.hrl b/apps/rexi/include/rexi.hrl similarity index 100% rename from src/rexi/include/rexi.hrl rename to apps/rexi/include/rexi.hrl diff --git a/src/rexi/priv/stats_descriptions.cfg b/apps/rexi/priv/stats_descriptions.cfg similarity index 100% rename from src/rexi/priv/stats_descriptions.cfg rename to apps/rexi/priv/stats_descriptions.cfg diff --git a/src/rexi/rebar.config b/apps/rexi/rebar.config similarity index 100% rename from src/rexi/rebar.config rename to apps/rexi/rebar.config diff --git a/src/rexi/src/rexi.app.src b/apps/rexi/src/rexi.app.src similarity index 100% rename from src/rexi/src/rexi.app.src rename to apps/rexi/src/rexi.app.src diff --git a/src/rexi/src/rexi.erl b/apps/rexi/src/rexi.erl similarity index 100% rename from src/rexi/src/rexi.erl rename to apps/rexi/src/rexi.erl diff --git a/src/rexi/src/rexi_app.erl b/apps/rexi/src/rexi_app.erl similarity index 100% rename from src/rexi/src/rexi_app.erl rename to apps/rexi/src/rexi_app.erl diff --git a/src/rexi/src/rexi_buffer.erl b/apps/rexi/src/rexi_buffer.erl similarity index 100% rename from src/rexi/src/rexi_buffer.erl rename to apps/rexi/src/rexi_buffer.erl diff --git a/src/rexi/src/rexi_monitor.erl b/apps/rexi/src/rexi_monitor.erl similarity index 100% rename from src/rexi/src/rexi_monitor.erl rename to apps/rexi/src/rexi_monitor.erl diff --git a/src/rexi/src/rexi_server.erl b/apps/rexi/src/rexi_server.erl similarity index 100% rename from src/rexi/src/rexi_server.erl rename to apps/rexi/src/rexi_server.erl diff --git a/src/rexi/src/rexi_server_mon.erl b/apps/rexi/src/rexi_server_mon.erl similarity index 100% rename from src/rexi/src/rexi_server_mon.erl rename to apps/rexi/src/rexi_server_mon.erl diff --git a/src/rexi/src/rexi_server_sup.erl b/apps/rexi/src/rexi_server_sup.erl similarity index 100% rename from src/rexi/src/rexi_server_sup.erl rename to apps/rexi/src/rexi_server_sup.erl diff --git a/src/rexi/src/rexi_sup.erl b/apps/rexi/src/rexi_sup.erl similarity index 100% rename from src/rexi/src/rexi_sup.erl rename to apps/rexi/src/rexi_sup.erl diff --git a/src/rexi/src/rexi_utils.erl b/apps/rexi/src/rexi_utils.erl similarity index 100% rename from src/rexi/src/rexi_utils.erl rename to apps/rexi/src/rexi_utils.erl diff --git a/src/setup/.gitignore b/apps/setup/.gitignore similarity index 100% rename from src/setup/.gitignore rename to apps/setup/.gitignore diff --git a/src/setup/LICENSE b/apps/setup/LICENSE similarity index 100% rename from src/setup/LICENSE rename to apps/setup/LICENSE diff --git a/src/setup/README.md b/apps/setup/README.md similarity index 100% rename from src/setup/README.md rename to apps/setup/README.md diff --git a/src/setup/src/setup.app.src b/apps/setup/src/setup.app.src similarity index 100% rename from src/setup/src/setup.app.src rename to apps/setup/src/setup.app.src diff --git a/src/setup/src/setup.erl b/apps/setup/src/setup.erl similarity index 100% rename from src/setup/src/setup.erl rename to apps/setup/src/setup.erl diff --git a/src/setup/src/setup_app.erl b/apps/setup/src/setup_app.erl similarity index 100% rename from src/setup/src/setup_app.erl rename to apps/setup/src/setup_app.erl diff --git a/src/setup/src/setup_epi.erl b/apps/setup/src/setup_epi.erl similarity index 100% rename from src/setup/src/setup_epi.erl rename to apps/setup/src/setup_epi.erl diff --git a/src/setup/src/setup_httpd.erl b/apps/setup/src/setup_httpd.erl similarity index 100% rename from src/setup/src/setup_httpd.erl rename to apps/setup/src/setup_httpd.erl diff --git a/src/setup/src/setup_httpd_handlers.erl b/apps/setup/src/setup_httpd_handlers.erl similarity index 100% rename from src/setup/src/setup_httpd_handlers.erl rename to apps/setup/src/setup_httpd_handlers.erl diff --git a/src/setup/src/setup_sup.erl b/apps/setup/src/setup_sup.erl similarity index 100% rename from src/setup/src/setup_sup.erl rename to apps/setup/src/setup_sup.erl diff --git a/src/setup/test/t-frontend-setup.sh b/apps/setup/test/t-frontend-setup.sh similarity index 100% rename from src/setup/test/t-frontend-setup.sh rename to apps/setup/test/t-frontend-setup.sh diff --git a/src/setup/test/t-single-node-auto-setup.sh b/apps/setup/test/t-single-node-auto-setup.sh similarity index 100% rename from src/setup/test/t-single-node-auto-setup.sh rename to apps/setup/test/t-single-node-auto-setup.sh diff --git a/src/setup/test/t-single-node.sh b/apps/setup/test/t-single-node.sh similarity index 100% rename from src/setup/test/t-single-node.sh rename to apps/setup/test/t-single-node.sh diff --git a/src/setup/test/t.sh b/apps/setup/test/t.sh similarity index 100% rename from src/setup/test/t.sh rename to apps/setup/test/t.sh diff --git a/src/smoosh/README.md b/apps/smoosh/README.md similarity index 100% rename from src/smoosh/README.md rename to apps/smoosh/README.md diff --git a/src/smoosh/operator_guide.md b/apps/smoosh/operator_guide.md similarity index 100% rename from src/smoosh/operator_guide.md rename to apps/smoosh/operator_guide.md diff --git a/src/smoosh/rebar.config b/apps/smoosh/rebar.config similarity index 100% rename from src/smoosh/rebar.config rename to apps/smoosh/rebar.config diff --git a/src/smoosh/recovery_process_diagram.jpeg b/apps/smoosh/recovery_process_diagram.jpeg similarity index 100% rename from src/smoosh/recovery_process_diagram.jpeg rename to apps/smoosh/recovery_process_diagram.jpeg diff --git a/src/smoosh/src/smoosh.app.src b/apps/smoosh/src/smoosh.app.src similarity index 100% rename from src/smoosh/src/smoosh.app.src rename to apps/smoosh/src/smoosh.app.src diff --git a/src/smoosh/src/smoosh.erl b/apps/smoosh/src/smoosh.erl similarity index 100% rename from src/smoosh/src/smoosh.erl rename to apps/smoosh/src/smoosh.erl diff --git a/src/smoosh/src/smoosh_app.erl b/apps/smoosh/src/smoosh_app.erl similarity index 100% rename from src/smoosh/src/smoosh_app.erl rename to apps/smoosh/src/smoosh_app.erl diff --git a/src/smoosh/src/smoosh_channel.erl b/apps/smoosh/src/smoosh_channel.erl similarity index 100% rename from src/smoosh/src/smoosh_channel.erl rename to apps/smoosh/src/smoosh_channel.erl diff --git a/src/smoosh/src/smoosh_priority_queue.erl b/apps/smoosh/src/smoosh_priority_queue.erl similarity index 100% rename from src/smoosh/src/smoosh_priority_queue.erl rename to apps/smoosh/src/smoosh_priority_queue.erl diff --git a/src/smoosh/src/smoosh_server.erl b/apps/smoosh/src/smoosh_server.erl similarity index 100% rename from src/smoosh/src/smoosh_server.erl rename to apps/smoosh/src/smoosh_server.erl diff --git a/src/smoosh/src/smoosh_sup.erl b/apps/smoosh/src/smoosh_sup.erl similarity index 100% rename from src/smoosh/src/smoosh_sup.erl rename to apps/smoosh/src/smoosh_sup.erl diff --git a/src/smoosh/src/smoosh_utils.erl b/apps/smoosh/src/smoosh_utils.erl similarity index 100% rename from src/smoosh/src/smoosh_utils.erl rename to apps/smoosh/src/smoosh_utils.erl diff --git a/src/smoosh/test/exunit/scheduling_window_test.exs b/apps/smoosh/test/exunit/scheduling_window_test.exs similarity index 100% rename from src/smoosh/test/exunit/scheduling_window_test.exs rename to apps/smoosh/test/exunit/scheduling_window_test.exs diff --git a/src/smoosh/test/exunit/test_helper.exs b/apps/smoosh/test/exunit/test_helper.exs similarity index 100% rename from src/smoosh/test/exunit/test_helper.exs rename to apps/smoosh/test/exunit/test_helper.exs diff --git a/src/smoosh/test/smoosh_priority_queue_tests.erl b/apps/smoosh/test/smoosh_priority_queue_tests.erl similarity index 100% rename from src/smoosh/test/smoosh_priority_queue_tests.erl rename to apps/smoosh/test/smoosh_priority_queue_tests.erl diff --git a/src/smoosh/test/smoosh_tests.erl b/apps/smoosh/test/smoosh_tests.erl similarity index 100% rename from src/smoosh/test/smoosh_tests.erl rename to apps/smoosh/test/smoosh_tests.erl diff --git a/src/weatherreport/.gitignore b/apps/weatherreport/.gitignore similarity index 100% rename from src/weatherreport/.gitignore rename to apps/weatherreport/.gitignore diff --git a/src/weatherreport/.manifest b/apps/weatherreport/.manifest similarity index 100% rename from src/weatherreport/.manifest rename to apps/weatherreport/.manifest diff --git a/src/weatherreport/LICENSE b/apps/weatherreport/LICENSE similarity index 100% rename from src/weatherreport/LICENSE rename to apps/weatherreport/LICENSE diff --git a/src/weatherreport/README.md b/apps/weatherreport/README.md similarity index 100% rename from src/weatherreport/README.md rename to apps/weatherreport/README.md diff --git a/src/weatherreport/how_to_add_a_check.md b/apps/weatherreport/how_to_add_a_check.md similarity index 100% rename from src/weatherreport/how_to_add_a_check.md rename to apps/weatherreport/how_to_add_a_check.md diff --git a/src/weatherreport/rebar.config b/apps/weatherreport/rebar.config similarity index 100% rename from src/weatherreport/rebar.config rename to apps/weatherreport/rebar.config diff --git a/src/weatherreport/src/weatherreport.app.src b/apps/weatherreport/src/weatherreport.app.src similarity index 100% rename from src/weatherreport/src/weatherreport.app.src rename to apps/weatherreport/src/weatherreport.app.src diff --git a/src/weatherreport/src/weatherreport.erl b/apps/weatherreport/src/weatherreport.erl similarity index 100% rename from src/weatherreport/src/weatherreport.erl rename to apps/weatherreport/src/weatherreport.erl diff --git a/src/weatherreport/src/weatherreport_check.erl b/apps/weatherreport/src/weatherreport_check.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check.erl rename to apps/weatherreport/src/weatherreport_check.erl diff --git a/src/weatherreport/src/weatherreport_check_custodian.erl b/apps/weatherreport/src/weatherreport_check_custodian.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_custodian.erl rename to apps/weatherreport/src/weatherreport_check_custodian.erl diff --git a/src/weatherreport/src/weatherreport_check_disk.erl b/apps/weatherreport/src/weatherreport_check_disk.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_disk.erl rename to apps/weatherreport/src/weatherreport_check_disk.erl diff --git a/src/weatherreport/src/weatherreport_check_internal_replication.erl b/apps/weatherreport/src/weatherreport_check_internal_replication.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_internal_replication.erl rename to apps/weatherreport/src/weatherreport_check_internal_replication.erl diff --git a/src/weatherreport/src/weatherreport_check_ioq.erl b/apps/weatherreport/src/weatherreport_check_ioq.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_ioq.erl rename to apps/weatherreport/src/weatherreport_check_ioq.erl diff --git a/src/weatherreport/src/weatherreport_check_mem3_sync.erl b/apps/weatherreport/src/weatherreport_check_mem3_sync.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_mem3_sync.erl rename to apps/weatherreport/src/weatherreport_check_mem3_sync.erl diff --git a/src/weatherreport/src/weatherreport_check_membership.erl b/apps/weatherreport/src/weatherreport_check_membership.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_membership.erl rename to apps/weatherreport/src/weatherreport_check_membership.erl diff --git a/src/weatherreport/src/weatherreport_check_memory_use.erl b/apps/weatherreport/src/weatherreport_check_memory_use.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_memory_use.erl rename to apps/weatherreport/src/weatherreport_check_memory_use.erl diff --git a/src/weatherreport/src/weatherreport_check_message_queues.erl b/apps/weatherreport/src/weatherreport_check_message_queues.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_message_queues.erl rename to apps/weatherreport/src/weatherreport_check_message_queues.erl diff --git a/src/weatherreport/src/weatherreport_check_node_stats.erl b/apps/weatherreport/src/weatherreport_check_node_stats.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_node_stats.erl rename to apps/weatherreport/src/weatherreport_check_node_stats.erl diff --git a/src/weatherreport/src/weatherreport_check_nodes_connected.erl b/apps/weatherreport/src/weatherreport_check_nodes_connected.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_nodes_connected.erl rename to apps/weatherreport/src/weatherreport_check_nodes_connected.erl diff --git a/src/weatherreport/src/weatherreport_check_process_calls.erl b/apps/weatherreport/src/weatherreport_check_process_calls.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_process_calls.erl rename to apps/weatherreport/src/weatherreport_check_process_calls.erl diff --git a/src/weatherreport/src/weatherreport_check_process_memory.erl b/apps/weatherreport/src/weatherreport_check_process_memory.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_process_memory.erl rename to apps/weatherreport/src/weatherreport_check_process_memory.erl diff --git a/src/weatherreport/src/weatherreport_check_safe_to_rebuild.erl b/apps/weatherreport/src/weatherreport_check_safe_to_rebuild.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_safe_to_rebuild.erl rename to apps/weatherreport/src/weatherreport_check_safe_to_rebuild.erl diff --git a/src/weatherreport/src/weatherreport_check_search.erl b/apps/weatherreport/src/weatherreport_check_search.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_search.erl rename to apps/weatherreport/src/weatherreport_check_search.erl diff --git a/src/weatherreport/src/weatherreport_check_tcp_queues.erl b/apps/weatherreport/src/weatherreport_check_tcp_queues.erl similarity index 100% rename from src/weatherreport/src/weatherreport_check_tcp_queues.erl rename to apps/weatherreport/src/weatherreport_check_tcp_queues.erl diff --git a/src/weatherreport/src/weatherreport_config.erl b/apps/weatherreport/src/weatherreport_config.erl similarity index 100% rename from src/weatherreport/src/weatherreport_config.erl rename to apps/weatherreport/src/weatherreport_config.erl diff --git a/src/weatherreport/src/weatherreport_getopt.erl b/apps/weatherreport/src/weatherreport_getopt.erl similarity index 100% rename from src/weatherreport/src/weatherreport_getopt.erl rename to apps/weatherreport/src/weatherreport_getopt.erl diff --git a/src/weatherreport/src/weatherreport_log.erl b/apps/weatherreport/src/weatherreport_log.erl similarity index 100% rename from src/weatherreport/src/weatherreport_log.erl rename to apps/weatherreport/src/weatherreport_log.erl diff --git a/src/weatherreport/src/weatherreport_node.erl b/apps/weatherreport/src/weatherreport_node.erl similarity index 100% rename from src/weatherreport/src/weatherreport_node.erl rename to apps/weatherreport/src/weatherreport_node.erl diff --git a/src/weatherreport/src/weatherreport_runner.erl b/apps/weatherreport/src/weatherreport_runner.erl similarity index 100% rename from src/weatherreport/src/weatherreport_runner.erl rename to apps/weatherreport/src/weatherreport_runner.erl diff --git a/src/weatherreport/src/weatherreport_util.erl b/apps/weatherreport/src/weatherreport_util.erl similarity index 100% rename from src/weatherreport/src/weatherreport_util.erl rename to apps/weatherreport/src/weatherreport_util.erl diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full index 53caab2efe2..b6be7ddd614 100644 --- a/build-aux/Jenkinsfile.full +++ b/build-aux/Jenkinsfile.full @@ -149,7 +149,7 @@ def generateNativeStage(platform) { error("Build step failed with error: ${err.getMessage()}") } finally { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' + junit '**/_build/test/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/test/javascript/junit.xml' sh 'killall -9 beam.smp || true' sh 'rm -rf ${WORKSPACE}/*' } @@ -195,7 +195,7 @@ def generateContainerStage(platform) { error("Build step failed with error: ${err.getMessage()}") } finally { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' + junit '**/_build/test/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/test/javascript/junit.xml' sh 'rm -rf ${WORKSPACE}/*' } } @@ -357,7 +357,7 @@ pipeline { post { always { */ -// junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' +// junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/apps/mango/nosetests.xml, **/test/javascript/junit.xml' /* } success { diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr index db0d095d09d..6d5e9eed30c 100644 --- a/build-aux/Jenkinsfile.pr +++ b/build-aux/Jenkinsfile.pr @@ -161,7 +161,7 @@ pipeline { } post { always { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' + junit '**/_build/test/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/test/javascript/junit.xml' } cleanup { sh 'rm -rf ${WORKSPACE}/*' diff --git a/build-aux/couchdb-build-release.sh b/build-aux/couchdb-build-release.sh index dfd529d13e8..fc90c85b094 100755 --- a/build-aux/couchdb-build-release.sh +++ b/build-aux/couchdb-build-release.sh @@ -18,17 +18,17 @@ CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD` # copy sources over git archive ${CURRENT_BRANCH} | tar -xC ${REL_DIR}/ -f - -cd src/ +cd apps/ for repo in *; do cd ${repo} if [ -d ".git" ]; then - mkdir -p ../../${REL_DIR}/src/${repo} + mkdir -p ../../${REL_DIR}/apps/${repo} git_ish=`git rev-parse --short HEAD` git archive ${git_ish} \ - | tar --exclude '*do_not_compile.erl' -xC ../../${REL_DIR}/src/${repo}/ -f - + | tar --exclude '*do_not_compile.erl' -xC ../../${REL_DIR}/apps/${repo}/ -f - fi set +e - grep -rl '{vsn, git}' ../../${REL_DIR}/src/${repo}/ 2>/dev/null \ + grep -rl '{vsn, git}' ../../${REL_DIR}/apps/${repo}/ 2>/dev/null \ | xargs sed -ie "s/{vsn, git}/{vsn, \"${VERSION}\"}/" 2>/dev/null set -e cd .. @@ -53,4 +53,4 @@ if test -e .git; then fi # copy our rebar -cp bin/rebar ${REL_DIR}/bin/rebar +cp bin/rebar3 ${REL_DIR}/bin/rebar3 diff --git a/build-aux/introspect b/build-aux/introspect index 9b527455f09..6750eaf5f1d 100755 --- a/build-aux/introspect +++ b/build-aux/introspect @@ -45,7 +45,7 @@ introspect_diff(App, From, ToBranch) -> end. sh(App, Cmd) -> - Dir = lists:flatten(["src/", atom_to_list(App)]), + Dir = lists:flatten(["apps/", atom_to_list(App)]), Port = open_port({spawn, lists:flatten(Cmd)}, [{cd, Dir}, {line, 16384}, diff --git a/build-aux/logfile-uploader.py b/build-aux/logfile-uploader.py index d846db2453c..1f18aa8f175 100755 --- a/build-aux/logfile-uploader.py +++ b/build-aux/logfile-uploader.py @@ -41,7 +41,7 @@ def collect_logfiles(): for log in glob.glob("test-results.log"): tb.add(log) # EUnit - for log in glob.glob("src/*/.eunit/couch.log"): + for log in glob.glob("couch.log"): tb.add(log) # JS harness for log in glob.glob("dev/logs/node1.log"): diff --git a/build-aux/print-committerlist.sh b/build-aux/print-committerlist.sh index f6abc4c7819..782a7d0b365 100755 --- a/build-aux/print-committerlist.sh +++ b/build-aux/print-committerlist.sh @@ -30,7 +30,7 @@ function get_contributors { | grep -v @apache.org \ | sed $SED_ERE_FLAG -e "$CONTRIB_EMAIL_SED_COMMAND" else - cd src/$1 + cd apps/$1 git shortlog -se HEAD \ | grep -v @apache.org \ | sed $SED_ERE_FLAG -e "$CONTRIB_EMAIL_SED_COMMAND" @@ -43,7 +43,7 @@ function print_comitter_list { local EXCLUDE=("bear" "folsom" "goldrush" "ibrowse" "jiffy" "lager" "meck" "mochiweb" "snappy") local EXCLUDE=$(printf "\|%s" "${EXCLUDE[@]}") local EXCLUDE=${EXCLUDE:2} - local SUBREPOS=$(ls src/ | grep -v "$EXCLUDE") + local SUBREPOS=$(ls apps/ | grep -v "$EXCLUDE") if test -e .git; then diff --git a/build-aux/show-test-results.py b/build-aux/show-test-results.py index edd6ca13f4f..f9646b402cc 100755 --- a/build-aux/show-test-results.py +++ b/build-aux/show-test-results.py @@ -9,9 +9,9 @@ TEST_COLLECTIONS = { - "EUnit": "src/**/.eunit/*.xml", + "EUnit": "_build/test/*.xml", "EXUnit": "_build/integration/lib/couchdbtest/*.xml", - "Mango": "src/mango/*.xml", + "Mango": "apps/mango/*.xml", "JavaScript": "test/javascript/*.xml", } diff --git a/configure b/configure index 9f8cb682841..a3abb01080a 100755 --- a/configure +++ b/configure @@ -55,7 +55,6 @@ Options: --dev alias for --disable-docs --disable-fauxton --spidermonkey-version VSN specify the version of SpiderMonkey to use (defaults to $SM_VSN) --skip-deps do not update erlang dependencies - --rebar=PATH use rebar by specified path (version >=2.6.0 && <3.0 required) --generate-tls-dev-cert generate a cert for TLS distribution (To enable TLS, change the vm.args file.) --rebar3=PATH use rebar3 by specified path --erlfmt=PATH use erlfmt by specified path @@ -126,22 +125,6 @@ parse_opts() { continue ;; - --rebar) - if [ -x "$2" ]; then - version=`$2 --version 2> /dev/null | grep -o "2\.[6-9]\.[0-9]"` - if [ $? -ne 0 ]; then - printf 'Rebar >=2.6.0 and <3.0.0 required' >&2 - exit 1 - fi - eval REBAR=$2 - shift 2 - continue - else - printf 'ERROR: "--rebar" requires valid path to executable.\n' >&2 - exit 1 - fi - ;; - --rebar3) if [ -x "$2" ]; then eval REBAR3=$2 @@ -291,48 +274,31 @@ cat > $rootdir/config.erl << EOF {spidermonkey_version, "$SM_VSN"}. EOF -install_local_rebar() { - if [ ! -x "${rootdir}/bin/rebar" ]; then - if [ ! -d "${rootdir}/src/rebar" ]; then - # git clone --depth 1 https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar - git clone https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar - fi - make -C ${rootdir}/src/rebar - mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar - make -C ${rootdir}/src/rebar clean - fi -} - install_local_rebar3() { if [ ! -x "${rootdir}/bin/rebar3" ]; then - if [ ! -d "${rootdir}/src/rebar3" ]; then - git clone --depth 1 --branch ${REBAR3_BRANCH} https://github.com/erlang/rebar3.git ${rootdir}/src/rebar3 + if [ ! -d "${rootdir}/apps/rebar3" ]; then + git clone --depth 1 --branch ${REBAR3_BRANCH} https://github.com/erlang/rebar3.git ${rootdir}/apps/rebar3 fi - cd src/rebar3 + cd apps/rebar3 ./bootstrap - mv ${rootdir}/src/rebar3/rebar3 ${rootdir}/bin/rebar3 + mv ${rootdir}/apps/rebar3/rebar3 ${rootdir}/bin/rebar3 cd ../.. fi } install_local_erlfmt() { if [ ! -x "${rootdir}/bin/erlfmt" ]; then - if [ ! -d "${rootdir}/src/erlfmt" ]; then - git clone --depth 1 https://github.com/WhatsApp/erlfmt.git ${rootdir}/src/erlfmt + if [ ! -d "${rootdir}/apps/erlfmt" ]; then + git clone --depth 1 https://github.com/WhatsApp/erlfmt.git ${rootdir}/apps/erlfmt fi - cd "${rootdir}"/src/erlfmt + cd "${rootdir}"/apps/erlfmt ${REBAR3} as release escriptize - mv ${rootdir}/src/erlfmt/_build/release/bin/erlfmt ${rootdir}/bin/erlfmt + mv ${rootdir}/apps/erlfmt/_build/release/bin/erlfmt ${rootdir}/bin/erlfmt ${REBAR3} clean cd ../.. fi } -if [ -z "${REBAR}" ]; then - install_local_rebar - REBAR=${rootdir}/bin/rebar -fi - if [ -z "${REBAR3}" ]; then install_local_rebar3 REBAR3=${rootdir}/bin/rebar3 @@ -346,13 +312,13 @@ fi # only update dependencies, when we are not in a release tarball if [ -d .git -a $SKIP_DEPS -ne 1 ]; then echo "==> updating dependencies" - ${REBAR} get-deps update-deps + ${REBAR3} get-deps fi # External repos frequently become integrated with the primary repo, # resulting in obsolete .git directories, and possible confusion. # It is usually a good idea to delete these .git directories. -for path in $(find src -name .git -type d); do +for path in $(find apps -name .git -type d); do git ls-files --error-unmatch $(dirname $path) > /dev/null 2>&1 && \ echo "WARNING unexpected .git directory $path" done diff --git a/configure.ps1 b/configure.ps1 index 54c63776e7c..24e068e1fce 100644 --- a/configure.ps1 +++ b/configure.ps1 @@ -196,30 +196,30 @@ if (((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null) -or if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null) { Write-Verbose "==> rebar.cmd not found; bootstrapping..." - if (-Not (Test-Path "src\rebar")) + if (-Not (Test-Path "apps\rebar")) { - git clone --depth 1 https://github.com/apache/couchdb-rebar.git $rootdir\src\rebar + git clone --depth 1 https://github.com/apache/couchdb-rebar.git $rootdir\apps\rebar } - cmd /c "cd src\rebar && $rootdir\src\rebar\bootstrap.bat" - cp $rootdir\src\rebar\rebar $rootdir\bin\rebar - cp $rootdir\src\rebar\rebar.cmd $rootdir\bin\rebar.cmd - make -C $rootdir\src\rebar clean + cmd /c "cd apps\rebar && $rootdir\apps\rebar\bootstrap.bat" + cp $rootdir\apps\rebar\rebar $rootdir\bin\rebar + cp $rootdir\apps\rebar\rebar.cmd $rootdir\bin\rebar.cmd + make -C $rootdir\apps\rebar clean } # check for rebar3; if not found, build it and add it to our path if ((Get-Command "rebar3.cmd" -ErrorAction SilentlyContinue) -eq $null) { Write-Verbose "==> rebar3.cmd not found; bootstrapping..." - if (-Not (Test-Path "src\rebar3")) + if (-Not (Test-Path "apps\rebar3")) { - git clone --depth 1 https://github.com/erlang/rebar3.git $rootdir\src\rebar3 + git clone --depth 1 https://github.com/erlang/rebar3.git $rootdir\apps\rebar3 } - cd src\rebar3 + cd apps\rebar3 .\bootstrap.ps1 - cp $rootdir\src\rebar3\rebar3 $rootdir\bin\rebar3 - cp $rootdir\src\rebar3\rebar3.cmd $rootdir\bin\rebar3.cmd - cp $rootdir\src\rebar3\rebar3.ps1 $rootdir\bin\rebar3.ps1 - make -C $rootdir\src\rebar3 clean + cp $rootdir\apps\rebar3\rebar3 $rootdir\bin\rebar3 + cp $rootdir\apps\rebar3\rebar3.cmd $rootdir\bin\rebar3.cmd + cp $rootdir\apps\rebar3\rebar3.ps1 $rootdir\bin\rebar3.ps1 + make -C $rootdir\apps\rebar3 clean cd ..\.. } @@ -227,15 +227,15 @@ if ((Get-Command "rebar3.cmd" -ErrorAction SilentlyContinue) -eq $null) if ((Get-Command "erlfmt.cmd" -ErrorAction SilentlyContinue) -eq $null) { Write-Verbose "==> erlfmt.cmd not found; bootstrapping..." - if (-Not (Test-Path "src\erlfmt")) + if (-Not (Test-Path "apps\erlfmt")) { - git clone --depth 1 https://github.com/WhatsApp/erlfmt.git $rootdir\src\erlfmt + git clone --depth 1 https://github.com/WhatsApp/erlfmt.git $rootdir\apps\erlfmt } - cd src\erlfmt + cd apps\erlfmt rebar3 as release escriptize - cp $rootdir\src\erlfmt\_build\release\bin\erlfmt $rootdir\bin\erlfmt - cp $rootdir\src\erlfmt\_build\release\bin\erlfmt.cmd $rootdir\bin\erlfmt.cmd - make -C $rootdir\src\erlfmt clean + cp $rootdir\apps\erlfmt\_build\release\bin\erlfmt $rootdir\bin\erlfmt + cp $rootdir\apps\erlfmt\_build\release\bin\erlfmt.cmd $rootdir\bin\erlfmt.cmd + make -C $rootdir\apps\erlfmt clean cd ..\.. } diff --git a/dev/run b/dev/run index f87786058d6..af442184dbc 100755 --- a/dev/run +++ b/dev/run @@ -280,7 +280,7 @@ def check_beams(ctx): def check_boot_script(ctx): if not os.path.exists(os.path.join(ctx["devdir"], "devnode.boot")): env = os.environ.copy() - env["ERL_LIBS"] = os.path.join(ctx["rootdir"], "src") + env["ERL_LIBS"] = os.path.join(ctx["rootdir"], "_build/default/lib") sp.check_call(["escript", "make_boot_script"], env=env, cwd=ctx["devdir"]) @@ -598,15 +598,17 @@ def check_node_alive(url): def set_boot_env(ctx): # fudge fauxton path - if os.path.exists("src/fauxton/dist/release"): - fauxton_root = "src/fauxton/dist/release" + if os.path.exists("_build/default/lib/fauxton/dist/release"): + fauxton_root = "_build/default/lib/fauxton/dist/release" else: fauxton_root = "share/www" os.environ["COUCHDB_FAUXTON_DOCROOT"] = fauxton_root # fudge default query server paths - couchjs = os.path.join(ctx["rootdir"], "src", "couch", "priv", "couchjs") + couchjs = os.path.join( + ctx["rootdir"], "_build/default/lib", "couch", "priv", "couchjs" + ) mainjs = os.path.join(ctx["rootdir"], "share", "server", "main.js") coffeejs = os.path.join(ctx["rootdir"], "share", "server", "main-coffee.js") @@ -621,7 +623,7 @@ def set_boot_env(ctx): def boot_node(ctx, node): set_boot_env(ctx) env = os.environ.copy() - env["ERL_LIBS"] = os.path.join(ctx["rootdir"], "src") + env["ERL_LIBS"] = os.path.join(ctx["rootdir"], "_build/default/lib") node_etcdir = os.path.join(ctx["devdir"], "lib", node, "etc") reldir = os.path.join(ctx["rootdir"], "rel") diff --git a/erlang_ls.config b/erlang_ls.config index 94483cfec26..66cc72cf9f0 100644 --- a/erlang_ls.config +++ b/erlang_ls.config @@ -1,5 +1,5 @@ apps_dirs: - - "src/*" + - "apps/*" include_dirs: - - "src" - - "src/*/include" + - "apps" + - "apps/*/include" diff --git a/mix.exs b/mix.exs index 4dda326a1a8..ebb570a1a57 100644 --- a/mix.exs +++ b/mix.exs @@ -52,7 +52,7 @@ defmodule CouchDBTest.Mixfile do version: "0.1.0", elixir: "~> 1.13", lockfile: Path.expand("mix.lock", __DIR__), - deps_path: Path.expand("src", __DIR__), + deps_path: Path.expand("_build/default/lib", __DIR__), build_path: Path.expand("_build", __DIR__), compilers: [:elixir, :app], start_permanent: Mix.env() == :prod, @@ -90,24 +90,24 @@ defmodule CouchDBTest.Mixfile do {:excoveralls, "~> 0.12", only: :test}, {:b64url, path: path("b64url")}, {:jiffy, path: path("jiffy")}, - {:jwtf, path: path("jwtf")}, + {:jwtf, path: Path.expand("apps/jwtf", __DIR__)}, {:ibrowse, path: path("ibrowse"), override: true}, {:credo, "~> 1.6.4", only: [:dev, :test, :integration], runtime: false} ] end defp path(app) do - lib_dir = Path.expand("src", __DIR__) + lib_dir = Path.expand("_build/default/lib", __DIR__) Path.expand(app, lib_dir) end def get_test_paths(:test) do - Path.wildcard("src/*/test/exunit") |> Enum.filter(&File.dir?/1) + Path.wildcard("apps/*/test/exunit") |> Enum.filter(&File.dir?/1) end def get_test_paths(:integration) do integration_tests = - Path.wildcard("src/*/test/integration") |> Enum.filter(&File.dir?/1) + Path.wildcard("apps/*/test/integration") |> Enum.filter(&File.dir?/1) ["test/elixir/test" | integration_tests] end @@ -148,7 +148,7 @@ defmodule CouchDBTest.Mixfile do "folsom" ] - deps |> Enum.map(fn app -> "src/#{app}" end) + deps |> Enum.map(fn app -> "_build/default/lib/#{app}" end) end defp get_coverage_paths() do @@ -158,7 +158,7 @@ defmodule CouchDBTest.Mixfile do MapSet.put(set, "#{x}/ebin") end) - Path.wildcard("src/*/ebin") + Path.wildcard("apps/*/ebin") |> Enum.filter(&File.dir?/1) |> Enum.filter(fn path -> not MapSet.member?(deps, path) end) end diff --git a/setup_eunit.template b/plugins/ic/priv/setup_eunit.template similarity index 56% rename from setup_eunit.template rename to plugins/ic/priv/setup_eunit.template index ceef60d121b..dd3ed15b425 100644 --- a/setup_eunit.template +++ b/plugins/ic/priv/setup_eunit.template @@ -14,7 +14,7 @@ {dir, "tmp/etc"}. {dir, "tmp/data"}. {dir, "tmp/tmp_data"}. -{template, "rel/overlay/etc/default.ini", "tmp/etc/default_eunit.ini"}. -{template, "rel/overlay/etc/local.ini", "tmp/etc/local_eunit.ini"}. -{template, "rel/files/eunit.ini", "tmp/etc/eunit.ini"}. -{template, "rel/overlay/etc/vm.args", "tmp/etc/vm.args"}. +{template, "../../../rel/overlay/etc/default.ini", "tmp/etc/default_eunit.ini"}. +{template, "../../../rel/overlay/etc/local.ini", "tmp/etc/local_eunit.ini"}. +{template, "../../../rel/files/eunit.ini", "tmp/etc/eunit.ini"}. +{template, "../../../rel/overlay/etc/vm.args", "tmp/etc/vm.args"}. diff --git a/plugins/ic/src/ic.app.src b/plugins/ic/src/ic.app.src new file mode 100644 index 00000000000..cbc56fc84d1 --- /dev/null +++ b/plugins/ic/src/ic.app.src @@ -0,0 +1,7 @@ +{application, ic, [ + {description, "rebar3 ic plugin"}, + {vsn, "0.1.0"}, + {registered, []}, + {applications, [kernel, stdlib]}, + {env, []} +]}. diff --git a/plugins/ic/src/ic.erl b/plugins/ic/src/ic.erl new file mode 100644 index 00000000000..f808b7d27f4 --- /dev/null +++ b/plugins/ic/src/ic.erl @@ -0,0 +1,8 @@ +-module(ic). + +-export([init/1]). + +-spec init(rebar_state:t()) -> {ok, rebar_state:t()}. +init(State) -> + {ok, State1} = ic_prv_setup_eunit:init(State), + {ok, State1}. diff --git a/plugins/ic/src/ic_prv_setup_eunit.erl b/plugins/ic/src/ic_prv_setup_eunit.erl new file mode 100644 index 00000000000..16cbde3649a --- /dev/null +++ b/plugins/ic/src/ic_prv_setup_eunit.erl @@ -0,0 +1,81 @@ +-module(ic_prv_setup_eunit). + +-behaviour(provider). + +-export([init/1, do/1, format_error/1]). + +-define(PROVIDER, setup_eunit). +-define(NAMESPACE, ic). +-define(CWD, filename:absname(rebar_dir:get_cwd())). +-define(TEMPLATE, "setup_eunit"). +-define(DEPS, []). + +%% =================================================================== +%% Public API +%% =================================================================== +-spec init(rebar_state:t()) -> {ok, rebar_state:t()}. +init(State) -> + Provider = providers:create([ + {namespace, ?NAMESPACE}, + {name, ?PROVIDER}, + {module, ?MODULE}, + {bare, true}, + {deps, ?DEPS}, + {example, "rebar3 ic setup_eunit"}, + {opts, [{force, $f, "force", undefined, "overwrite existing files"}]}, + {short_desc, "Setup eunit from template"}, + {desc, "Setup eunit from template"} + ]), + {ok, rebar_state:add_provider(State, Provider)}. + +-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. +do(State) -> + build_eunit_config(State), + {ok, State}. + +-spec format_error(any()) -> iolist(). +format_error(Reason) -> + io_lib:format("~p", [Reason]). + +%% =================================================================== +%% Internal functions +%% =================================================================== +build_eunit_config(State) -> + Force = is_forced(State), + DataDir = ?CWD ++ "/tmp/data", + TmpDataDir = ?CWD ++ "/tmp/tmp_data", + cleanup_dirs([DataDir, TmpDataDir]), + AllOpts = [ + {template, ?TEMPLATE}, + {prefix, ?CWD}, + {data_dir, DataDir}, + {view_index_dir, DataDir}, + {geo_index_dir, DataDir}, + {state_dir, TmpDataDir} + ], + StateNew = lists:foldl( + fun({Key, Value}, StateAcc) -> + rebar_state:set(StateAcc, Key, Value) + end, + State, + AllOpts + ), + ok = rebar_templater:new(?TEMPLATE, [], Force, StateNew). + +is_forced(State) -> + {Args, _} = rebar_state:command_parsed_args(State), + case proplists:get_value(force, Args) of + undefined -> false; + _ -> true + end. + +cleanup_dirs(Dirs) -> + [del_dir(Dir) || Dir <- Dirs, filelib:is_dir(Dir)]. + +del_dir(Dir) -> + All = filelib:wildcard(Dir ++ "/**"), + {Dirs, Files} = lists:partition(fun filelib:is_dir/1, All), + lists:foreach(fun file:delete/1, Files), + SortedDirs = lists:sort(fun(A, B) -> length(A) > length(B) end, Dirs), + lists:foreach(fun file:del_dir/1, SortedDirs), + file:del_dir(Dir). diff --git a/rebar.config.script b/rebar.config.script index 1aa16305ab8..4ec23059255 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -104,103 +104,103 @@ end. os:putenv("COUCHDB_APPS_CONFIG_DIR", filename:join([COUCHDB_ROOT, "rel/apps"])). -SubDirs = [ - %% must be compiled first as it has a custom behavior - "src/couch_epi", - "src/couch_log", - "src/chttpd", - "src/couch", - "src/couch_event", - "src/mem3", - "src/couch_index", - "src/couch_mrview", - "src/couch_replicator", - "src/couch_plugins", - "src/couch_pse_tests", - "src/couch_stats", - "src/couch_peruser", - "src/couch_tests", - "src/couch_dist", - "src/custodian", - "src/ddoc_cache", - "src/dreyfus", - "src/fabric", - "src/global_changes", - "src/ioq", - "src/jwtf", - "src/ken", - "src/mango", - "src/rexi", - "src/setup", - "src/smoosh", - "src/weatherreport", - "src/couch_prometheus", - "rel" -]. - -DepDescs = [ -%% Independent Apps -{config, "config", {tag, "2.1.9"}}, -{b64url, "b64url", {tag, "1.0.3"}}, -{ets_lru, "ets-lru", {tag, "1.1.0"}}, -{khash, "khash", {tag, "1.1.0"}}, -{snappy, "snappy", {tag, "CouchDB-1.0.8"}}, - -%% Non-Erlang deps -{docs, {url, "https://github.com/apache/couchdb-documentation"}, - {tag, "3.2.1-1"}, [raw]}, -{fauxton, {url, "https://github.com/apache/couchdb-fauxton"}, - {tag, "v1.2.8"}, [raw]}, -%% Third party deps -{folsom, "folsom", {tag, "CouchDB-0.8.4"}}, -{hyper, "hyper", {tag, "CouchDB-2.2.0-7"}}, -{ibrowse, "ibrowse", {tag, "CouchDB-4.4.2-5"}}, -{jiffy, "jiffy", {tag, "1.1.1"}}, -{mochiweb, "mochiweb", {tag, "v3.0.0"}}, -{meck, "meck", {tag, "0.9.2"}}, -{recon, "recon", {tag, "2.5.2"}} -]. - -WithProper = lists:keyfind(with_proper, 1, CouchConfig) == {with_proper, true}. - -OptionalDeps = case WithProper of - true -> - [{proper, {url, "https://github.com/proper-testing/proper"}, {tag, "v1.4"}}]; - false -> - [] -end. - -BaseUrl = "https://github.com/apache/". - -MakeDep = fun - ({AppName, {url, Url}, Version}) -> - {AppName, ".*", {git, Url, Version}}; - ({AppName, {url, Url}, Version, Options}) -> - {AppName, ".*", {git, Url, Version}, Options}; - ({AppName, RepoName, Version}) -> - Url = BaseUrl ++ "couchdb-" ++ RepoName ++ ".git", - {AppName, ".*", {git, Url, Version}}; - ({AppName, RepoName, Version, Options}) -> - Url = BaseUrl ++ "couchdb-" ++ RepoName ++ ".git", - {AppName, ".*", {git, Url, Version}, Options} -end. - AddConfig = [ {require_otp_vsn, "23|24|25"}, - {deps_dir, "src"}, - {deps, lists:map(MakeDep, DepDescs ++ OptionalDeps)}, - {sub_dirs, SubDirs}, - {lib_dirs, ["src"]}, {erl_opts, [{i, "../"}, {d, 'COUCHDB_ERLANG_VERSION', VerString}]}, - {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}, - {plugins, [eunit_plugin]}, + {deps, []}, + {plugins, [ic, erlfmt]}, + {erlfmt, [write]}, + {eunit_opts, [ + verbose, + {report, {eunit_progress, [colored, profile]}}, + {report, {eunit_surefire, [{dir, "_build/test"}]}} + ]}, + {eunit_tests, [ + {application, b64url}, + {application, chttpd}, + {application, config}, + {application, couch_dist}, + {application, couch_event}, + {application, couch_index}, + {application, couch_log}, + {application, couch_mrview}, + {application, couch_peruser}, + {application, couch_plugins}, + {application, couch_prometheus}, + {application, couch_pse_tests}, + {application, couch_replicator}, + {application, couch_stats}, + {application, couch_tests}, + {application, couch}, + {application, custodian}, + {application, ddoc_cache}, + {application, dreyfus}, + {application, ets_lru}, + {application, fabric}, + {application, global_changes}, + {application, ioq}, + {application, jiffy}, + {application, jwtf}, + {application, ken}, + {application, khash}, + {application, mango}, + {application, mem3}, + {application, recon}, + {application, rexi}, + {application, setup}, + {application, smoosh}, + {application, weatherreport}, + {application, couch_epi} + ]}, + {profiles, [{test, [{extra_src_dirs, [{"test", [{recursive, true}]}]}]}]}, {dialyzer, [ {plt_location, local}, {plt_location, COUCHDB_ROOT}, {plt_extra_apps, [ asn1, compiler, crypto, inets, kernel, runtime_tools, sasl, setup, ssl, stdlib, syntax_tools, xmerl]}, - {warnings, [unmatched_returns, error_handling, race_conditions]}]}, + {warnings, [unmatched_returns, error_handling, race_conditions]} + ]}, + {relx, [ + {release, {couchdb, "3.2.2"}, [ + %% stdlib + asn1, compiler, crypto, inets, runtime_tools, + sasl, ssl, syntax_tools, xmerl, + + %% couchdb + b64url, bear, chttpd, config, couch, couch_epi, + couch_index, couch_log, couch_mrview, couch_plugins, + couch_replicator, couch_stats, couch_event, + couch_peruser, couch_dist, custodian, ddoc_cache, + dreyfus, ets_lru, fabric, folsom, global_changes, + hyper, ibrowse, ioq, jiffy, jwtf, ken, khash, mango, + mem3, mochiweb, rexi, setup, smoosh, snappy, + weatherreport, couch_prometheus, + + %% extra + recon + ]}, + + {mode, prod}, + {overlay_vars, "rel/couchdb.config"}, + {sys_config, "rel/files/sys.config"}, + {vm_args, "rel/files/vm.args"}, + {check_for_undefined_functions, false}, + {overlay, [ + {copy, "LICENSE", "LICENSE"}, + {mkdir, "var/log"}, + {copy, "rel/overlay/bin", "bin"}, + {copy, "rel/overlay/etc", "etc"}, + {copy, "bin/couchjs", "bin/couchjs"}, + {copy, "share/server/main.js", "share/rserver/main.js"}, + {copy, "share/server/main-coffee.js", "share/server/main-coffee.js"}, + {copy, "bin/weatherreport", "bin/weatherreport"}, + {template, "rel/overlay/etc/default.ini", "etc/default.ini"}, + {template, "rel/overlay/etc/vm.args", "etc/vm.args"}, + {template, "rel/files/couchdb.in", "bin/couchdb"}, + {template, "rel/files/couchdb.cmd.in", "bin/couchdb.cmd"} + ]} + ]}, {post_hooks, [{compile, "escript support/build_js.escript"}]} ]. diff --git a/rel/files/couchdb.cmd.in b/rel/files/couchdb.cmd.in index 244803bc80f..0acc53bb51c 100644 --- a/rel/files/couchdb.cmd.in +++ b/rel/files/couchdb.cmd.in @@ -29,7 +29,7 @@ IF NOT DEFINED COUCHDB_QUERY_SERVER_JAVASCRIPT SET COUCHDB_QUERY_SERVER_JAVASCRI IF NOT DEFINED COUCHDB_QUERY_SERVER_COFFEESCRIPT SET COUCHDB_QUERY_SERVER_COFFEESCRIPT={{prefix}}/bin/couchjs {{prefix}}/share/server/main-coffee.js IF NOT DEFINED COUCHDB_FAUXTON_DOCROOT SET COUCHDB_FAUXTON_DOCROOT={{fauxton_root}} -"%BINDIR%\erl" -boot "%ROOTDIR%\releases\%APP_VSN%\couchdb" ^ +"%BINDIR%\erl" -boot "%ROOTDIR%\releases\%APP_VSN%\start" ^ -args_file "%ROOTDIR%\etc\vm.args" ^ -epmd "%BINDIR%\epmd.exe" ^ -config "%ROOTDIR%\releases\%APP_VSN%\sys.config" %* diff --git a/rel/files/couchdb.in b/rel/files/couchdb.in index 3ebb2e4eedb..de049b4036e 100755 --- a/rel/files/couchdb.in +++ b/rel/files/couchdb.in @@ -46,7 +46,7 @@ ARGS_FILE="${COUCHDB_ARGS_FILE:-$ROOTDIR/etc/vm.args}" [ -n "${COUCHDB_INI_FILES:-}" ] && INI_ARGS="-couch_ini $COUCHDB_INI_FILES" SYSCONFIG_FILE="${COUCHDB_SYSCONFIG_FILE:-$ROOTDIR/releases/$APP_VSN/sys.config}" -exec "$BINDIR/erlexec" -boot "$ROOTDIR/releases/$APP_VSN/couchdb" \ +exec "$BINDIR/erlexec" -boot "$ROOTDIR/releases/$APP_VSN/start" \ -args_file "${ARGS_FILE}" \ ${INI_ARGS:-} \ -config "${SYSCONFIG_FILE}" "$@" diff --git a/rel/plugins/eunit_plugin.erl b/rel/plugins/eunit_plugin.erl deleted file mode 100644 index 8f298db5f44..00000000000 --- a/rel/plugins/eunit_plugin.erl +++ /dev/null @@ -1,59 +0,0 @@ -% Licensed 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. - --module(eunit_plugin). - --export([setup_eunit/2]). - -setup_eunit(Config, AppFile) -> - case is_base_dir(Config) of - false -> ok; - true -> build_eunit_config(Config, AppFile) - end. - -%% from https://github.com/ChicagoBoss/ChicagoBoss/blob/master/skel/priv/rebar/boss_plugin.erl -is_base_dir(RebarConf) -> - filename:absname(rebar_utils:get_cwd()) =:= - rebar_config:get_xconf(RebarConf, base_dir, undefined). - -build_eunit_config(Config0, AppFile) -> - Cwd = filename:absname(rebar_utils:get_cwd()), - DataDir = Cwd ++ "/tmp/data", - ViewIndexDir = Cwd ++ "/tmp/data", - StateDir = Cwd ++ "/tmp/data", - TmpDataDir = Cwd ++ "/tmp/tmp_data", - cleanup_dirs([DataDir, TmpDataDir]), - Config1 = rebar_config:set_global(Config0, template, "setup_eunit"), - Config2 = rebar_config:set_global(Config1, prefix, Cwd), - Config3 = rebar_config:set_global(Config2, data_dir, DataDir), - Config4 = rebar_config:set_global(Config3, view_index_dir, ViewIndexDir), - Config = rebar_config:set_global(Config4, state_dir, StateDir), - rebar_templater:create(Config, AppFile). - -cleanup_dirs(Dirs) -> - lists:foreach( - fun(Dir) -> - case filelib:is_dir(Dir) of - true -> del_dir(Dir); - false -> ok - end - end, - Dirs - ). - -del_dir(Dir) -> - All = filelib:wildcard(Dir ++ "/**"), - {Dirs, Files} = lists:partition(fun filelib:is_dir/1, All), - ok = lists:foreach(fun file:delete/1, Files), - SortedDirs = lists:sort(fun(A, B) -> length(A) > length(B) end, Dirs), - ok = lists:foreach(fun file:del_dir/1, SortedDirs), - ok = file:del_dir(Dir). diff --git a/rel/reltool.config b/rel/reltool.config index ab26fb2ed5e..76bd5b451aa 100644 --- a/rel/reltool.config +++ b/rel/reltool.config @@ -11,7 +11,7 @@ % the License. {sys, [ - {lib_dirs, ["../src"]}, + {lib_dirs, ["../_build/default/lib"]}, {rel, "couchdb", "3.2.2", [ %% stdlib asn1, @@ -139,10 +139,10 @@ {mkdir, "var/log"}, {copy, "overlay/bin"}, {copy, "overlay/etc"}, - {copy, "../src/couch/priv/couchjs", "bin/couchjs"}, + {copy, "../apps/couch/priv/couchjs", "bin/couchjs"}, {copy, "../share/server/main.js", "share/server/main.js"}, {copy, "../share/server/main-coffee.js", "share/server/main-coffee.js"}, - {copy, "../src/weatherreport/weatherreport", "bin/weatherreport"}, + {copy, "../apps/weatherreport/weatherreport", "bin/weatherreport"}, {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"}, {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}, {template, "overlay/etc/default.ini", "etc/default.ini"}, diff --git a/src/dreyfus/test/elixir/mix.lock b/src/dreyfus/test/elixir/mix.lock deleted file mode 100644 index ed51e5312a6..00000000000 --- a/src/dreyfus/test/elixir/mix.lock +++ /dev/null @@ -1,5 +0,0 @@ -%{ - "httpotion": {:hex, :httpotion, "3.1.0", "14d20d9b0ce4e86e253eb91e4af79e469ad949f57a5d23c0a51b2f86559f6589", [:mix], [{:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm"}, - "ibrowse": {:hex, :ibrowse, "4.4.1", "2b7d0637b0f8b9b4182de4bd0f2e826a4da2c9b04898b6e15659ba921a8d6ec2", [:rebar3], [], "hexpm"}, - "jiffy": {:hex, :jiffy, "0.14.13", "225a9a35e26417832c611526567194b4d3adc4f0dfa5f2f7008f4684076f2a01", [:rebar3], [], "hexpm"}, -} diff --git a/test/elixir/README.md b/test/elixir/README.md index efd0e2d92f6..01f93728cfd 100644 --- a/test/elixir/README.md +++ b/test/elixir/README.md @@ -121,13 +121,13 @@ Below we present a few use cases where code-generation is really helpful. ## How to write ExUnit tests 1. Create new file in test/exunit/ directory (the file name should match *_test.exs) -2. In case it is a first file in the directory create test_helper.exs (look at src/couch/test/exunit/test_helper.exs to get an idea) +2. In case it is a first file in the directory create test_helper.exs (look at apps/couch/test/exunit/test_helper.exs to get an idea) 3. define test module which does `use Couch.Test.ExUnit.Case` 4. Define test cases in the module You can run tests either: - using make: `make exunit` -- using mix: BUILDDIR=`pwd` ERL_LIBS=`pwd`/src MIX_ENV=test mix test --trace +- using mix: BUILDDIR=`pwd` ERL_LIBS=`pwd`/apps MIX_ENV=test mix test --trace ## Generating tests from spec diff --git a/test/elixir/lib/utils.ex b/test/elixir/lib/utils.ex index 3ecf878e733..c4e03def5b0 100644 --- a/test/elixir/lib/utils.ex +++ b/test/elixir/lib/utils.ex @@ -3,10 +3,10 @@ defmodule Couch.Test.Utils do @moduledoc "Helper functions for testing" @project_root "#{__DIR__}/../../../" Record.defrecord :user_ctx, Record.extract( - :user_ctx, from: "#{@project_root}/src/couch/include/couch_db.hrl") + :user_ctx, from: "#{@project_root}/apps/couch/include/couch_db.hrl") Record.defrecord :doc_info, Record.extract( - :doc_info, from: "#{@project_root}/src/couch/include/couch_db.hrl") + :doc_info, from: "#{@project_root}/apps/couch/include/couch_db.hrl") def random_name(prefix) do time = :erlang.monotonic_time() diff --git a/test/view_server/query_server_spec.rb b/test/view_server/query_server_spec.rb index 59883c0ebc2..b1b9a332cbe 100644 --- a/test/view_server/query_server_spec.rb +++ b/test/view_server/query_server_spec.rb @@ -127,7 +127,7 @@ def self.run_command class ExternalRunner < OSProcessRunner def self.run_command - "#{COUCH_ROOT}/src/couchdb/couchjs #{COUCH_ROOT}/share/server/echo.js" + "#{COUCH_ROOT}/apps/couchdb/couchjs #{COUCH_ROOT}/share/server/echo.js" end end diff --git a/test/view_server/run_native_process.es b/test/view_server/run_native_process.es index fcf16d75d07..06b814aa364 100755 --- a/test/view_server/run_native_process.es +++ b/test/view_server/run_native_process.es @@ -52,8 +52,8 @@ loop(Pid) -> end. main([]) -> - code:add_pathz("src/couchdb"), - code:add_pathz("src/mochiweb"), + code:add_pathz("apps/couchdb"), + code:add_pathz("apps/mochiweb"), {ok, Pid} = couch_native_process:start_link(), loop(Pid).