summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-03-25 20:10:42 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2016-03-25 20:10:42 +0100
commit09579eac17f0f8eaf4565a863bbda194ebd4a6c7 (patch)
tree037182052d30969a8dfe952445b128db08e44556
parent84c6f5921e4e5f4c1fe1e27761bbc645549a6e17 (diff)
fix dist commands
-rw-r--r--Makefile57
-rw-r--r--vendor/autoload.php2
-rw-r--r--vendor/composer/LICENSE2
-rw-r--r--vendor/composer/autoload_real.php10
4 files changed, 44 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index 6284f1540..e665b192b 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@
#
# Dependencies:
# * make
+# * which
# * curl: used if phpunit and composer are not installed to fetch them from the web
# * tar: for building the archive
# * npm: for building and testing everything JS
@@ -44,20 +45,30 @@ source_package_name=$(source_build_directory)/$(app_name)
appstore_build_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_build_directory)/$(app_name)
npm=$(shell which npm 2> /dev/null)
+composer=$(shell which composer 2> /dev/null)
all: build
-# Fetches the PHP and JS dependencies and compiles the JS
+# Fetches the PHP and JS dependencies and compiles the JS. If no composer.json
+# is present, the composer step is skipped, if no package.json or js/package.json
+# is present, the npm step is skipped
.PHONY: build
build:
+ifneq (,$(wildcard $(CURDIR)/composer.json))
make composer
+endif
+ifneq (,$(wildcard $(CURDIR)/package.json))
+ make npm
+endif
+ifneq (,$(wildcard $(CURDIR)/js/package.json))
make npm
+endif
# Installs and updates the composer dependencies. If composer is not installed
# a copy is fetched from the web
.PHONY: composer
composer:
-ifeq (, $(shell which composer 2> /dev/null))
+ifeq (, $(composer))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sS https://getcomposer.org/installer | php
@@ -100,8 +111,10 @@ dist:
mkdir -p $(source_build_directory)
tar cvzf $(source_package_name).tar.gz ../$(app_name) \
--exclude-vcs \
- --exclude=../$(app_name)/build \
- --exclude=../$(app_name)/js/node_modules \
+ --exclude="../$(app_name)/build" \
+ --exclude="../$(app_name)/js/node_modules" \
+ --exclude="../$(app_name)/*.log" \
+ --exclude="../$(app_name)/js/*.log" \
# Builds the source package for the app store, ignores php and js tests
.PHONY: appstore
@@ -112,22 +125,26 @@ appstore:
mkdir -p $(appstore_build_directory)
tar cvzf $(appstore_package_name).tar.gz ../$(app_name) \
--exclude-vcs \
- --exclude=../$(app_name)/build \
- --exclude=../$(app_name)/tests \
- --exclude=../$(app_name)/Makefile \
- --exclude=../$(app_name)/\.* \
- --exclude=../$(app_name)/*\.log \
- --exclude=../$(app_name)/phpunit*xml \
- --exclude=../$(app_name)/composer\.* \
- --exclude=../$(app_name)/js/node_modules \
- --exclude=../$(app_name)/js/tests \
- --exclude=../$(app_name)/js/test \
- --exclude=../$(app_name)/js/*\.log
- --exclude=../$(app_name)/js/\.* \
- --exclude=../$(app_name)/js/package.json \
- --exclude=../$(app_name)/js/bower.json \
- --exclude=../$(app_name)/js/karma\.* \
- --exclude=../$(app_name)/js/protractor\.* \
+ --exclude="../$(app_name)/build" \
+ --exclude="../$(app_name)/tests" \
+ --exclude="../$(app_name)/Makefile" \
+ --exclude="../$(app_name)/*.log" \
+ --exclude="../$(app_name)/phpunit*xml" \
+ --exclude="../$(app_name)/composer.*" \
+ --exclude="../$(app_name)/js/node_modules" \
+ --exclude="../$(app_name)/js/tests" \
+ --exclude="../$(app_name)/js/test" \
+ --exclude="../$(app_name)/js/*.log" \
+ --exclude="../$(app_name)/js/package.json" \
+ --exclude="../$(app_name)/js/bower.json" \
+ --exclude="../$(app_name)/js/karma.*" \
+ --exclude="../$(app_name)/js/protractor.*" \
+ --exclude="../$(app_name)/package.json" \
+ --exclude="../$(app_name)/bower.json" \
+ --exclude="../$(app_name)/karma.*" \
+ --exclude="../$(app_name)/protractor\.*" \
+ --exclude="../$(app_name)/.*" \
+ --exclude="../$(app_name)/js/.*" \
# Command for running JS and PHP tests. Works for package.json files in the js/
# and root directory. If phpunit is not installed systemwide, a copy is fetched
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 25e1e4df5..2d0533ed7 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInit334c7e054c9bab39cbcd0f5e07be903e::getLoader();
+return ComposerAutoloaderInite705c48abdefdf8479a684120707f72b::getLoader();
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
index c8d57af8b..1a2812488 100644
--- a/vendor/composer/LICENSE
+++ b/vendor/composer/LICENSE
@@ -1,5 +1,5 @@
-Copyright (c) 2015 Nils Adermann, Jordi Boggiano
+Copyright (c) 2016 Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 2d8b2eda7..8ad9866c8 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit334c7e054c9bab39cbcd0f5e07be903e
+class ComposerAutoloaderInite705c48abdefdf8479a684120707f72b
{
private static $loader;
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit334c7e054c9bab39cbcd0f5e07be903e
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit334c7e054c9bab39cbcd0f5e07be903e', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInite705c48abdefdf8479a684120707f72b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit334c7e054c9bab39cbcd0f5e07be903e', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInite705c48abdefdf8479a684120707f72b', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit334c7e054c9bab39cbcd0f5e07be903e
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire334c7e054c9bab39cbcd0f5e07be903e($fileIdentifier, $file);
+ composerRequiree705c48abdefdf8479a684120707f72b($fileIdentifier, $file);
}
return $loader;
}
}
-function composerRequire334c7e054c9bab39cbcd0f5e07be903e($fileIdentifier, $file)
+function composerRequiree705c48abdefdf8479a684120707f72b($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;