Commits

Anonymous committed f9b67c5

first submit of dart support for the styx protocol generator

  • Participants
  • Parent commits a817ec2

Comments (0)

Files changed (13)

 .classpath
 .project
 .settings
+.DS_Store
 bin
 *~
 core/dependency-reduced-pom.xml

core/dependency-reduced-pom.xml

   <parent>
     <artifactId>styx-root</artifactId>
     <groupId>com.cubeia.styx</groupId>
-    <version>1.17-SNAPSHOT</version>
+    <version>1.18-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>styx-core</artifactId>

maven/protocol-archetype/src/main/resources/archetype-resources/pom.xml

 					</protocol_file>
 					<language>all</language>
 					<package_name>${package}</package_name>
+                    <dart_library_name>${packet}</dart_library_name>
 					<output_dir>
 						target/jruby-protocol-plugin/generated-sources/java/${package}
 					</output_dir>

maven/protocol-generator-plugin/src/main/java/com/cubeia/ProtocolGeneratorMojo.java

      * @required
      */
     private String language;
+
     
     /**
      * Protocol definition file. The path is relative to ${basedir}.
      * @parameter default-value="false"
      */
     private boolean fail_on_bad_packet_order;
+
+    /**
+     * @parameter
+     */
+    private String dart_library_name;
     
     /**
      * The maven project.
      */
     private MavenProject project;
 
-    private enum Languages {java, flash, cpp, csharp, cplusplus, protobuf, javascript};
+    private enum Languages {java, flash, cpp, csharp, cplusplus, protobuf, javascript, dart};
     
     private final String GENERATOR_WRAPPER_SCRIPT = "/code_generator_wrapper.rb";
     
         getLog().info("  IN generate_visitors = " + generate_visitors);
         getLog().info("  IN fail_on_bad_packet_order = " + fail_on_bad_packet_order);
         getLog().info("  IN version = " + version);
