Coder Social home page Coder Social logo

Comments (5)

aborovsky avatar aborovsky commented on August 15, 2024 1

@Aarbel After saving "Legacy buiuld system settings", Xcode creates new file: platforms/ios/EverBee.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings with content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>BuildSystemType</key>
	<string>Original</string>
	<key>PreviewsEnabled</key>
	<false/>
</dict>
</plist>

checked with Xcode Version 11.4.1 (11E503a).

One could create a hook file hooks/after_platform_add/create-ios-workspaceSettings.js:

const fs = require('fs'),
  path = require("path");

const workspaceSettings = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
\t<key>BuildSystemType</key>
\t<string>Original</string>
</dict>
</plist>
`;

// Returns the project name
function getProjectName(protoPath) {
  const
    cordovaConfigPath = path.join(protoPath, 'config.xml'),
    content = fs.readFileSync(cordovaConfigPath, 'utf-8');
  return /<name>([\s\S]*)<\/name>/mi.exec(content)[1].trim();
}

module.exports = function (context) {
  const
    projectRoot = context.opts.projectRoot,
    projectName = getProjectName(projectRoot),
    workspaceSettingsPath = path.join(projectRoot, `/platforms/ios/${projectName}.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings`);
  fs.writeFileSync(workspaceSettingsPath, workspaceSettings);
}

and register it at config.xml to be called:

<platform name="ios">
    ...
    <hook src="hooks/after_platform_add/create-ios-workspaceSettings.js" type="after_platform_add" />
</platform>

from cordova-custom-config.

dpa99c avatar dpa99c commented on August 15, 2024

I don't know how Xcode internally stores that setting when you change it in the Xcode UI, but the fact it comes under "workspace settings" suggest to me that it's stored in the .xcworkspace and not the .xcodeproj/project.pbxproj file. This plugin currently can only operate on the project file, not the workspace.

You can confirm this by changing the setting in "Per-user workspace settings" and diffing the .xcworkspace for changes.

from cordova-custom-config.

Aarbel avatar Aarbel commented on August 15, 2024

Thank you @dpa99c, so no solutions for the moment ?

from cordova-custom-config.

dpa99c avatar dpa99c commented on August 15, 2024

Not by using this plugin

from cordova-custom-config.

Aarbel avatar Aarbel commented on August 15, 2024

Thanks a lot, do you know other plugins that could help in this ?

Cheers

from cordova-custom-config.

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.