replace type="exec" with exec="true" - fixes #295

Sun, 10 Sep 2023 13:04:02 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 10 Sep 2023 13:04:02 +0200
changeset 43
741a0d9efa47
parent 42
becfbf7af928
child 44
1d963f2c7e91

replace type="exec" with exec="true" - fixes #295

src/main/java/de/unixwork/uwproj/ConfigVar.java file | annotate | diff | comparison | revisions
test/make/project.xml file | annotate | diff | comparison | revisions
test/make/project2.xml file | annotate | diff | comparison | revisions
uwproj.xsd file | annotate | diff | comparison | revisions
--- a/src/main/java/de/unixwork/uwproj/ConfigVar.java	Sun Sep 10 12:59:04 2023 +0200
+++ b/src/main/java/de/unixwork/uwproj/ConfigVar.java	Sun Sep 10 13:04:02 2023 +0200
@@ -26,7 +26,7 @@
         }
 
         var.value = Util.getContent(e);
-        var.exec = e.getAttribute("type").equals("exec");
+        var.exec = Boolean.parseBoolean(e.getAttribute("exec"));
 
         return var;
     }
--- a/test/make/project.xml	Sun Sep 10 12:59:04 2023 +0200
+++ b/test/make/project.xml	Sun Sep 10 13:04:02 2023 +0200
@@ -2,7 +2,7 @@
 <project xmlns="http://unixwork.de/uwproj">
 	<!-- makefile config -->
 	<config>
-		<var name="HOST" type="exec">uname -n</var>
+		<var name="HOST" exec="true">uname -n</var>
 		<var name="PREFIX">`pwd`/work</var>
 		<var name="INSTALL_DIR">$PREFIX</var>
 	</config>
@@ -13,8 +13,8 @@
 
 	<!-- library dependencies -->
 	<dependency name="libxml2" platform="macos">
-		<cflags type="exec">xml2-config --cflags</cflags>
-		<ldflags type="exec">xml2-config --libs</ldflags>
+		<cflags exec="true">xml2-config --cflags</cflags>
+		<ldflags exec="true">xml2-config --libs</ldflags>
 	</dependency>
 
 	<dependency name="libxml2">
--- a/test/make/project2.xml	Sun Sep 10 12:59:04 2023 +0200
+++ b/test/make/project2.xml	Sun Sep 10 13:04:02 2023 +0200
@@ -5,8 +5,8 @@
 		<ldflags>-lcurl</ldflags>
 	</dependency>
 	<dependency name="curl" platform="macos">
-		<cflags type="exec">curl-config --cflags</cflags>
-		<ldflags type="exec">curl-config --ldflags</ldflags>
+		<cflags exec="true">curl-config --cflags</cflags>
+		<ldflags exec="true">curl-config --ldflags</ldflags>
 	</dependency>
 	<dependency name="test" platform="bsd" not="macos">
 		<cflags>-DBSD</cflags>
--- a/uwproj.xsd	Sun Sep 10 12:59:04 2023 +0200
+++ b/uwproj.xsd	Sun Sep 10 13:04:02 2023 +0200
@@ -25,18 +25,11 @@
         <xs:simpleContent>
             <xs:extension base="xs:string">
                 <xs:attribute name="name" type="xs:string" use="required"/>
-                <xs:attribute name="type" type="ExecType"/>
+                <xs:attribute name="exec" type="xs:boolean" default="false"/>
             </xs:extension>
         </xs:simpleContent>
     </xs:complexType>
 
-    <!-- TODO: we should replace this type with a simple Boolean -->
-    <xs:simpleType name="ExecType">
-        <xs:restriction base="xs:string">
-            <xs:enumeration value="exec"/>
-        </xs:restriction>
-    </xs:simpleType>
-
     <xs:complexType name="DependencyType">
         <xs:choice minOccurs="0" maxOccurs="unbounded">
             <xs:element name="lang" type="xs:string"/>
@@ -54,7 +47,7 @@
     <xs:complexType name="FlagsType">
         <xs:simpleContent>
             <xs:extension base="xs:string">
-                <xs:attribute name="type" type="ExecType"/>
+                <xs:attribute name="exec" type="xs:boolean" default="false"/>
             </xs:extension>
         </xs:simpleContent>
     </xs:complexType>

mercurial