+        getLog().info("  IN version = " + dart_library_name);
         
         
         if (output_dir != null) {
         if (isProtocolFileNewerThanGeneratedCode(protocolFile, outputBaseDir)) {
             if ("all".equals(language)) {
                 for (Languages lang : Languages.values()) {
-                    generateCode(lang.name(), protocolFile, outputBaseDir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name);
+                    generateCode(lang.name(), protocolFile, outputBaseDir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name,dart_library_name);
                 }
             } else {
             	String[] languages = language.split(",");
             	for ( String lang : languages ) {
-            		generateCode(lang, protocolFile, outputBaseDir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name);
+            		generateCode(lang, protocolFile, outputBaseDir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name,dart_library_name);
             	}
             }
         } else {
         String packageName, 
         boolean generateVisitors, 
         String version,
-        boolean failOnBadPacketOrder, String javascript_package_name) throws MojoExecutionException, MojoFailureException {
+        boolean failOnBadPacketOrder, String javascript_package_name, String dart_library_name) throws MojoExecutionException, MojoFailureException {
 		
 		if(append_language_to_output_base_dir) {
 			outputBaseDirectory = appendLangToBaseDir(lang, outputBaseDirectory);
             generateVisitors ? "true" : null,
             version, 
             failOnBadPacketOrder ? "true" : null,
-            javascript_package_name};
+            javascript_package_name,
+            dart_library_name};
         
         InputStreamReader scriptReader = new InputStreamReader(scriptIn);
         

maven/protocol-generator-plugin/src/main/scripts/code_generator_wrapper.rb

 # top level function wrapper for the code generator
 require 'generate_source'
 
-def generate_code(protocol_file, language, output_dir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name)
-  CodeGenerator.new.generate_code(protocol_file, language, output_dir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name)
+def generate_code(protocol_file, language, output_dir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name,dart_library_name)
+  CodeGenerator.new.generate_code(protocol_file, language, output_dir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name,dart_library_name)
 end

maven/protocol-generator-plugin/src/main/scripts/dart_generator.rb

+#
+# Java output writer.
+#
+
+DART_TYPES = {
+  'uint8'  => 'int',
+  'int8'   => 'int',
+  'uint16' => 'int',
+  'int16'  => 'int',
+  'int32'  => 'int',
+  'uint32' => 'int',
+  'int64'  => 'int',
+  'uint64' => 'int',
+  'string' => 'String',
+  'bool'   => 'bool'
+}
+DART_TYPES2 = {
+    'uint8'  => 'UnsignedByte',
+    'int8'   => 'Byte',
+    'uint16' => 'UnsignedShort',
+    'int16'  => 'Short',
+    'int32'  => 'Int',
+    'uint32' => 'UnsignedInt',
+    'int64'  => 'Long',
+    'uint64' => 'Long',
+    'string' => 'String',
+    'bool'   => 'Bool'
+}
+
+# Member type definitions, special handling for unsigned data types,
+# since java decides to suck
+DART_UNSIGNED_TYPES = {
+  'UnsignedByte'  => 'int',
+  'UnsignedShort' => 'int',
+  'UnsignedInt'   => 'int'
+}
+
+def dtype(generic_type)
+  DART_TYPES[generic_type] || camelcasetype(generic_type)
+end
+def dtype2(generic_type)
+  DART_TYPES2[generic_type] || camelcasetype(generic_type)
+end
+
+def capitalize_first(s) 
+  s[0..0].upcase + s[1..-1]  
+end
+
+def builtin?(generic_type)
+  DART_TYPES.has_key?(generic_type)
+end
+
+def enum?(type)
+  $enums.has_key?(type)
+end
+
+def camelcase(str)
+  result = ''
+  str.split('_').each_with_index do |e,index|
+    e.capitalize! if index != 0
+    result << e
+  end
+  result
+end
+
+def camelcasetype(str)
+  str.split('_').map{|e| e.capitalize}.join
+end
+
+class DartOut
+  def initialize(output_file)
+    @indent_level = 0
+    @out = output_file
+  end
+  
+  def order
+    [:start_class, :nested_types, :members, :field_constructor, :save, :load, :sysout, :end_class]
+  end
+  
+  def start_class(name, class_id)
+    @classname = name
+    static_tag = @indent_level != 0 ? ' static' : ''
+    parent_tag = @indent_level == 0 ? ' implements ProtocolObject' : ''
+
+    wi("#{static_tag} class #{camelcasetype(name)}#{parent_tag} {")
+    @indent_level += 1
+    if !class_id.to_s.empty?
+      wi("int classId() {")
+      wi("return #{class_id};",1)
+      wi("}")
+      wi("")
+    end
+  end
+  
+  def end_scope
+    @indent_level -= 1
+    wi("}")
+  end
+
+  def end_save
+    wi("return byteArray;")
+    @indent_level -= 1
+    wi("}")
+  end
+
+  alias :end_class :end_scope
+  alias :end_load :end_scope
+  
+  def member_scalar(scalar)
+    type = dtype(scalar.obj_type)
+    if(DART_UNSIGNED_TYPES.has_key?(type))
+      type = DART_UNSIGNED_TYPES[type]
+    end
+    wi("#{type} #{camelcase(scalar.name)};")
+    return type
+  end
+  
+  def member_list(list)
+    type = dtype(list.obj_type)
+    # If complex type, then use List
+    if (DART_UNSIGNED_TYPES.has_key?(type))
+      type = DART_UNSIGNED_TYPES[type]
+    end
+    wi("List<#{type}> #{camelcase(list.name)};")
+    result = "List<#{type}>"
+    return result
+  end
+  
+  def member_enum(enum)
+
+
+    enumtype = enum.type
+    enumtype = enumtype.capitalize
+    enumtype = camelcase(enumtype)
+    name = camelcase(enum.name)
+
+    wi("#{enumtype} #{name} =  #{enumtype}.make#{enumtype}(0);")
+
+
+    return "#{enumtype}"
+  end
+  
+  def start_save(struct)
+    wi("")
+    wi("ByteArray save() {")
+    if !@empty
+      wi("ByteArray byteArray = new ByteArray();")
+    end
+    @indent_level += 1
+  end
+  
+  def save_scalar(scalar)
+    name = camelcase(scalar.name)
+    if(builtin?(scalar.obj_type))
+      wi("byteArray.write#{dtype2(scalar.obj_type)}(this.#{name});")
+    else
+      wi("byteArray.writeArray(this.#{name}.save());")
+    end
+  end
+  
+  def save_list(list)
+
+    name = camelcase(list.name)
+    ltype = dtype(list.obj_type)
+    ltype2 = dtype2(list.obj_type)
+
+    if(list.obj_type == "uint8" || list.obj_type == "int8")
+      wi("byteArray.writeInt(this.#{name}.length);")
+      wi("byteArray.writeArray(this.#{name});")
+    else
+      # Save as List of Objects
+      wi("byteArray.writeInt(this.#{name}.length);")
+
+      wi("for(int i = 0; i < this.#{name}.length; i ++) {")
+      #@indent_level += 1
+      if(jsbuiltin?(list.obj_type))
+        wi("byteArray.write#{ltype2}(this.#{name}[i]);",1)
+
+      elsif(enum?(list.obj_type))
+        wi("byteArray.writeUnsignedByte(this.#{name}[i]); // ENUM Fixme",1)
+
+      else
+        wi("byteArray.writeArray(this.#{name}[i].save());",1)
+      end
+      wi("}");
+    end
+  end
+  
+  def start_load(struct)
+    wi("")
+    wi("void load(ByteArray byteArray) {")
+    @indent_level += 1
+  end
+  
+  def load_enum(enum)
+    name = enum.type.capitalize
+    name = camelcase(name)
+    wi("this.#{camelcase(enum.name)} = #{name}.make#{name}(byteArray.readUnsignedByte());")
+
+  end
+  
+  def save_enum(enum)
+    name = camelcase(enum.name)
+    wi("if (this.#{name} == null) {");
+    @indent_level += 1
+    wi("byteArray.writeUnsignedByte(-1);")
+    @indent_level -= 1
+    wi("} else {")
+    @indent_level += 1
+    wi("byteArray.writeUnsignedByte(this.#{name}.value);")
+    @indent_level -= 1
+    wi("}")
+  end
+  
+  def load_scalar(scalar)
+    name = camelcase(scalar.name)
+    if(builtin?(scalar.obj_type))
+      wi("this.#{name} = byteArray.read#{dtype2(scalar.obj_type)}();")
+    else
+      wi("this.#{name} = new #{dtype(scalar.obj_type)}();")
+      wi("this.#{name}.load(byteArray);")
+    end
+  end
+  
+  def load_list(list)
+    name = camelcase(list.name)
+    ltype = dtype(list.obj_type)
+    ltype2 = dtype2(list.obj_type)
+
+    if(builtin?(list.obj_type))
+
+      wi("int #{name}Count = byteArray.readInt();")
+      wi("this.#{name} = new List<#{ltype}>();")
+      wi("for (int i = 0; i < #{name}Count; i ++) {")
+      wi("this.#{name}.add(byteArray.read#{ltype2}());",1)
+      wi("}");
+
+    else
+
+      wi("int #{name}Count = byteArray.readInt();")
+
+      if(!builtin?(list.obj_type))
+        wi("#{ltype} o#{ltype};");
+      end
+      wi("this.#{name} = new List<#{ltype}>();")
+      wi("for(int i = 0; i < #{name}Count; i ++) {")
+      if(builtin?(list.obj_type))
+        wi("this.#{name}.add(byteArray.read#{ltype2}());",1)
+      elsif(enum?(list.obj_type))
+        wi("o#{ltype} =  #{ltype}.make#{ltype}(byteArray.readUnsignedByte());", 1)
+        wi("this.#{name}.add(o#{ltype});",1)
+      else
+        wi("o#{ltype} = new #{ltype}();",1)
+        wi("o#{ltype}.load(byteArray);",1)
+        wi("this.#{name}.add(o#{ltype});",1)
+      end
+      wi("}")
+
+    end
+
+
+  end
+  def library(structs,name)
+    wi("library #{name};")
+    wi("part 'enums.dart';");
+    structs.each do |struct|
+      wi("part '#{dartfile(struct.name)}';",0)
+    end
+
+    wi("abstract class ProtocolObject {");
+    wi("int classId();",1);
+    wi("ByteArray save();",1);
+    wi("void load(ByteArray array);",1);
+    wi("}");
+  end
+  def dartfile(str)
+    result = "#{str.downcase}.dart";
+    result
+
+  end
+  def object_factory(structs, version,library)
+    wi("part of #{library}")
+    wi("class ProtocolObjectFactory {")
+    wi("int version() {",1)
+    wi("return #{version};",2)
+    wi("}",1)
+    wi("")
+    wi("ProtocolObject create(int classId) {",1)
+    wi("switch(classId) {",2)
+    
+    structs.each do |struct|
+      wi("case #{struct.class_id}:",3)
+      wi("return new #{camelcasetype(struct.name)}();",4)
+    end
+    
+    wi("}",2)
+    wi("throw new ArgumentError(\"Unknown class id: $classId\");",2)
+    wi("}",1)
+    wi("}")
+  end
+  
+  # Create Visitor interface
+  def object_visitor(structs, version)
+    wi("interface PacketVisitor extends ProtocolObjectVisitor {")
+    structs.each do |struct|
+      wi("void visit(#{camelcasetype(struct.name)} packet);",1)
+    end
+    wi("}")
+  end
+  
+  # Create Visitable interface (used by all ProtocolObjects if applicable)
+  def object_visitable(structs, version)
+    wi("interface Visitable {")
+    wi("void accept(ProtocolObjectVisitor visitor);",1)
+    wi("}")
+  end
+  
+  def wi(line,extra = 0)
+    if(!line.empty?)
+      @out.write("    " * (@indent_level + extra))
+    end
+    @out.write(line + "\n")
+  end
+  
+  def DartOut.gen_enum_deserializer(name, values)
+    str = "    static #{name} make#{name}(int value) {\n"
+    str<< "        switch(value) {\n"
+    values.each_with_index {|v,i| str << "            case #{i}: return #{name}.#{v};\n" }
+    str<< "            default: throw new ArgumentError(\"Invalid enum value for #{name}: $value\");\n"
+    str<< "        }\n"
+    str<< "    }\n\n"
+    str
+  end
+
+  
+  def DartOut.generate_enums(f, enums)
+
+    enums.each_pair do |enum, values|
+      name = enum.capitalize
+      name = camelcase(name)
+      f.write("class #{name} {")
+      values.each_with_index {|v,i| f.write(" static const #{v} = const #{name}._(#{i});\n") }
+      f.write("final int value;\n");
+      f.write("const #{name}._(this.value);\n");
+      f.write(gen_enum_deserializer(name,values));
+      f.write("}")
+    end
+  end
+  
+  def sysout(list)
+    wi("\n")
+    wi("@override\n")
+    wi("String toString() {")
+    wi(" StringBuffer result = new StringBuffer(\"#{camelcasetype(@classname)} :\");", 1)
+    list.each do |member|
+        wi("result.write(\" #{member.name}[ $#{camelcase(member.name)} ]\");", 1)
+    end
+    wi("return result.toString();", 1)
+    wi("}\n")
+  end
+  
+  def create_field_list(members)
+    result = ""
+    members.each do |member|
+      result << "#{member.class_definition} #{camelcase(member.name)}, "
+    end
+    return result.chomp(", ")
+  end
+  
+  def field_constructor(members)
+    if (members.empty?)
+      # Don't create a field construct if there are no fields.
+      return
+    end
+    
+    field_list = create_field_list(members)
+    wi("")
+    wi("#{camelcasetype(@classname)}([#{field_list}]) {")
+    members.each do |member|
+      var = camelcase(member.name)
+      wi("this.#{var} = #{var};", 1)      
+    end
+    wi("}")
+  end
+  
+  def default_constructor()
+    wi("")
+    wi("/**")
+    wi(" * Default constructor.")
+    wi(" *")
+    wi(" */")
+    wi("#{camelcasetype(@classname)}() {")
+    wi("// Nothing here", 1)
+    wi("}")
+  end
+  def DartOut.part_of_header(package)
+    <<HEADER_END
+// I AM AUTO-GENERATED, DON'T CHECK ME INTO SUBVERSION (or else...)
+part of #{package};
+
+
+HEADER_END
+  end
+  def DartOut.file_header(package)
+    <<HEADER_END
+// I AM AUTO-GENERATED, DON'T CHECK ME INTO SUBVERSION (or else...)
+
+
+
+HEADER_END
+  end
+end

maven/protocol-generator-plugin/src/main/scripts/generate_source.rb

 $id_counter = 0
 $class_ids = []
 
+require 'dart_generator'
 require 'java_generator'
 require 'cpp_generator'
 require 'flash_generator'
     end
   end
   
-  def generate_code(protocol_file, language, output_dir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name)
+  def generate_code(protocol_file, language, output_dir, package_name, generate_visitors, version, fail_on_bad_packet_order, javascript_package_name,dart_library_name)
     $quiet = false
     
-    if(language != 'java' && language != 'cpp' && language != 'flash' && language != 'csharp' && language != 'cplusplus' && language != 'protobuf' && language != 'javascript')
+    if(language != 'java' && language != 'cpp' && language != 'flash' && language != 'csharp' && language != 'cplusplus' && language != 'protobuf' && language != 'javascript' && language !='dart')
       script_name = File.basename($0)
       puts "Usage:"
       puts "  java-mode: #{script_name} protocol.xml java  output-directory [package.name] [visitor]"
+      puts "  dart-mode: #{script_name} protocol.xml dart  output-directory [package.name] [visitor]"
       puts " flash-mode: #{script_name} protocol.xml flash output-directory [package.name]"
       puts "   c++-mode: #{script_name} protocol.xml cpp   output-file"
       puts "csharp-mode: #{script_name} protocol.xml csharp output-directory [namespace.name]"
           JavaOut.generate_enums(enum_file, $enums)
         end
         puts "Wrote #{enum_file_name}" unless $quiet
-        
+
+      elsif (language == 'dart')
+        library = dart_library_name || "protocol_library"
+
+        new_output_dir = create_dart_output_dir(output_dir, package_name)
+
+        puts 'Generating dart code to ' + new_output_dir unless $quiet
+
+        FileUtils.mkdir_p(new_output_dir)
+
+        puts 'Generated dir: ' + FileTest.exists?(new_output_dir).to_s
+
+        structs.each do |struct|
+
+          class_name = camelcasetype(struct.name)
+          file_name = "#{new_output_dir}/#{struct.name.downcase}.dart"
+
+          File.open(file_name,'w') do |outfile|
+            outfile.write(DartOut.part_of_header(library))
+            struct.to_stream(DartOut.new(outfile),language)
+          end
+          puts "Wrote #{file_name}" unless $quiet
+        end
+
+        #library
+        # Object Factory
+        library_file_name = "#{new_output_dir}/#{library}.dart"
+        File.open(library_file_name,'w') do |library_file|
+          library_file.write(DartOut.file_header(library))
+          DartOut.new(library_file).library(structs, library)
+        end
+
+        # Object Factory
+        factory_file_name = "#{new_output_dir}/protocol_object_factory.dart"
+        File.open(factory_file_name, 'w') do |factory_file|
+          factory_file.write(DartOut.file_header(library))
+          DartOut.new(factory_file).object_factory(structs, version,library)
+        end
+        puts "Wrote #{factory_file_name}" unless $quiet
+
+
+        enum_file_name = "#{new_output_dir}/enums.dart"
+        File.open(enum_file_name, 'w') do |enum_file|
+          enum_file.write(DartOut.part_of_header(library))
+          DartOut.generate_enums(enum_file, $enums)
+        end
+        puts "Wrote #{enum_file_name}" unless $quiet
+
+
       elsif (language == 'csharp')
         package = package_name || "Styx"
         
   def create_java_output_dir(base_name, package_name)
     result = base_name + '/' + package_name.gsub(/[\.]/, '/')
   end
+
+  def create_dart_output_dir(base_name, package_name)
+    result = base_name + '/dart'
+  end
   
   def create_flash_output_dir(base_name, package_name)
     puts "base = " + base_name

maven/protocol-generator-plugin/src/main/scripts/javascript_generator.rb

      end
      @indent_level -= 1
      wi("};")
-  end
+end
 
   def end_class
     @indent_level -= 1

maven/protocol-tests/dart-test/pom.xml

+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>styx-dart-test</artifactId>
+	<name>Styx Dart Test</name>
+	<packaging>jar</packaging>
+
+	<parent>
+		<groupId>com.cubeia.styx</groupId>
+		<artifactId>styx-tests-root</artifactId>
+		<version>1.18-SNAPSHOT</version>
+	</parent>
+
+	<dependencies>
+		<dependency>
+			<groupId>com.cubeia.styx</groupId>
+			<artifactId>styx-core</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.10</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>com.cubeia.styx</groupId>
+				<artifactId>protocol-generator-plugin</artifactId>
+				<version>${project.version}</version>
+				<configuration>
+					<protocol_file>src/test/resources/protocol.xml</protocol_file>
+					<language>dart</language>
+					<package_name>test_protocol</package_name>
+                    <dart_library_name>test_protocol</dart_library_name>
+					<generate_visitors>false</generate_visitors>
+					<fail_on_bad_packet_order>true</fail_on_bad_packet_order>
+				</configuration>
+				<executions>
+					<execution>
+						<phase>generate-sources</phase>
+						<goals>
+							<goal>generate</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

maven/protocol-tests/dart-test/src/test/java/com/cubeia/styx/test/ProtocolTest.java

+package com.cubeia.styx.test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+
+import org.junit.Test;
+
+import com.cubeia.firebase.io.PacketOutputStream;
+//import com.cubeia.styx.test.protocol.EnumTestPacket;
+
+public class ProtocolTest {
+
+	@Test
+	public void nullEnumOnSave() throws Exception {
+		/*
+        EnumTestPacket e = new EnumTestPacket();
+		e.type = null;
+		ByteArrayOutputStream ba = new ByteArrayOutputStream();
+		PacketOutputStream out = new PacketOutputStream(new DataOutputStream(ba));
+		e.save(out);*/
+	}
+}

maven/protocol-tests/dart-test/src/test/resources/protocol.xml

+<protocol version="$Revision: 6329 $">
+
+    <enum name="enum_type">
+      <value>STRING</value>
+      <value>INT</value>
+      <value>DATE</value>
+    </enum>
+
+    <!-- ==========  General Structs  ========== -->
+    
+    <struct id="1" name="enum_test_packet">
+        <var name="type" type="enum_type"/>
+    </struct>
+    
+    <struct id="2" name="type_test_packet">
+        <var name="ui8" type="uint8"/>
+        
+        <var name="i8" type="int8"/>
+        <var name="i16" type="int16"/>
+        <var name="i32" type="int32"/>
+        
+        <var name="b" type="bool"/>
+        <var name="s" type="string"/>
+    </struct>
+    
+    <struct ud="3" name="list_test_packet">
+        <list name="l" type="uint8"/>
+    </struct>
+    
+    <struct ud="4" name="dep_test_packet">
+        <var name="t" type="type_test_packet"/>
+    </struct>
+    
+    <struct id="5" name="list_of_enums">
+    	<list name="l" type="enum_type" />
+    </struct>
+    
+    <struct id="6" name="list_of_ints">
+    	<list name="l" type="int32" />
+    </struct>
+    
+    <struct id="7" name="list_of_uint32">
+    	<list name="l" type="uint32" />
+    </struct>
+    
+    <struct id="8" name="list_of_uint16">
+    	<list name="l" type="uint16" />
+    </struct>
+
+    <struct id="9" name="list_of_uint8">
+    	<list name="l" type="uint8" />
+    </struct>
+    
+</protocol>

maven/protocol-tests/pom.xml

 	<modules>
 		<module>js-test</module>
 		<module>java-test</module>
+        <module>dart-test</module>
 	</modules>
 
 	<build>
 					</execution>
 				</executions>
 			</plugin>
+            <!--
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
 						</goals>
 					</execution>
 				</executions>
-			</plugin>
+			</plugin>   -->
 			<plugin>
 				<artifactId>maven-release-plugin</artifactId>
 				<configuration>