Skip to content

Commit

Permalink
Merge pull request #65 from DoclerLabs/develop
Browse files Browse the repository at this point in the history
release 0.15.0
  • Loading branch information
aliokan authored Feb 13, 2017
2 parents dd826c6 + a254123 commit 11084b2
Show file tree
Hide file tree
Showing 26 changed files with 487 additions and 108 deletions.
42 changes: 18 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,51 @@
sudo: required
dist: trusty

language: haxe

# haxe versions : http://haxe.org/website-content/downloads/versions.json
haxe:
- "3.2.1"
- "3.3.0-rc.1"
- "3.4.0"
- development

matrix:
allow_failures:
- haxe: development

addons:
apt:
packages:
# PHP
- php5-cli
# Flash
- libcurl3:i386
- libglib2.0-0:i386
- libx11-6:i386
- libxext6:i386
- libxt6:i386
- libxcursor1:i386
- libnss3:i386
- libgtk2.0-0:i386

before_install:
- echo $TRAVIS_BRANCH
- if [[ "$TRAVIS_BRANCH" != "master" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=master; fi
- echo $TRAVIS_TAG
- if [[ "$TRAVIS_TAG" != "" ]]; then export DEPENDENCIES_BRANCH=$TRAVIS_TAG; fi
- echo $DEPENDENCIES_BRANCH
- sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list" "/opt/google/chrome/cron/google-chrome"
- sudo dpkg --add-architecture i386
- sudo apt-get update
- sudo apt-get install -qq libcurl3:i386
- sudo apt-get install -qq libglib2.0-0:i386
- sudo apt-get install -qq libx11-6:i386
- sudo apt-get install -qq libxext6:i386
- sudo apt-get install -qq libxt6:i386
- sudo apt-get install -qq libxcursor1:i386
- sudo apt-get install -qq libnss3:i386
- sudo apt-get install -qq libgtk2.0-0:i386

install:
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexCore.git ./hexcore
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexReflection.git ./hexreflection
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexAnnotation.git ./hexannotation
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexInject.git ./hexinject
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexUnit.git ./hexunit
- git clone --recursive https://github.com/chipshort/hexDoc-Theme.git ./hexdoctheme
- export DISPLAY=:99.0;
- export AUDIODEV=null;
- haxe flash/install.hxml

script:
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-each.hxml -cp hexdoctheme/src --macro "ImportAll.run()" --no-output -php bin; fi
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-php.hxml && php bin/index.php; fi
- haxe build-each.hxml -cp hexdoctheme/src --macro "ImportAll.run()" --no-output -neko bin/docs.n
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-neko.hxml && neko bin/MainMVCTest.n; fi
- haxe build-each.hxml -cp hexdoctheme/src --macro "ImportAll.run()" --no-output -js bin/docs.js
- haxe build-js.hxml && node bin/MainMVCTest.js
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-each.hxml -cp hexdoctheme/src --macro "ImportAll.run()" --no-output -swf-version 11 -swf bin/docs.swf; fi
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-flash.hxml -D fdb && haxe flash/run.hxml bin/MainMVCTest.swf; fi
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-neko.hxml && neko bin/MainTest.n; fi
- haxe build-js.hxml && node bin/MainTest.js
- if [ $TRAVIS_HAXE_VERSION != "3.2.1" ]; then haxe build-flash.hxml -D fdb && haxe flash/run.hxml bin/MainTest.swf; fi

notifications:
email:
Expand Down
12 changes: 11 additions & 1 deletion build-flash.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
build-each.hxml

--each

--macro include('hex')
--no-output
-swf-version 11
-swf bin/MainMVCTest.swf
-swf bin/docs.swf

--next

-swf-version 11
-swf bin/MainTest.swf
11 changes: 10 additions & 1 deletion build-js.hxml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
build-each.hxml
-js bin/MainMVCTest.js

--each

--macro include('hex')
--no-output
-js bin/docs.js

--next

-js bin/MainTest.js
11 changes: 10 additions & 1 deletion build-neko.hxml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
build-each.hxml
-neko bin/MainMVCTest.n

--each

--macro include('hex')
--no-output
-neko bin/docs.n

--next

-neko bin/MainTest.n
9 changes: 9 additions & 0 deletions build-php.hxml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
build-each.hxml

--each

--macro include('hex')
--no-output
-php bin

--next

-php bin
35 changes: 0 additions & 35 deletions package.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/hex/config/stateless/ModuleConfig.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ModuleConfig implements IStatelessConfig implements IInjectorContainer

public function configure() : Void
{
throw new VirtualMethodException( this + ".configure must be overridden" );
throw new VirtualMethodException();
}

public function get<T>( type : Class<T>, name : String = "" ) : T
Expand Down
2 changes: 1 addition & 1 deletion src/hex/config/stateless/StatelessCommandConfig.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class StatelessCommandConfig implements IStatelessConfig implements IInjectorCon
*/
public function configure() : Void
{
throw new VirtualMethodException( "'configure' is not implemented" );
throw new VirtualMethodException();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hex/config/stateless/StatelessConfig.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StatelessConfig implements IStatelessConfig implements IInjectorContainer

public function configure() : Void
{
throw new VirtualMethodException( this + ".configure must be overridden" );
throw new VirtualMethodException();
}

public function map<T>( interfaceRef : Class<T>, classRef : Class<T>, name : String = "" ) : Void
Expand Down
4 changes: 2 additions & 2 deletions src/hex/config/stateless/StatelessModelConfig.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class StatelessModelConfig implements IStatelessConfig implements IInjectorConta

public function configure() : Void
{
throw new VirtualMethodException( this + ".configure must be overridden" );
throw new VirtualMethodException();
}

public function map<ModelType>( modelInterface : Class<ModelType>, modelClass : Class<ModelType>, name : String = "" ) : Void
{
var instance : Dynamic = this.injector.instantiateUnmapped( modelClass );
var instance = this.injector.instantiateUnmapped( modelClass );
this.injector.mapToValue( modelInterface, instance, name );
this.injector.mapToValue( Type.resolveClass( Type.getClassName( modelInterface ) + "RO" ), instance, name );
}
Expand Down
2 changes: 1 addition & 1 deletion src/hex/config/stateless/StatelessModuleConfig.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class StatelessModuleConfig implements IStatelessConfig implements IInjectorCont

public function configure() : Void
{
throw new VirtualMethodException( this + ".configure must be overridden" );
throw new VirtualMethodException();
}

public function mapCommand( messageType : MessageType, commandClass : Class<ICommand> ) : ICommandMapping
Expand Down
11 changes: 0 additions & 11 deletions src/hex/control/FrontController.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package hex.control;

import hex.collection.Locator;
import hex.collection.LocatorMessage;
import hex.control.command.CommandExecutor;
import hex.control.command.CommandMapping;
import hex.control.command.ICommand;
Expand Down Expand Up @@ -62,14 +61,4 @@ class FrontController extends Locator<MessageType, ICommandMapping> implements I
commandExecutor.executeCommand( commandMapping, request, mappingRemoval );
}
}

override function _dispatchRegisterEvent( key : MessageType, element : ICommandMapping ) : Void
{
this._dispatcher.dispatch( LocatorMessage.REGISTER, [ key, element ] );
}

override function _dispatchUnregisterEvent( key : MessageType ) : Void
{
this._dispatcher.dispatch( LocatorMessage.UNREGISTER, [ key ] );
}
}
10 changes: 5 additions & 5 deletions src/hex/control/async/AsyncCommandUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import hex.error.PrivateConstructorException;
*/
class AsyncCommandUtil
{

public function new()
/** @private */
function new()
{
throw new PrivateConstructorException( "'AsyncCommandUtil' class can't be instantiated." );
throw new PrivateConstructorException();
}

static public function addListenersToAsyncCommand( handlers : Array<Function>, methodToAddListener : ( IAsyncCommand->Void )->Void ) : Void
static public function addListenersToAsyncCommand( handlers : Array<IAsyncCommand->Void>, methodToAddListener : ( IAsyncCommand->Void )->Void ) : Void
{
for ( handler in handlers )
{
methodToAddListener( cast handler );
methodToAddListener( handler );
}
}
}
21 changes: 11 additions & 10 deletions src/hex/control/command/CommandMapping.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package hex.control.command;

