Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Now filename of build.properties may be specified #563

Closed
wants to merge 2 commits into from

3 participants

@serjoscha87

Added the option to tell the generator commands a custom name of the project's "build.properties". This brings the advantage of being able to have build.properties for each project like "project1.build.properties", "project2.build.properties" and so on. You can now build the project according to the custom build.props via
"propel anyPropelCommand --build-properties=project1.build.properties"
That makes generation of stuff much more comfortable when using one and the same propel installation for different projects which all reference the same propel dir and the generated classes within it.

serjoscha87 added some commits
@serjoscha87 serjoscha87 Now filename of build.properties may be specified
Added the option to tell the generator commands a custom name of the project's "build.properties". This brings the advantage of being able to have build.properties for each project like "project1.build.properties", "project2.build.properties" and so on. You can now build the project according to the custom build.props via 
"propel anyPropelCommand --build-properties=project1.build.properties"
That makes generation of stuff much more comfortable when using one and the same propel installation for different projects which all reference the same propel dir and the generated classes within it.
031f98d
@serjoscha87 serjoscha87 Added failure checking to changes of last commmit
Functionality still the same. Automated testing failed. Now it shall be working
1742684
@robin850

Personally I think that it's not worth shipping with this patch since the configuration system is under refactoring (c.f. #527). Thanks for your contribution so far! :-)

@willdurand willdurand closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 4, 2014
  1. @serjoscha87

    Now filename of build.properties may be specified

    serjoscha87 authored
    Added the option to tell the generator commands a custom name of the project's "build.properties". This brings the advantage of being able to have build.properties for each project like "project1.build.properties", "project2.build.properties" and so on. You can now build the project according to the custom build.props via 
    "propel anyPropelCommand --build-properties=project1.build.properties"
    That makes generation of stuff much more comfortable when using one and the same propel installation for different projects which all reference the same propel dir and the generated classes within it.
  2. @serjoscha87

    Added failure checking to changes of last commmit

    serjoscha87 authored
    Functionality still the same. Automated testing failed. Now it shall be working
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/Propel/Generator/Command/AbstractCommand.php
View
9 src/Propel/Generator/Command/AbstractCommand.php
@@ -26,6 +26,7 @@
{
const DEFAULT_INPUT_DIRECTORY = '.';
const DEFAULT_PLATFORM = 'MysqlPlatform';
+ const DEFAULT_BUILD_PROPERTIES_FILE_NAME = 'build.properties';
protected $filesystem;
@@ -38,6 +39,7 @@ protected function configure()
->addOption('platform', null, InputOption::VALUE_REQUIRED, 'The platform', self::DEFAULT_PLATFORM)
->addOption('input-dir', null, InputOption::VALUE_REQUIRED, 'The input directory', self::DEFAULT_INPUT_DIRECTORY)
->addOption('recursive', null, InputOption::VALUE_NONE, 'Search for schema.xml inside the input directory')
+ ->addOption('build-properties', null, InputOption::VALUE_REQUIRED, 'Declare a file containing build.properties to be used', self::DEFAULT_BUILD_PROPERTIES_FILE_NAME)
;
}
@@ -52,11 +54,16 @@ protected function configure()
*/
protected function getGeneratorConfig(array $properties, InputInterface $input = null)
{
+ if($input && $input->hasOption('build-properties'))
+ $buildfile = $input->getOption('build-properties');
+ else
+ $buildfile = self::DEFAULT_BUILD_PROPERTIES_FILE_NAME;
+
$options = $properties;
if ($input && $input->hasOption('input-dir')) {
$options = array_merge(
$properties,
- $this->getBuildProperties($input->getOption('input-dir') . '/build.properties')
+ $this->getBuildProperties($input->getOption('input-dir') . '/' . $buildfile)
);
}
Something went wrong with that request. Please try again.