- Timestamp:
- 10/04/08 16:27:05 (3 months ago)
- Location:
- trunk/extra/moddev
- Files:
-
- 1 added
- 3 modified
-
configure.ac (modified) (1 diff)
-
src/Makefile.am (modified) (1 diff)
-
src/ebox-moddev-create (modified) (10 diffs)
-
src/ebox-moddev-model.in (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/extra/moddev/configure.ac
r11471 r11472 16 16 src/Makefile 17 17 src/ebox-moddev-create 18 src/ebox-moddev-model 18 19 stubs/Makefile 19 20 ]) -
trunk/extra/moddev/src/Makefile.am
r11471 r11472 1 1 ## Process this file with automake to produce Makefile.in 2 bin_SCRIPTS = ebox-moddev-create 2 bin_SCRIPTS = ebox-moddev-create ebox-moddev-model 3 3 4 4 DISTCLEANFILES = -
trunk/extra/moddev/src/ebox-moddev-create
r11381 r11472 14 14 { 15 15 MODULE_VERSION => '0.1', 16 STUBS_PATH => '/ home/magnetic/dev/ebox/sources/trunk/extra/moddev/stubs',16 STUBS_PATH => '/usr/share/emoddev/stubs', 17 17 }; 18 18 … … 23 23 print STDERR "\t--version\n"; 24 24 print STDERR "\t--destdir\n"; 25 print STDERR "\t--model form | table. Default: form\n"; 25 26 exit 1; 26 27 } … … 34 35 version => MODULE_VERSION, 35 36 destdir => undef, 36 37 model => 'form', 37 38 ); 38 39 my $help; … … 44 45 'version=s' => \$options{version}, 45 46 'destdir=s' => \$options{destdir}, 47 'model=s' => \$options{model}, 46 48 'help' => \$help, 47 49 'info' => \$info, … … 136 138 name => $options->{moduleName}, 137 139 printableName => $options->{printableModuleName}, 138 domain => 'ebox-' . $options->{moduleName} 140 domain => 'ebox-' . $options->{moduleName}, 141 modelDomain => $options->{mainClass}, 139 142 )); 140 143 write_file($dir . "/$mainClass", ${$output}); … … 158 161 write_file($dir . '/Makefile.am', ${$output}); 159 162 160 $comp = $interp->make_component( 161 comp_file => STUBS_PATH . '/src/Model/TableModel.pm.mas', 163 # TableModel or FormModel ? 164 my $template; 165 if ($options->{model} eq 'table') { 166 $template = '/src/Model/TableModel.pm.mas'; 167 } else { 168 $template = '/src/Model/FormModel.pm.mas'; 169 } 170 $comp = $interp->make_component( 171 comp_file => STUBS_PATH . $template, 162 172 ); 163 173 ${$output} = ''; … … 270 280 } 271 281 282 sub _stubs 283 { 284 my ($interp, $output, $options) = @_; 285 286 my $dir = $options->{destdir} . '/stubs'; 287 my $module = $options->{moduleName}; 288 289 mkdir ("$dir") or die "Can't create $dir"; 290 291 my $comp = $interp->make_component( 292 comp_file => STUBS_PATH . '/stubs/Makefile.am.mas', 293 ); 294 ${$output} = ''; 295 $interp->exec($comp, ( module=> $module)); 296 write_file($dir . '/Makefile.am', ${$output}); 297 298 my $confSrc = STUBS_PATH . '/stubs/'; 299 my $confDst = $options->{destdir} . '/tools'; 300 301 copy(STUBS_PATH . '/stubs/service.conf.mas', "$dir/service.conf.mas"); 302 303 304 } 272 305 sub _m4 273 306 { … … 288 321 289 322 `cp -a $toolsSrc $toolsDst`; 323 chmod(0755, "$toolsDst/po-am.generator"); 290 324 } 291 325 … … 301 335 302 336 } 337 338 sub _runAutogen 339 { 340 my ($options) = @_; 341 342 my $dir = $options->{destdir}; 343 344 my $cwd = getcwd(); 345 chdir($dir); 346 347 system("./autogen.sh"); 348 349 chdir($cwd); 350 } 351 303 352 sub _createModule 304 353 { … … 325 374 _autogen($interp, \$output, $options); 326 375 _tools($interp, \$output, $options); 376 _stubs($interp, \$output, $options); 377 _runAutogen($options); 327 378 328 379 }