import haxe.Constraints.Function;
import hex.control.async.IAsyncCommand;
import hex.control.command.ICommand;
import hex.control.payload.ExecutionPayload;
import hex.di.IContextOwner;
Expand All @@ -17,9 +18,9 @@ class CommandMapping implements ICommandMapping

var _contextOwner : IContextOwner;

var _completeHandlers : Array<Function>;
var _cancelHandlers : Array<Function>;
var _failHandlers : Array<Function>;
var _completeHandlers : Array<IAsyncCommand->Void>;
var _cancelHandlers : Array<IAsyncCommand->Void>;
var _failHandlers : Array<IAsyncCommand->Void>;

var _mappingResults : Array<ICommandMapping>;

Expand Down Expand Up @@ -92,7 +93,7 @@ class CommandMapping implements ICommandMapping
return this;
}

public function getCompleteHandlers() : Array<Function>
public function getCompleteHandlers() : Array<IAsyncCommand->Void>
{
return this._completeHandlers;
}
Expand All @@ -103,18 +104,18 @@ class CommandMapping implements ICommandMapping
return this._completeHandlers != null;
}

public function withCompleteHandler( handler : Function ) : ICommandMapping
public function withCompleteHandler( handler : IAsyncCommand->Void ) : ICommandMapping
{
if ( this._completeHandlers == null )
{
this._completeHandlers = new Array<Function>();
this._completeHandlers = [];
}

this._completeHandlers.push( handler );
return this;
}

public function getFailHandlers() : Array<Function>
public function getFailHandlers() : Array<IAsyncCommand->Void>
{
return this._failHandlers;
}
Expand All @@ -125,7 +126,7 @@ class CommandMapping implements ICommandMapping
return this._failHandlers != null;
}

public function withFailHandler( handler : Function ) : ICommandMapping
public function withFailHandler( handler : IAsyncCommand->Void ) : ICommandMapping
{
if ( this._failHandlers == null )
{
Expand All @@ -136,7 +137,7 @@ class CommandMapping implements ICommandMapping
return this;
}

public function getCancelHandlers() : Array<Function>
public function getCancelHandlers() : Array<IAsyncCommand->Void>
{
return this._cancelHandlers;
}
Expand All @@ -147,7 +148,7 @@ class CommandMapping implements ICommandMapping
return this._cancelHandlers != null;
}

public function withCancelHandler( handler : Function ) : ICommandMapping
public function withCancelHandler( handler : IAsyncCommand->Void ) : ICommandMapping
{
if ( this._cancelHandlers == null )
{
Expand Down
Loading

0 comments on commit 11084b2

Please sign in to comment.