|
From: | Enrico Gallus |
Subject: | [cybop-developers] CodeBlock project file |
Date: | Sat, 11 Mar 2017 12:42:56 +0900 |
Hi Kevin,I appreciate that! Here information about the version which is preinstalled on mac os x: perl -v This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) Here the max possible output i could force: perl -Mdiagnostics=-traceonly makeproject.pl binmode() on closed filehandle $in at makeproject.pl line 17. read() on closed filehandle $in at /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/XML/LibXML.pm line 744. Uncaught exception from user code: read error at /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/XML/LibXML.pm line 884. at makeproject.pl line 18. XML::LibXML::parse_fh('XML::LibXML=HASH(0x7ff2b2335d40)', 'GLOB(0x7ff2b20034e8)', undef) called at /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/XML/LibXML.pm line 770 XML::LibXML::load_xml('XML::LibXML', 'IO', 'GLOB(0x7ff2b20034e8)') called at makeproject.pl line 18
The project structure changed a bit. Since a couple of days there exists another directory containing c-files which is situation directly under root. It is called ‘test' and contains the test files. I am not familiar enough with CodeBlocks to tell if it would be enough and a good solution to just add the test files to the project node as well in the perl script. The executable are created together with the cmake of the source. Hm, now thinking about that, maybe I should make it possible to target the cmake in test independent as well.. What would you recommend how should the tests c-files be added in the code block project file? Just as nodes as well? different project with separated target? I had a look at the script and i have a proposal for an improvement. To reduce the code-redundancy, .c and .h files could be load into files. Depending on the file ending the option-child-node is added or not. #Read out files my @files = File::Find::Rule->file() ->name( '*.c', '*.h' ) ->in( getcwd . '/src' ); #And write nodes for my $file (@files) { my @pieces = split(/src/, $file); my $correctPath = "../../src" . $pieces[1]; my $node = XML::LibXML::Element->new("Unit"); $node->setAttribute('filename', $correctPath); # add option node to c-files if ($correctPath =~ /.c$/) { my $optionNode = XML::LibXML::Element->new("Option"); $optionNode->setAttribute('compilerVar', 'CC'); $node->addChild($optionNode); } $projectNode->addChild($node); } #Save document After checking the script i realised that it is expected to execute the script from the root-directory and not from the directory where the script is situated. So the script works, looks like the above printed error means, ‘could not find the file’. But after the execution another problem showed up. The unbind node leaves a lot of empty lines and the xml-handling which adds the new nodes does not handle the newline correctly at least on my system. I attached the resulting CYBOI.cbp. Any proposals how to fix this?
Enrico |
CYBOI.cbp
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |