Skip to content

Commit 7989e0a

Browse files
author
Anton Smirnov
committed
* export function
* real composer autoloader * pest as a dependency
1 parent b2a010c commit 7989e0a

File tree

12 files changed

+417
-548
lines changed

12 files changed

+417
-548
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ build/.*
88

99
# vendor - required only for update process
1010
vendor
11-
12-
# composer.lock is not required because we commit our classes into git
13-
composer.lock

build/build-package.php

+21-7
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,36 @@ function run($path, $command)
1717
print `cd $path && $command`;
1818
}
1919

20+
//install composer
21+
print "Install/Update composer\n";
22+
if (is_file(__DIR__ .'/composer.phar')) {
23+
run(__DIR__, 'php composer.phar self-update');
24+
} else {
25+
run(__DIR__, 'curl -sS https://getcomposer.org/installer | php');
26+
}
27+
28+
print "Get libraries\n";
29+
run(MODULE_DIR, 'php build/composer.phar install');
30+
2031
print "Starting...\n";
2132
run (__DIR__, 'mkdir '. BUILD_DIR);
2233

2334
print "Copying files...\n";
2435

25-
run (__DIR__, 'cp -r '. MODULE_DIR .'/classes '. BUILD_DIR);
26-
run (__DIR__, 'cp -r '. MODULE_DIR .'/install '. BUILD_DIR);
27-
run (__DIR__, 'cp -r '. MODULE_DIR .'/options '. BUILD_DIR);
28-
run (__DIR__, 'cp -r '. MODULE_DIR .'/lang '. BUILD_DIR);
29-
run (__DIR__, 'cp '. MODULE_DIR .'/include.php '. BUILD_DIR);
30-
run (__DIR__, 'cp '. MODULE_DIR .'/options.php '. BUILD_DIR);
36+
run (__DIR__, 'cp -r '. MODULE_DIR .'/classes '. BUILD_DIR);
37+
run (__DIR__, 'cp -r '. MODULE_DIR .'/install '. BUILD_DIR);
38+
run (__DIR__, 'cp -r '. MODULE_DIR .'/options '. BUILD_DIR);
39+
run (__DIR__, 'cp -r '. MODULE_DIR .'/lang '. BUILD_DIR);
40+
run (__DIR__, 'cp -r '. MODULE_DIR .'/vendor '. BUILD_DIR);
41+
run (__DIR__, 'cp '. MODULE_DIR .'/composer.json '. BUILD_DIR);
42+
run (__DIR__, 'cp '. MODULE_DIR .'/composer.lock '. BUILD_DIR);
43+
run (__DIR__, 'cp '. MODULE_DIR .'/include.php '. BUILD_DIR);
44+
run (__DIR__, 'cp '. MODULE_DIR .'/options.php '. BUILD_DIR);
3145

3246
print "Creating archive...\n";
3347

3448
run (__DIR__, "rm -f mk.rees46-{$version}.zip mk.rees46-{$version}-utf8.zip");
3549
run (__DIR__, "zip -r mk.rees46-{$version}.zip mk.rees46");
36-
run (__DIR__.'/mk.rees46', "find -iname \\*.php -exec sh -c 'iconv -f cp1251 -t utf8 {} > {}.tmp && rm -f {} && mv {}.tmp {}' \\;");
50+
run (__DIR__.'/mk.rees46/lang', "find -iname \\*.php -exec sh -c 'iconv -f cp1251 -t utf8 {} > {}.tmp && rm -f {} && mv {}.tmp {}' \\;");
3751
run (__DIR__, "zip -r mk.rees46-{$version}-utf8.zip mk.rees46");
3852
run (__DIR__, 'rm -rf mk.rees46');

0 commit comments

Comments
 (0)