Permalink
Browse files

Reordered some build to succeeded on first try.

  • Loading branch information...
1 parent b9dc305 commit cd0d33178b1a868b34b3d10028c3732caad9f5ae @lordnull lordnull committed Mar 26, 2012
View
100 hooks.sh
@@ -0,0 +1,100 @@
+#! /usr/bin/env bash
+
+function do_included_apps {
+ initDir=`pwd`
+ for file in include_apps/*
+ do
+ echo "das file: $file"
+ cd $file
+ ../../rebar $1
+ cd $initDir
+ done
+}
+
+function post_compile {
+ do_included_apps "compile"
+}
+
+function pre_compile {
+ if [ ! -d ebin ]; then
+ mkdir ebin
+ fi
+
+ for file in proto_src/*.proto
+ do
+ nameBase=`echo "$file" | sed -e "s/^proto_src\///"`
+ nameBase="src/${nameBase}"
+ if [ ! -e $nameBase -o $file -nt $nameBase ]
+ then
+ cp $file src/
+ fi
+ done
+
+ # hack for include_apps
+
+ # hack for reltool
+ if [ ! -d OpenACD ]; then
+ mkdir OpenACD
+ ln -sf ../ebin OpenACD/ebin
+ ln -sf ../src OpenACD/src
+ ln -sf ../include OpenACD/include
+ ln -sf ../priv OpenACD/priv
+ ln -sf ../deps OpenACD/deps
+ fi
+
+ # record what commit/version openacd is at
+ OPENACD_COMMIT=""
+ if [ -d ".git" ]
+ then
+ OPENACD_COMMIT=`git log -1 --pretty=format:%H`
+ fi
+ if [ -e "include/commit_ver.hrl" ] && [ ! $OPENACD_COMMIT ]
+ then
+ exit 0
+ else
+ if [ ! $OPENACD_COMMIT ]
+ then
+ OPENACD_COMMIT="undefined"
+ else
+ OPENACD_COMMIT="\"$OPENACD_COMMIT\""
+ fi
+ fi
+ echo "%% automatically generated by OpenACD precompile script. Editing means
+%% it will just get overwritten again.
+
+-define(OPENACD_COMMIT, $OPENACD_COMMIT)." > include/commit_ver.hrl
+}
+
+function pre_get-deps {
+ if [ "${GIT_UPDATE_DISABLED}" != "1" ]; then
+ echo "Updating submodules..."
+ git submodule init && git submodule update
+ fi
+}
+
+function post_get-deps {
+ do_included_apps "get-deps"
+}
+
+function pre_clean {
+ rm -rf "OpenACD"
+}
+
+function post_clean {
+ do_included_apps clean
+}
+
+case $1 in
+ "pre_get-deps")
+ pre_get-deps;;
+ "post_get-deps")
+ post_get-deps;;
+ "pre_compile")
+ pre_compile;;
+ "post_compile")
+ post_compile;;
+ "pre_clean")
+ pre_clean;;
+ "post_clean")
+ post_clean;;
+esac
@@ -0,0 +1,8 @@
+function post_compile {
+ cat success_message
+}
+
+case $1 in
+ "post_compile")
+ post_compile;;
+esac
@@ -3,7 +3,7 @@
%{sub_dirs, ["rel"]}.
{lib_dirs, ["../..", "../../deps"]}.
-{post_hooks, [{compile, "cat success_message"}]}.
+{post_hooks, [{compile, "./hooks.sh post_compile"}]}.
{edoc_opts, [{def, {web, "<b>Web Api </b>"}}]}.
@@ -1,70 +0,0 @@
-import "../../proto_src/cpx_base.proto";
-import "../../proto_src/cpx_agent.proto";
-
-package openacd.agent.freeswitch;
-
-// By the power vested in me by my OS and being at the keyboard,
-// I hearby declare Freeswitch reserves message extension range from
-// 3000 to 3050. I doubt I'll need 50 new fields, but one never knows.
-
-enum FreeswitchEvent {
- CALLER_ONHOLD = 1;
- CALLER_OFFHOLD = 2;
- IN_CONFERENCE = 3;
- HOLD_CONFERENCE = 4;
- THIRD_PARTY = 5;
- HOLD_CONFERENCE_3RD_PARTY = 6;
- IN_CONFERENCE_3RDPARTY = 7;
-}
-
-enum FreeswitchRequestHint {
- SET_AUDIO_LEVEL = 1;
- TOGGLE_HOLD = 2;
- CONTACT_3RD_PARTY = 3;
- RETRIEVE_CONFERENCE = 4;
- MERGE_3RD_PARTY = 5;
- BLIND_TRANSFER = 6;
- RETRIEVE_3RD_PARTY = 7;
- HANGUP_3RD_PARTY = 8;
- PLAY_DTMF = 9;
-}
-
-enum FreeswitchVoicemailRequest {
- REPLAY = 1;
-}
-
-message AudioLevelRequest {
- enum AudioChannel {
- SPEAKER = 1;
- MIC = 2;
- }
- required AudioChannel channel = 1;
- required int32 value = 2; // This is -4 to 4
-}
-
-message Contact3rdPartyRequest {
- optional string target = 1;
-}
-
-message Merge3rdPartyRequest {
- optional bool include_self = 1 [default=false];
-}
-
-message BlindTransferRequest {
- required string target = 1;
-}
-
-extend MediaCommandRequest {
- optional FreeswitchRequestHint freeswitch_request_hint = 3000;
- optional AudioLevelRequest audio_level_request = 3001;
- optional Contact3rdPartyRequest contact_3rd_party = 3002;
- optional Merge3rdPartyRequest merge_3rd_party = 3003;
- optional BlindTransferRequest blind_transfer = 3004;
- optional FreeswitchVoicemailRequest freeswitch_voicemail_request_hint = 3005;
- optional string dtmf_string = 3006;
-}
-
-extend MediaEvent {
- optional FreeswitchEvent freeswitch_event = 3000;
-}
-
View
@@ -1 +0,0 @@
-cat success_message
View
@@ -1,57 +0,0 @@
-#! /bin/sh
-
-if [ ! -d ebin ]; then
- mkdir ebin
-fi
-
-for file in proto_src/*.proto
-do
- nameBase=`echo "$file" | sed -e "s/^proto_src\///"`
- nameBase="src/${nameBase}"
- if [ ! -e $nameBase -o $file -nt $nameBase ]
- then
- cp $file src/
- fi
-done
-
-# hack for include_apps
-initDir=`pwd`
-for file in include_apps/*
-do
- echo "das file: $file"
- cd $file
- ../../rebar compile
- cd $initDir
-done
-
-# hack for reltool
-if [ ! -d OpenACD ]; then
- mkdir OpenACD
- ln -sf ../ebin OpenACD/ebin
- ln -sf ../src OpenACD/src
- ln -sf ../include OpenACD/include
- ln -sf ../priv OpenACD/priv
- ln -sf ../deps OpenACD/deps
-fi
-
-# record what commit/version openacd is at
-OPENACD_COMMIT=""
-if [ -d ".git" ]
-then
- OPENACD_COMMIT=`git log -1 --pretty=format:%H`
-fi
-if [ -e "include/commit_ver.hrl" ] && [ ! $OPENACD_COMMIT ]
-then
- exit 0
-else
- if [ ! $OPENACD_COMMIT ]
- then
- OPENACD_COMMIT="undefined"
- else
- OPENACD_COMMIT="\"$OPENACD_COMMIT\""
- fi
-fi
-echo "%% automatically generated by OpenACD precompile script. Editing means
-%% it will just get overwritten again.
-
--define(OPENACD_COMMIT, $OPENACD_COMMIT)." > include/commit_ver.hrl
View
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-if [ "${GIT_UPDATE_DISABLED}" != "1" ]; then
- echo "Updating submodules..."
- git submodule init && git submodule update
-fi
View
@@ -13,9 +13,9 @@
{mochiweb, "2.3.0", {git, "http://github.com/mochi/mochiweb.git", {tag, "v2.3.0"}}},
{gen_server_mock, "0.0.5", {git, "http://github.com/lordnull/gen_server_mock.git", {branch, "master"}}},
{iconv, "1.0.2", {git, "https://github.com/OpenACD/erlang-iconv.git", {branch, "R15B"}}},
- {netstring, "1", {git, "https://github.com/lordnull/erlnetstr.git", {branch, "master"}}},
- oacd_freeswitch,
- oacd_dummy
+ {netstring, "1", {git, "https://github.com/lordnull/erlnetstr.git", {branch, "master"}}}%,
+ %oacd_freeswitch,
+ %oacd_dummy
]}.
{edoc_opts, [
@@ -24,10 +24,16 @@
{def, {version, "2.0.0"}}
]}.
-{pre_hooks, [{compile, "./pre_compile.sh"},
- {'get-deps', "./pre_get-deps.sh"},
- {clean, "rm -rf OpenACD"}]}.
-{post_hooks, [{compile, "./post_compile.sh"}]}.
+{pre_hooks, [
+ {compile, "./hooks.sh pre_compile"},
+ {'get-deps', "./hooks.sh pre_get-deps"},
+ {clean, "./hooks.sh pre_clean"}
+]}.
+{post_hooks, [
+ {compile, "./hooks.sh post_compile"},
+ {'get-deps', "./hooks.sh post_get-deps"},
+ {clean, "./hooks.sh post_clean"}
+]}.
{cover_enabled, true}.
{eunit_opts, [verbose]}.

0 comments on commit cd0d331

Please sign in to comment.