This commit is contained in:
2014-06-22 21:29:13 +04:00
commit 8f689d4be9
6 changed files with 60 additions and 0 deletions

5
.gitignore vendored Executable file
View File

@@ -0,0 +1,5 @@
target/
src-gen/
*.iml
*.ipr
*.iws

2
gen.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
haxelib run protohx generate protohx.json

16
project.xml Executable file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<meta title="Armageddon" package="ru.m.armageddon" version="0.0.0" company="m"/>
<app main="ru.m.armageddon.Armageddon" path="target" file="armageddon"/>
<source path="src/haxe"/>
<source path="src-gen/haxe"/>
<haxelib name="openfl"/>
<haxelib name="protohx"/>
<haxelib name="haxework" version="git"/>
<window width="800" height="600" if="desktop"/>
<window width="800" height="600" if="flash"/>
<window width="0" height="0" if="html5"/>
<haxeflag name="-dce" value="no"/>
<haxeflag name="-debug"/>
<haxeflag name="--macro" value="Meta.set('0.0.0')"/>
</project>

3
proto/base.proto Executable file
View File

@@ -0,0 +1,3 @@
message Foo {
required string bar = 1;
}

9
protohx.json Executable file
View File

@@ -0,0 +1,9 @@
{
"protoPath": ".",
"protoFiles": [
"proto/base.proto"
],
"cleanOut": true,
"haxeOut": "src-gen/haxe",
"javaOut": null
}

View File

@@ -0,0 +1,25 @@
package ru.m.armageddon;
import haxe.io.BytesOutput;
import haxework.log.TraceLogger;
class Armageddon {
private static inline var TAG = "Armageddon";
public static function main() {
L.push(new TraceLogger());
L.d(TAG, Meta.getVersion());
var foo = new Foo();
foo.bar = "test";
var out = new BytesOutput();
foo.writeTo(out);
var foo2 = new Foo();
foo2.mergeFrom(out.getBytes());
L.d(TAG, foo2.bar);
}
}