| 
									
										
										
										
											2016-02-03 23:01:32 +08:00
										 |  |  | ## The contents of this file are subject to the Mozilla Public License | 
					
						
							|  |  |  | ## Version 1.1 (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.mozilla.org/MPL/ | 
					
						
							|  |  |  | ## | 
					
						
							|  |  |  | ## Software distributed under the License is distributed on an "AS IS" | 
					
						
							|  |  |  | ## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | 
					
						
							|  |  |  | ## the License for the specific language governing rights and | 
					
						
							|  |  |  | ## limitations under the License. | 
					
						
							|  |  |  | ## | 
					
						
							|  |  |  | ## The Original Code is RabbitMQ. | 
					
						
							|  |  |  | ## | 
					
						
							|  |  |  | ## The Initial Developer of the Original Code is GoPivotal, Inc. | 
					
						
							|  |  |  | ## Copyright (c) 2007-2016 Pivotal Software, Inc.  All rights reserved. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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, | 
					
						
							|  |  |  |       version: "0.0.1", | 
					
						
							|  |  |  |       elixir: "~> 1.2", | 
					
						
							|  |  |  |       build_embedded: Mix.env == :prod, | 
					
						
							|  |  |  |       start_permanent: Mix.env == :prod, | 
					
						
							| 
									
										
										
										
											2016-06-16 23:29:06 +08:00
										 |  |  |       escript: [main_module: RabbitMQCtl], | 
					
						
							|  |  |  |       deps: deps | 
					
						
							| 
									
										
										
										
											2016-03-05 01:42:43 +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 | 
					
						
							| 
									
										
										
										
											2016-03-05 01:42:43 +08:00
										 |  |  |     [applications: [:logger, :mix]] | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  |   defp deps do | 
					
						
							| 
									
										
										
										
											2016-06-06 18:06:46 +08:00
										 |  |  |     # RabbitMQ components (rabbit_common and amqp_client) requires GNU | 
					
						
							|  |  |  |     # Make. Let's verify first if GNU Make is available before blindly | 
					
						
							|  |  |  |     # using "make" and get a Tolstoï-long parsing error message. | 
					
						
							|  |  |  |     make = find_gnu_make() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-03 23:08:47 +08:00
										 |  |  |     [ | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         :rabbit_common, | 
					
						
							|  |  |  |         git: "https://github.com/rabbitmq/rabbitmq-common.git", | 
					
						
							| 
									
										
										
										
											2016-06-06 18:06:46 +08:00
										 |  |  |         branch: "master", | 
					
						
							|  |  |  |         compile: make | 
					
						
							| 
									
										
										
										
											2016-05-05 22:29:45 +08:00
										 |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         :amqp_client, | 
					
						
							|  |  |  |         git: "https://github.com/rabbitmq/rabbitmq-erlang-client.git", | 
					
						
							| 
									
										
										
										
											2016-05-26 05:34:15 +08:00
										 |  |  |         branch: "master", | 
					
						
							| 
									
										
										
										
											2016-06-06 18:06:46 +08:00
										 |  |  |         compile: make, | 
					
						
							| 
									
										
										
										
											2016-05-05 22:29:45 +08:00
										 |  |  |         override: true | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         :amqp, | 
					
						
							|  |  |  |         git: "https://github.com/pma/amqp.git", | 
					
						
							|  |  |  |         branch: "master" | 
					
						
							| 
									
										
										
										
											2016-03-03 23:08:47 +08:00
										 |  |  |       } | 
					
						
							|  |  |  |     ] | 
					
						
							| 
									
										
										
										
											2016-02-03 02:54:36 +08:00
										 |  |  |   end | 
					
						
							| 
									
										
										
										
											2016-03-04 00:34:13 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-06 18:06:46 +08:00
										 |  |  |   defp find_gnu_make do | 
					
						
							|  |  |  |     possible_makes = [ | 
					
						
							|  |  |  |       System.get_env("MAKE"), | 
					
						
							|  |  |  |       "make", | 
					
						
							|  |  |  |       "gmake" | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  |     test_gnu_make(possible_makes) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   defp test_gnu_make([nil | rest]) do | 
					
						
							|  |  |  |     test_gnu_make(rest) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  |   defp test_gnu_make([make | rest]) do | 
					
						
							|  |  |  |     {output, _} = System.cmd(make, ["--version"], stderr_to_stdout: true) | 
					
						
							|  |  |  |     case String.contains?(output, "GNU Make") do | 
					
						
							|  |  |  |       true  -> make | 
					
						
							|  |  |  |       false -> test_gnu_make(rest) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  |   defp test_gnu_make([]) do | 
					
						
							|  |  |  |     nil | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-03 02:54:36 +08:00
										 |  |  | end |