| 
									
										
										
										
											2020-07-12 02:23:07 +08:00
										 |  |  | ## This Source Code Form is subject to the terms of the Mozilla Public | 
					
						
							|  |  |  | ## License, v. 2.0. If a copy of the MPL was not distributed with this | 
					
						
							|  |  |  | ## file, You can obtain one at https://mozilla.org/MPL/2.0/. | 
					
						
							| 
									
										
										
										
											2016-02-03 23:01:32 +08:00
										 |  |  | ## | 
					
						
							| 
									
										
										
										
											2024-07-19 13:21:30 +08:00
										 |  |  | ## Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.  All rights reserved. | 
					
						
							| 
									
										
										
										
											2016-02-03 23:01:32 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-16 23:29:06 +08:00
										 |  |  | defmodule RabbitMQCtl.MixfileBase do | 
					
						
							| 
									
										
										
										
											2016-02-03 02:54:36 +08:00
										 |  |  |   use Mix.Project | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def project do | 
					
						
							| 
									
										
										
										
											2016-03-05 01:42:43 +08:00
										 |  |  |     [ | 
					
						
							|  |  |  |       app: :rabbitmqctl, | 
					
						
							| 
									
										
										
										
											2024-07-19 13:21:30 +08:00
										 |  |  |       version: "4.0.0-dev", | 
					
						
							| 
									
										
										
										
											2024-12-13 02:30:04 +08:00
										 |  |  |       elixir: ">= 1.13.4 and < 1.19.0", | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |       build_embedded: Mix.env() == :prod, | 
					
						
							|  |  |  |       start_permanent: Mix.env() == :prod, | 
					
						
							| 
									
										
										
										
											2023-12-13 00:51:14 +08:00
										 |  |  |       escript: [ | 
					
						
							|  |  |  |         main_module: RabbitMQCtl, | 
					
						
							| 
									
										
										
										
											2023-12-30 12:55:17 +08:00
										 |  |  |         emu_args: "-hidden", | 
					
						
							| 
									
										
										
										
											2023-12-13 00:51:14 +08:00
										 |  |  |         path: "escript/rabbitmqctl" | 
					
						
							|  |  |  |       ], | 
					
						
							| 
									
										
										
										
											2023-11-17 20:09:31 +08:00
										 |  |  |       prune_code_paths: false, | 
					
						
							| 
									
										
										
										
											2024-12-12 19:08:06 +08:00
										 |  |  |       elixirc_options: [ignore_module_conflict: true], | 
					
						
							| 
									
										
										
										
											2023-04-12 20:27:32 +08:00
										 |  |  |       deps: deps(Mix.env()), | 
					
						
							| 
									
										
										
										
											2020-10-20 18:48:01 +08:00
										 |  |  |       xref: [ | 
					
						
							|  |  |  |         exclude: [ | 
					
						
							|  |  |  |           CSV, | 
					
						
							|  |  |  |           CSV.Encode, | 
					
						
							| 
									
										
										
										
											2023-11-17 20:08:10 +08:00
										 |  |  |           JSON, | 
					
						
							| 
									
										
										
										
											2020-10-20 18:48:01 +08:00
										 |  |  |           :mnesia, | 
					
						
							|  |  |  |           :msacc, | 
					
						
							|  |  |  |           :public_key, | 
					
						
							|  |  |  |           :pubkey_cert, | 
					
						
							|  |  |  |           :rabbit, | 
					
						
							|  |  |  |           :rabbit_control_misc, | 
					
						
							|  |  |  |           :rabbit_data_coercion, | 
					
						
							| 
									
										
										
										
											2023-09-05 00:46:58 +08:00
										 |  |  |           :rabbit_db_cluster, | 
					
						
							| 
									
										
										
										
											2020-10-20 18:48:01 +08:00
										 |  |  |           :rabbit_env, | 
					
						
							|  |  |  |           :rabbit_event, | 
					
						
							|  |  |  |           :rabbit_file, | 
					
						
							|  |  |  |           :rabbit_net, | 
					
						
							|  |  |  |           :rabbit_misc, | 
					
						
							|  |  |  |           :rabbit_mnesia, | 
					
						
							|  |  |  |           :rabbit_nodes_common, | 
					
						
							|  |  |  |           :rabbit_pbe, | 
					
						
							|  |  |  |           :rabbit_plugins, | 
					
						
							|  |  |  |           :rabbit_resource_monitor_misc, | 
					
						
							|  |  |  |           :stdout_formatter | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |       ] | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |     ] | 
					
						
							| 
									
										
										
										
											2016-02-03 02:54:36 +08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # Configuration for the OTP application | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # Type "mix help compile.app" for more information | 
					
						
							|  |  |  |   def application do | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |     [ | 
					
						
							|  |  |  |       applications: [:logger], | 
					
						
							|  |  |  |       env: [ | 
					
						
							|  |  |  |         scopes: [ | 
					
						
							|  |  |  |           "rabbitmq-plugins": :plugins, | 
					
						
							|  |  |  |           rabbitmqctl: :ctl, | 
					
						
							|  |  |  |           "rabbitmq-diagnostics": :diagnostics, | 
					
						
							|  |  |  |           "rabbitmq-queues": :queues, | 
					
						
							|  |  |  |           "rabbitmq-streams": :streams, | 
					
						
							|  |  |  |           "rabbitmq-upgrade": :upgrade, | 
					
						
							| 
									
										
										
										
											2023-02-16 20:39:20 +08:00
										 |  |  |           "vmware-rabbitmq": :vmware | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |         ] | 
					
						
							|  |  |  |       ] | 
					
						
							| 
									
										
										
										
											2016-06-17 17:49:38 +08:00
										 |  |  |     ] | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |     |> add_modules(Mix.env()) | 
					
						
							| 
									
										
										
										
											2016-06-23 19:33:39 +08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   defp add_modules(app, :test) do | 
					
						
							| 
									
										
										
										
											2017-06-09 01:15:21 +08:00
										 |  |  |     # There are issues with building a package without this line ¯\_(ツ)_/¯ | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |     Mix.Project.get() | 
					
						
							|  |  |  |     path = Mix.Project.compile_path() | 
					
						
							| 
									
										
										
										
											2016-06-23 19:33:39 +08:00
										 |  |  |     mods = modules_from(Path.wildcard("#{path}/*.beam")) | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     test_modules = [ | 
					
						
							|  |  |  |       RabbitMQ.CLI.Ctl.Commands.DuckCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Ctl.Commands.GrayGooseCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Ctl.Commands.UglyDucklingCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Plugins.Commands.StorkCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Plugins.Commands.HeronCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Custom.Commands.CrowCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Custom.Commands.RavenCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Seagull.Commands.SeagullCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Seagull.Commands.PacificGullCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Seagull.Commands.HerringGullCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Seagull.Commands.HermannGullCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Wolf.Commands.CanisLupusCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Wolf.Commands.CanisLatransCommand, | 
					
						
							|  |  |  |       RabbitMQ.CLI.Wolf.Commands.CanisAureusCommand | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     [{:modules, (mods ++ test_modules) |> Enum.sort()} | app] | 
					
						
							| 
									
										
										
										
											2016-06-23 19:33:39 +08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-23 19:33:39 +08:00
										 |  |  |   defp add_modules(app, _) do | 
					
						
							|  |  |  |     app | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   defp modules_from(beams) do | 
					
						
							| 
									
										
										
										
											2022-10-03 01:54:11 +08:00
										 |  |  |     Enum.map(beams, &(&1 |> Path.basename() |> Path.rootname(".beam") |> String.to_atom())) | 
					
						
							| 
									
										
										
										
											2016-02-03 02:54:36 +08:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # Dependencies can be Hex packages: | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   #   {:mydep, "~> 0.3.0"} | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # Or git/path repositories: | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"} | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # Type "mix help deps" for more examples and options | 
					
						
							| 
									
										
										
										
											2019-05-17 20:42:00 +08:00
										 |  |  |   # | 
					
						
							|  |  |  |   # CAUTION: Dependencies which are shipped with RabbitMQ *MUST* com | 
					
						
							|  |  |  |   # from Hex.pm! Therefore it's ok to fetch dependencies from Git if | 
					
						
							|  |  |  |   # they are test dependencies or it is temporary while testing a patch. | 
					
						
							|  |  |  |   # But that's about it. If in doubt, use Hex.pm! | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # The reason is that we have some Makefile code to put dependencies | 
					
						
							|  |  |  |   # from Hex.pm in RabbitMQ source archive (the source archive must be | 
					
						
							|  |  |  |   # self-contained and RabbitMQ must be buildable offline). However, we | 
					
						
							|  |  |  |   # don't have the equivalent for other methods. | 
					
						
							| 
									
										
										
										
											2023-04-12 20:27:32 +08:00
										 |  |  |   defp deps(env) do | 
					
						
							| 
									
										
										
										
											2023-03-01 00:59:17 +08:00
										 |  |  |     deps_dir = System.get_env("DEPS_DIR", "deps") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Mix is confused by any `rebar.{config,lock}` we might have left in | 
					
						
							|  |  |  |     # `rabbit_common` or `amqp_client`. So just remove those files to be | 
					
						
							|  |  |  |     # safe, as they are generated when we publish to Hex.pm only. | 
					
						
							|  |  |  |     for dir <- ["rabbit_common", "amqp_client"] do | 
					
						
							|  |  |  |       for file <- ["rebar.config", "rebar.lock"] do | 
					
						
							|  |  |  |         File.rm(Path.join([deps_dir, dir, file])) | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     make_cmd = System.get_env("MAKE", "make") | 
					
						
							| 
									
										
										
										
											2023-06-27 21:56:58 +08:00
										 |  |  |     fake_cmd = "true" | 
					
						
							| 
									
										
										
										
											2023-03-01 00:59:17 +08:00
										 |  |  |     is_bazel = System.get_env("IS_BAZEL") != nil | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-12-12 19:08:06 +08:00
										 |  |  |     # Note that normal deps will be fetched by Erlang.mk on build. | 
					
						
							| 
									
										
										
										
											2023-03-01 00:59:17 +08:00
										 |  |  |     [ | 
					
						
							| 
									
										
										
										
											2023-11-17 20:05:38 +08:00
										 |  |  |       { | 
					
						
							|  |  |  |         :json, | 
					
						
							|  |  |  |         path: Path.join(deps_dir, "json") | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2023-03-14 21:27:47 +08:00
										 |  |  |       { | 
					
						
							|  |  |  |         :csv, | 
					
						
							|  |  |  |         path: Path.join(deps_dir, "csv") | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2023-03-01 00:59:17 +08:00
										 |  |  |       { | 
					
						
							|  |  |  |         :stdout_formatter, | 
					
						
							|  |  |  |         path: Path.join(deps_dir, "stdout_formatter"), | 
					
						
							| 
									
										
										
										
											2023-06-27 21:56:58 +08:00
										 |  |  |         compile: if(is_bazel, do: fake_cmd, else: make_cmd) | 
					
						
							| 
									
										
										
										
											2023-03-01 00:59:17 +08:00
										 |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         :rabbit_common, | 
					
						
							|  |  |  |         path: Path.join(deps_dir, "rabbit_common"), | 
					
						
							| 
									
										
										
										
											2023-06-27 21:56:58 +08:00
										 |  |  |         compile: if(is_bazel, do: fake_cmd, else: make_cmd), | 
					
						
							| 
									
										
										
										
											2023-03-01 00:59:17 +08:00
										 |  |  |         override: true | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2023-04-12 20:27:32 +08:00
										 |  |  |     ] ++ | 
					
						
							|  |  |  |       case env do | 
					
						
							|  |  |  |         :test -> | 
					
						
							|  |  |  |           [ | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |               :amqp, | 
					
						
							|  |  |  |               path: Path.join(deps_dir, "amqp") | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2023-07-04 00:06:53 +08:00
										 |  |  |             { | 
					
						
							|  |  |  |               :rabbit, | 
					
						
							|  |  |  |               path: Path.join(deps_dir, "rabbit"), | 
					
						
							|  |  |  |               compile: if(is_bazel, do: fake_cmd, else: make_cmd), | 
					
						
							|  |  |  |               override: true | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2023-04-12 20:27:32 +08:00
										 |  |  |             { | 
					
						
							|  |  |  |               :temp, | 
					
						
							|  |  |  |               path: Path.join(deps_dir, "temp") | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |               :x509, | 
					
						
							|  |  |  |               path: Path.join(deps_dir, "x509") | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |               :amqp_client, | 
					
						
							|  |  |  |               path: Path.join(deps_dir, "amqp_client"), | 
					
						
							| 
									
										
										
										
											2023-06-27 21:56:58 +08:00
										 |  |  |               compile: if(is_bazel, do: fake_cmd, else: make_cmd), | 
					
						
							| 
									
										
										
										
											2023-04-12 20:27:32 +08:00
										 |  |  |               override: true | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |           ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         _ -> | 
					
						
							|  |  |  |           [] | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2016-02-03 02:54:36 +08:00
										 |  |  |   end | 
					
						
							|  |  |  | end |