Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

BOUNTY: bakefile - Output: C::B Project Files

<< < (3/7) > >>

mandrav:

--- Quote from: ABX ---I can prepare Code::Blocks format as long as you could give me specification of your project file format.
--- End quote ---

This sounds nice :)
It's simple XML. What info exactly do you want?


--- Code: ---<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="Some App"/>
<Option compiler="0"/> <!-- 0-based compiler index: compiler 0 is always gcc -->
<Build>
<Target title="Debug_Linux"> <!-- build target; roughly analogous to MSVC configurations -->
<Option output="glfwapp"/> <!-- the binary output result -->
<Option working_dir="."/>
<Option object_output=".objs\debug"/>
<Option deps_output=".deps"/>
<Option type="1"/> <--! 0=GUI, 1=console, 2=staticlib, 3=dll, 4="commands only" -->
<Option compiler="0"/> <!-- compiler index -->
<Option includeInTargetAll="0"/> <!-- if all targets have this zero, no "all" target is created; a specific target must be selected for building (like MSVC's configurations) -->
<Compiler> <!-- compiler options for target -->
<Add option="-g"/>
<Add option="-DDEBUG_MEMORY"/>
<Add option="-DDEBUG"/>
<Add directory="test\subdir"/>
</Compiler>
<Linker> <!-- linker options for target -->
<Add library="GL"/>
<Add library="Xxf86vm"/>
<Add library="pthread"/>
<Add directory="\usr\X11R6\lib"/>
</Linker>
<Environment> <!-- environment variables for target -->
<Variable name="GM" value="/home/mandrav/Devel/GameMonkey/gm"/>
</Environment>
</Target>
<!-- more targets follow (as needed) -->
<Target>
</Target>
</Build>
<Compiler> <!-- compiler options for project (added to each target's compiler options) -->
<Add option="-Wall"/>
<Add directory="core\gm"/>
<Add directory="core\gm\platform\win32gcc"/>
<Add directory="core\gm\binds"/>
</Compiler>
<Linker> <!-- linker options for project (added to each target's linker options) -->
<Add library="glfw"/>
<Add directory="core\gm"/>
</Linker>
<!-- project files follow -->
<Unit filename="core\bst.cpp">
<Option compilerVar="CPP"/>
<Option compile="1"/>
<Option link="1"/>
<!-- the following repeats for all targets this file is part of... -->
<Option target="Debug_Linux"/>
<Option target="Release_Linux"/>
<Option target="Release_Win32"/>
<Option target="Debug_Win32"/>
</Unit>
<!-- more units follow (as needed) -->
<Unit>
</Unit>
</Project>
</CodeBlocks_project_file>

--- End code ---

ABX:

--- Quote from: mandrav on September 21, 2005, 03:16:17 pm ---
--- Quote from: ABX ---I can prepare Code::Blocks format as long as you could give me specification of your project file format.
--- End quote ---

This sounds nice :)
It's simple XML. What info exactly do you want?
--- End quote ---

Thanks for the sample code, quick questions:

1. Is this case sensitive format? In tags? In tag parameters? In values?
2. Is this format finished? Once it will be in bakefiles you will be limited to supported syntax. Are you sure it will never ever extend it? I ask because I don't see version number in syntax.
3. Can <Project> occur more than once?
4. Compilers can be from indexed list. How can I provide settings for all of them at once? I see single block for compiler 0 only.
5. Different compilers have different linkers. How to supply settings to other linkers?
6. How <Option type="5"/> (commands only) codes commands?
7. Are names in <Option target="Debug_Linux"/> preset and can be only selected from predefined list or not?
8. Is there concept of workspace which collects some project files as in VC IDE?

I will probably have more questions in the future so is there direct url to the online source responsible for parsing that structure?

ABX

rickg22:
1. Yes, it's case sensitive. All XML is.
2. No, we plan to extend it in future versions.
3. No, a project file only has one project.
4. This is an issue we'll tackle in future versions, current format is kinda... ugly.
5. Same as above.
6. and  7. I don't know :P Yiannis knows that.
8. Yes, there are workspace files.

ABX:

--- Quote from: rickg22 on September 21, 2005, 05:42:57 pm ---1. Yes, it's case sensitive. All XML is.
--- End quote ---

Well, the only source of my knowledge about it is this thread and as corrections mentioned in this thread pointed out it wasn't "real" XML when this thread started, I wanted to have it confirmed. :)


--- Quote from: rickg22 on September 21, 2005, 05:42:57 pm ---2. No, we plan to extend it in future versions.
3. No, a project file only has one project.
4. This is an issue we'll tackle in future versions, current format is kinda... ugly.
5. Same as above.
--- End quote ---

Then I would suggest to introduce concept of version number before I will code things for bakefile. That would allow easier cooperation between us (as well as bug reporting for C::B users probably).


--- Quote from: rickg22 on September 21, 2005, 05:42:57 pm ---8. Yes, there are workspace files.
--- End quote ---

... and its syntax is?

ABX

mandrav:

--- Quote from: ABX on September 21, 2005, 05:08:16 pm ---
--- Quote from: mandrav on September 21, 2005, 03:16:17 pm ---
--- Quote from: ABX ---I can prepare Code::Blocks format as long as you could give me specification of your project file format.
--- End quote ---

This sounds nice :)
It's simple XML. What info exactly do you want?
--- End quote ---

Thanks for the sample code, quick questions:

1. Is this case sensitive format? In tags? In tag parameters? In values?
2. Is this format finished? Once it will be in bakefiles you will be limited to supported syntax. Are you sure it will never ever extend it? I ask because I don't see version number in syntax.
3. Can <Project> occur more than once?
4. Compilers can be from indexed list. How can I provide settings for all of them at once? I see single block for compiler 0 only.
5. Different compilers have different linkers. How to supply settings to other linkers?
6. How <Option type="5"/> (commands only) codes commands?
7. Are names in <Option target="Debug_Linux"/> preset and can be only selected from predefined list or not?
8. Is there concept of workspace which collects some project files as in VC IDE?

I will probably have more questions in the future so is there direct url to the online source responsible for parsing that structure?

ABX

--- End quote ---

1) Yes
2) I guess you probably missed this tag? (<FileVersion major="1" minor="1"/>)
3) No, a project file contains a single project
4 and 5) Currently, you 'd have to duplicate targets to give different options for different compilers. After v1.0 is released this will change though, since a major overhaul is planned for the compiler framework
6) See example below
7) Target names are free text, whatever describes them better. In MSVC terms, an example target could be named "Win32 | Release"
8 ) Yes and it's a separate file (*.workspace). You asked for projects ;)

Example for "commands-only" target:

--- Code: ---                        <Target title="update">
                                <Option type="4"/>
                                <Option includeInTargetAll="0"/>
                                <ExtraCommands>
                                        <Mode before="always"/> <!-- always run pre-build steps -->
                                        <Add before="update1.bat"/> <!-- pre-build step -->
                                        <Add before="update2.bat"/> <!-- pre-build step -->
                                        <Add after="cmd /c copy my.lib ../../lib/m.lib"/> <!-- post-build step -->
                                </ExtraCommands>
                        </Target>

--- End code ---

If you want to have a more in-depth look at the project's file format, look at the source.

Workspace file:


--- Code: ---<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_workspace_file>
<CodeBlocks_workspace_file>
        <Workspace title="Default workspace">
                <Project filename="../projects/someproject.cbp"/>
                <Project filename="../projects/otherproject.cbp" active="1"/> <!-- this project is active when the workspace loads -->
        </Workspace>
</CodeBlocks_workspace_file>

--- End code ---

Note that project dependencies are not implemented yet.
If you want to have a more in-depth look at the workspace's file format, look at the source.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version