-
Notifications
You must be signed in to change notification settings - Fork 4
Source folder layout re-arrangement required #6
Comments
Current Source Layout:
Goal is to split 'core' from games, and generate static libs from each subgroup. So, future layout I'm looking forward (conceptually, at least...) to have:
Conceptually, each folder under
Points of debate, contention, and doubts:
|
Can't readily review that - even more so as I have similar questions on py tests layout - I keep asking: http://stackoverflow.com/questions/34694437/python-test-package-layout Will have a closer look - but I guess that's a trial and error approach problem - so see what's in the code, how it splits better/compiles faster etc I have extensive refactoring experience though, so I could have a look soonish - just this week will be pressed Nice work on labels btw ! This repo is becoming my little garden of order and beauty in a chaotic wrye Bash world :) |
Good point, yes. And no worries, take your time, no hurry. I'm not going to do anything big before analyzing/thinking on the consequences.
((BTW, I really liked the idea I saw on one of the answers there of putting tests inside the same code folder, but inside a tests/ directory. So, maybe I'll do that for the C++ tests. It simplifies the folder structure quite a bit, by reducing it by one level, basically.)) I think I'll take the plunge and do the renaming locally, I'll try the different things and see which one produces the most cleaner layout. I'll do that after getting at least one released binary in the old format (CBash.dll) so we can at least test it and see if everything is working as it should, before starting doing too much changes at once.
Thanks! I shamelessly copied them from your main repo :)
Thanks! Haven't seen that one... need to dive more into the wikis, it seems. And I totally misunderstood the use of the TODO. I tagged all issues that have check-lists with TODO, but the actual use-case is very specific. And going a bit off topic here, so pardon me: I thought about having three-layered tags at most, like one label tags the "module" (for now: Bash API & docs), the next is the type (bug, enh, etc.) and the last is a flag/modifier, like review/goal/etc. No more than three static label components per issue, there can be more when they tag a transitory state (like question, and also, I thought about adding a WIP tag to mark what I'm doing ATM, for example) but I think that's better handled with milestones and/or projects, right? |
Yep ! Re: three levels - good idea letr me ponder - the labels is still wip on main repo but mostly settled - I have thought long and hard, trial and error etc |
Replace old deprecated C headers with the C++11 compliant one.
(This will make a big mess, that's why I'm doing it before anything else.) All tis commit does is to move game specific sources to a sub-folder `src/game` instead of it being all dumped on the `src` folder.
Moved source files that aren't dependend on game specifics to folder `src/common` and made a static library out of them.
Moved sources that are specific to the C api defined for CBash.dll to a sub-folder called `src/capi`.
Moved source files that depend on `game` but aren't part of the C API to folder `src/main` and made a static library out of them.
Added CMakeLists.txt build rules to `src/common`, `src/capi` and `src/main`. Added build rules for creating static library targets for FalloutNV, Oblivion and Skyrim to folder `src/game/<game>` . Added a fake intermediate library `src/game` that serves as a quick referral for adding dependences to the three implemented games indirectly. For this I required to add a dummy empty `game.cpp` file as CMake doesn't accept libraries with no source code. Also adjusted pre-existing CMakeLists.txt for the new folder structure and static libraries usage.
Adjusted `#include`s not to depend on relative folder structure and instead be based on module of origin, as this: `#include "<module>/<header>.h"` This is allowed by the fact that the `src` directory is added to the INCLUDES search path.
Split the content of the file `src/GRUPRecord.h` into three pieces and added each corresponding part to the existing `src/game/<game>/GRUPRecord.h` that was already in existance. After that the original file was empty, so it was deleted. Also the `src/game/<game>/GRUPRecord.h` files now required explicit inclusion of `Allocator.h` since the content that was moved to them depended on the class template declared there.
Moved the game-specific game-specific Record out of the file `src/common/GenericRecord.h` and into new files named after each class' name, on the `src/game/<game>` folder.
Skyrim and FalloutNV records now depend on the new specific game record header that was accesible before by just including `GenericRecord.h`. Those are TES5Record.h for Skyrim's records and FNVRecord.h for FalloutNV's ones.
Moved Skyrim's specific String functionality that was located in the generic master record (TES4Record) to the Skyrim ModFile implementation, as it's only used from records belonging to Skyrim's implementation. For that I had to break a cyclic dependence on TES5Record <-> TES5File by introducing a new zero sized abstract class TES5ModFile that only publishes the method required to access the StringsLookup implementation. As a result of this I can remove the inclusion of SkyrimCommon.h from `TES4Record.cpp`
Modified implementation of code that required access to the LookupStrings to use the new location, by accessing it from the parent ModFile. NOTE: I left some code commented for now since I don't want to lose it, but I didn't see it used from anywhere, so I don't know yet the proper place where to move them. I supposed the logical place should also be the game's ModFile class.
Added CMakeLists.txt build rules to `src/common`, `src/capi` and `src/main`. Added build rules for creating static library targets for FalloutNV, Oblivion and Skyrim to folder `src/game/<game>` . Added a fake intermediate library `src/game` that serves as a quick referral for adding dependences to the three implemented games indirectly. For this I required to add a dummy empty `game.cpp` file as CMake doesn't accept libraries with no source code. Also adjusted pre-existing CMakeLists.txt for the new folder structure and static libraries usage.
Adjusted `#include`s not to depend on relative folder structure and instead be based on module of origin, as this: `#include "<module>/<header>.h"` This is allowed by the fact that the `src` directory is added to the INCLUDES search path.
Split the content of the file `src/GRUPRecord.h` into three pieces and added each corresponding part to the existing `src/game/<game>/GRUPRecord.h` that was already in existance. After that the original file was empty, so it was deleted. Also the `src/game/<game>/GRUPRecord.h` files now required explicit inclusion of `Allocator.h` since the content that was moved to them depended on the class template declared there.
Moved the game-specific game-specific Record out of the file `src/common/GenericRecord.h` and into new files named after each class' name, on the `src/game/<game>` folder.
Skyrim and FalloutNV records now depend on the new specific game record header that was accesible before by just including `GenericRecord.h`. Those are TES5Record.h for Skyrim's records and FNVRecord.h for FalloutNV's ones.
Moved Skyrim's specific String functionality that was located in the generic master record (TES4Record) to the Skyrim ModFile implementation, as it's only used from records belonging to Skyrim's implementation. For that I had to break a cyclic dependence on TES5Record <-> TES5File by introducing a new zero sized abstract class TES5ModFile that only publishes the method required to access the StringsLookup implementation. As a result of this I can remove the inclusion of SkyrimCommon.h from `TES4Record.cpp`
Modified implementation of code that required access to the LookupStrings to use the new location, by accessing it from the parent ModFile. NOTE: I left some code commented for now since I don't want to lose it, but I didn't see it used from anywhere, so I don't know yet the proper place where to move them. I supposed the logical place should also be the game's ModFile class.
Moved source files that generate the python binding to folder `src/papi` (i.e. "Python API").
Replace old deprecated C headers with the C++11 compliant one.
(This will make a big mess, that's why I'm doing it before anything else.) All tis commit does is to move game specific sources to a sub-folder `src/game` instead of it being all dumped on the `src` folder.
Moved source files that aren't dependend on game specifics to folder `src/common` and made a static library out of them.
Moved sources that are specific to the C api defined for CBash.dll to a sub-folder called `src/capi`.
Moved source files that depend on `game` but aren't part of the C API to folder `src/main` and made a static library out of them.
Added CMakeLists.txt build rules to `src/common`, `src/capi` and `src/main`. Added build rules for creating static library targets for FalloutNV, Oblivion and Skyrim to folder `src/game/<game>` . Added a fake intermediate library `src/game` that serves as a quick referral for adding dependences to the three implemented games indirectly. For this I required to add a dummy empty `game.cpp` file as CMake doesn't accept libraries with no source code. Also adjusted pre-existing CMakeLists.txt for the new folder structure and static libraries usage.
Adjusted `#include`s not to depend on relative folder structure and instead be based on module of origin, as this: `#include "<module>/<header>.h"` This is allowed by the fact that the `src` directory is added to the INCLUDES search path.
Split the content of the file `src/GRUPRecord.h` into three pieces and added each corresponding part to the existing `src/game/<game>/GRUPRecord.h` that was already in existance. After that the original file was empty, so it was deleted. Also the `src/game/<game>/GRUPRecord.h` files now required explicit inclusion of `Allocator.h` since the content that was moved to them depended on the class template declared there.
Moved the game-specific game-specific Record out of the file `src/common/GenericRecord.h` and into new files named after each class' name, on the `src/game/<game>` folder.
Skyrim and FalloutNV records now depend on the new specific game record header that was accesible before by just including `GenericRecord.h`. Those are TES5Record.h for Skyrim's records and FNVRecord.h for FalloutNV's ones.
Moved Skyrim's specific String functionality that was located in the generic master record (TES4Record) to the Skyrim ModFile implementation, as it's only used from records belonging to Skyrim's implementation. For that I had to break a cyclic dependence on TES5Record <-> TES5File by introducing a new zero sized abstract class TES5ModFile that only publishes the method required to access the StringsLookup implementation. As a result of this I can remove the inclusion of SkyrimCommon.h from `TES4Record.cpp`
Modified implementation of code that required access to the LookupStrings to use the new location, by accessing it from the parent ModFile. NOTE: I left some code commented for now since I don't want to lose it, but I didn't see it used from anywhere, so I don't know yet the proper place where to move them. I supposed the logical place should also be the game's ModFile class.
Moved source files that generate the python binding to folder `src/papi` (i.e. "Python API").
I'd want to make space for introducing separate projects for test cases, and also, break up main CBash sources into static lib packages, with the least possible dependencies with one another.
Also, in the future, I'd want to create a new project for the boost.python generated binding, to replace the current cint API.
My initial idea would be to create a static library for each game which will contain all the record definitions (initially... at least.)
End goal is to speed up a bit the full recompilation of the main CBash project (since the bulk of time recompiling is lost on the individual record files), and also, will help in modularize the source code, as we can use those projects in isolation of one another, and detect unwanted dependencies.
The text was updated successfully, but these errors were encountered: