diff --git a/.travis/before-install.sh b/.travis/before-install.sh index 8f9f56ca19..d67271b28e 100755 --- a/.travis/before-install.sh +++ b/.travis/before-install.sh @@ -10,7 +10,7 @@ sudo rm /usr/local/bin/docker-compose curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose chmod +x docker-compose sudo mv docker-compose /usr/local/bin -echo "Docker-compose version: " +echo "Docker-compose version: " docker-compose --version # Update docker @@ -22,7 +22,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get install docker-ce -echo "Docker version: " +echo "Docker version: " docker --version # Grab the parent (root) directory. @@ -51,6 +51,49 @@ echo "->- Build cfg being used" cat ${DIR}/build.cfg echo "-<-" + +###### +# checking the changes that are in this file +echo "Travis commit range $TRAVIS_COMMIT_RANGE" +echo "Travis commit $TRAVIS_COMMIT" +echo "Travis event type $TRAVIS_EVENT_TYPE" + + +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]" +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then + echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then + echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']' +else + echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' +fi + + +cd $TRAVIS_BUILD_DIR +git diff --name-only $(echo $TRAVIS_COMMIT_RANGE | sed 's/\.//') + +if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + git show --pretty=format: --name-only "$TRAVIS_COMMIT_RANGE"|sort|uniq > changedfiles.log +elif [ -n "$TRAVIS_PULL_REQUEST" ]; then + git diff --name-only "$TRAVIS_COMMIT" "$TRAVIS_BRANCH" > changedfiles.log +fi + +RESULT=$(cat changedfiles | sed '/^\s*$/d' | awk '!/composer-website/ { print "MORE" }') +if [ "${RESULT}" == "" ]; +then + echo "Only docs changes" +else + echo "More than docs changes" +fi +rm changedfiles.log + +cd - > /dev/null +###### + + + + # Check of the task current executing if [ "${FC_TASK}" = "docs" ]; then echo Doing Docs - no requirement for installations of other software diff --git a/packages/composer-common/.gitignore b/packages/composer-common/.gitignore index 9fbb2780af..0eaf316b67 100644 --- a/packages/composer-common/.gitignore +++ b/packages/composer-common/.gitignore @@ -47,4 +47,5 @@ out # Build generated files should be ignored by git, but not by npm. lib/acl/parser.js lib/introspect/parser.js +lib/query/parser.js index.d.ts diff --git a/packages/composer-common/.npmignore b/packages/composer-common/.npmignore index f56be875dc..dc39138d9d 100644 --- a/packages/composer-common/.npmignore +++ b/packages/composer-common/.npmignore @@ -47,4 +47,5 @@ out # Build generated files should be ignored by git, but not by npm. # lib/acl/parser.js # lib/introspect/parser.js +# lib/query/parser.js # index.d.ts diff --git a/packages/composer-common/api.txt b/packages/composer-common/api.txt index e5c1659dd2..02a03505ae 100644 --- a/packages/composer-common/api.txt +++ b/packages/composer-common/api.txt @@ -27,9 +27,9 @@ class BusinessNetworkMetadata { class Factory { + void constructor(ModelManager) + Resource newInstance(string,string,string,Object,boolean,string) throws ModelException - + Resource newResource(string,string,string,Object,boolean,string) throws ModelException - + Resource newConcept(string,string,Object,boolean,string) throws ModelException - + Relationship newRelationship(string,string,string) throws ModelException + + Resource newResource(string,string,string,Object,boolean,string) throws TypeNotFoundException + + Resource newConcept(string,string,Object,boolean,string) throws TypeNotFoundException + + Relationship newRelationship(string,string,string) throws TypeNotFoundException + Resource newTransaction(string,string,string,Object,string) + Resource newEvent(string,string,string,Object,string) + Object toJSON() @@ -45,7 +45,7 @@ class FileWallet extends Wallet { + Promise remove(string) } class IllegalModelException extends BaseException { - + void constructor(string,string,string) + + void constructor(String,ModelFile,Object,String,String,String,String) + string getModelFile() + string getFileLocation() } @@ -117,6 +117,10 @@ class Serializer { class ValidationException extends BaseException { + void constructor(string) } +class TypeNotFoundException extends BaseException { + + void constructor(String,String) + + string getTypeName() +} class Wallet { + Wallet getWallet() + void setWallet(Wallet) diff --git a/packages/composer-common/changelog.txt b/packages/composer-common/changelog.txt index d065b34084..705d983e68 100644 --- a/packages/composer-common/changelog.txt +++ b/packages/composer-common/changelog.txt @@ -12,6 +12,11 @@ # Note that the latest public API is documented using JSDocs and is available in api.txt. # +Version 0.7.6 {1dbfded54f54b7861b8eadb64d95f82a} 2017-06-14 +- Added TypeNotFoundException +- Corrected JSDoc for IllegalModelException.constructor +- Corrected JSDoc for Factory.newRelationship + Version 0.7.5 {b2c1c30d370b04c153426500a03c3061} 2017-06-07 - Added optional JSZip options parameter to toArchive diff --git a/packages/composer-common/index.js b/packages/composer-common/index.js index d8b67f9e64..79081dc5c5 100644 --- a/packages/composer-common/index.js +++ b/packages/composer-common/index.js @@ -54,6 +54,7 @@ module.exports.AssetDeclaration = require('./lib/introspect/assetdeclaration'); module.exports.BaseException = require('./lib/baseexception'); module.exports.BusinessNetworkDefinition = require('./lib/businessnetworkdefinition'); module.exports.ClassDeclaration = require('./lib/introspect/classdeclaration'); +module.exports.CodeGen = require('./lib/codegen/codegen.js'); module.exports.ComboConnectionProfileStore = require('./lib/comboconnectionprofilestore'); module.exports.Concept = require('./lib/model/concept'); module.exports.ConceptDeclaration = require('./lib/introspect/conceptdeclaration'); @@ -74,8 +75,11 @@ module.exports.Logger = require('./lib/log/logger'); module.exports.LoopbackVisitor = require('./lib/codegen/fromcto/loopback/loopbackvisitor'); module.exports.ModelFile = require('./lib/introspect/modelfile'); module.exports.ModelManager = require('./lib/modelmanager'); +module.exports.OrderBy = require('./lib/query/orderby'); module.exports.ParticipantDeclaration = require('./lib/introspect/participantdeclaration'); module.exports.Property = require('./lib/introspect/property'); +module.exports.Query = require('./lib/query/query'); +module.exports.QueryFile = require('./lib/query/queryfile'); module.exports.Relationship = require('./lib/model/relationship'); module.exports.RelationshipDeclaration = require('./lib/introspect/relationshipdeclaration'); module.exports.Resource = require('./lib/model/resource'); @@ -84,11 +88,13 @@ module.exports.Script = require('./lib/introspect/script'); module.exports.ScriptManager = require('./lib/scriptmanager'); module.exports.SecurityContext = require('./lib/securitycontext'); module.exports.SecurityException = require('./lib/securityexception'); +module.exports.Select = require('./lib/query/select'); module.exports.Serializer = require('./lib/serializer'); +module.exports.Sort = require('./lib/query/sort'); module.exports.TransactionDeclaration = require('./lib/introspect/transactiondeclaration'); module.exports.TypescriptVisitor = require('./lib/codegen/fromcto/typescript/typescriptvisitor'); module.exports.Util = require('./lib/util'); module.exports.Wallet = require('./lib/wallet'); -module.exports.CodeGen = require('./lib/codegen/codegen.js'); +module.exports.Where = require('./lib/query/where'); module.exports.Writer = require('./lib/codegen/writer.js'); module.exports.version = require('./package.json'); diff --git a/packages/composer-common/lib/factory.js b/packages/composer-common/lib/factory.js index fa78dddc08..da5a11b536 100644 --- a/packages/composer-common/lib/factory.js +++ b/packages/composer-common/lib/factory.js @@ -17,6 +17,8 @@ const debug = require('debug')('ibm-concerto'); const Globalize = require('./globalize'); +const ModelUtil = require('./modelutil'); + const InstanceGenerator = require('./serializer/instancegenerator'); const ValueGeneratorFactory = require('./serializer/valuegenerator'); const ResourceValidator = require('./serializer/resourcevalidator'); @@ -86,7 +88,7 @@ class Factory { *