Skip to content

Commit 3e0c261

Browse files
committed
Retrieve the version number dynamically in the build script
1 parent 1236f34 commit 3e0c261

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

system/build.xml renamed to build.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0"?>
2-
<project name="Contao Open Source CMS" default="build" basedir="../">
3-
<property name="version" value="3.3.RC1" />
2+
<project name="Contao Open Source CMS" default="build" basedir=".">
3+
<exec executable="system/bin/version" outputProperty="version" />
44

55
<target name="build" depends="clone, update, purge, archive, cleanup">
66
<echo message="Contao ${version} build complete" />
77
</target>
88

99
<target name="clone">
10-
<exec executable="git" dir=".">
10+
<exec executable="git">
1111
<arg value="clone" />
1212
<arg value="." />
1313
<arg value="contao-${version}" />
1414
</exec>
15-
<exec executable="git" dir="contao-${version}">
15+
<exec executable="git" dir="contao-${version}" failonerror="true">
1616
<arg value="checkout" />
1717
<arg value="${version}" />
1818
<arg value="--quiet" />
@@ -24,7 +24,7 @@
2424
</target>
2525

2626
<target name="update">
27-
<exec executable="composer" dir="contao-${version}">
27+
<exec executable="composer" dir="contao-${version}" failonerror="true">
2828
<arg value="install" />
2929
<arg value="--prefer-dist" />
3030
</exec>
@@ -52,7 +52,7 @@
5252
</target>
5353

5454
<target name="phpdoc">
55-
<exec executable="phpdoc.php" dir=".">
55+
<exec executable="phpdoc.php">
5656
<arg value="--title=Contao Open Source CMS" />
5757
<arg value="--target=../api" />
5858
<arg value="--directory=system/modules/core/library,system/modules/*/models" />

system/bin/version

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/**
5+
* Contao Open Source CMS
6+
*
7+
* Copyright (c) 2005-2014 Leo Feyer
8+
*
9+
* @package Core
10+
* @link https://contao.org
11+
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
12+
*/
13+
14+
// Load the constants.php file
15+
include dirname(__DIR__) . '/config/constants.php';
16+
17+
// Output the version and build number
18+
echo VERSION . '.' . BUILD;

0 commit comments

Comments
 (0)