Skip to content

About

The GNUstep Xcode Library is a library for building xcode projects. It can be used to parse and provide information regarding an xcode project or used to build an xcode project directly.

Resources

Stars

54 stars

Watchers

5 watching

Forks

Repository files navigation

libs-xcode

1 README

The GNUstep Xcode Library is a library for building xcode projects. It can be used to parse and provide information regarding an xcode project or used to build an xcode project directly.

1.1 License

The GNUstep libraries and library resources are covered under the GNU Lesser General Public License. This means you can use these libraries in any program (even non-free programs). If you distribute the libraries along with your program, you must make the improvements you have made to the libraries freely available. You should read the COPYING.LIB file for more information.

For Applications we are using the LICENSE file (GPLv3) and we use COPYING.LIB which is (LGPLv2.1) for the libraries/framworks.

1.2 Ycode

Ycode is the GNUstep graphical IDE included in this repository. It uses libs-xcode to work with Xcode projects and also opens ProjectCenter projects and folders containing a GNUmakefile or Makefile.

  • Create applications, tools, bundles, frameworks, and libraries from templates; import and export ProjectCenter projects.
  • Browse groups and files with directories first, image previews, and the icons of compiled applications. Double-click a file to open its default application, including Gorm for associated interface files.
  • Edit source with syntax highlighting, configurable indentation (two spaces by default), project search, and a find/replace panel. Edit > Convert Tabs to Spaces normalizes the current file as one undoable edit. Modified files prompt to save when closing tabs, closing projects, or quitting.
  • Build, run, clean, and run tests with target, configuration, and architecture selection. Console, Issues, and Test views show output and results.
  • Debug with GDB using source breakpoints, stepping controls, and a command transcript. A resizable, hideable variables pane shows locals and globals from the selected frame's source file. Both Console and Debugger output can be selected and copied.
  • Use File > Create .ycode.plist for a directory or ProjectCenter project without an existing settings file. Xcode projects do not use this command. The command creates and opens the file, preserving current settings, adding the runnable executable, and supplying default Clean and Test targets. If automatic detection is ambiguous, choose the executable in a file panel. Add build targets or architecture environments as needed.

Ycode also provides Edit > Replace in Project with a before/after preview and undoable edits, and Project > Source Control for local Git status, diffs, staging, commits, and history. Gorm remains the interface editor.

Ycode development environment

Build Ycode with an installed GNUstep development environment, including GNUstep GUI:

make -C XCode
make -C Applications/ycode

The top-level make also builds Ycode. GDB is required for debugging; test runners and toolchains depend on the project. See the Ycode guide for installation, project formats, editing, debugging, tests, and .ycode.plist configuration. Ycode uses GNUstep build tools and GDB; it does not provide Apple's SDKs, simulators, signing, or the full Xcode toolchain.

1.3 How to use

To use this library you need to build it and install it and then compile the front-end which is in the Tools directory and is called buildtool.
Simply go into a directory which contains an Xcode project and type buildtool and it should build the project. If it doesn't then submit a bug.
Currently GNUstep can only build projects for macOS. Once support for UIKit and other frameworks are available, those will be added.

buildtool also accepts xcodebuild-style options alongside its original sub-commands. The default action is build; clean, install, generate, link, and save remain available.

Common examples:

buildtool -project MyApp.xcodeproj
buildtool -workspace MyWorkspace.xcworkspace
buildtool -project MyApp.xcodeproj -target MyApp -configuration Debug
buildtool -project MyApp.xcodeproj clean
buildtool -project MyApp.xcodeproj generate make

Supported xcodebuild-style options:

  • -project <path> - build an .xcodeproj.
  • -workspace <path> - build an .xcworkspace.
  • -target <name> - build only the named target.
  • -scheme <name> - accepted as a target-name alias when no -target is supplied.
  • -configuration <name> - use the named build configuration.
  • -alltargets - build all targets, even when a target or scheme is supplied.
  • -sdk <sdk>, -arch <arch>, -destination <destination>, -derivedDataPath <path>, -archivePath <path>, -jobs <count>, -parallelizeTargets, -quiet, -verbose, -list, and -showBuildSettings are accepted for command-line compatibility.

