Compare commits
2 Commits
3fafb89bdc
...
2ac9363d30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ac9363d30 | ||
| 4698b54832 |
@ -1,6 +1,6 @@
|
|||||||
{application,gmserialization,
|
{application,gmserialization,
|
||||||
[{description,"Serialization of data for the Gajumaru"},
|
[{description,"Serialization of data for the Gajumaru"},
|
||||||
{vsn,"0.1.2"},
|
{vsn,"0.2.0"},
|
||||||
{registered,[]},
|
{registered,[]},
|
||||||
{applications,[kernel,stdlib,crypto,base58]},
|
{applications,[kernel,stdlib,crypto,base58]},
|
||||||
{env,[]},
|
{env,[]},
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(gmser_api_encoder).
|
-module(gmser_api_encoder).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([encode/2,
|
-export([encode/2,
|
||||||
decode/1,
|
decode/1,
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmser_chain_objects).
|
-module(gmser_chain_objects).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ serialize/4
|
-export([ serialize/4
|
||||||
, deserialize/4
|
, deserialize/4
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(gmser_contract_code).
|
-module(gmser_contract_code).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-include("gmser_contract_code.hrl").
|
-include("gmser_contract_code.hrl").
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(gmser_delegation).
|
-module(gmser_delegation).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ aens_preclaim_sig/3
|
-export([ aens_preclaim_sig/3
|
||||||
, aens_name_sig/4
|
, aens_name_sig/4
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
-module(gmser_dyn).
|
-module(gmser_dyn).
|
||||||
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ encode/1 %% (Term) -> rlp()
|
-export([ encode/1 %% (Term) -> rlp()
|
||||||
, encode/2 %% (Term, Types) -> rlp()
|
, encode/2 %% (Term, Types) -> rlp()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
-module(gmser_dyn_types).
|
-module(gmser_dyn_types).
|
||||||
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ add_type/3 %% (Tag, Code, Template) -> Types1
|
-export([ add_type/3 %% (Tag, Code, Template) -> Types1
|
||||||
, add_type/4 %% (Tag, Code, Template, Types) -> Types1
|
, add_type/4 %% (Tag, Code, Template, Types) -> Types1
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmser_id).
|
-module(gmser_id).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ create/2
|
-export([ create/2
|
||||||
, specialize/1
|
, specialize/1
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmser_rlp).
|
-module(gmser_rlp).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ decode/1
|
-export([ decode/1
|
||||||
, decode_one/1
|
, decode_one/1
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{application, gmserialization,
|
{application, gmserialization,
|
||||||
[{description, "Serialization of data for the Gajumaru"},
|
[{description, "Serialization of data for the Gajumaru"},
|
||||||
{vsn, "0.1.0"},
|
{vsn, "zomp"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications,
|
{applications,
|
||||||
[kernel,
|
[kernel,
|
||||||
|
|||||||
14
src/gmserialization.app.src.script
Normal file
14
src/gmserialization.app.src.script
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
%% -*- erlang-mode; erlang-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
[{application, Name, Opts}] = CONFIG.
|
||||||
|
case lists:keyfind(vsn, 1, Opts) of
|
||||||
|
{vsn, "zomp"} ->
|
||||||
|
ZompMetaF = filename:join(filename:dirname(filename:dirname(SCRIPT)), "zomp.meta"),
|
||||||
|
{ok, ZMeta} = file:consult(ZompMetaF),
|
||||||
|
{_, {_, _, {Vmaj,Vmin,Vpatch}}} = lists:keyfind(package_id, 1, ZMeta),
|
||||||
|
VsnStr = unicode:characters_to_list(io_lib:fwrite("~w.~w.~w", [Vmaj, Vmin, Vpatch])),
|
||||||
|
Opts1 = lists:keyreplace(vsn, 1, Opts, {vsn, VsnStr}),
|
||||||
|
[{application, Name, Opts1}];
|
||||||
|
_ ->
|
||||||
|
CONFIG
|
||||||
|
end.
|
||||||
@ -7,7 +7,7 @@
|
|||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
|
|
||||||
-module(gmserialization).
|
-module(gmserialization).
|
||||||
-vsn("0.1.2").
|
-vsn("0.2.0").
|
||||||
|
|
||||||
-export([ decode_fields/2
|
-export([ decode_fields/2
|
||||||
, decode_field/2
|
, decode_field/2
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
{type,lib}.
|
{type,lib}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
{prefix,none}.
|
{prefix,none}.
|
||||||
{author,"Hans Svensson"}.
|
|
||||||
{desc,"Serialization helpers for the Gajumaru."}.
|
{desc,"Serialization helpers for the Gajumaru."}.
|
||||||
{package_id,{"otpr","gmserialization",{0,1,2}}}.
|
{author,"Hans Svensson"}.
|
||||||
|
{package_id,{"otpr","gmserialization",{0,2,0}}}.
|
||||||
{deps,[{"otpr","eblake2",{1,0,1}},{"otpr","base58",{0,1,1}}]}.
|
{deps,[{"otpr","eblake2",{1,0,1}},{"otpr","base58",{0,1,1}}]}.
|
||||||
{key_name,none}.
|
{key_name,none}.
|
||||||
{a_email,[]}.
|
{a_email,[]}.
|
||||||
|
|||||||
49
zompify.sh
Executable file
49
zompify.sh
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
APP=$(basename "$PWD")
|
||||||
|
|
||||||
|
SRC="_build/default/lib/$APP"
|
||||||
|
DST="$PWD/_build/zomp/lib/$APP"
|
||||||
|
IGNORE_FILE="zomp.ignore"
|
||||||
|
|
||||||
|
mkdir -p "$DST"
|
||||||
|
|
||||||
|
# Remove broken symlinks
|
||||||
|
find "$SRC" -type l ! -exec test -e {} \; -delete || true
|
||||||
|
|
||||||
|
# Build ignore matcher
|
||||||
|
IGNORE_TEMP=$(mktemp)
|
||||||
|
trap "rm -f $IGNORE_TEMP" EXIT
|
||||||
|
|
||||||
|
# Expand globs in zomp.ignore to patterns suitable for grep
|
||||||
|
if [ -e "$IGNORE_FILE" ]; then
|
||||||
|
grep -v '^\s*#' "$IGNORE_FILE" | sed 's#/#\\/#g' | sed 's/\./\\./g' | sed 's/\*/.*/g' > "$IGNORE_TEMP"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy Git-tracked and Zomp-allowed files
|
||||||
|
git ls-files -z | while IFS= read -r -d '' file; do
|
||||||
|
# Skip if ignored
|
||||||
|
echo "$file" | grep -Eq -f "$IGNORE_TEMP" && continue
|
||||||
|
# Only copy if file exists in the build dir
|
||||||
|
if [ -e "$SRC/$file" ]; then
|
||||||
|
mkdir -p "$DST/$(dirname "$file")"
|
||||||
|
cp -a "$SRC/$file" "$DST/$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm "$IGNORE_TEMP"
|
||||||
|
|
||||||
|
# Copy metadata
|
||||||
|
cp "$PWD/zomp.meta" "$DST/"
|
||||||
|
cp "$PWD/Emakefile" "$DST/"
|
||||||
|
|
||||||
|
# copy generated schema
|
||||||
|
SCHEMA="$SRC/priv/gmhc_schema.json"
|
||||||
|
if [ -e "$SCHEMA" ]; then
|
||||||
|
mkdir -p "$DST/priv"
|
||||||
|
cp -a "$SCHEMA" "$DST/priv/$(basename "$SCHEMA")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clean up beam files just in case
|
||||||
|
[ -d "$DST/ebin" ] && find "$DST/ebin" -name '*.beam' -exec rm -f {} + || true
|
||||||
Loading…
x
Reference in New Issue
Block a user