Sun, 10 Sep 2023 13:10:07 +0200
make FeatureType.default an xs:boolean - fixes #296
--- a/src/main/java/de/unixwork/uwproj/Feature.java Sun Sep 10 13:04:02 2023 +0200 +++ b/src/main/java/de/unixwork/uwproj/Feature.java Sun Sep 10 13:10:07 2023 +0200 @@ -23,10 +23,8 @@ throw new Exception("feature element requires name attribute"); } - String ld = def.toLowerCase(); - boolean on = ld.equals("on") || ld.equals("true"); feature.setName(name); - feature.setDefault(on); + feature.setDefault(Boolean.parseBoolean(def)); if (arg.isBlank()) { feature.setArg(name); } else {
--- a/test/make/project2.xml Sun Sep 10 13:04:02 2023 +0200 +++ b/test/make/project2.xml Sun Sep 10 13:10:07 2023 +0200 @@ -44,7 +44,7 @@ </dependency> <target name="dav"> - <feature name="db" default="on"> + <feature name="db" default="true"> <dependencies>sqlite</dependencies> <define name="DATABASE"/> </feature>
--- a/uwproj.xsd Sun Sep 10 13:04:02 2023 +0200 +++ b/uwproj.xsd Sun Sep 10 13:10:07 2023 +0200 @@ -71,17 +71,7 @@ </xs:choice> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="arg" type="xs:string"/> - <xs:attribute name="default" default="false"> - <!-- TODO: this should be just Boolean --> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - <xs:enumeration value="on"/> - <xs:enumeration value="off"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> + <xs:attribute name="default" type="xs:boolean" default="false"/> </xs:complexType> <xs:complexType name="OptionType">