buildtool test builds the project, like xcodebuild test, then runs each unit-test target's .xctest bundle with xctest from tools-xctest. For test, -target and -scheme choose the test targets (a scheme's testables and its skipped or selected tests) rather than narrowing the build, so test hosts are still built:

buildtool test                                  # every unit-test target
buildtool test -target MyTests                  # one target
buildtool test -scheme MyApp                    # a scheme's testables
buildtool test -only-testing:MyTests/FooTests -skip-testing:MyTests/FooTests/testSlow

-only-testing: becomes an -XCTest selection, which any tools-xctest accepts. Skipping tests (-skip-testing:, or a scheme's skipped tests) needs an xctest that lists -skip-testing in its --help, and a test target whose TEST_HOST names an application in the project runs inside that application, which needs one that lists -host (and an X display, e.g. xvfb-run -a buildtool test). With an older xctest, those targets fail with a message saying so. XCTEST chooses the xctest program, and XCTEST_FLAGS passes extra options to it (e.g. XCTEST_FLAGS="-junit-report results.xml"). buildtool exits with status 1 when the build or any test fails.

Buildtool exits with status 0 on success and nonzero on a failed operation, invalid project path, or exception. An explicit project path never falls back to another project in the current directory.

1.3.1 Native macOS build

With full Xcode installed and selected as the active developer directory, build the framework and command-line tools against Apple's frameworks:

xcodebuild -project libs-xcode.xcodeproj \
  -target XCodeNative -target buildtool-native \
  -target pc2xc-native -target pcpg-native \
  -configuration Debug SYMROOT="$PWD/build/macos" CODE_SIGNING_ALLOWED=NO build

Products are in build/macos/Debug. Keep the command-line tools beside XCode.framework so their runtime search paths can locate it. The native targets use manual reference counting and do not require GNUstep or CocoaPods. The other targets in this project, including All, invoke GNUstep make.

To build the framework, tools, and native Ycode app, run the shared regression tests, and check buildtool startup:

sh Tests/run-macos.sh
CONFIGURATION=Release sh Tests/run-macos.sh

Ycode is packaged as build/macos/Debug/Ycode.app (or Release), with its framework and editor/debugger bundles embedded. See the Ycode build instructions.

Link clients against XCode.framework and import its public headers:

#import <XCode/XCode.h>

This native build supports using the project parsing library and tools on macOS. Buildtool's project-building backend still uses GNUstep tools and framework mappings; it is not a replacement for Apple's SDK build pipeline.

1.3.2 Project generators and conversion

The library includes Makefile, CMake, ProjectCenter, and ProjectBuilder output generators. buildtool generate selects an output format; the pc2xc and pcpg tools provide additional project conversion and generation support. See the buildtool guide for command usage and supported options.

1.3.3 Documentation

The documentation guide covers buildtool.plist configuration and the manual. The Ycode guide covers the graphical IDE and its separate .ycode.plist settings.

1.3.4 Source conventions and checks

C and Objective-C sources use GNU formatting and GNUstep selector spacing. Objective-C implementation code uses Objective-C 1.0 syntax and manual reference counting. This applies to the library, Ycode, tools, generators, tests, templates, and bundled C sources. Source-code strings in syntax-highlighting tests are test data and may contain newer syntax.

With Python 3 and clang-format 19 installed, run:

python3 Tools/format-source.py  # apply GNU/GNUstep formatting
make check-style              # check formatting and lexical syntax rules
make check-objc1              # also audit compiler ASTs and GNU99 C syntax

The compiler audit requires GNUstep development headers, Clang, and GCC. It checks all tracked translation units, including templates and sources outside the default build. It does not replace legacy-runtime linkage tests or native macOS/Windows builds. Formatting preserves source tokens and literal contents; long literals and existing comment text are retained intact.

1.4 Continuous integration

CI runs on branch pushes, pull requests, release tag pushes, and manually from GitHub's Actions > CI > Run workflow. It follows apps-gorm's Linux setup: Ubuntu 24.04, GCC with the legacy Objective-C runtime, and Clang with libobjc2. GNUstep Make, Base, GUI, the Cairo backend, and libobjc2 are pinned in .github/scripts/build-gnustep.sh and installed into an isolated prefix outside the source checkout.

Each job builds and installs the framework, generators, tools, and Ycode, then runs make check and focused Ycode checks under Xvfb for debugger output, sound inspection, architecture selection, and AppKit resources. Both compiler jobs must pass before the release job runs. The full Ycode suite is excluded for now: local verification found a shell-resize assertion failure and a modal delete-confirmation dialog that blocks unattended execution. The standalone editor-bundle check also failed local bundle discovery and is not included in this baseline. This workflow also does not cover native macOS or Windows builds, interactive UI behavior, or the separate make check-objc1 source audit.

1.5 Releases

Release CI prepares a draft GitHub release when a tag such as XCode-0_6_0 is pushed. It attaches libs-xcode-0.6.0.tar.gz and its SHA-256 checksum after both Linux build/test jobs pass. The archive contains only the tagged sources; it does not include GNUstep dependencies or prebuilt binaries. Publishing the draft is the final manual step.

This is a combined source release of the library, generators, command-line tools, and Ycode (Applications/ycode). Ycode requires the library and is shipped in the same archive; its own application version is independent of the repository release number.

To enable this, merge the workflow and scripts into the repository and ensure GitHub Actions is enabled under Settings > Actions > General, with actions/checkout allowed. The release job requests contents: write for the built-in GITHUB_TOKEN; no personal access token or additional secret is required. Organization policies must allow that permission.

For a release (using 0.6.0 as an example):

  1. Set VERSION_NUMBER=0.6.0 in the root Version; the root GNUmakefile includes this file. Add release notes to ChangeLog. Component/framework versions are separate; review them when their compatibility or product version changes.

  2. Commit these changes and push the release commit. Wait for Actions > CI to pass. Run the source audit and native macOS checks described above where the corresponding toolchains are available.

  3. With a clean working tree at that commit, preview and start the release:

    Scripts/release.sh --dry-run
    Scripts/release.sh
  4. Open Actions > CI and select the tag run. CI tests the tagged commit again, checks that the tag matches the root Version file, and creates the draft with generated release notes and source assets.

  5. Open the repository's Releases, edit the draft, review its notes and assets, and click Publish release. Alternatively, with an authenticated GitHub CLI (gh), publish the reviewed draft from the same checkout:

    Scripts/release.sh --publish --dry-run
    Scripts/release.sh --publish

    Downloaders can verify the archive with sha256sum -c libs-xcode-0.6.0.tar.gz.sha256.

The helper reads Version, creates an annotated tag at HEAD, and pushes only that tag to origin. It does not bump versions, commit files, or push branches. Use --remote NAME for another remote and use that same option when publishing. An existing tag at HEAD can be reused after a failed push; conflicting tags are never force-updated. --publish requires an existing local tag at HEAD and a GitHub draft with both nonempty source assets. Its dry run queries GitHub but does not publish.

For a Ycode version bump, review Applications/ycode/GNUmakefile and the ApplicationRelease, FullVersionID, and NSBuildVersion fields in Applications/ycode/YcodeInfo.plist before committing the release. Component version changes are not performed automatically by the helper.

Run python3 Scripts/Tests/test_release.py to test the helper using disposable Git repositories and a simulated GitHub CLI, without publishing anything.

Tags must use XCode-MAJOR_MINOR_PATCH with numeric components. A version mismatch or failed test prevents release creation. To retry a transient failure, use Re-run failed jobs on the tag run. A retry can replace assets on an existing draft, but deliberately fails if that release has already been published. Fix source failures in a new commit and use a new release tag; do not move published tags. Run workflow performs validation only and does not create a release, even when run against a tag.

1.6 How can you help?

  • Give us feedback! Tell us what you like; tell us what you think could be better.

Please log bug reports on the GNUstep project page https://github.com/gnustep/libs-xcode/issues or send bug reports to bug-gnustep@gnu.org.

Happy hacking!

Copyright (C) 2005 Free Software Foundation

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

About

The GNUstep Xcode Library is a library for building xcode projects. It can be used to parse and provide information regarding an xcode project or used to build an xcode project directly.

Resources

Stars

54 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages