-
This commit is contained in:
5
.gitignore
vendored
Executable file
5
.gitignore
vendored
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
target/
|
||||||
|
src-gen/
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
2
gen.sh
Executable file
2
gen.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
haxelib run protohx generate protohx.json
|
||||||
16
project.xml
Executable file
16
project.xml
Executable 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
3
proto/base.proto
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
message Foo {
|
||||||
|
required string bar = 1;
|
||||||
|
}
|
||||||
9
protohx.json
Executable file
9
protohx.json
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"protoPath": ".",
|
||||||
|
"protoFiles": [
|
||||||
|
"proto/base.proto"
|
||||||
|
],
|
||||||
|
"cleanOut": true,
|
||||||
|
"haxeOut": "src-gen/haxe",
|
||||||
|
"javaOut": null
|
||||||
|
}
|
||||||
25
src/haxe/ru/m/armageddon/Armageddon.hx
Executable file
25
src/haxe/ru/m/armageddon/Armageddon.hx
Executable 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user