/src/tools/configuration/etc/liberty_etc_version_constraint.e
Specman e | 53 lines | 32 code | 7 blank | 14 comment | 1 complexity | e58bf44b083493e719096bfb0b313e82 MD5 | raw file
1-- This file is part of Liberty Eiffel. 2-- 3-- Liberty Eiffel is free software: you can redistribute it and/or modify 4-- it under the terms of the GNU General Public License as published by 5-- the Free Software Foundation, version 3 of the License. 6-- 7-- Liberty Eiffel is distributed in the hope that it will be useful, 8-- but WITHOUT ANY WARRANTY; without even the implied warranty of 9-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10-- GNU General Public License for more details. 11-- 12-- You should have received a copy of the GNU General Public License 13-- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>. 14-- 15class LIBERTY_ETC_VERSION_CONSTRAINT 16 17inherit 18 LIBERTY_ETC_CONSTRAINT 19 20create {LIBERTY_ETC_VISITOR_IMPL} 21 make 22 23feature {ANY} 24 check_validity (a_cluster: LIBERTY_ETC_CLUSTER) is 25 do 26 if not operator.item([a_cluster.version, version]) then 27 std_error.put_line("*** Version mismatch: " + a_cluster.name 28 + " version " + a_cluster.version + " not compatible") 29 die_with_code(1) 30 end 31 end 32 33feature {} 34 make (a_operator: like operator; a_version: like version) is 35 require 36 a_operator /= Void 37 a_version /= Void 38 do 39 operator := a_operator 40 version := a_version 41 ensure 42 operator = a_operator 43 version = a_version 44 end 45 46 operator: PREDICATE[TUPLE[FIXED_STRING, FIXED_STRING]] 47 version: FIXED_STRING 48 49invariant 50 operator /= Void 51 version /= Void 52 53end