Coder Social home page Coder Social logo

Can't add package to XCode project about axmol HOT 8 CLOSED

udirub avatar udirub commented on September 16, 2024
Can't add package to XCode project

from axmol.

Comments (8)

udirub avatar udirub commented on September 16, 2024

Just tested on axmol 2.1.4 and the problem persists.

from axmol.

smilediver avatar smilediver commented on September 16, 2024

I don't know how packages work in Xcode, but if they integrate into your Xcode project, then they will be gone the next time Xcode project is regenerated (e.g. after adding new source files, etc). This is not how Axmol workflow works. You should treat generated Xcode project as "readonly". You'll probably want to look into something that can be integrated from command line like CocoaPods.

from axmol.

udirub avatar udirub commented on September 16, 2024

Oh...
So it's not like the XCode project Cocos2d-x made where I edited it directly?

from axmol.

rh101 avatar rh101 commented on September 16, 2024

So it's not like the XCode project Cocos2d-x made where I edited it directly?

Cocos2d-x v3.17+ and V4 both use cmake, which generate the Xcode project, and Axmol also uses the cmake build system, so nothing has changed in that regard. If you're referring to v2 of Cocos2d-x. then yes, a lot has changed. Anything you want to add to the Xcode project would need to be done via cmake or CocoaPods.

The ASN1Swift project you linked has an example of how to add it via CocoaPods.

from axmol.

smilediver avatar smilediver commented on September 16, 2024

To expand on this: yes, you should not edit Xcode project directly, and do not add it to your source control. Basically, you want to have an easy runnable two steps setup:

  1. Generate Xcode project - axmol build -p ios -a arm64 -c or similar.
  2. Modify Xcode project - your custom automated step that makes the changes to the Xcode project. This could be done using CocoaPods or something else.

I was a bit wrong to say "treat generated Xcode project as "readonly"". You can certainly modify it, but it must be automated, cause you will lose changes the second that you modify CMake files, or CMake runs ZERO_CHECK task for some reason. It also hardcodes paths, so you would not be able to build that project on another machine, or if you moved your project to another folder.

Also, be aware that if you're running build in Xcode after editing CMake files (or if CMake reruns ZERO_CHECK task for some other reason), then Xcode project will be regenerated during the build, and Xcode will notice it and it will cancel the build to reload it. Then you need to execute your step 2, since your Xcode project changes will be gone, and then restart the build.

from axmol.

udirub avatar udirub commented on September 16, 2024

So it's not like the XCode project Cocos2d-x made where I edited it directly?

Cocos2d-x v3.17+ and V4 both use cmake, which generate the Xcode project, and Axmol also uses the cmake build system, so nothing has changed in that regard. If you're referring to v2 of Cocos2d-x. then yes, a lot has changed. Anything you want to add to the Xcode project would need to be done via cmake or CocoaPods.

The ASN1Swift project you linked has an example of how to add it via CocoaPods.

I am working with cocos 3.10 which created an XCode project when I created the project and I've been working on it directly all the time and it worked fine. I thought I could do the same with axmol.

from axmol.

udirub avatar udirub commented on September 16, 2024

To expand on this: yes, you should not edit Xcode project directly, and do not add it to your source control. Basically, you want to have an easy runnable two steps setup:

1. Generate Xcode project - `axmol build -p ios -a arm64 -c` or similar.

2. Modify Xcode project - your custom _automated_ step that makes the changes to the Xcode project. This could be done using CocoaPods or something else.

I was a bit wrong to say "treat generated Xcode project as "readonly"". You can certainly modify it, but it must be automated, cause you will lose changes the second that you modify CMake files, or CMake runs ZERO_CHECK task for some reason. It also hardcodes paths, so you would not be able to build that project on another machine, or if you moved your project to another folder.

Also, be aware that if you're running build in Xcode after editing CMake files (or if CMake reruns ZERO_CHECK task for some other reason), then Xcode project will be regenerated during the build, and Xcode will notice it and it will cancel the build to reload it. Then you need to execute your step 2, since your Xcode project changes will be gone, and then restart the build.

I have never worked directly with CMake. I created my project with cocos 3.10 and it created an XCode project and I've done all my work through XCode and it worked great.
Is there a way to work with axmol the same way?

from axmol.

rh101 avatar rh101 commented on September 16, 2024

I am working with cocos 3.10 which created an XCode project when I created the project and I've been working on it directly all the time and it worked fine. I thought I could do the same with axmol.

When the cmake build system was added to Cocos2d-x v3, the intention was never to use it in the way you are describing, and you would not be doing yourself any favors by attempting to continue working in this way. The fact that it worked without issues is purely by chance.

Embracing the cmake build system should make things simpler and less time consuming, especially if you wish to support multiple platforms for your application.

@halx99 I feel that this should be moved to the discussion section, since it's not an issue with Axmol.

from axmol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.