Git Product home page Git Product logo

Comments (3)

danoli3 avatar danoli3 commented on August 12, 2024

Proposed solution:

#ifdef __APPLE__
#include <cstdlib>  // std::system
#endif
...
	if (fs::exists(projectDataDir)) {
		// originally only on IOS
		//this is needed for 0.9.3 / 0.9.4 projects which have iOS media assets in bin/data/
		// TODO: Test on IOS
        fs::path templateBinDir { templatePath / "bin" };
		fs::path templateDataDir { templatePath / "bin" / "data" };
		if (fs::exists(templateDataDir) && fs::is_directory(templateDataDir)) {
			baseProject::recursiveCopyContents(templateDataDir, projectDataDir);
		}
        if (fs::exists(templateBinDir) && fs::is_directory(templateBinDir)) {
#ifdef __APPLE__
            try {
                //  extended attributes on macOS
                std::string command = "xattr -w com.apple.xcode.CreatedByBuildSystem true " + templateBinDir.string();
                if (std::system(command.c_str()) != 0) {
                    std::cerr << "Failed to set extended attributes on " <<  templateBinDir.string() << std::endl;
                } else {
                    std::cout << "xattr set correctly for bin" << endl;
                }
            } catch (const std::exception& e) {
                std::cout << e.what() << std::endl;
            }
#endif
        }
	}
	```

from projectgenerator.

danoli3 avatar danoli3 commented on August 12, 2024

std::string command = "xattr -w com.apple.xcode.CreatedByBuildSystem true " + templateBinDir.string();

from projectgenerator.

danoli3 avatar danoli3 commented on August 12, 2024

One could also add to the Xcode build phases like: (in bash)

mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/bin"
xattr -w com.apple.xcode.CreatedByBuildSystem true "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/bin"

from projectgenerator.

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.