adding files to all platforms of a cocos2d-x project - cocos2d-x

This is a very basic question, but I have not been able to find the answer anywhere.
I just got Cocos 2Dx 3.3, made a new project and built the HelloWorld scene that was generated.
It generated projects for all platforms, but I am currently compiling and running the Mac project using XCode.
I can easily add new files using XCode, but of course it only adds it to my XCode Project. I would have expected a way to automatically modify all projects at once to add files or change compiler settings. I saw that there is a CMake file, probably used for command line compilation, but I cannot find a way to use that to regenerate the projects for all platforms.
Is it possible to automatically add a file to all platforms? Maybe it is possible to modify the template directory os Cocos and use the cocos new command line to recreate the project from scratch?
Or is it better to do all that manually?

Such an automation would imply parsing of a project file, finding list of relevant files and then changing all the dozen of project files. Which is hell of the work.
Even if it was implemented, how would this implementation decide which project file is a main one? (to get filelist from) And if your projects all have different lists of files? This would need merging etc. etc.
For now cocos new only copies files from one place to another. Frankly, Cocos2d-x have much more serious problems to solve, so I don't think this feature will ever be implemented.
However, you could customize project files/folders to your needs to make process of adding files more or less convenient and sometimes even automatic. Here are some clues:
It is easy to change Android and Linux Makefiles so they will pick up all the source files from a specified folder. Just use wildcards. Resource files are picked up by default.
For Visual Studio solutions (Win32, Win8, WinPhone) you could enable "Show all files" to see all files that either added or not. Unfortunately you can only see files down in the folder tree relative to project folder. To see Classes folder, make a symlink (link /j) of a Classes folder near .vcxproj file. You'd better don't copy/move project folder after it. And don't forget to add this linked folder to ignore list of your versioning system, or you will end up with duplicated files. Resource files are picked up by default for Windows projects.
I am not aware of any solution for XCode project, so you basically stuck with manual source file addition. Which is most annoying among all platforms. However it can pick up resource folders with all files.
Anyway, I would be glad if someone would proof me wrong and would write some kind of script to solve this problem (and also to change project name, company id, automatic versioning, etc.). I believe it could be done more or less reliably with, let's say Python and some regex magic. At least until project file formats will change.

Related

Dependencies in an AIDE Libgdx project

I've been using AIDE with Libgdx to make a game. The problem is that when you create a Libgdx project in AIDE the project structure is different, for instance there are no build.gradle files, only .classpath and .project files, which look different. I've managed so far by luckily finding instructions for adding the specific libraries I've needed using the .classpath files. Can anybody explain to me how one would go about translating how a dependancy should look in a build.gradle file to how it should look in a .classpath file. For instance I'm trying to add the Google Play Billing library to my project which is said should look like this in my build.gradle file:
dependencies {
def billing_version = "5.0.0"
implementation "com.android.billingclient:billing:$billing_version"
}
How should that look in a .classpath file, or how would I go about adding that to my .classpath file, or my project in general. So far I think I've had to always copy the libraries to my project manually, I'm thinking for some reason I can't access remote repositories, only local ones. Am I wrong about that, is there a way to access them without copying them to the project manually.

Converting .exe to VS solution file / project

I've recently had an issue at work where I have lost my solution files to my projects, but I still have the executables that have been produced by the projects / solution. It has been collection of 50+ webforms.
I have tried some de-compiler tools like ILSpy, JustComplie and .Net Reflector but everything gives source code in different format (not originally written by me) and also not designs of forms.
Is there any possibility to decompiling the executable back into a solution/project file?
I don't think that you can actually decompile the executables to a solution structure as seen on VS.
Although you can decompile the executable files (there are decompilers on the net that can perofrm the operation for you - only the decompilation),
you need to re-create the solution manually and add the source files you have retrieved from the previous operation.
Furthermore, if your files were obfuscated this makes it harder for them to be decompiled.
Even if this works, be prepared to do some debugging and check references/dependencies.
There is a Decompiler that works very well for .Net applications called DNSpy.
Here is link to the Project :
https://github.com/0xd4d/dnSpy
After you have decompiled you can start debugging and such from this application.
Hope this help.

How can I use multiple JetBrains IDEs on same project without annoying pop-ups when switching between them?

I have a project that uses both PHP and Python, and I would like to use JetBrains IDEs (in this case PhpStorm and PyCharm) to work with both languages.
However when I open the project using both IDEs concurrently I get a pop up whenever I switch from one to the other, as the newly focused IDE detects metadata that has been written to the project directory by the other IDE. I imagine this would be a problem between other combinations of JetBrains IDEs as well (hence the use of the generic jetbrains tag).
I have a work around (I will post in an answer for others to view), but it is somewhat awkward to set up, and I may well be working with other projects that use the same combination of languages.
Is there an easier solution?
My current workaround:
Create a new directory separate to the main project directory - using the language specific IDE for the second-most used language in the project, open the new directory as a project, and using the options in Settings > Project > Project Structure, add the main project directory as a separate content root.
Whenever needing to work on the parts of the project written in the secondary language, you can now open the new directory instead; this keeps metadata for both IDEs separate.
A workaround which allows for two IDE's to share the same directory without IDE settings conflicts.
JetBrains software allows you to store project settings as either a file based project (*.iml), or a directory based project (.idea).
To choose file or directory based projects, change the file storage type when opening a project.
Note: Directory based projects are preferred to file based projects, as they allow for versioning of shared settings. Support for file based projects is deprecated and may be removed.

Missing Json/Bootstrap files when creating a new project - Sencha Architect 3

Most of the time I create a project I miss a lot of necessary files such as the bootstrap and Json files.
I have all the dependencies (Ruby, JDK, Apache Ant) and Sencha CMD 5.1 (6 gives me alot of problems), I have also set my custom Cmd Base Path to cmd/5.1.3.61
It's a lot like a hit in miss, i'll create and save a lot of projects in different places hoping that 1 will provide me with all the necessary files needed to code properly (had to create over 10 projects for me to get a project folder with all the files in, and save them all in different directories).
Anyone know the cause of this or how to fix it so that Sencha Architect will give me all the necessary files with each project I create?
I've tried Saving As the project folder to a different location, using sencha cmd web start, saving the entire project and (it's not letting me build the project as it is greyed out)
Also tried reinstalling sencha architect, cmd, and all its dependencies; problem still occuring.
Fixed by turning on build tools (which should be enabled since I have all the dependencies) that then allowed me to build the project and get all the required files

How to manage directory structure of a project that uses third-party open source library?

I develope an open source application. Directory structure of my project is:
app
|-include
|-src
|-doc
|-build
|-lib
|-bin
I want to use another open source library. There are some choises:
Add third-party library source code to include and src directory.
Compile third-party library and add to include and lib directory.
Create a third_party directory and add complete source code of third-party library to it.
Create a third_party directory and add compiled of third-party library to it.
What is the best choise? Is there any better way to manage directory structure of a project that uses third-party open source library?
If you are ever planning to upgrade the third-party library, it will be much more convenient to keep it in a specific subdirectory. You don't have to have a specific "third-party" directory; you could name it after the library.
Think about what goes in version control.
If you are copying the third-party library into your repository, then you SHOULD NOT include compiled products (using source instead), as they are typically impossible to diff and platform-specific.
If the user is going to obtain the library separately and add it to your project's tree, then using a subdirectory will make it easier to unarchive and guarantee there won't be any name conflicts; source versus binary should be left up to the user.
At the other extreme, if you are using a reference your VCS manages (such as SVN externals or Git submodules), you will probably have to include the source in a subdirectory.
One concern you should bear in mind, depending on your situation, is whether you will someday have to account for those third party open source components and compliance with the licenses etc.. It can be easier to manage this kind of thing if you keep the third party files in their own directories. Having the unmodified source code and licenses handy and a link back to where you got the source code and could get it again would be useful as well. I've worked at companies where there were license compliance verification processes that were easier to get through if the third party sources were segregated in this fashion.
https://softwareengineering.stackexchange.com/questions/234511/what-is-the-best-practice-for-arranging-third-party-library-licenses-paperwork is relevant on this.