pax_global_header00006660000000000000000000000064147543164320014523gustar00rootroot0000000000000052 comment=bc666fe5d2d7e2ef69c2f847c69d2b295399c8ea libs-xcode-XCode-0_5_0/000077500000000000000000000000001475431643200147205ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/.github/000077500000000000000000000000001475431643200162605ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/.github/scripts/000077500000000000000000000000001475431643200177475ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/.github/scripts/build.sh000077500000000000000000000011321475431643200214020ustar00rootroot00000000000000#! /usr/bin/env sh set -ex echo "Building..." # build dependencies... ./.github/scripts/dependencies.sh export LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LIBRARY_PATH; export LD_LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LD_LIBRARY_PATH; if [ $LIBRARY_COMBO = 'ng-gnu-gnu' ]; then export CPATH=$HOME/staging/include; else export CPATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/include; fi; export PATH=$HOME/staging/bin:$PATH; export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles; . $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh; # Build libs-xcode make && make install libs-xcode-XCode-0_5_0/.github/scripts/dependencies.sh000077500000000000000000000054321475431643200227400ustar00rootroot00000000000000#! /usr/bin/env sh set -ex install_gnustep_make() { echo "::group::GNUstep Make" cd $DEPS_PATH git clone -q -b ${TOOLS_MAKE_BRANCH:-master} https://github.com/gnustep/tools-make.git cd tools-make MAKE_OPTS= if [ -n "$HOST" ]; then MAKE_OPTS="$MAKE_OPTS --host=$HOST" fi if [ -n "$RUNTIME_VERSION" ]; then MAKE_OPTS="$MAKE_OPTS --with-runtime-abi=$RUNTIME_VERSION" fi ./configure --prefix=$INSTALL_PATH --with-library-combo=$LIBRARY_COMBO $MAKE_OPTS || cat config.log make install echo Objective-C build flags: $INSTALL_PATH/bin/gnustep-config --objc-flags echo "::endgroup::" } install_libobjc2() { echo "::group::libobjc2" cd $DEPS_PATH git clone -q https://github.com/gnustep/libobjc2.git cd libobjc2 git submodule sync git submodule update --init mkdir build cd build cmake \ -DTESTS=off \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DGNUSTEP_INSTALL_TYPE=NONE \ -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \ ../ make install echo "::endgroup::" } install_libdispatch() { echo "::group::libdispatch" cd $DEPS_PATH # will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged git clone -q -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git libdispatch mkdir libdispatch/build cd libdispatch/build # -Wno-error=void-pointer-to-int-cast to work around build error in queue.c due to -Werror cmake \ -DBUILD_TESTING=off \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \ -DCMAKE_C_FLAGS="-Wno-error=void-pointer-to-int-cast" \ -DINSTALL_PRIVATE_HEADERS=1 \ -DBlocksRuntime_INCLUDE_DIR=$INSTALL_PATH/include \ -DBlocksRuntime_LIBRARIES=$INSTALL_PATH/lib/libobjc.so \ ../ make install echo "::endgroup::" } install_gnustep_gui() { echo "::group::GNUstep GUI" cd $DEPS_PATH . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh git clone -q -b ${LIBS_GUI_BRANCH:-master} https://github.com/gnustep/libs-gui.git cd libs-gui ./configure make make install echo "::endgroup::" } install_gnustep_base() { echo "::group::GNUstep Base" cd $DEPS_PATH . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh git clone -q -b ${LIBS_BASE_BRANCH:-master} https://github.com/gnustep/libs-base.git cd libs-base ./configure make make install echo "::endgroup::" } mkdir -p $DEPS_PATH # Windows MSVC toolchain uses tools-windows-msvc scripts to install non-GNUstep dependencies if [ "$LIBRARY_COMBO" = "ng-gnu-gnu" -a "$IS_WINDOWS_MSVC" != "true" ]; then install_libobjc2 install_libdispatch fi install_gnustep_make install_gnustep_base install_gnustep_gui libs-xcode-XCode-0_5_0/.github/scripts/test.sh000077500000000000000000000002371475431643200212670ustar00rootroot00000000000000#! /usr/bin/env sh set -ex echo "Testing..." . $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh; # Test gorm make check || (cat Tests/tests.log && false); libs-xcode-XCode-0_5_0/.github/workflows/000077500000000000000000000000001475431643200203155ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/.github/workflows/main.yml000066400000000000000000000065201475431643200217670ustar00rootroot00000000000000name: CI on: push: pull_request: workflow_dispatch: inputs: tools_make_branch: description: "tools-make branch" default: "master" required: true libs_base_branch: description: "libs-base branch" default: "master" required: true libs_back_branch: description: "libs-back branch" default: "master" required: true env: APT_PACKAGES: >- pkg-config libgnutls28-dev libffi-dev libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev gnutls-bin libcurl4-gnutls-dev libgmp-dev libcairo2-dev # packages for GCC Objective-C runtime APT_PACKAGES_gcc: >- libobjc-10-dev libblocksruntime-dev gobjc # packages for libobjc2 / libdispatch APT_PACKAGES_clang: >- libpthread-workqueue-dev jobs: ########### Linux ########### linux: name: ${{ matrix.name }} runs-on: ubuntu-latest # don't run pull requests from local branches twice if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository strategy: fail-fast: false matrix: include: - name: Ubuntu x64 GCC library-combo: gnu-gnu-gnu CC: gcc CXX: g++ - name: Ubuntu x64 Clang gnustep-1.9 library-combo: ng-gnu-gnu runtime-version: gnustep-1.9 CC: clang CXX: clang++ - name: Ubuntu x64 Clang gnustep-2.0 library-combo: ng-gnu-gnu runtime-version: gnustep-2.0 CC: clang CXX: clang++ env: SRC_PATH: ${{ github.workspace }}/source DEPS_PATH: ${{ github.workspace }}/dependencies INSTALL_PATH: ${{ github.workspace }}/build CC: ${{ matrix.CC }} CXX: ${{ matrix.CXX }} LIBRARY_COMBO: ${{ matrix.library-combo }} RUNTIME_VERSION: ${{ matrix.runtime-version }} defaults: run: working-directory: ${{ env.SRC_PATH }} steps: - uses: actions/checkout@v3 with: path: ${{ env.SRC_PATH }} - name: Install packages run: | sudo apt-get -q -y update sudo apt-get -q -y install $APT_PACKAGES $APT_PACKAGES_${{ matrix.library-combo == 'ng-gnu-gnu' && 'clang' || 'gcc' }} # gnustep-2.0 runtime requires ld.gold or lld if [ "$RUNTIME_VERSION" = "gnustep-2.0" ]; then sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10 fi - name: Install dependencies env: TOOLS_MAKE_BRANCH: ${{github.event.inputs.tools_make_branch}} LIBS_BASE_BRANCH: ${{github.event.inputs.libs_base_branch}} LIBS_GUI_BRANCH: ${{github.event.inputs.libs_gui_branch}} run: ./.github/scripts/dependencies.sh - name: Build source for libs-xcode run: . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh && make && make install - name: Run tests run: | . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh make check - name: Upload logs uses: actions/upload-artifact@v3 if: always() with: name: Logs - ${{ matrix.name }} path: | ${{ env.SRC_PATH }}/config.log ${{ env.SRC_PATH }}/Tests/tests.log libs-xcode-XCode-0_5_0/.gitignore000066400000000000000000000001271475431643200167100ustar00rootroot00000000000000obj XCode.framework derived_src *.generator *~ *.app *.app/* *.backup *.backup/* build libs-xcode-XCode-0_5_0/Applications/000077500000000000000000000000001475431643200173465ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Applications/GNUmakefile000066400000000000000000000007321475431643200214220ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # Generator bundles SUBPROJECTS = \ ycode # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Applications/ycode/000077500000000000000000000000001475431643200204515ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Applications/ycode/AppController.h000066400000000000000000000014241475431643200234070ustar00rootroot00000000000000/* Project: Ycode Author: Gregory John Casamento,,, Created: 2017-08-15 03:31:31 -0400 by heron Application Controller */ #ifndef _PCAPPPROJ_APPCONTROLLER_H #define _PCAPPPROJ_APPCONTROLLER_H #import @class YCodeWindowController; @interface AppController : NSObject { YCodeWindowController *windowController; } + (void) initialize; - (id) init; - (void) dealloc; - (void) awakeFromNib; - (void) applicationDidFinishLaunching: (NSNotification *)aNotif; - (BOOL) applicationShouldTerminate: (id)sender; - (void) applicationWillTerminate: (NSNotification *)aNotif; - (BOOL) application: (NSApplication *)application openFile: (NSString *)fileName; - (void) showPrefPanel: (id)sender; - (IBAction) openProject: (id)sender; @end #endif libs-xcode-XCode-0_5_0/Applications/ycode/AppController.m000066400000000000000000000023171475431643200234160ustar00rootroot00000000000000/* Project: Ycode Author: Gregory John Casamento,,, Created: 2017-08-15 03:31:31 -0400 by heron Application Controller */ #import "AppController.h" @implementation AppController + (void) initialize { NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; /* * Register your app's defaults here by adding objects to the * dictionary, eg * * [defaults setObject:anObject forKey:keyForThatObject]; * */ [[NSUserDefaults standardUserDefaults] registerDefaults: defaults]; [[NSUserDefaults standardUserDefaults] synchronize]; } - (id) init { if ((self = [super init])) { } return self; } - (void) dealloc { [super dealloc]; } - (void) awakeFromNib { } - (void) applicationDidFinishLaunching: (NSNotification *)aNotif { // Uncomment if your application is Renaissance-based // [NSBundle loadGSMarkupNamed: @"Main" owner: self]; } - (BOOL) applicationShouldTerminate: (id)sender { return YES; } - (void) applicationWillTerminate: (NSNotification *)aNotif { } - (BOOL) application: (NSApplication *)application openFile: (NSString *)fileName { return NO; } - (void) showPrefPanel: (id)sender { } - (IBAction) openProject: (id)sender { } @end libs-xcode-XCode-0_5_0/Applications/ycode/GNUmakefile000066400000000000000000000025321475431643200225250ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) ifeq ($(GNUSTEP_MAKEFILES),) $(warning ) $(warning Unable to obtain GNUSTEP_MAKEFILES setting from gnustep-config!) $(warning Perhaps gnustep-make is not properly installed,) $(warning so gnustep-config is not in your PATH.) $(warning ) $(warning Your PATH is currently $(PATH)) $(warning ) endif endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Application # VERSION = 0.1 PACKAGE_NAME = Ycode APP_NAME = Ycode Ycode_APPLICATION_ICON = # # Resource files # Ycode_RESOURCE_FILES = \ Resources/Ycode.gorm \ # # Header files # Ycode_HEADER_FILES = \ AppController.h \ YCodeDocumentController.h \ YCTreeView.h \ YCEditorView.h \ YCInspectorView.h \ YCodeWindowController.h # # Objective-C Class files # Ycode_OBJC_FILES = \ AppController.m \ YCodeDocumentController.m \ YCTreeView.m \ YCEditorView.m \ YCInspectorView.m \ YCodeWindowController.m # # Other sources # Ycode_OBJC_FILES += \ Ycode_main.m # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Applications/ycode/GNUmakefile.postamble000066400000000000000000000012441475431643200245110ustar00rootroot00000000000000# # GNUmakefile.postamble - Generated by ProjectCenter # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: libs-xcode-XCode-0_5_0/Applications/ycode/GNUmakefile.preamble000066400000000000000000000010701475431643200243070ustar00rootroot00000000000000# # GNUmakefile.preamble - Generated by ProjectCenter # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to Objective C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to C compiler ADDITIONAL_CFLAGS += # Additional flags to pass to the linker ADDITIONAL_LDFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += # Additional GUI libraries to link ADDITIONAL_GUI_LIBS += libs-xcode-XCode-0_5_0/Applications/ycode/README.md000066400000000000000000000006061475431643200217320ustar00rootroot00000000000000# apps-ycode Xcode like application which combines the capabilities of gorm and projectecenter. It's primary purpose is to provide an interface analogous to Xcode so that we can have a more modern development IDE where all of the development happens in one place. This will also help to unify our approach to dealing with certain types of interfaces which Gorm can't easily deal with. libs-xcode-XCode-0_5_0/Applications/ycode/Resources/000077500000000000000000000000001475431643200224235ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Applications/ycode/Resources/Ycode.gorm/000077500000000000000000000000001475431643200244315ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Applications/ycode/Resources/Ycode.gorm/data.classes000066400000000000000000000013131475431643200267170ustar00rootroot00000000000000{ "## Comment" = "Do NOT change this file, Gorm maintains it"; AppController = { Actions = ( "showPrefPanel:", "openProject:" ); Outlets = ( ); Super = NSObject; }; FirstResponder = { Actions = ( "openProject:", "orderFrontFontPanel:", "showPrefPanel:" ); Super = NSObject; }; YCEditorView = { Actions = ( ); Outlets = ( ); Super = NSView; }; YCInspectorView = { Actions = ( ); Outlets = ( ); Super = NSView; }; YCTreeView = { Actions = ( ); Outlets = ( ); Super = NSView; }; YCodeDocumentController = { Actions = ( ); Outlets = ( inspectorView, projectView, editorView ); Super = NSObject; }; }libs-xcode-XCode-0_5_0/Applications/ycode/Resources/Ycode.gorm/data.info000066400000000000000000000002701475431643200262160ustar00rootroot00000000000000GNUstep archive000f4240:00000003:00000003:00000000:01GormFilePrefsManager1NSObject%01NSString&%Latest Version0& % Typed Streamlibs-xcode-XCode-0_5_0/Applications/ycode/Resources/Ycode.gorm/objects.gorm000066400000000000000000000304251475431643200267540ustar00rootroot00000000000000GNUstep archive000f4240:0000001b:00000178:00000000:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01NSMenu01NSString& % Main Menu01NSMutableArray1NSArray&01 NSMenuItem0&%Info0&JJI0 1 NSImage0 &%GSMenuSelected0 0 & % GSMenuMixedI0 0&0 0& % Info Panel...JJI I0 0&%Preferences...JJI I0 0&%Help...0&%?JJI I0 0&%DocumentJJI I00&  0 0&%Open...0&%oJJI I0 0& % Open RecentJJI I00 &0! 0"& % Clear ListJJI I0# 0$&%New0%&%nJJI I0& 0'&%Save...0(&%sJJI I0) 0*& % Save As...0+&%SJJI I0, 0-& % Save To...JJI I0. 0/&%Save AllJJI I00 01&%Revert To SavedJJI I02 03&%CloseJJI I04 05&%WindowsJJI I06507&08 09&%Arrange In FrontJJI I0: 0;&%Miniaturize Window0<&%mJJI I0= 0>& % Close Window0?&%wJJI I0@ 0A&%ServicesJJI I0BA0C&0D 0E&%Hide0F&%hJJI I0G 0H&%Quit0I&%qJJI I0J1 GSNibItem0K& % AppController  &0L 0M&%YCodeDocumentController  &0N1 GSWindowTemplate1 GSClassSwapper0O&% NSWindow1NSWindow1 NSResponder% ? @" @ @JI @x @ 0P1NSView% ? @" @ @  @ @J0Q&0R1 NSSplitView% @$ @$ @ @8  @ @8J0S&0T1NSBox%  @i @8  @i @8J0U% @ @ @g @  @g @JT0V&0W&U0X1NSCell0Y&%Box0Z1NSFont%JJJJJJJJJJJJJJJ @ @%%0[% @j`  @ @8  @ @8J0\% @ @ @ @  @ @J[0]&0^&\0_0`&%BoxZJJJJJJJJJJJJJJJ @ @%%0a% @  @i @8  @i @8J0b% @ @ @g @  @g @Ja0c&0d&b0e0f&%BoxZJJJJJJJJJJJJJJJ @ @%%0g 0h& %  common_Dimple0i1NSColor0j&% NSNamedColorSpace0k&% System0l&% controlShadowColor @ I0mjk0n&% windowBackgroundColor0o&%Windowo0p&% Window ? ? @Ç @wI&  @ @0q&0r&0s1NSMutableDictionary1 NSDictionary&0t& % MenuItem(87)D0u& % MenuItem(52)!0v& % MenuItem(35)!0w& % MenuItem(18)#0x& % MenuItem24@0y&%Menu(13)B0z& % MenuItem9:0{&%Menu(4)0|& % MenuItem(0)0}& % MenuItem(58)80~& % MenuItem(75)0& % MenuItem(92)0& % MenuItem(40).0& % MenuItem(23)00&%Menu(19)60&%NSMenu0& % MenuItem(6))0& % MenuItem18=0& % MenuItem(98)40& % MenuItem(80)0& % MenuItem50& % MenuItem(46)0& % MenuItem200& % MenuItem(63)0& % MenuItem(29)0&%YCodeDocumentController(0)L0& % MenuItem(11)0& % SplitView(0)R0& % MenuItem(69))0& % MenuItem(86)=0& % MenuItem(34)0& % MenuItem(51)0& % MenuItem(17)!0&%Menu(12) 0& % MenuItem14D0&%Menu(3)0& % MenuItem1G0&%View(0)P0& % MenuItem(57)00& % GormNSMenu1B0& % MenuItem(74)G0& % MenuItem(91)0&%Menu(18)0& % MenuItem(22).0&%Menu(9)B0& % MenuItem(100)G0& % MenuItem(5)&0&%View(6)\0& % MenuItem25G0& % MenuItem(97)20& % MenuItem(45)G0& % MenuItem10=0& % MenuItem(62)0& % MenuItem(28)G0& % MenuItem(10)20& % MenuItem(85)40& % MenuItem(68)&0& % MenuItem19D0& % MenuItem(33)0& % MenuItem(50)0& % MenuItem(16)0& % MenuItem210&%Menu(11)B0& % MenuItem6@0&%Menu(2) 0& % MenuItem(73):0& % MenuItem(90)0& % MenuItem(39),0& % MenuItem(56).0& % Window(0)N0&%Menu(17) 0& % MenuItem(21),0&%Menu(8)0& % GormNSMenu 0& % MenuItem(4)#0& % MenuItem1540&%View(5)U0& % MenuItem(79)0±& % MenuItem(96),0ñ& % MenuItem(61)0ı& % MenuItem20ű& % MenuItem(44)=0Ʊ&% NSOwner0DZ& % NSApplication0ȱ& % MenuItem(27)@0ɱ& % GormNSMenu260ʱ&%Box(5)[0˱& % MenuItem260̱& % MenuItem(67)!0ͱ& % MenuItem(84)20α& % MenuItem(32)0ϱ& % MenuItem(15)0б&%Menu(10) 0ѱ& % MenuItem1140ұ&%Menu(1)0ӱ& % MenuItem(72)80Ա& % MenuItem(38))0ձ& % MenuItem(55),0ֱ&%Menu(16)60ױ& % MenuItem(20))0ر&%Menu(7) 0ٱ& % MenuItem(3)!0ڱ& % MenuItem740۱&%View(4)b0ܱ& % MenuItem220ݱ&%NSRecentDocumentsMenu0ޱ& % MenuItem(78)0߱& % MenuItem(95))0& % MenuItem(60)G0& % MenuItem(43):0& % MenuItem(26)=0& % MenuItem(9)00&%Box(4)T0& % MenuItem1680& % MenuItem(49)0& % MenuItem(66)0& % MenuItem(83),0& % MenuItem(31)0& % MenuItem(14)0& % MenuItem30&%Menu(0)0& % GormNSMenu3 0& % MenuItem(89)0& % MenuItem(71)00& % MenuItem(54))0& % MenuItem(37)&0&%Menu(15)0&%Menu(6)B0& % MenuItem(2)0& % MenuItem12D0& % MenuItem(77)0& % MenuItem(94)&0& % MenuItem(42)80& % MenuItem(25)80& % MenuItem(8).0&%Box(3)a0& % MenuItem(82))0& % MenuItem880& % MenuItem(65)0& % MenuItem23P& % MenuItem(48)P& % MenuItem(30)P& % MenuItem(13)P& % NSWindowsMenu6P& % MenuItem(88)GP& % MenuItem(36)#P& % AppControllerJP& % MenuItem(53)&P& % MenuItem(70),P & % MenuItem(19)&P &%Menu(14) P & % MenuItem17:P &%NSServicesMenuBP &%Menu(5)6P& % MenuItem(1)P& % MenuItem4P& % MenuItem(76)P&%MenuItemDP& % MenuItem(59):P& % MenuItem(93)P& % MenuItem(41)0P& % MenuItem(24)4P& % MenuItem(7),P& % MenuItem(99)=P& % MenuItem(81)&P& % MenuItem(64)P& % MenuItem(47)P& % MenuItem134P& % MenuItem(12)P&@@P1NSNibConnectorƐPP P!˰P" ːP# P$ P% P&ȰP' ȐP(P) P* P+ P, P-1NSNibControlConnector˰P.&%submenuAction:P/P0&%submenuAction:P1ȰP2&%submenuAction:P3P4&% NSFirstP5&%hide:P64P7& % terminate:P84P9&%orderFrontStandardInfoPanel:P:4P;&%arrangeInFront:P<4P=&%performMiniaturize:P>4P?& % performClose:P@ƐPAPB&%showPrefPanel:PC1NSNibOutletConnectorPD1NSMutableString&%delegatePEƐPFPGPHPI4PJ& % openDocument:PKPLݰPMٰݐPN4PO&%clearRecentDocuments:PPPQ&%submenuAction:PRPS4PT& % newDocument:PUPV4PW& % saveDocument:PXPY4PZ&%saveDocumentAs:P[P\4P]&%saveDocumentTo:P^P_4P`&%saveAllDocuments:PaPb4Pc&%revertDocumentToSaved:PdͰPe4Pf&%close:PgPh&%submenuAction:PiƐPjPkPl۰Pm䰏PnPoʰPpʐPqPrPs& % projectViewPtPu& % editorViewPvPw& % inspectorViewPx&libs-xcode-XCode-0_5_0/Applications/ycode/Resources/Ycode.tiff000066400000000000000000000213701475431643200243430ustar00rootroot00000000000000MM*΀ P8$ BaPd6DbQ8V-c@(dRbM'E@2 L /H`RG2^Ȁ2)}?R& Ln2Ow%@Wu az}>-vY|eV |Aw=`bI~ I0@ _/suY8 G@R'l Fzb Oh3*u20j07<W_v Iy:nw9Иp:0"L`Hj |Gwwio*adao&1{bE L4 2!PTyZt!FKgDR ) h `,"0$  y2  8  %lY{YrgFєa1i{HXL?^X @ByX=Wz-0@0Pi@ pܶzat4&b9|Ugyzv[@6}x (fYf$|κVb|@0fP!Q6vM ">I.+IX#ťZ;ԥi耸ƒ|MwUuGI{~ , "x'\ fZVA{ǝb ; A8 a9bxr𱋫kiZIc;;tJ҃>Tt IdH5euP`J6`@ ^-@z@ `}b҈tc q(k@4b"P(kB7WH O ጋ8%"ö8'A_!Q(r0 x.#J=Zy@or.E `1[ l "UhD q];G1Nx@p@ ` иf+b.Gӡc?2+^QA]hJX8"O_y8||Fဆ+#>d y>@Mn?l yp!hjZmtK' 8A!ؐ8%d(N*a( kbBV$ ""8 $k2aVaaO>X| xf X `*r D p$NКX!v!&O'~` ` Bb +J\v FtaFANvDjvdA$x!qN4ggj3lg`@˘E PL1'A``(3fB n"aaxK  .X ,iA$u 2BkA#BL1+!`qA $8k x`q!Q%Ah" v q|!b4| @T`nyO1T,~xA&"%"&@ca:&$ NZ]EMFۀ |y 02m&Fb(AB"+ "C Z@V<bVhgJerݒ M*A6Ɓ+/3aL-FM[srxŪ^pi.%i&0I@!+` V@ >$*$/X(M*hMi 0&R d&i012zA &g*0Ya  -K86*2``zn<t =j<8&r!РD!@`"p avD/'~`.f&z4* hlk "e*@¬,&rh4l /D, T y Of%3A/!d'^ `` j).* `q$Bdmvg!,tB @. M'y *[F@`@%`& ."R;ȁ!xa|B` :l@TG`#YdAO`w@ˊEVTfA~hwY-,6VmXА# SH!;[).MBjЋ!4n3 Bc1A `b `Z$< W *[gb\54O|g1fV(#Obq|(bA\aK#2,-g^b.؟@TaaxfƐ'}" B iB>os?W`ĄEMRav ~*|"6 dT{kf#%$$(`^䁊Qo1#t`4 `T.H4%}bVJ*f NƵ3eF0 gogLZq.FAf "Dd  N 8"@>`4Yk! %5Ŗrd1+J!{ R\!srNr `:u ~kkyy4&" kW$ !aza*9( fIp(~,@&fj$b a2f^W'T$BFO1y 5Fg[gVunVUz@ ZA8q FHD"?`{*@, ^ V` `$Z`k$Ejvkq jH_VG~L%wH!ĚdaD;h4ABH<8z, ,+ !N ` p `*1`<bt@?Hf&k,;kHUA¤ p@r'n@ֶ&ÁK$`6 R (@A(f#$:&!.`T J Fz(lkkV)1r2p '`D$A$! $î!bD:%%nZB&܀WPKx$H"j7s"g?ha:`u$`x`{,+UPalbA!aŞ/sVnL @>h TӜ:U~]i.ťƄa8&PA"૨0[$fBsvTf @Ag i;&h'HBT D t.&'n&φ lAbDIn4z!ҦeUL}[! :H0ycWPJu`- & aፙEqڢDj0<8%Rf$ATan'x;Z@P\ rpL&XkiH"N)E@ n6?"@t:߯sFI5W3=O\`@}?:D"0`087ӫȕ'Oʝm[0MOӺ'Up GBpN00 0(=RSs H HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Kmlibs-xcode-XCode-0_5_0/Applications/ycode/YCEditorView.h000066400000000000000000000020501475431643200231340ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2018 Free Software Foundation Author: Gregory John Casamento,,, Created: 2018-12-17 20:02:20 -0500 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _YCEDITORVIEW_H_ #define _YCEDITORVIEW_H_ #import #import @interface YCEditorView : NSView { } @end #endif // _YCEDITORVIEW_H_ libs-xcode-XCode-0_5_0/Applications/ycode/YCEditorView.m000066400000000000000000000016541475431643200231520ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2018 Free Software Foundation Author: Gregory John Casamento,,, Created: 2018-12-17 20:01:50 -0500 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "YCEditorView.h" @implementation YCEditorView @end libs-xcode-XCode-0_5_0/Applications/ycode/YCInspectorView.h000066400000000000000000000020641475431643200236610ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2018 Free Software Foundation Author: Gregory John Casamento,,, Created: 2018-12-17 20:16:45 -0500 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _YCINSPECTORVIEW_H_ #define _YCINSPECTORVIEW_H_ #import #import @interface YCInspectorView : NSView { } @end #endif // _YCINSPECTORVIEW_H_ libs-xcode-XCode-0_5_0/Applications/ycode/YCInspectorView.m000066400000000000000000000016621475431643200236710ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2018 Free Software Foundation Author: Gregory John Casamento,,, Created: 2018-12-17 20:16:45 -0500 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "YCInspectorView.h" @implementation YCInspectorView @end libs-xcode-XCode-0_5_0/Applications/ycode/YCTreeView.h000066400000000000000000000020401475431643200226040ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2018 Free Software Foundation Author: Gregory John Casamento,,, Created: 2018-12-17 19:30:54 -0500 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _YCTREEVIEW_H_ #define _YCTREEVIEW_H_ #import #import @interface YCTreeView : NSView { } @end #endif // _YCTREEVIEW_H_ libs-xcode-XCode-0_5_0/Applications/ycode/YCTreeView.m000066400000000000000000000016501475431643200226170ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2018 Free Software Foundation Author: Gregory John Casamento,,, Created: 2018-12-17 19:30:54 -0500 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "YCTreeView.h" @implementation YCTreeView @end libs-xcode-XCode-0_5_0/Applications/ycode/YCodeDocumentController.h000066400000000000000000000021421475431643200253670ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2017 Free Software Foundation Author: Gregory John Casamento,,, Created: 2017-08-20 03:22:49 -0400 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _YCODEDOCUMENTCONTROLLER_H_ #define _YCODEDOCUMENTCONTROLLER_H_ #import #import @interface YCodeDocumentController : NSDocumentController { } @end #endif // _YCODEDOCUMENTCONTROLLER_H_ libs-xcode-XCode-0_5_0/Applications/ycode/YCodeDocumentController.m000066400000000000000000000017021475431643200253750ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2017 Free Software Foundation Author: Gregory John Casamento,,, Created: 2017-08-20 03:22:49 -0400 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "YCodeDocumentController.h" @implementation YCodeDocumentController @end libs-xcode-XCode-0_5_0/Applications/ycode/YCodeWindowController.h000066400000000000000000000021301475431643200250550ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2023 Free Software Foundation Author: Gregory John Casamento,,, Created: 2023-11-01 11:42:13 -0400 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _YCODEWINDOWCONTROLLER_H_ #define _YCODEWINDOWCONTROLLER_H_ #import #import @interface YCodeWindowController : NSWindowController { } @end #endif // _YCODEWINDOWCONTROLLER_H_ libs-xcode-XCode-0_5_0/Applications/ycode/YCodeWindowController.m000066400000000000000000000016761475431643200251000ustar00rootroot00000000000000/* Project: Ycode Copyright (C) 2023 Free Software Foundation Author: Gregory John Casamento,,, Created: 2023-11-01 11:42:13 -0400 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "YCodeWindowController.h" @implementation YCodeWindowController @end libs-xcode-XCode-0_5_0/Applications/ycode/Ycode.pcproj/000077500000000000000000000000001475431643200230105ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Applications/ycode/Ycode.pcproj/PC.project000066400000000000000000000036641475431643200247130ustar00rootroot00000000000000{ APPLICATIONICON = ""; "APP_DOCUMENT_BASED" = NO; "APP_TYPE" = GORM; "BUILDER_TARGETS" = ( all, install, uninstall, clean, distclean, dist ); "BUNDLE_IDENTIFIER" = ""; "CLASS_FILES" = ( "AppController.m", "YCodeDocumentController.m", "YCTreeView.m", "YCEditorView.m", "YCInspectorView.m", "YCodeWindowController.m" ); COMPILEROPTIONS = ""; CPPOPTIONS = ""; "CREATION_DATE" = "2017-08-15 03:31:31 -0400"; "DOCU_FILES" = ( ); FRAMEWORKS = ( ); "HEADER_FILES" = ( "AppController.h", "YCodeDocumentController.h", "YCTreeView.h", "YCEditorView.h", "YCInspectorView.h", "YCodeWindowController.h" ); IMAGES = ( ); INSTALLDIR = "$(HOME)/GNUstep"; INTERFACES = ( "Ycode.gorm" ); LANGUAGE = English; LIBRARIES = ( "gnustep-base", "gnustep-gui" ); LINKEROPTIONS = ""; "LOCALIZED_RESOURCES" = ( ); MAININTERFACE = "Ycode.gorm"; MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; "OBJC_COMPILEROPTIONS" = ""; "OTHER_RESOURCES" = ( ); "OTHER_SOURCES" = ( "Ycode_main.m" ); "PRINCIPAL_CLASS" = NSApplication; "PROJECT_AUTHORS" = ( ); "PROJECT_COPYRIGHT" = "Copyright (C) 200x"; "PROJECT_COPYRIGHT_DESC" = "Released under ..."; "PROJECT_CREATOR" = "Gregory John Casamento,,,"; "PROJECT_DESCRIPTION" = "No description avaliable!"; "PROJECT_DOCUMENTTYPES" = ( ); "PROJECT_GROUP" = "No group avaliable!"; "PROJECT_MAINTAINER" = "Gregory John Casamento,,,"; "PROJECT_NAME" = Ycode; "PROJECT_RELEASE" = "0.1"; "PROJECT_SUMMARY" = "No summary avaliable!"; "PROJECT_TYPE" = Application; "PROJECT_URL" = ""; "SEARCH_HEADER_DIRS" = ( ); "SEARCH_LIB_DIRS" = ( ); SUBPROJECTS = ( ); "SUPPORTING_FILES" = ( "GNUmakefile.preamble", GNUmakefile, "GNUmakefile.postamble", "YcodeInfo.plist" ); "USER_LANGUAGES" = ( AmericanEnglish, English ); }libs-xcode-XCode-0_5_0/Applications/ycode/Ycode.pcproj/heron.project000066400000000000000000000003641475431643200255160ustar00rootroot00000000000000{"LAST_EDITING" = "2023-11-01 11:44:36 -0400"; "PC_WINDOWS" = {ProjectBrowser = "{x = 0; y = 0; width = 1430; height = 166}"; ProjectBuild = "0 0 0 0 0 0 3840 2160 "; ProjectWindow = "979 365 1448 1321 0 0 3840 2160 "; ShowToolbar = YES; }; }libs-xcode-XCode-0_5_0/Applications/ycode/YcodeInfo.plist000066400000000000000000000006351475431643200234110ustar00rootroot00000000000000{ "!" = "Generated by ProjectCenter, do not edit"; ApplicationDescription = "No description avaliable!"; ApplicationName = Ycode; ApplicationRelease = "0.1"; Copyright = "Copyright (C) 200x"; CopyrightDescription = "Released under ..."; FullVersionID = "0.1"; NSExecutable = Ycode; NSMainNibFile = "Ycode.gorm"; NSPrincipalClass = NSApplication; NSRole = Application; }libs-xcode-XCode-0_5_0/Applications/ycode/Ycode_main.m000066400000000000000000000011531475431643200226760ustar00rootroot00000000000000/* Project: Ycode Author: Gregory John Casamento,,, Created: 2017-08-15 03:31:31 -0400 by heron */ #import int main(int argc, const char *argv[]) { // Uncomment if your application is Renaissance application /* CREATE_AUTORELEASE_POOL (pool); [NSApplication sharedApplication]; [NSApp setDelegate: [AppController new]]; #ifdef GNUSTEP [NSBundle loadGSMarkupNamed: @"MainMenu-GNUstep" owner: [NSApp delegate]]; #else [NSBundle loadGSMarkupNamed: @"MainMenu-OSX" owner: [NSApp delegate]]; #endif RELEASE (pool); */ return NSApplicationMain (argc, argv); } libs-xcode-XCode-0_5_0/CODEOWNERS000066400000000000000000000003441475431643200163140ustar00rootroot00000000000000# These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. * @gcasa libs-xcode-XCode-0_5_0/COPYING.LIB000066400000000000000000000635061475431643200163720ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libs-xcode-XCode-0_5_0/ChangeLog000066400000000000000000000164451475431643200165040ustar00rootroot000000000000002025-02-16 Gregory John Casamento * GNUmakefile * Version: Release 0.5.0 2024-11-22 Gregory John Casamento * XCode/PBXFileReference.m * XCode/PBXGroup.m * XCode/PBXHeadersBuildPhase.m * XCode/PBXResourcesBuildPhase.m * XCode/PBXSourcesBuildPhase.m * XCode/PBXFileSystemSynchronizedRootGroup.[hm]: Add support for file system synchronized groups. 2022-04-12 Riccardo Mottola * PBXFileReference.m (_headerStringForPath): Look for headers only if it is a directory, skip if a file. 2022-01-10 Gregory John Casamento * PBXFileReference.[hm]: Fix issues with resolving headers. 2022-01-06 Gregory John Casamento * GSXCBuildContext.m * NSString+PBXAdditions.h * NSString+PBXAdditions.m: Add code to execute commend and collect output * PBXAbstractBuildPhase.h * PBXAbstractBuildPhase.m: Add call to get target information * PBXBuildFile.h * PBXBuildFile.m: Fixes * PBXContainerItemProxy.m: Fixes for executing proxy'd project * PBXFileReference.h * PBXFileReference.m: Build fixes * PBXFrameworksBuildPhase.m: Fix building of framework, bundle, etc. * PBXNativeTarget.m * PBXProject.h * PBXProject.m: Fixes * PBXShellScriptBuildPhase.m: Move script creation to /tmp * PBXTargetDependency.h: Add declarations for call to get dependencies. 2021-12-17 Gregory John Casamento * Resources/Framework-mapping.plist: Add OpenGL framework to the mapping list. 2021-10-10 Gregory John Casamento * GNUmakefile * PBXFileReference.m * PBXFrameworksBuildPhase.m * Resources/Framework-mapping.plist: Add mapping plist so that these mappings are no longer hardcoded. 2021-09-22 Gregory John Casamento * NSString+PBXAdditions.m * PBXFileReference.m * PBXFrameworksBuildPhase.m * PBXNativeTarget.m * PBXProject.m: Refactor path handling. Correct handling of escaping paths. 2016-05-08 00:37-EDT Gregory John Casamento * Tools/pcpg/PLCPG.m: Fix issue with include/import of non-NS classes. 2016-04-26 20:48-EDT Gregory John Casamento * PBXFrameworksBuildPhase.m: Fix tool compilation. 2016-04-26 19:45-EDT Gregory John Casamento * PBXFrameworksBuildPhase.m: Use gnustep-config to get the paths for GNUSTEP_SYSTEM_LIBRARY, GNUSTEP_LOCAL_LIBRARY and GNUSTEP_USER_LIBRARY after RFM's change to gnustep-make. This change makes the build method a little more consistent. 2014-08-03 03:49-EDT Gregory John Casamento * Updated README and Tools/pcpg/README. 2014-03-25 03:49-EDT Gregory John Casamento * PBXProject.m: Change to debug settings 2013-09-21 08:17-EDT Gregory John Casamento * PBXFileReference.m: Add all subdirectories in the project to the include directives. 2013-09-21 02:06-EDT Gregory John Casamento * PBXFileReference.m: Use gnu99 as default. Need to start thinking about a specs file which will allow definition of defaults on a per compiler/platform basis. 2013-08-31 Fred Kiefer * PBXCoder.h, * PBXCoder.m: Remove method -changeToProjectRoot. * GSXCBuildContext.m: Remove directory change from pop. * PBXContainerItemProxy.m: Handle all directory changes here. * PBXFileReference.m: Add std to the compile options. * PBXFrameworksBuildPhase.m: Add frameworks in OTHER_LDFLAGS to the link options. 2013-05-09 12:56-EDT Gregory John Casamento * PBXApplicationTarget.m: Set the product type in init. * PBXBundleTarget.m: Set the product type in init. * PBXCommon.h: Add GSXCCommon.h to the header. * PBXFrameworkTarget.m: Set the product type in init. 2013-05-09 12:44-EDT Gregory John Casamento * PBXApplicationTarget.h * PBXApplicationTarget.m * PBXBundleTarget.h * PBXBundleTarget.m * PBXFrameworkTarget.h * PBXFrameworkTarget.m: Add new classes to handle older files for these targets. 2013-05-09 12:44-EDT Gregory John Casamento * GNUmakefile * PBXNativeTarget.h * PBXNativeTarget.m: Add new method. 2013-05-07 19:58-EDT Gregory John Casamento * PBXFrameworksBuildPhase.m: Use the gnustep-config script everywhere to allow us to automatically use the default compiler. * Tools/pcpg/PLCPG.m: Fix an issue where mutable dictionary was not used. 2013-05-06 02:14-EDT Gregory John Casamento * PBXAbstractBuildPhase.h * PBXAbstractBuildPhase.m: Added missing methods for property showEnvVarsInLog. 2013-05-06 01:55-EDT Gregory John Casamento * PBXFileReference.m: -build, override buildPath pre-prending of project root in some cases. This is likely due to differences in some versions of the xcodeproj format. 2013-05-04 20:38-EDT Gregory John Casamento * PBXNativeTarget.m * PBXResourcesBuildPhase.m: Fix issue with copying English.lproj 2013-04-24 02:39-EDT Gregory John Casamento * NSString+PBXAdditions.h * NSString+PBXAdditions.m: Path manipulation methods. * PBXFileReference.m * PBXProject.m: Correct issue with handling older project files after last modification. 2013-04-20 23:16-EDT Gregory John Casamento * PBXContainerItemProxy.m * PBXFileReference.h * PBXFileReference.m: Use the compiler which was used to build GNUstep instead of hardcoding. * PBXProject.m: Proceed into target directories when doing the build * PBXResourcesBuildPhase.m: Copy lproj files. * PBXShellScriptBuildPhase.m: Improve building of 10.7 and 10.8 (Xcode 4.4 and 4.5) style files. 2012-10-15 13:20-EDT Gregory John Casamento * GSXCBuildContext.h: Add declaration for addEntriesFromDictionary: * GSXCBuildContext.m: Implement addEntriesFromDictionary: * PBXContainerItemProxy.m: Correct warnings. * PBXContainer.m: Added method to collect header directories which need to be referenced for build. * PBXFileReference.m: Add code to handle INCLUDE_DIRS context variable. * PBXProject.h: Added ivar * PBXProject.m: Add project context. 2012-08-07 01:13-EDT Gregory John Casamento * PBXFrameworksBuildPhase.m: Automatically add link directives -I and -L for frameworks present in the UninstalledProducts directory. This allows for linking of dependencies prior to installation. 2012-08-07 00:09-EDT Gregory John Casamento * PBXNativeTarget.m: Generate the links with a relative path. 2012-03-14 18:25-EDT Gregory John Casamento * PBXFrameworksBuildPhase.m: Remove commented out code.. * README: Update readme to reflect new name. 2012-02-25 11:36-EST Gregory John Casamento * PBXResourcesBuildPhase.m: Fix issues with copying of resources which are localized. 2012-02-25 10:29-EST Gregory John Casamento * PBXVariantGroup.m: More fixes for appending resource names. Only use the last path component. 2012-02-25 00:53-EST Gregory John Casamento * ChangeLog: Add ChangeLog. * PBXVariantGroup.m: Fix issue with appending resource names. libs-xcode-XCode-0_5_0/Documentation/000077500000000000000000000000001475431643200175315ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Documentation/GNUmakefile000066400000000000000000000026511475431643200216070ustar00rootroot00000000000000# # Documentation makefile for the GNUstep GUI Library # Copyright (C) 1995 Free Software Foundation, Inc. # # Written by: Adam Fedor # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = libs-xcode include $(GNUSTEP_MAKEFILES)/common.make include ../Version # The documents to be generated DOCUMENT_NAME = ReleaseNotes # SUBPROJECTS = General GuiUser manual # The text documents to be generated # Manual pages to install MAN1_PAGES = \ buildtool.1 -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/documentation.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Documentation/GNUmakefile.postamble000066400000000000000000000046171475431643200236000ustar00rootroot00000000000000# # GNUmakefile.postamble # # Copyright (C) 2024 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Gui Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Things to do before compiling # before-all:: # After building local documentation, we need to run the special makefile # in the source directory to generate library reference documentation from # the source code. after-all:: # Things to do before installing # before-install:: # Install the library reference documentation manually # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling after-uninstall:: rm -rf $(REF_DOC_INSTALL_DIR) # Things to do before cleaning # before-clean:: # Things to do after cleaning after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: regenerate: $(DOCUMENT_TEXT_NAME) mv -f $(TOP_DOC_FILES) .. version.texi: ../Version rm -f version.texi echo '@set GNUSTEP-GUI-VERSION' $(GNUSTEP_GUI_VERSION) \ > version.texi echo '@set GNUSTEP-GUI-GCC $(GNUSTEP_GUI_GCC)' \ >> version.texi echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \ >> version.texi echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \ >> version.texi if [ $(GNUSTEP_GUI_FTP_MACHINE) ]; then \ echo '@set GNUSTEP-GUI-FTP-MACHINE $(GNUSTEP_GUI_FTP_MACHINE)' \ >> version.texi; fi if [ $(GNUSTEP_GUI_FTP_DIRECTORY) ]; then \ echo '@set GNUSTEP-GUI-FTP-DIRECTORY $(GNUSTEP_GUI_FTP_DIRECTORY)' \ >> version.texi; fi libs-xcode-XCode-0_5_0/Documentation/README.md000066400000000000000000000104111475431643200210050ustar00rootroot00000000000000# XCode lib manual This manual is intended as a guide to using the libs-xcode library along with buildtool, it's command line front-end. This library and tool were written for the purpose of allowing the user to easily build xcode projects on any other platform that GNUstep currently supports. ## Property list values With any project it is possible to use a propertly list file called buildtool.plist. This propery file allows you to set specific paramters to alter the behavior of the build for whatever platform you are building on. An example property list is here: ``` { target = "msvc"; setupScript = "/home/gregc/Scripts/setup_env.sh"; buildType = "parallel"; "# Comment" = "This target name maps to the above..."; msvc = { additional = ( "-lgdi32", ); copylibs = YES; ignored = ( "VideoToolbox", "CoreMedia" ); }; headerPaths = ( "/home/gregc/headers" ); remappedSource = { "ASourceFile.m" = "AlternateSourceFile.m"; }; skippedTarget = ( "ASkippedTargetName" ); mapped = { "curl" = "-llibcurl"; }; ignored = ( "ssh2" ); substitutions = { "-lSomeLibrary" = "-lSubtituteLib"; "-lAnotherLib" = ""; }; additional = ( "-lAdditionalLib" ); linkerPaths = ( "/c/src/vcpkg/installed/x64-windows/lib" ); additionalCFlags = "-DSOME_DEFINE"; } ``` The property list contains the following elements, many of which are fairely self explanitory: * ```target``` = the values of this can be "msvc", "linux", or "msys2" usually this is left blank. It is usually only specified when building on msvc (or VisualStudio) targets since buildtool/xcode can't currently detect if you are using msvc automatically. The need for this parameter might become obsolete. * ```setupScript``` = This is a script which is run before the build is done. In this case it is used to set up a new environment for buildtool/xcode to use to build the application. This is done, for instance, to set up paths for alternate tool chains (Android/VisualStudio/etc). * ```TargetName``` = In our example this is a proxy for whatever target you need to set up specific parameters for. For example if your target is named "Foo" replace "TargetName" with that name. This dictionary can contain all of the same entries as the parent list, but they will only be applied to the given target * ```buildType``` = The values for this are "linear" and "parallel". A linear build builds the files one by one, the parallel mode builds on all available processors unless otherwise specified. * ```cpus``` = This specifies the number of cpus to use in a parallel build. * ```copylibs``` = YES / NO - If YES then the tool will copy shared libraries into the .app folder (presuming you're building an application or other bundle) when the build completes. * ```ignored``` = Ignore a given set (array) of frameworks or libraries when linking. * ```headerPaths``` = An array of additional header paths to add when building. * ```remappedSource ``` = A dictionary of source files to remap. Remapping a file causes the file it is mapped to to build instead. This is useful for GNUstep specific code. * ```skippedTarget``` = An array of targets to skip. * ```linkerPaths``` = An array of additional paths to check when linking. This adds -L directives to the compiler invocation. * ```additionalCFlags``` = A string that contains any additional C flags that need to be added. * ```substitutions``` = An dictionary containing mappings of a library to a given library on your architecture. Mapping a library to "" is equivalent to adding it to the ```ignored``` array. * ```additional``` = An array containing more libraries to be added ### Planned for the future: * For ```buildType``` the value distributed will be used to send files to build "servers" to help speed up the build. In this case the ```cpus``` setting will be used to determine the number of servers to use. ### Also planned: Work on the YCode application is planned in the near future. Currently it is a stub, but it should start seeing serious development in 2023. ### Maintainer The maintainer of this package is Gregory John Casamento ### How to contribute You can submit patches on the github page. I usually respond quickly to updates and changes. Report any bugs there as well. libs-xcode-XCode-0_5_0/Documentation/buildtool.1000066400000000000000000000043331475431643200216130ustar00rootroot00000000000000.\"buildtool(1) man page .\"put together by Gregory Casamento .\"Copyright (C) 2005 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii buildtool.1 .\" .TH BUILDTOOL 1 "June 2024" GNUstep "GNUstep System Manual" .SH NAME buildtool \- build macOS projects that use xcode .SH SYNOPSIS .B buildtool .RB [clean | generate .RB [makefile|cmake|projectbuilder|projectcenter] .RB | build] .RB [filename] .P .SH DESCRIPTION The .B buildtool command allows you to build a project that was originally created with Xcode on macOS. .PP You can specify the project name if you need to (for example, if there are several .xcodeproj files in one directory) if you don't it will use the first one it finds and build with that. .I filenames The filename for the .xcodeproj is assumed to be in the current working directory. .PP By default, .B buildtool will open .I filename in the current working directory or, if no filename is specified, will build using the first one it finds. .PP .SH OPTIONS .IP "build" build the .xcodeproj file in the current directory .I filename if optionally specified .IP "clean" clean the current project directory .IP "generate" generate one of the following... cmake, makefile, projectbuilder, projectcenter types of files. if none is specified it will assume you are trying to generate a makefile. .PP .SH EXAMPLES Build the project in the current working directory .PP .I buildtool .PP .I buildtool build .PP .I buildtool build .B filename.xcodeproj .PP To clean the project directory .PP .I buildtool clean .PP To generate a gnumakefile, cmake, etc... .PP .I buildtool generate .PP You can optionally use any of the types mentioned above after the generate option. .SH BUGS .B buildtool can currently open most project types. If you find any that it can't handle or get any build errors that are specific to buildtool, then please submit bugs to the tracker on github for libs-xcode. .P .SH HISTORY .B buildtool was written in September of 2012 and is regularly updated. .P This manual page was first written in June 2023 .P .SH AUTHORS .B buildtool was written by Gregory Casamento . .P This man page was written by Gregory Casamento libs-xcode-XCode-0_5_0/Extensions/000077500000000000000000000000001475431643200170575ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Extensions/README.md000066400000000000000000000000651475431643200203370ustar00rootroot00000000000000# Extensions Future place for any VSCode extensions.libs-xcode-XCode-0_5_0/GNUmakefile000066400000000000000000000011101475431643200167630ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Aggregate # VERSION = 0.5.0 PACKAGE_NAME = XCode # Generator bundles SUBPROJECTS = \ XCode \ Generators \ Tools \ Applications \ Documentation # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Generators/000077500000000000000000000000001475431643200170315ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Generators/CMake/000077500000000000000000000000001475431643200200115ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Generators/CMake/GNUmakefile000066400000000000000000000007241475431643200220660ustar00rootroot00000000000000# Makefile for GNUmakefile generation include $(GNUSTEP_MAKEFILES)/common.make ADDITIONAL_INCLUDE_DIRS += -I../.. BUNDLE_NAME = cmake BUNDLE_EXTENSION = .generator cmake_PRINCIPAL_CLASS = GSXCCMakeGenerator cmake_HAS_RESOURCE_BUNDLE = yes cmake_OBJC_FILES = GSXCCMakeGenerator.m cmake_RESOURCE_FILES = cmake_STANDARD_INSTALL = yes -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Generators/CMake/GNUmakefile.preamble000066400000000000000000000005721475431643200236550ustar00rootroot00000000000000# Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../XCode ifeq ($(GNUSTEP_TARGET_OS),mingw32) ADDITIONAL_LIB_DIRS += \ -L../../XCode/XCode.framework ADDITIONAL_GUI_LIBS += -lXCode endif ifeq ($(GNUSTEP_TARGET_OS),windows) ADDITIONAL_LIB_DIRS += \ -L../../XCode/XCode.framework \ ADDITIONAL_GUI_LIBS += -lXCode endiflibs-xcode-XCode-0_5_0/Generators/CMake/GSXCCMakeGenerator.h000066400000000000000000000002261475431643200234760ustar00rootroot00000000000000#import "GSXCGenerator.h" @interface GSXCCMakeGenerator : GSXCGenerator { NSString *_projectType; NSString *_projectName; BOOL _append; } @end libs-xcode-XCode-0_5_0/Generators/CMake/GSXCCMakeGenerator.m000066400000000000000000000362641475431643200235160ustar00rootroot00000000000000// Released under the terms of LGPL 2.1, Please see COPYING.LIB #import "GSXCCMakeGenerator.h" #import "PBXNativeTarget.h" #import "XCConfigurationList.h" #import "PBXBuildFile.h" #import "PBXFileReference.h" #import "NSString+PBXAdditions.h" @interface GSXCCMakeGenerator (Private) - (void) createInfoPlist; @end @implementation GSXCCMakeGenerator - (instancetype) init { self = [super init]; if (self != nil) { _append = NO; _projectName = nil; _projectType = nil; } return self; } - (NSString *) cmakePreamble { NSString *output = @""; NSString *header = [NSString stringWithFormat: @"## CMake Generated by buildtool - %@\n\n", _projectName]; NSString *project = [NSString stringWithFormat: @"project(%@ C CXX)\n", _projectName]; NSString *ccompiler = [NSString stringForCommand: @"gnustep-config --variable=CC"]; NSString *cxxcompiler = [NSString stringForCommand: @"gnustep-config --variable=CXX"]; output = [output stringByAppendingString: header]; output = [output stringByAppendingString: @"## Begin header\n"]; output = [output stringByAppendingString: @"cmake_minimum_required(VERSION 3.13)\n"]; output = [output stringByAppendingString: @"set(CMAKE_EXPORT_COMPILE_COMMANDS ON)\n"]; output = [output stringByAppendingString: @"if (EXISTS CMake/common.cmake)\n include(CMake/common.cmake)\nendif()\n"]; output = [output stringByAppendingString: @"set(CMAKE_CXX_STANDARD 11)\n"]; output = [output stringByAppendingString: [NSString stringWithFormat: @"set(CMAKE_C_COMPILER \"%@\")\n", ccompiler]]; // These should be set dynamically... output = [output stringByAppendingString: [NSString stringWithFormat: @"set(CMAKE_CXX_COMPILER \"%@\")\n", cxxcompiler]]; // So should this one... output = [output stringByAppendingString: project]; output = [output stringByAppendingString: @"set(BUILD_FOLDER_NAME \"build\")\n"]; output = [output stringByAppendingString: @"set(CMAKE_SOURCE_DIR \".\")\n\n"]; return output; } - (NSString *) cmakeSourceFiles: (NSArray *)array { NSString *output = @""; NSEnumerator *en = [array objectEnumerator]; NSString *file = nil; if ([array count] > 0) { output = [output stringByAppendingString: @"# Begin sources\n"]; if (_append == NO) { output = [output stringByAppendingString: @"set (SOURCES\n"]; _append = YES; } else { output = [output stringByAppendingString: @"list (APPEND SOURCES\n"]; } } while((file = [en nextObject]) != nil) { output = [output stringByAppendingString: [NSString stringWithFormat: @" ${CMAKE_SOURCE_DIR}/%@\n", file]]; } if ([array count] > 0) { output = [output stringByAppendingString: @")\n\n"]; output = [output stringByAppendingString: @"if (EXISTS CMake/sources.cmake)\n include(CMake/sources.cmake)\nendif()\n\n"]; } return output; } - (NSString *) cmakeHeaderFiles: (NSArray *)array { NSString *output = @""; NSEnumerator *en = [array objectEnumerator]; id file = nil; if ([array count] > 0) { output = [output stringByAppendingString: @"# Begin headers\n"]; output = [output stringByAppendingString: @"set (HEADERS\n"]; } while((file = [en nextObject]) != nil) { if ([file isKindOfClass: [PBXBuildFile class]]) { output = [output stringByAppendingString: [NSString stringWithFormat: @" ${CMAKE_SOURCE_DIR}/%@\n", [file buildPath]]]; } else if ([file isKindOfClass: [NSString class]]) { output = [output stringByAppendingString: [NSString stringWithFormat: @" ${CMAKE_SOURCE_DIR}/%@\n", file]]; } } if ([array count] > 0) { output = [output stringByAppendingString: @")\n\n"]; if ([_projectType isEqualToString: @"library"]) { } else if ([_projectType isEqualToString: @"framework"]) { output = [output stringByAppendingString: [NSString stringWithFormat: @"file(COPY ${HEADERS} DESTINATION \"%@.framework/Headers\")\n", _projectName]]; } output = [output stringByAppendingString: @"if (EXISTS CMake/headers.cmake)\n include(CMake/headers.cmake)\nendif()\n\n"]; } return output; } - (NSString *) cmakeLibraryFiles: (NSArray *)array { NSString *output = @""; if ([_projectType isEqualToString: @"application"]) { } else if ([_projectType isEqualToString: @"bundle"]) { } else if ([_projectType isEqualToString: @"library"]) { } else if ([_projectType isEqualToString: @"tool"]) { } return output; } - (NSString *) cmakeResourceFiles: (NSArray *)array { NSString *output = @""; NSString *file = nil; if ([_projectType isEqualToString: @"tool"] || array == nil || [array count] == 0) { return @""; } // handle info plist file... NSMutableArray *resources = [NSMutableArray arrayWithArray: array]; NSString *infoPlistName = [NSString stringWithFormat: @"%@Info.plist", _projectName]; NSEnumerator *en = [resources objectEnumerator]; [resources removeObject: infoPlistName]; // remove the plist if it exists... [resources addObject: @"Info-gnustep.plist"]; [self createInfoPlist]; if ([array count] > 0) { output = [output stringByAppendingString: @"# Begin resources\n"]; output = [output stringByAppendingString: @"set (GLOBAL_RESOURCES\n"]; } while((file = [en nextObject]) != nil) { output = [output stringByAppendingString: [NSString stringWithFormat: @" ${CMAKE_SOURCE_DIR}/%@\n", file]]; } if ([array count] > 0) { output = [output stringByAppendingString: @")\n\n"]; output = [output stringByAppendingString: @"if (EXISTS CMake/resources.cmake)\n include(CMake/resources.cmake)\nendif()\n\n"]; } return output; } - (NSString *) cmakeDeclareProject { NSString *output = @"# Copy resources\n"; if ([_projectType isEqualToString: @"application"]) { output = [output stringByAppendingString: [NSString stringWithFormat: @"set_target_properties(%@ PROPERTIES RUNTIME_OUTPUT_DIRECTORY \"%@.app\")\n", _projectName, _projectName]]; output = [output stringByAppendingString: [NSString stringWithFormat: @"file(COPY ${GLOBAL_RESOURCES} DESTINATION \"%@.app/Resources\")\n", _projectName]]; } else if ([_projectType isEqualToString: @"bundle"]) { NSString *bundleName = @"bundle"; // this should be set by a variable/setting. output = [output stringByAppendingString: [NSString stringWithFormat: @"set_target_properties(%@ PROPERTIES RUNTIME_OUTPUT_DIRECTORY \"%@.%@\")\n", _projectName, _projectName, bundleName]]; output = [output stringByAppendingString: [NSString stringWithFormat: @"file(COPY ${GLOBAL_RESOURCES} DESTINATION \"%@.%@/Resources\")\n", _projectName, bundleName]]; } else if ([_projectType isEqualToString: @"framework"]) { output = [output stringByAppendingString: [NSString stringWithFormat: @"set_target_properties(%@ PROPERTIES RUNTIME_OUTPUT_DIRECTORY \"%@.framework\")\n", _projectName, _projectName]]; output = [output stringByAppendingString: [NSString stringWithFormat: @"file(COPY ${GLOBAL_RESOURCES} DESTINATION \"%@.framework/Resources\")\n", _projectName]]; } else // if ([_projectType isEqualToString: @"tool"]) // ([_projectType isEqualToString: @"library"]) { output = [output stringByAppendingString: [NSString stringWithFormat: @"set_target_properties(%@ PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)\n", _projectName]]; } return output; } - (NSString *) cmakeIncludeDirList: (NSArray *)includeArray { NSString *output = [NSString stringWithFormat: @"# Include directories\ntarget_include_directories(%@ PRIVATE\n", _projectName]; NSEnumerator *en = [includeArray objectEnumerator]; NSString *includeDir = nil; while ((includeDir = [en nextObject]) != nil) { output = [output stringByAppendingString: [NSString stringWithFormat: @" %@\n", includeDir]]; } // Add canonical directories... NSString *localIncludes = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_HEADERS"]; output = [output stringByAppendingString: [NSString stringWithFormat: @" %@\n", localIncludes]]; NSString *systemIncludes = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_SYSTEM_HEADERS"]; output = [output stringByAppendingString: [NSString stringWithFormat: @" %@\n", systemIncludes]]; // Close declaration... output = [output stringByAppendingString: @")\n\n"]; output = [output stringByAppendingString: @"if (EXISTS CMake/include.cmake)\n include(CMake/include.cmake)\nendif()\n\n"]; return output; } - (NSString *) cmakeTargetCompileOptions { NSString *output = [NSString stringWithFormat: @"# Compile options\n" @"target_compile_options(%@ PRIVATE ", _projectName]; NSString *command = [NSString stringForCommand: @"gnustep-config --objc-flags"]; output = [output stringByAppendingString: command]; output = [output stringByAppendingString: @")\n\n"]; return output; } - (NSString *) cmakeTargetLinkOptions { NSString *output = [NSString stringWithFormat: @"# Link options\n" @"target_link_options(%@ PRIVATE ", _projectName]; NSString *command = nil; if ([_projectType isEqualToString: @"application"]) { command = [NSString stringForCommand: @"gnustep-config --gui-libs"]; } else if ([_projectType isEqualToString: @"bundle"]) { command = [NSString stringForCommand: @"gnustep-config --base-libs"]; } else if ([_projectType isEqualToString: @"library"]) { command = [NSString stringForCommand: @"gnustep-config --base-libs"]; } else if ([_projectType isEqualToString: @"framework"]) { command = [NSString stringForCommand: @"gnustep-config --base-libs"]; } else // tool { command = [NSString stringForCommand: @"gnustep-config --base-libs"]; } output = [output stringByAppendingString: command]; output = [output stringByAppendingString: @")\n\n"]; output = [output stringByAppendingString: @"if (EXISTS CMake/link.cmake)\n include(CMake/link.cmake)\nendif()\n\n"]; return output; } - (NSString *) cmakeDeclareTarget { NSString *output = @""; output = [output stringByAppendingString: [NSString stringWithFormat: @"# Declare target\n" @"add_executable(\n" @" %@\n" @" ${SOURCES}\n" @")\n\n", _projectName]]; return output; } // TODO: Need to find a way to make this a common function.... - (BOOL) processInfoPlistInput: (NSString *)inputFileName output: (NSString *)outputFileName { if (inputFileName != nil) { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *settings = [context objectForKey: @"PRODUCT_SETTINGS_XML"]; if(settings == nil) { NSString *inputFileString = [NSString stringWithContentsOfFile: inputFileName]; NSString *outputFileString = [inputFileString stringByReplacingEnvironmentVariablesWithValues]; NSMutableDictionary *plistDict = [NSMutableDictionary dictionaryWithDictionary: [outputFileString propertyList]]; // NSString *filename = [self processAssets]; /* if (filename != nil) { [plistDict setObject: filename forKey: @"NSIcon"]; } */ [plistDict writeToFile: outputFileName atomically: YES]; NSDebugLog(@"%@", plistDict); } else { [settings writeToFile: outputFileName atomically: YES encoding: NSUTF8StringEncoding error: NULL]; } } else { NSArray *keys = [NSArray arrayWithObjects: @"NSPrincipalClass", @"NSMainNibFile", nil]; NSArray *objs = [NSArray arrayWithObjects: @"NSApplication", @"MainMenu", nil]; NSDictionary *ipl = [NSDictionary dictionaryWithObjects: objs forKeys: keys]; [ipl writeToFile: outputFileName atomically: YES]; } return YES; } - (void) createInfoPlist { if ([_projectType isEqualToString: @"tool"]) { return; } NSString *inputFileName = [NSString stringWithFormat: @"%@Info.plist", _projectName]; [self processInfoPlistInput: inputFileName output: @"Info-gnustep.plist"]; } - (BOOL) generate { BOOL result = YES; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *projectType = [context objectForKey: @"PROJECT_TYPE"]; NSString *name = [_target name]; NSString *projName = [name stringByDeletingPathExtension]; NSString *outputName = @"CMakeLists.txt"; NSString *outputString = @""; // Assign to ivars... ASSIGN(_projectType, projectType); ASSIGN(_projectName, projName); // Construct the makefile out of the data we have thusfar collected. xcputs("\t* Generating CMakeLists.txt..."); // Sometimes the build will generate all of the target makefiles in one place, // depending on the version of Xcode the project was created with. if([[NSFileManager defaultManager] fileExistsAtPath: @"CMakeLists.txt"]) { // if it collides with the existing name, add the target name... outputName = [outputName stringByAppendingString: [NSString stringWithFormat: @"_%@.txt", _projectName]]; } // Initial setup... outputString = [self cmakePreamble]; // Add sources... outputString = [outputString stringByAppendingString: [self cmakeSourceFiles: [context objectForKey: @"OBJC_FILES"]]]; outputString = [outputString stringByAppendingString: [self cmakeSourceFiles: [context objectForKey: @"C_FILES"]]]; outputString = [outputString stringByAppendingString: [self cmakeSourceFiles: [context objectForKey: @"CPP_FILES"]]]; outputString = [outputString stringByAppendingString: [self cmakeSourceFiles: [context objectForKey: @"OBJCPP_FILES"]]]; // Declare target outputString = [outputString stringByAppendingString: [self cmakeDeclareTarget]]; // Headers outputString = [outputString stringByAppendingString: [self cmakeHeaderFiles: [context objectForKey: @"HEADERS"]]]; outputString = [outputString stringByAppendingString: [self cmakeLibraryFiles: [context objectForKey: @"ADDITIONAL_OBJC_LIBS"]]]; // Include dirs outputString = [outputString stringByAppendingString: [self cmakeIncludeDirList: nil]]; // Resources outputString = [outputString stringByAppendingString: [self cmakeResourceFiles: [context objectForKey: @"RESOURCES"]]]; // Compile options... outputString = [outputString stringByAppendingString: [self cmakeTargetCompileOptions]]; // Link options... outputString = [outputString stringByAppendingString: [self cmakeTargetLinkOptions]]; // Handle project type... this builds the directory structure needed for a given type. outputString = [outputString stringByAppendingString: [self cmakeDeclareProject]]; NSDebugLog(@"output = %@", outputString); [outputString writeToFile: outputName atomically: YES]; xcputs([[NSString stringWithFormat: @"=== Completed generation for target %@", name] cString]); return result; } @end libs-xcode-XCode-0_5_0/Generators/GNUmakefile000066400000000000000000000010131475431643200210760ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # Generator bundles SUBPROJECTS = \ Makefile \ CMake \ ProjectCenter \ ProjectBuilder \ # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Generators/Makefile/000077500000000000000000000000001475431643200205465ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Generators/Makefile/GNUmakefile000066400000000000000000000007541475431643200226260ustar00rootroot00000000000000# Makefile for GNUmakefile generation include $(GNUSTEP_MAKEFILES)/common.make ADDITIONAL_INCLUDE_DIRS += -I../.. BUNDLE_NAME = makefile BUNDLE_EXTENSION = .generator makefile_PRINCIPAL_CLASS = GSXCMakefileGenerator makefile_HAS_RESOURCE_BUNDLE = yes makefile_OBJC_FILES = GSXCMakefileGenerator.m makefile_RESOURCE_FILES = makefile_STANDARD_INSTALL = yes -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Generators/Makefile/GNUmakefile.preamble000066400000000000000000000005721475431643200244120ustar00rootroot00000000000000# Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../XCode ifeq ($(GNUSTEP_TARGET_OS),mingw32) ADDITIONAL_LIB_DIRS += \ -L../../XCode/XCode.framework ADDITIONAL_GUI_LIBS += -lXCode endif ifeq ($(GNUSTEP_TARGET_OS),windows) ADDITIONAL_LIB_DIRS += \ -L../../XCode/XCode.framework \ ADDITIONAL_GUI_LIBS += -lXCode endiflibs-xcode-XCode-0_5_0/Generators/Makefile/GSXCMakefileGenerator.h000066400000000000000000000001211475431643200247620ustar00rootroot00000000000000#import "GSXCGenerator.h" @interface GSXCMakefileGenerator : GSXCGenerator @end libs-xcode-XCode-0_5_0/Generators/Makefile/GSXCMakefileGenerator.m000066400000000000000000000124431475431643200250010ustar00rootroot00000000000000// Released under the terms of LGPL 2.1, Please see COPYING.LIB #import "GSXCMakefileGenerator.h" #import "PBXNativeTarget.h" #import "XCConfigurationList.h" #import "PBXBuildFile.h" #import "PBXFileReference.h" #import "NSArray+Additions.h" @implementation GSXCMakefileGenerator - (NSString *) projectTypeForString: (NSString *)type { if ([type isEqualToString: @"APPLICATION"]) { return @"APP"; } return type; } - (id) objectForString: (NSString *)o { return o != nil ? o : @""; } - (BOOL) generate { BOOL result = YES; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *name = [_target name]; NSString *appName = [name stringByDeletingPathExtension]; NSString *makefileName = @"GNUmakefile"; NSString *makefileString = @""; NSString *headerFilesString = [[context objectForKey: @"HEADERS"] arrayToList]; NSString *objCFilesString = [[context objectForKey: @"OBJC_FILES"] arrayToList]; NSString *cFilesString = [[context objectForKey: @"C_FILES"] arrayToList]; NSString *cppFilesString = [[context objectForKey: @"CPP_FILES"] arrayToList]; NSString *objCPPFilesString = [[context objectForKey: @"OBJCPP_FILES"] arrayToList]; NSString *resourceFilesString = [[context objectForKey: @"RESOURCES"] arrayToList]; NSString *additionalIncludes = [[context objectForKey: @"ADDITIONAL_INCLUDE_DIRS"] arrayToIncludeList]; NSString *additionalOCflags = [[context objectForKey: @"ADDITIONAL_OBJC_LIBS"] arrayToLinkList]; NSString *projectType = [context objectForKey: @"PROJECT_TYPE"]; // Construct the makefile out of the data we have thusfar collected. xcputs("\t* Generating GNUmakefile"); // Sometimes the build will generate all of the target makefiles in one place, depending on the version of // Xcode the project was created with. if([[NSFileManager defaultManager] fileExistsAtPath: @"GNUmakefile"]) { // if it collides with the existing name, add the target name... makefileName = [makefileName stringByAppendingString: [NSString stringWithFormat: @"_%@", appName]]; } makefileString = [makefileString stringByAppendingString: @"#\n"]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"# GNUmakefile for target %@\n", name]]; makefileString = [makefileString stringByAppendingString: @"# begin - generated by buildtool, please don't modify\n"]; makefileString = [makefileString stringByAppendingString: @"#\n\n"]; makefileString = [makefileString stringByAppendingString: @"include $(GNUSTEP_MAKEFILES)/common.make\n\n"]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_NAME = %@\n\n", [self projectTypeForString: [projectType uppercaseString]], appName]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_OBJC_FILES = %@\n\n", appName, [self objectForString: objCFilesString]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_C_FILES = %@\n\n", appName, [self objectForString: cFilesString]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_CPP_FILES = %@\n\n", appName, [self objectForString: cppFilesString]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_OBJCPP_FILES = %@\n\n", appName, [self objectForString: objCPPFilesString]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_HEADER_FILES = %@\n\n", appName, [self objectForString: headerFilesString]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"%@_RESOURCE_FILES = %@\n\n", appName, [self objectForString: resourceFilesString]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"ADDITIONAL_INCLUDE_DIRS += %@\n\n", [self objectForString: additionalIncludes]]]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"ADDITIONAL_OBJC_LIBS += %@\n\n", [self objectForString: additionalOCflags]]]; makefileString = [makefileString stringByAppendingString: @"-include GNUmakefile.preamble\n"]; makefileString = [makefileString stringByAppendingString: @"include $(GNUSTEP_MAKEFILES)/common.make\n"]; makefileString = [makefileString stringByAppendingString: [NSString stringWithFormat: @"include $(GNUSTEP_MAKEFILES)/%@.make\n", projectType]]; makefileString = [makefileString stringByAppendingString: @"-include GNUmakefile.postamble\n\n"]; makefileString = [makefileString stringByAppendingString: @"#\n"]; makefileString = [makefileString stringByAppendingString: @"# end - generated makefile\n"]; makefileString = [makefileString stringByAppendingString: @"#\n"]; NSDebugLog(@"makefile = %@", makefileString); [makefileString writeToFile: makefileName atomically: YES]; xcputs([[NSString stringWithFormat: @"=== Completed generation of %@ for target %@", makefileName, name] cString]); return result; } @end libs-xcode-XCode-0_5_0/Generators/ProjectBuilder/000077500000000000000000000000001475431643200217465ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Generators/ProjectBuilder/GNUmakefile000066400000000000000000000007431475431643200240240ustar00rootroot00000000000000# Makefile for GNUmakefile generation include $(GNUSTEP_MAKEFILES)/common.make ADDITIONAL_INCLUDE_DIRS += -I../.. BUNDLE_NAME = ProjectBuilder BUNDLE_EXTENSION = .generator ProjectBuilder_PRINCIPAL_CLASS = ProjectBuilder_HAS_RESOURCE_BUNDLE = yes ProjectBuilder_OBJC_FILES = ProjectBuilder_RESOURCE_FILES = ProjectBuilder_STANDARD_INSTALL = yes -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Generators/ProjectCenter/000077500000000000000000000000001475431643200216005ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Generators/ProjectCenter/GNUmakefile000066400000000000000000000007351475431643200236570ustar00rootroot00000000000000# Makefile for GNUmakefile generation include $(GNUSTEP_MAKEFILES)/common.make ADDITIONAL_INCLUDE_DIRS += -I../.. BUNDLE_NAME = ProjectCenter BUNDLE_EXTENSION = .generator ProjectCenter_PRINCIPAL_CLASS = ProjectCenter_HAS_RESOURCE_BUNDLE = yes ProjectCenter_OBJC_FILES = ProjectCenter_RESOURCE_FILES = ProjectCenter_STANDARD_INSTALL = yes -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/README.md000066400000000000000000000050441475431643200162020ustar00rootroot00000000000000# libs-xcode [![CI](https://github.com/gnustep/apps-gorm/actions/workflows/main.yml/badge.svg)](https://github.com/gnustep/apps-gorm/actions/workflows/main.yml?query=branch%3Amaster) 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. 1.2 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. 1.2.1 Plans for the future ========================== * Create delegate which will provide a way for the library to execute callbacks into the caller so that information can be shown. This should eliminate the need to print anything in the library as all of the printing will be done on the front end based on information sent back by the library to the delegate. * Add more options to how the build is run so that the caller can specify which target should be built. * Add support for translated to .pcproj files. 1.2.2 Documentation =================== I am working on a manual as well as gsdocs for the code so that the library is properly documented. There is a manual for buildtool.plist settings and other information in the Documentation directory of this project. 1.3 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 . 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. libs-xcode-XCode-0_5_0/Tools/000077500000000000000000000000001475431643200160205ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/GNUmakefile000066400000000000000000000010411475431643200200660ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Aggregate # VERSION = 0.3.0 PACKAGE_NAME = XCode_Tools # Tools SUBPROJECTS = \ buildtool \ pcpg \ pc2xc \ # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Tools/buildtool/000077500000000000000000000000001475431643200200155ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/buildtool/ArgPair.h000066400000000000000000000023511475431643200215140ustar00rootroot00000000000000/* ArgPair.h * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #ifndef INCLUDE_ArgPair_H #define INCLUDE_ArgPair_H #import @class NSString; @interface ArgPair : NSObject { NSString *_argument; NSString *_value; } - (void) setArgument: (NSString *)arg; - (NSString *) argument; - (void) setValue: (NSString *)val; - (NSString *) value; @end #endif // INCLUDE_ArgPair_H libs-xcode-XCode-0_5_0/Tools/buildtool/ArgPair.m000066400000000000000000000030711475431643200215210ustar00rootroot00000000000000/* AppDelegate.m * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import #import "ArgPair.h" @implementation ArgPair - (id) init { self = [super init]; if (self != nil) { _argument = nil; _value = nil; } return self; } - (void) dealloc { RELEASE(_argument); RELEASE(_value); [super dealloc]; } - (void) setArgument: (NSString *)arg { ASSIGN(_argument, arg); } - (NSString *) argument { return _argument; } - (void) setValue: (NSString *)val { ASSIGN(_value, val); } - (NSString *) value { return _value; } - (id) copyWithZone: (NSZone *)z { id obj = [[[self class] allocWithZone: z] init]; [obj setArgument: _argument]; [obj setValue: _value]; return obj; } @end libs-xcode-XCode-0_5_0/Tools/buildtool/ChangeLog000066400000000000000000000011341475431643200215660ustar00rootroot000000000000002013-05-12 23:36-EDT Gregory John Casamento * main.m: Do not use hidden version of xcodeproj file. 2013-04-24 13:42-EDT Gregory John Casamento * main.m: Fix error detecting the xcodeproj file. 2013-04-24 02:38-EDT Gregory John Casamento * main.m: Handle command if it is either the first or second argument depending on whether we can locate the project file. 2012-10-15 13:40-EDT Gregory John Casamento * main.m: Changes to automatically detect and build the correct project file. libs-xcode-XCode-0_5_0/Tools/buildtool/GNUmakefile000066400000000000000000000023301475431643200220650ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) ifeq ($(GNUSTEP_MAKEFILES),) $(warning ) $(warning Unable to obtain GNUSTEP_MAKEFILES setting from gnustep-config!) $(warning Perhaps gnustep-make is not properly installed,) $(warning so gnustep-config is not in your PATH.) $(warning ) $(warning Your PATH is currently $(PATH)) $(warning ) endif endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Tool # VERSION = 0.1 PACKAGE_NAME = buildtool TOOL_NAME = buildtool buildtool_TOOL_ICON = # # Libraries # buildtool_LIBRARIES_DEPEND_UPON += -lXCode # # Resource files # buildtool_RESOURCE_FILES = \ Resources/Version \ # # Header files # buildtool_HEADER_FILES = \ ArgPair.h \ ToolDelegate.h # # Objective-C Class files # buildtool_OBJC_FILES = \ ArgPair.m \ ToolDelegate.m # # Other sources # buildtool_OBJC_FILES += \ main.m # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Tools/buildtool/GNUmakefile.postamble000066400000000000000000000012441475431643200240550ustar00rootroot00000000000000# # GNUmakefile.postamble - Generated by ProjectCenter # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: libs-xcode-XCode-0_5_0/Tools/buildtool/GNUmakefile.preamble000066400000000000000000000012171475431643200236560ustar00rootroot00000000000000# # GNUmakefile.preamble - Generated by ProjectCenter # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to Objective C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to C compiler ADDITIONAL_CFLAGS += # Additional flags to pass to the linker ADDITIONAL_LDFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../ # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L/usr/GNUstep/System/Library/Libraries -L../../XCode/XCode.framework # Additional TOOL libraries to link ADDITIONAL_TOOL_LIBS += -lXCode libs-xcode-XCode-0_5_0/Tools/buildtool/README.md000066400000000000000000000026451475431643200213030ustar00rootroot00000000000000buildtool -- The purpose of this tool is to duplicate the functionality of xcodebuild. The associated library for this tool is libs-xcode. This library provides the means of parsing and "executing" the build. This tool is a simple front-end to the XCode library. It provides the user with a simple interface with which to build xcode projects. How to use it: ---- 1) Go into an Xcode project directory. 2) type "buildtool" * by default, buildtool executes its 'build' sub-command that builds the Xcode project using the build phases and settings defined there 3) buildtool will create a build directory with the following structure: * ```build/$(TARGET_NAME)/Products/$(PRODUCT_NAME).app``` The tool will copy all the resources into the directory for the application. The above is simply an example, you can build any kind of target based on the frameworks we have. Other sub-commands for buildtool include: * generate - the purpose of generate is to translate the Xcode project file into a GNUmakefile * clean - this cleans the build directory XCode ---- This library is what makes the above command work.  I separated it out into a lib so that it could easily be leveraged by applications that might want to use it to build targets and also to get information about xcode projects. Please enjoy using and testing these as I have enjoyed creating them. Please do not hesistate to report bugs in their respective repos. libs-xcode-XCode-0_5_0/Tools/buildtool/Resources/000077500000000000000000000000001475431643200217675ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/buildtool/Resources/.gitignore000066400000000000000000000000001475431643200237450ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/buildtool/ToolDelegate.h000066400000000000000000000024711475431643200225420ustar00rootroot00000000000000/* ToolDelegate.m * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import #import @class NSDictionary; @class NSMutableArray; @class NSSet; NSString *findProjectFilename(NSArray *projectDirEntries); NSString *findWorkspaceFilename(NSArray *projectDirEntries); NSString *resolveProjectName(BOOL *isProject); @interface ToolDelegate : XCAbstractDelegate // Handling arguments - (NSDictionary *) parseArguments; - (void) process; @end libs-xcode-XCode-0_5_0/Tools/buildtool/ToolDelegate.m000066400000000000000000000202761475431643200225520ustar00rootroot00000000000000/* ToolDelegate.m * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import #import #import #import #import #import #import "ToolDelegate.h" #import "ArgPair.h" NSString *findProjectFilename(NSArray *projectDirEntries) { NSEnumerator *e = [projectDirEntries objectEnumerator]; NSString *fileName; while ((fileName = [e nextObject])) { NSRange range = [fileName rangeOfString:@"._"]; if ([[fileName pathExtension] isEqual: @"xcodeproj"] && range.location == NSNotFound) { return [fileName stringByAppendingPathComponent: @"project.pbxproj"]; } } return nil; } NSString *findWorkspaceFilename(NSArray *projectDirEntries) { NSEnumerator *e = [projectDirEntries objectEnumerator]; NSString *fileName; while ((fileName = [e nextObject])) { NSRange range = [fileName rangeOfString:@"._"]; if ([[fileName pathExtension] isEqual: @"xcworkspace"] && range.location == NSNotFound) { return [fileName stringByAppendingPathComponent: @"contents.xcworkspacedata"]; } } return nil; } NSString *resolveProjectName(BOOL *isProject) { NSString *fileName = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *projectDir = [fileManager currentDirectoryPath]; NSArray *projectDirEntries = [fileManager directoryContentsAtPath: projectDir]; fileName = findWorkspaceFilename(projectDirEntries); if (fileName != nil) { *isProject = NO; } else { *isProject = YES; fileName = findProjectFilename(projectDirEntries); } return fileName; } // ToolDelegate... @implementation ToolDelegate - (NSDictionary *) parseArguments { NSMutableDictionary *result = [NSMutableDictionary dictionary]; NSProcessInfo *pi = [NSProcessInfo processInfo]; NSMutableArray *args = [NSMutableArray arrayWithArray: [pi arguments]]; NSEnumerator *en = [args objectEnumerator]; id obj = nil; BOOL parse_val = NO; ArgPair *pair = AUTORELEASE([[ArgPair alloc] init]); while ((obj = [en nextObject]) != nil) { if (parse_val) { [pair setValue: obj]; [result setObject: pair forKey: [pair argument]]; parse_val = NO; continue; } else { pair = AUTORELEASE([[ArgPair alloc] init]); if ([obj isEqualToString: @"-project"]) { [pair setArgument: obj]; parse_val = YES; } if ([obj isEqualToString: @"-target"]) { [pair setArgument: obj]; parse_val = YES; } if ([obj isEqualToString: @"-write"]) { [pair setArgument: obj]; parse_val = YES; } if ([obj isEqualToString: @"-license"]) { [pair setArgument: obj]; parse_val = NO; } if ([obj isEqualToString: @"build"]) { [pair setArgument: obj]; parse_val = NO; } if ([obj isEqualToString: @"install"]) { [pair setArgument: obj]; parse_val = NO; } if ([obj isEqualToString: @"clean"]) { [pair setArgument: obj]; parse_val = NO; } if ([obj isEqualToString: @"generate"]) { [pair setArgument: obj]; parse_val = YES; } if ([obj isEqualToString: @"link"]) { [pair setArgument: obj]; parse_val = NO; } if ([obj isEqualToString: @"save"]) { [pair setArgument: obj]; parse_val = YES; } // If there is no parameter for the argument, set it anyway... if (parse_val == NO) { [result setObject: pair forKey: obj]; } } } if (parse_val == YES) { [self postMessage: @"# Parameter is mandatory, non specified."]; return nil; // exit if no parameter... } return result; } - (void) process { NSString *file = nil; NSString *fileName = nil; NSDictionary *args = [self parseArguments]; ArgPair *opt = nil; BOOL isProject = NO; NSString *parameter = nil; // @"cmake"; // NSLog(@"args = %@", args); // NSLog(@"file = %@", file); // Get the file to write out to... NSString *outputFile = nil; if (args == nil) { return; } opt = [args objectForKey: @"-project"]; if (opt != nil) { file = [opt value]; } if (file != nil) { NSString *ext = [file pathExtension]; if ([ext isEqualToString: @"xcworkspace"]) { isProject = NO; fileName = file; } else if ([ext isEqualToString: @"xcodeproj"]) { isProject = YES; fileName = file; } if (fileName != nil) { fileName = [fileName stringByAppendingPathComponent: @"project.pbxproj"]; } else { fileName = resolveProjectName(&isProject); } } else { fileName = resolveProjectName(&isProject); } // If any of these other options is defined, then don't build because we are transforming data... opt = [args objectForKey: @"-write"]; if (opt != nil) { outputFile = [opt value]; NSLog(@"outputFile = %@", outputFile); } if (opt == nil) { NSString *function = nil; // Get the current function... opt = [args objectForKey: @"build"]; if (opt != nil) { function = @"build"; } opt = [args objectForKey: @"install"]; if (opt != nil) { function = @"install"; } opt = [args objectForKey: @"clean"]; if (opt != nil) { function = @"clean"; } opt = [args objectForKey: @"generate"]; if (opt != nil) { function = @"generate"; ASSIGN(parameter, [opt value]); } opt = [args objectForKey: @"link"]; if (opt != nil) { function = @"link"; } opt = [args objectForKey: @"save"]; if (opt != nil) { function = @"save"; ASSIGN(parameter, [opt value]); } // if no function is specified, build is the default... if (function == nil) { function = @"build"; } // Execute.. if (function != nil) { NS_DURING { NSString *display = [function stringByCapitalizingFirstCharacter]; SEL operation = NSSelectorFromString(function); if (fileName == nil) { fileName = resolveProjectName(&isProject); } if (isProject) { PBXCoder *coder = nil; PBXContainer *container = nil; // Unarchive... coder = [[PBXCoder alloc] initWithContentsOfFile: fileName]; container = [coder unarchive]; [container setParameter: parameter]; [coder setDelegate: self]; // Build... if ([container respondsToSelector: operation]) { // build... [self postMessage: @"\033[1;32m**\033[0m Start operation %@", display]; if ([container performSelector: operation]) { [self postMessage: @"\033[1;32m**\033[0m %@ Succeeded", display]; } else { [self postMessage: @"\033[1;31m**\033[0m %@ Failed", display]; } } else { [self postMessage: @"Unknown build operation \"%@\" for %@", display, container]; } } else { XCWorkspaceParser *p = [XCWorkspaceParser parseWorkspaceFile: fileName]; XCWorkspace *w = [p workspace]; if ([w respondsToSelector: operation]) { [w performSelector: operation]; } } } NS_HANDLER { NSLog(@"%@", localException); } NS_ENDHANDLER; } } } @end libs-xcode-XCode-0_5_0/Tools/buildtool/Version000066400000000000000000000005651475431643200213730ustar00rootroot00000000000000# This file is included in various Makefile's to get version information. # Compatible with Bourne shell syntax, so it can included there too. # The minimum gcc version required to compile the library. GNUSTEP_GCC=4.3.0 # The version number of this release. MAJOR_VERSION=0 MINOR_VERSION=1 SUBMINOR_VERSION=0 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} libs-xcode-XCode-0_5_0/Tools/buildtool/buildtool.pcproj.backup/000077500000000000000000000000001475431643200245525ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/buildtool/buildtool.pcproj.backup/PC.project000066400000000000000000000030361475431643200264460ustar00rootroot00000000000000{ "BUILDER_TARGETS" = ( all, install, uninstall, clean, distclean, dist ); "CLASS_FILES" = ( "ArgPair.m", "ToolDelegate.m" ); COMPILEROPTIONS = ""; CPPOPTIONS = ""; "CREATION_DATE" = "2011-08-20 11:42:51 -0400"; "DOCU_FILES" = ( ); FRAMEWORKS = ( ); "HEADER_FILES" = ( "ArgPair.h", "ToolDelegate.h" ); IMAGES = ( ); INSTALLDIR = "$(HOME)/GNUstep/Tools"; LANGUAGE = English; LIBRARIES = ( "gnustep-base", XCode ); LINKEROPTIONS = ""; "LOCALIZED_RESOURCES" = ( ); MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; "OBJC_COMPILEROPTIONS" = ""; "OTHER_RESOURCES" = ( Version ); "OTHER_SOURCES" = ( "main.m" ); "PROJECT_AUTHORS" = ( ); "PROJECT_COPYRIGHT" = "Copyright (C) 200x"; "PROJECT_COPYRIGHT_DESC" = "Released under ..."; "PROJECT_CREATOR" = "Gregory John Casamento,,,"; "PROJECT_DESCRIPTION" = "No description available!"; "PROJECT_GROUP" = "No group available!"; "PROJECT_MAINTAINER" = "Gregory John Casamento,,,"; "PROJECT_NAME" = buildtool; "PROJECT_RELEASE" = "0.1"; "PROJECT_SUMMARY" = "No summary available!"; "PROJECT_TYPE" = Tool; "PROJECT_URL" = ""; "SEARCH_HEADER_DIRS" = ( ); "SEARCH_LIB_DIRS" = ( "/usr/GNUstep/System/Library/Libraries" ); SUBPROJECTS = ( ); "SUPPORTING_FILES" = ( "GNUmakefile.preamble", GNUmakefile, "GNUmakefile.postamble", "buildtoolInfo.plist" ); TOOLICON = ""; "USER_LANGUAGES" = ( AmericanEnglish, English ); }libs-xcode-XCode-0_5_0/Tools/buildtool/buildtool.pcproj.backup/heron.project000066400000000000000000000003121475431643200272510ustar00rootroot00000000000000{"LAST_EDITING" = "2024-09-10 22:46:35 -0400"; "PC_WINDOWS" = {ProjectBrowser = "{x = 0; y = 0; width = 1430; height = 166}"; ProjectWindow = "979 365 1448 1321 0 0 3840 2160 "; ShowToolbar = YES; }; }libs-xcode-XCode-0_5_0/Tools/buildtool/buildtool.pcproj/000077500000000000000000000000001475431643200233065ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/buildtool/buildtool.pcproj/PC.project000066400000000000000000000030361475431643200252020ustar00rootroot00000000000000{ "BUILDER_TARGETS" = ( all, install, uninstall, clean, distclean, dist ); "CLASS_FILES" = ( "ArgPair.m", "ToolDelegate.m" ); COMPILEROPTIONS = ""; CPPOPTIONS = ""; "CREATION_DATE" = "2011-08-20 11:42:51 -0400"; "DOCU_FILES" = ( ); FRAMEWORKS = ( ); "HEADER_FILES" = ( "ArgPair.h", "ToolDelegate.h" ); IMAGES = ( ); INSTALLDIR = "$(HOME)/GNUstep/Tools"; LANGUAGE = English; LIBRARIES = ( "gnustep-base", XCode ); LINKEROPTIONS = ""; "LOCALIZED_RESOURCES" = ( ); MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; "OBJC_COMPILEROPTIONS" = ""; "OTHER_RESOURCES" = ( Version ); "OTHER_SOURCES" = ( "main.m" ); "PROJECT_AUTHORS" = ( ); "PROJECT_COPYRIGHT" = "Copyright (C) 200x"; "PROJECT_COPYRIGHT_DESC" = "Released under ..."; "PROJECT_CREATOR" = "Gregory John Casamento,,,"; "PROJECT_DESCRIPTION" = "No description available!"; "PROJECT_GROUP" = "No group available!"; "PROJECT_MAINTAINER" = "Gregory John Casamento,,,"; "PROJECT_NAME" = buildtool; "PROJECT_RELEASE" = "0.1"; "PROJECT_SUMMARY" = "No summary available!"; "PROJECT_TYPE" = Tool; "PROJECT_URL" = ""; "SEARCH_HEADER_DIRS" = ( ); "SEARCH_LIB_DIRS" = ( "/usr/GNUstep/System/Library/Libraries" ); SUBPROJECTS = ( ); "SUPPORTING_FILES" = ( "GNUmakefile.preamble", GNUmakefile, "GNUmakefile.postamble", "buildtoolInfo.plist" ); TOOLICON = ""; "USER_LANGUAGES" = ( AmericanEnglish, English ); }libs-xcode-XCode-0_5_0/Tools/buildtool/buildtool.pcproj/heron.project000066400000000000000000000003641475431643200260140ustar00rootroot00000000000000{"LAST_EDITING" = "2024-09-11 06:32:07 -0400"; "PC_WINDOWS" = {ProjectBrowser = "{x = 0; y = 0; width = 1430; height = 166}"; ProjectBuild = "0 0 0 0 0 0 3840 2160 "; ProjectWindow = "979 365 1448 1321 0 0 3840 2160 "; ShowToolbar = YES; }; }libs-xcode-XCode-0_5_0/Tools/buildtool/buildtoolInfo.plist000066400000000000000000000004201475431643200236770ustar00rootroot00000000000000{ "!" = "Generated by ProjectCenter, do not edit"; Copyright = "Copyright (C) 200x"; CopyrightDescription = "Released under ..."; FullVersionID = "0.1"; ToolDescription = "No description available!"; ToolName = buildtool; ToolRelease = "0.1"; }libs-xcode-XCode-0_5_0/Tools/buildtool/main.m000066400000000000000000000027571475431643200211320ustar00rootroot00000000000000/* main.m * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ /* Project: buildtool Author: Gregory John Casamento,,, Created: 2011-08-20 11:42:51 -0400 by heron */ #import #import "ToolDelegate.h" int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; extern char **environ; // Do our stuff... ToolDelegate *delegate = AUTORELEASE([[ToolDelegate alloc] init]); // Initialize process... [NSProcessInfo initializeWithArguments: (char **)argv count: argc environment: environ]; // Process the arguments... [delegate process]; RELEASE(pool); return 0; } libs-xcode-XCode-0_5_0/Tools/pc2xc/000077500000000000000000000000001475431643200170375ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pc2xc/GNUmakefile000066400000000000000000000017521475431643200211160ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) ifeq ($(GNUSTEP_MAKEFILES),) $(warning ) $(warning Unable to obtain GNUSTEP_MAKEFILES setting from gnustep-config!) $(warning Perhaps gnustep-make is not properly installed,) $(warning so gnustep-config is not in your PATH.) $(warning ) $(warning Your PATH is currently $(PATH)) $(warning ) endif endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Tool # VERSION = 0.1 PACKAGE_NAME = pc2xc TOOL_NAME = pc2xc pc2xc_TOOL_ICON = # # Resource files # pc2xc_RESOURCE_FILES = \ Resources/Version \ # # Other sources # pc2xc_OBJC_FILES += \ main.m # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Tools/pc2xc/GNUmakefile.postamble000066400000000000000000000012441475431643200230770ustar00rootroot00000000000000# # GNUmakefile.postamble - Generated by ProjectCenter # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: libs-xcode-XCode-0_5_0/Tools/pc2xc/GNUmakefile.preamble000066400000000000000000000012171475431643200227000ustar00rootroot00000000000000# # GNUmakefile.preamble - Generated by ProjectCenter # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to Objective C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to C compiler ADDITIONAL_CFLAGS += # Additional flags to pass to the linker ADDITIONAL_LDFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../ # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L/usr/GNUstep/System/Library/Libraries -L../../XCode/XCode.framework # Additional TOOL libraries to link ADDITIONAL_TOOL_LIBS += -lXCode libs-xcode-XCode-0_5_0/Tools/pc2xc/main.m000066400000000000000000000233421475431643200201450ustar00rootroot00000000000000/* Project: pc2xc Author: Gregory John Casamento,,, Created: 2023-10-16 23:37:42 -0400 by heron */ #import #import #import NSMutableArray *buildFileReferences(NSArray *allFiles, NSString *ext) { NSMutableArray *result = [NSMutableArray array]; NSEnumerator *en = [allFiles objectEnumerator]; NSString *filename = nil; while ((filename = [en nextObject]) != nil) { if (ext != nil) { filename = [filename stringByAppendingPathExtension: ext]; } PBXFileReference *fileRef = AUTORELEASE([[PBXFileReference alloc] initWithPath: filename]); [result addObject: fileRef]; } return result; } NSString *typeForProjectType(NSString *projectType) { NSString *result = @""; if ([projectType isEqualToString: @"Application"]) { result = @"com.apple.product-type.application"; } else if ([projectType isEqualToString: @"Tool"]) { result = @"com.apple.product-type.tool"; } else if ([projectType isEqualToString: @"Library"]) { result = @"com.apple.product-type.library"; } else if ([projectType isEqualToString: @"Framework"]) { result = @"com.apple.product-type.framework"; } return result; } PBXGroup *productReferenceGroup(NSString *projectName, NSString *projectType) { PBXGroup *group = AUTORELEASE([[PBXGroup alloc] init]); NSString *type = typeForProjectType(projectType); NSString *ext = [PBXFileReference extForFileType: type]; NSString *path = (ext == nil || [ext isEqualToString: @""]) ? projectName : [projectName stringByAppendingPathExtension: ext]; PBXFileReference *productFileRef = AUTORELEASE([[PBXFileReference alloc] initWithPath: path]); NSMutableArray *children = [NSMutableArray arrayWithObject: productFileRef]; [group setChildren: children]; [group setName: @"Products"]; return group; } PBXGroup *mainGroupBuild(NSArray *files, PBXGroup *productReferenceGroup) { PBXGroup *mainGroup = AUTORELEASE([[PBXGroup alloc] init]); NSMutableArray *buildGroupFiles = buildFileReferences(files, nil); PBXGroup *buildFileGroup = AUTORELEASE([[PBXGroup alloc] init]); [buildFileGroup setChildren: buildGroupFiles]; NSMutableArray *mainGroupChildren = [NSMutableArray arrayWithObjects: buildFileGroup, productReferenceGroup, nil]; [mainGroup setChildren: mainGroupChildren]; return mainGroup; } void buildPhase(NSArray *items, PBXBuildPhase *phase) { NSMutableArray *sources = [NSMutableArray arrayWithCapacity: [items count]]; NSEnumerator *en = [items objectEnumerator]; NSString *item = nil; while ((item = [en nextObject]) != nil) { PBXFileReference *fileRef = AUTORELEASE([[PBXFileReference alloc] initWithPath: item]); PBXBuildFile *buildFile = AUTORELEASE([[PBXBuildFile alloc] init]); [buildFile setFileRef: fileRef]; [sources addObject: buildFile]; } [phase setFiles: sources]; } NSMutableArray *buildTargets(NSString *projectName, NSString *projectType, NSArray *files, NSArray *headers, NSArray *resources, NSArray *frameworks, PBXGroup *prodRefGroup) { NSMutableArray *result = [NSMutableArray array]; PBXNativeTarget *target = AUTORELEASE([[PBXNativeTarget alloc] init]); PBXSourcesBuildPhase *sourcePhase = AUTORELEASE([[PBXSourcesBuildPhase alloc] init]); buildPhase(files, sourcePhase); PBXResourcesBuildPhase *resourcePhase = AUTORELEASE([[PBXResourcesBuildPhase alloc] init]); buildPhase(resources, resourcePhase); // PBXFrameworksBuildPhase *frameworksPhase = AUTORELEASE([[PBXFrameworksBuildPhase alloc] init]); // buildPhase(frameworks, frameworksPhase); PBXFileReference *productRef = [[prodRefGroup children] objectAtIndex: 0]; NSMutableArray *phases = [NSMutableArray arrayWithObjects: sourcePhase, resourcePhase, nil]; // frameworksPhase, nil]; [target setBuildPhases: phases]; [target setName: projectName]; [target setProductName: [productRef path]]; [target setProductType: projectType]; [result addObject: target]; return result; } PBXContainer *buildContainer(NSString *projectName, NSString *projectType, NSArray *files, NSArray *headers, NSArray *resources, NSArray *other, NSArray *frameworks) { NSMutableArray *allFiles = [NSMutableArray arrayWithArray: files]; PBXProject *project = AUTORELEASE([[PBXProject alloc] init]); PBXContainer *container = AUTORELEASE([[PBXContainer alloc] initWithRootObject: project]); XCBuildConfiguration *buildConfigDebug = AUTORELEASE([[XCBuildConfiguration alloc] init]); XCBuildConfiguration *buildConfigRelease = AUTORELEASE([[XCBuildConfiguration alloc] initWithName: @"Release"]); NSMutableArray *configArray = [NSMutableArray arrayWithObjects: buildConfigDebug, buildConfigRelease, nil]; XCConfigurationList *configList = AUTORELEASE([[XCConfigurationList alloc] initWithConfigurations: configArray]); NSString *type = typeForProjectType(projectType); // Add all files to the main group... [allFiles addObjectsFromArray: other]; [allFiles addObjectsFromArray: resources]; // Set up groups... PBXGroup *productRefGroup = productReferenceGroup(projectName, projectType); // AUTORELEASE([[PBXGroup alloc] init]); PBXGroup *mainGroup = mainGroupBuild(allFiles, productRefGroup); // AUTORELEASE([[PBXGroup alloc] init]); NSMutableArray *targets = buildTargets(projectName, type, allFiles, headers, resources, frameworks, productRefGroup); [project setMainGroup: mainGroup]; [project setProductRefGroup: productRefGroup]; [project setBuildConfigurationList: configList]; // [project setContainer: container]; [project setTargets: targets]; return container; } PBXContainer *convertPBProject(NSDictionary *proj) { NSString *projectType = [proj objectForKey: @"PROJECTTYPE"]; NSString *projectName = [proj objectForKey: @"PROJECTNAME"]; NSDictionary *filesTable = [proj objectForKey: @"FILESTABLE"]; NSArray *files = [filesTable objectForKey: @"CLASSES"]; NSArray *headers = [filesTable objectForKey: @"H_FILES"]; NSArray *resources = [filesTable objectForKey: @"INTERFACES"]; NSArray *other = [filesTable objectForKey: @"OTHER_LINKED"]; NSArray *frameworks = [filesTable objectForKey: @"FRAMEWORKS"]; NSArray *images = [filesTable objectForKey: @"IMAGES"]; NSMutableArray *allResources = [NSMutableArray arrayWithArray: resources]; [allResources addObjectsFromArray: images]; return buildContainer(projectName, projectType, files, headers, allResources, other, frameworks); } PBXContainer *convertPCProject(NSDictionary *proj) { NSString *projectType = [proj objectForKey: @"PROJECT_TYPE"]; NSString *projectName = [proj objectForKey: @"PROJECT_NAME"]; NSArray *files = [proj objectForKey: @"CLASS_FILES"]; NSArray *headers = [proj objectForKey: @"HEADER_FILES"]; NSArray *resources = [proj objectForKey: @"LOCALIZED_RESOURCES"]; NSArray *other = [proj objectForKey: @"OTHER_SOURCES"]; NSArray *frameworks = [proj objectForKey: @"LIBRARIES"]; NSArray *images = [proj objectForKey: @"IMAGES"]; NSMutableArray *allResources = [NSMutableArray arrayWithArray: resources]; [allResources addObjectsFromArray: images]; return buildContainer(projectName, projectType, files, headers, allResources, other, frameworks); } BOOL buildXCodeProj(PBXContainer *container, NSString *dn) { NSError *error = nil; NSString *directoryName = [dn stringByAppendingPathExtension: @"xcodeproj"]; NSString *fn = [directoryName stringByAppendingPathComponent: @"project.pbxproj"]; NSFileManager *fm = [NSFileManager defaultManager]; BOOL created = [fm createDirectoryAtPath: directoryName withIntermediateDirectories: YES attributes: NULL error: &error]; BOOL result = NO; if (created) { xcprintf("=== Saving Project %s%s%s%s -> %s%s%s\n", BOLD, YELLOW, [fn cString], RESET, GREEN, [dn cString], RESET); // [container save]; // Setup to save... // Save the project... if (created && !error) { id dictionary = [PBXCoder archiveWithRootObject: container]; result = [dictionary writeToFile: fn atomically: YES]; if (result) { xcprintf("=== Done Saving Project %s%s%s%s\n", BOLD, GREEN, [dn cString], RESET); } else { xcprintf("=== Error Saving Project %s%s%s%s\n", BOLD, GREEN, [dn cString], RESET); } } } return result; } int main(int argc, const char *argv[]) { id pool = [[NSAutoreleasePool alloc] init]; if (argc > 1) { NSString *input = [NSString stringWithUTF8String: argv[1]]; NSString *output = [NSString stringWithUTF8String: argv[2]]; PBXContainer *container = nil; if ([[input lastPathComponent] isEqualToString: @"PB.project"]) { NSDictionary *proj = [NSDictionary dictionaryWithContentsOfFile: input]; xcprintf("== Parsing an old style NeXT project: %s -> %s\n", [input UTF8String], [output UTF8String]); container = convertPBProject(proj); } else if ([[input pathExtension] isEqualToString: @"pcproj"]) { NSString *path = [input stringByAppendingPathComponent: @"PC.project"]; NSDictionary *proj = [NSDictionary dictionaryWithContentsOfFile: path]; printf("== Parsing a ProjectCenter project: %s -> %s\n", [input UTF8String], [output UTF8String]); container = convertPCProject(proj); } else { xcprintf("== Unknown project type"); } if (container == nil) { xcprintf("== Unable to parse project file %@", input); return 255; } else { BOOL result = buildXCodeProj(container, output); if (result == NO) { return 255; } } } else { xcprintf("== Not enough arguments"); } [pool release]; return 0; } libs-xcode-XCode-0_5_0/Tools/pc2xc/pc2xc.pcproj/000077500000000000000000000000001475431643200213525ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pc2xc/pc2xc.pcproj/PC.project000066400000000000000000000025261475431643200232510ustar00rootroot00000000000000{ "CLASS_FILES" = ( ); COMPILEROPTIONS = ""; CPPOPTIONS = ""; "CREATION_DATE" = "2023-10-16 23:37:42 -0400"; "DOCU_FILES" = ( ); FRAMEWORKS = ( ); "HEADER_FILES" = ( ); IMAGES = ( ); INSTALLDIR = "$(HOME)/GNUstep/Tools"; LANGUAGE = English; LIBRARIES = ( "gnustep-base", XCode ); LINKEROPTIONS = ""; "LOCALIZED_RESOURCES" = ( ); MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; "OBJC_COMPILEROPTIONS" = ""; "OTHER_RESOURCES" = ( Version ); "OTHER_SOURCES" = ( "main.m" ); "PROJECT_AUTHORS" = ( ); "PROJECT_COPYRIGHT" = "Copyright (C) 200x"; "PROJECT_COPYRIGHT_DESC" = "Released under ..."; "PROJECT_CREATOR" = "Gregory John Casamento,,,"; "PROJECT_DESCRIPTION" = "No description available!"; "PROJECT_GROUP" = "No group available!"; "PROJECT_MAINTAINER" = "Gregory John Casamento,,,"; "PROJECT_NAME" = pc2xc; "PROJECT_RELEASE" = "0.1"; "PROJECT_SUMMARY" = "No summary available!"; "PROJECT_TYPE" = Tool; "PROJECT_URL" = ""; "SEARCH_HEADER_DIRS" = ( ); "SEARCH_LIB_DIRS" = ( ); SUBPROJECTS = ( ); "SUPPORTING_FILES" = ( "GNUmakefile.preamble", GNUmakefile, "GNUmakefile.postamble", "pc2xcInfo.plist" ); TOOLICON = ""; "USER_LANGUAGES" = ( AmericanEnglish, English ); }libs-xcode-XCode-0_5_0/Tools/pc2xc/pc2xc.pcproj/heron.project000066400000000000000000000003121475431643200240510ustar00rootroot00000000000000{"LAST_EDITING" = "2024-09-11 00:59:07 -0400"; "PC_WINDOWS" = {ProjectBrowser = "{x = 0; y = 0; width = 1430; height = 166}"; ProjectWindow = "979 365 1448 1321 0 0 3840 2160 "; ShowToolbar = YES; }; }libs-xcode-XCode-0_5_0/Tools/pc2xc/pc2xcInfo.plist000066400000000000000000000004141475431643200217460ustar00rootroot00000000000000{ "!" = "Generated by ProjectCenter, do not edit"; Copyright = "Copyright (C) 200x"; CopyrightDescription = "Released under ..."; FullVersionID = "0.1"; ToolDescription = "No description available!"; ToolName = pc2xc; ToolRelease = "0.1"; }libs-xcode-XCode-0_5_0/Tools/pcpg/000077500000000000000000000000001475431643200167515ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pcpg/GNUmakefile000066400000000000000000000013751475431643200210310ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Tool # VERSION = 0.1 PACKAGE_NAME = pcpg TOOL_NAME = pcpg pcpg_TOOL_ICON = # # Resource files # pcpg_RESOURCE_FILES = \ Resources/Version \ # # Header files # pcpg_HEADER_FILES = \ PLCPG.h # # Class files # pcpg_OBJC_FILES = \ PLCPG.m # # Other sources # pcpg_OBJC_FILES += \ main.m # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/Tools/pcpg/GNUmakefile.postamble000066400000000000000000000012441475431643200230110ustar00rootroot00000000000000# # GNUmakefile.postamble - Generated by ProjectCenter # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: libs-xcode-XCode-0_5_0/Tools/pcpg/GNUmakefile.preamble000066400000000000000000000010721475431643200226110ustar00rootroot00000000000000# # GNUmakefile.preamble - Generated by ProjectCenter # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to Objective C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to C compiler ADDITIONAL_CFLAGS += # Additional flags to pass to the linker ADDITIONAL_LDFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += # Additional TOOL libraries to link ADDITIONAL_TOOL_LIBS += libs-xcode-XCode-0_5_0/Tools/pcpg/PLCPG.h000066400000000000000000000022501475431643200177660ustar00rootroot00000000000000/* Project: pcpg Copyright (C) 2011 Free Software Foundation Author: Gregory John Casamento Created: 2011-08-16 14:15:42 -0400 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _PLCPG_H_ #define _PLCPG_H_ #import @interface PLCPG : NSObject { NSDictionary *plist; NSDictionary *dictionary; NSMutableDictionary *classes; NSMutableDictionary *classNameMap; } - (id) initWithPlist: (NSString *)plistName; - (void) generate; @end #endif // _PLCPG_H_ libs-xcode-XCode-0_5_0/Tools/pcpg/PLCPG.m000066400000000000000000000166061475431643200200050ustar00rootroot00000000000000/* Project: pcpg Copyright (C) 2011 Free Software Foundation Author: Gregory John Casamento Created: 2011-08-16 14:15:42 -0400 by heron This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "PLCPG.h" @interface NSString (PLCPG) - (NSString *) stringByUpperCasingFirstCharacter; @end @implementation NSString (PLCPG) - (NSString *) stringByUpperCasingFirstCharacter { unichar c = [self characterAtIndex: 0]; NSString *oneChar = [[NSString stringWithFormat: @"%C",c] uppercaseString]; NSString *newString = [self stringByReplacingCharactersInRange: NSMakeRange(0,1) withString: oneChar]; return newString; } @end @implementation PLCPG - (id) initWithPlist: (NSString *)plistName { if((self = [super init]) != nil) { plist = [[NSDictionary alloc] initWithContentsOfFile: plistName]; dictionary = [plist objectForKey: @"objects"]; classes = [[NSMutableDictionary alloc] initWithCapacity: 10]; classNameMap = [[NSMutableDictionary alloc] initWithObjectsAndKeys: @"NSString", @"NSConstantString", @"NSString", @"GSMutableString", @"NSMutableArray", @"GSMutableArray", @"NSMutableDictionary", @"GSMutableDictionary", nil]; } return self; } /* - (void) dealloc { [plist release]; [dictionary release]; [classes release]; [classNameMap release]; [super dealloc]; } */ - (NSString *) remapClassName: (NSString *)className { NSString *newClassName = [classNameMap objectForKey: className]; return (newClassName == nil) ? className : newClassName; } - (void) collectClassDetails { NSEnumerator *en = [dictionary keyEnumerator]; NSString *key = nil; while((key = [en nextObject]) != nil) { id obj = [dictionary objectForKey: key]; if([obj isKindOfClass: [NSDictionary class]]) { NSString *className = [obj objectForKey: @"isa"]; if(className == nil) { continue; } NSMutableDictionary *classInfo = [classes objectForKey: className]; if(classInfo == nil) { NSEnumerator *cen = [obj keyEnumerator]; id ckey = nil; classInfo = [NSMutableDictionary dictionaryWithCapacity:10]; [classes setObject: classInfo forKey: className]; while((ckey = [cen nextObject]) != nil) { if([ckey isEqualToString: @"isa"] == NO) { id cobj = [obj objectForKey: ckey]; if([cobj isKindOfClass: [NSString class]]) { id ref = [dictionary objectForKey: cobj]; // if cobj is a string, it might be a key.. so check. if([ref isKindOfClass: [NSDictionary class]]) { NSString *refClassName = [ref objectForKey: @"isa"]; [classInfo setObject: refClassName forKey: ckey]; } else { NSString *className = NSStringFromClass([cobj class]); className = [self remapClassName: className]; [classInfo setObject: className forKey: ckey]; } } else { NSString *className = NSStringFromClass([cobj class]); className = [self remapClassName: className]; [classInfo setObject: className forKey: ckey]; } } } } } } } - (void) createHeaderForClassNamed: (NSString *)className { NSString *classFileFormat = @"#import \n\n" @"// Local includes\n" @"#import \"PBXCoder.h\"\n" @"%@\n\n@interface %@ : NSObject\n" @"{\n%@}\n\n// Methods....\n%@\n" @"@end"; NSDictionary *classInfo = [classes objectForKey: className]; NSEnumerator *en = [classInfo keyEnumerator]; NSString *ivarString = @""; NSString *includeString = @""; NSString *methodString = @""; NSString *ivarName = nil; while((ivarName = [en nextObject]) != nil) { NSString *type = [classInfo objectForKey: ivarName]; // Map certain types... if ([type isEqualToString: @"GSCInlineString"]) { type = @"NSString"; } ivarString = [ivarString stringByAppendingString: [NSString stringWithFormat: @"\t%@ *_%@;\n",type, ivarName]]; if(![type isEqualToString: @"NSString"] && ![type isEqualToString: @"NSMutableArray"] && ![type isEqualToString: @"NSArray"] && ![type isEqualToString: @"NSDictionary"] && ![type isEqualToString: @"NSMutableDictionary"]) { includeString = [includeString stringByAppendingString: [NSString stringWithFormat: @"#import \"%@.h\"\n", type]]; } methodString = [methodString stringByAppendingString: [NSString stringWithFormat: @"- (%@ *) %@; // getter\n",type,ivarName]]; NSString *name = [ivarName stringByUpperCasingFirstCharacter]; methodString = [methodString stringByAppendingString: [NSString stringWithFormat: @"- (void) set%@: (%@ *)object; // setter\n",name,type]]; } NSString *classFileName = [className stringByAppendingString: @".h"]; NSString *classFile = [NSString stringWithFormat: classFileFormat, includeString, className, ivarString, methodString]; NSError *error = nil; [classFile writeToFile: classFileName atomically: NO encoding: NSASCIIStringEncoding error: &error]; } - (void) createSourceForClassNamed: (NSString *)className { NSString *classFileFormat = @"#import \"PBXCommon.h\"\n#import \"%@.h\"\n\n@implementation %@\n\n// Methods....\n%@\n@end"; NSString *methodString = @""; NSDictionary *classInfo = [classes objectForKey: className]; NSEnumerator *en = [classInfo keyEnumerator]; NSString *ivarName = nil; while((ivarName = [en nextObject]) != nil) { NSString *type = [classInfo objectForKey: ivarName]; // Map certain types... if ([type isEqualToString: @"GSCInlineString"]) { type = @"NSString"; } methodString = [methodString stringByAppendingString: [NSString stringWithFormat: @"- (%@ *) %@ // getter\n{\n\treturn _%@;\n}\n\n", type,ivarName,ivarName]]; NSString *name = [ivarName stringByUpperCasingFirstCharacter]; methodString = [methodString stringByAppendingString: [NSString stringWithFormat: @"- (void) set%@: (%@ *)object; // setter\n{\n\tASSIGN(_%@, object);\n}\n\n", name,type,ivarName]]; } NSString *classFileName = [className stringByAppendingString: @".m"]; NSString *classFile = [NSString stringWithFormat: classFileFormat, className, className, methodString]; NSError *error = nil; [classFile writeToFile: classFileName atomically: NO encoding: NSASCIIStringEncoding error: &error]; } - (void) createHeaderAndSourceFileForClassNamed: (NSString *)className { [self createHeaderForClassNamed: className]; [self createSourceForClassNamed: className]; } - (void) generateClassCode { NSLog(@"%@",classes); NSEnumerator *en = [classes keyEnumerator]; id cls = nil; while((cls = [en nextObject]) != nil) { [self createHeaderAndSourceFileForClassNamed: cls]; } } - (void) generate { [self collectClassDetails]; [self generateClassCode]; } @end libs-xcode-XCode-0_5_0/Tools/pcpg/README.md000066400000000000000000000004141475431643200202270ustar00rootroot00000000000000This tool is for parsing and determining missing classes in the framework. It is a metatool and is/was used to figure out the structure and function of the classes within the xcodeproj file. Use this whenever the library fails to recognize something which is parsed.libs-xcode-XCode-0_5_0/Tools/pcpg/Resources/000077500000000000000000000000001475431643200207235ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pcpg/Resources/.gitignore000066400000000000000000000000001475431643200227010ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pcpg/main.m000066400000000000000000000010411475431643200200470ustar00rootroot00000000000000/* Project: pcpg Author: Gregory John Casamento,,, Created: 2011-08-16 14:11:00 -0400 by heron */ #import #import "PLCPG.h" int main(int argc, const char *argv[]) { id pool = [[NSAutoreleasePool alloc] init]; // Your code here... if(argc > 0) { NSString *argument = [[NSString alloc] initWithCString: argv[1]]; PLCPG *plcpg = [[PLCPG alloc] initWithPlist: argument]; [plcpg generate]; [argument release]; [plcpg release]; } // The end... [pool release]; return 0; } libs-xcode-XCode-0_5_0/Tools/pcpg/pcpg.pcproj.backup/000077500000000000000000000000001475431643200224425ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pcpg/pcpg.pcproj.backup/PC.project000066400000000000000000000026711475431643200243420ustar00rootroot00000000000000{ "BUILDER_TARGETS" = ( all, install, uninstall, clean, distclean, dist ); "CLASS_FILES" = ( "PLCPG.m" ); COMPILEROPTIONS = ""; CPPOPTIONS = ""; "CREATION_DATE" = "2011-08-16 14:11:00 -0400"; "DOCU_FILES" = ( ); FRAMEWORKS = ( ); "HEADER_FILES" = ( "PLCPG.h" ); IMAGES = ( ); INSTALLDIR = "$(HOME)/GNUstep/Tools"; LANGUAGE = English; LIBRARIES = ( "gnustep-base" ); LINKEROPTIONS = ""; "LOCALIZED_RESOURCES" = ( ); MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; "OBJC_COMPILEROPTIONS" = ""; "OTHER_RESOURCES" = ( Version ); "OTHER_SOURCES" = ( "main.m" ); "PROJECT_AUTHORS" = ( ); "PROJECT_COPYRIGHT" = "Copyright (C) 200x"; "PROJECT_COPYRIGHT_DESC" = "Released under ..."; "PROJECT_CREATOR" = "Gregory John Casamento,,,"; "PROJECT_DESCRIPTION" = "No description available!"; "PROJECT_GROUP" = "No group available!"; "PROJECT_MAINTAINER" = "Gregory John Casamento,,,"; "PROJECT_NAME" = pcpg; "PROJECT_RELEASE" = "0.1"; "PROJECT_SUMMARY" = "No summary available!"; "PROJECT_TYPE" = Tool; "PROJECT_URL" = ""; "SEARCH_HEADER_DIRS" = ( ); "SEARCH_LIB_DIRS" = ( ); SUBPROJECTS = ( ); "SUPPORTING_FILES" = ( "GNUmakefile.preamble", GNUmakefile, "GNUmakefile.postamble", "pcpgInfo.plist" ); TOOLICON = ""; "USER_LANGUAGES" = ( AmericanEnglish, English ); }libs-xcode-XCode-0_5_0/Tools/pcpg/pcpg.pcproj/000077500000000000000000000000001475431643200211765ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/Tools/pcpg/pcpg.pcproj/PC.project000066400000000000000000000026711475431643200230760ustar00rootroot00000000000000{ "BUILDER_TARGETS" = ( all, install, uninstall, clean, distclean, dist ); "CLASS_FILES" = ( "PLCPG.m" ); COMPILEROPTIONS = ""; CPPOPTIONS = ""; "CREATION_DATE" = "2011-08-16 14:11:00 -0400"; "DOCU_FILES" = ( ); FRAMEWORKS = ( ); "HEADER_FILES" = ( "PLCPG.h" ); IMAGES = ( ); INSTALLDIR = "$(HOME)/GNUstep/Tools"; LANGUAGE = English; LIBRARIES = ( "gnustep-base" ); LINKEROPTIONS = ""; "LOCALIZED_RESOURCES" = ( ); MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; "OBJC_COMPILEROPTIONS" = ""; "OTHER_RESOURCES" = ( Version ); "OTHER_SOURCES" = ( "main.m" ); "PROJECT_AUTHORS" = ( ); "PROJECT_COPYRIGHT" = "Copyright (C) 200x"; "PROJECT_COPYRIGHT_DESC" = "Released under ..."; "PROJECT_CREATOR" = "Gregory John Casamento,,,"; "PROJECT_DESCRIPTION" = "No description available!"; "PROJECT_GROUP" = "No group available!"; "PROJECT_MAINTAINER" = "Gregory John Casamento,,,"; "PROJECT_NAME" = pcpg; "PROJECT_RELEASE" = "0.1"; "PROJECT_SUMMARY" = "No summary available!"; "PROJECT_TYPE" = Tool; "PROJECT_URL" = ""; "SEARCH_HEADER_DIRS" = ( ); "SEARCH_LIB_DIRS" = ( ); SUBPROJECTS = ( ); "SUPPORTING_FILES" = ( "GNUmakefile.preamble", GNUmakefile, "GNUmakefile.postamble", "pcpgInfo.plist" ); TOOLICON = ""; "USER_LANGUAGES" = ( AmericanEnglish, English ); }libs-xcode-XCode-0_5_0/Tools/pcpg/pcpg.pcproj/heron.project000066400000000000000000000003611475431643200237010ustar00rootroot00000000000000{"LAST_EDITING" = "2011-08-16 17:10:56 -0400"; "PC_WINDOWS" = {ProjectBrowser = "{x = 0; y = 0; width = 1012; height = 166.373}"; ProjectBuild = "0 0 0 0 0 0 0 0 "; ProjectWindow = "901 149 1030 784 0 0 2047 1044 "; ShowToolbar = YES; }; }libs-xcode-XCode-0_5_0/Tools/pcpg/pcpgInfo.plist000066400000000000000000000004131475431643200215710ustar00rootroot00000000000000{ "!" = "Generated by ProjectCenter, do not edit"; Copyright = "Copyright (C) 200x"; CopyrightDescription = "Released under ..."; FullVersionID = "0.1"; ToolDescription = "No description available!"; ToolName = pcpg; ToolRelease = "0.1"; }libs-xcode-XCode-0_5_0/Version000066400000000000000000000006021475431643200162660ustar00rootroot00000000000000# This file is included in various Makefile's to get version information. # Compatible with Bourne shell syntax, so it can included there too. # The gcc version required to compile the library. GNUSTEP_GUI_GCC=4.0.0 # Versions for libraries that gnustep-gui is dependent upon GNUSTEP_GUI_BASE=1.30.0 # numeric value should match above VERSION_NUMBER=0.5.0 VERSION=${VERSION_NUMBER} libs-xcode-XCode-0_5_0/XCode/000077500000000000000000000000001475431643200157225ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/XCode/GNUmakefile000066400000000000000000000051361475431643200200010ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make # # Framework # VERSION = 0.3.0 PACKAGE_NAME = XCode FRAMEWORK_NAME = XCode # # Resource files # XCode_RESOURCE_FILES = Resources/Framework-mapping.plist \ Resources/language-codes.plist \ Resources/create-dummy-class.sh \ # # Header files # XCode_HEADER_FILES = \ GSXCBuildDatabase.h \ GSXCBuildContext.h \ GSXCCommon.h \ NSArray+Additions.h \ NSString+PBXAdditions.h \ PBXBuildPhase.h \ PBXTarget.h \ PBXApplicationTarget.h \ PBXAggregateTarget.h \ PBXBuildFile.h \ PBXBuildRule.h \ PBXBundleTarget.h \ PBXCoder.h \ PBXCommon.h \ PBXContainer.h \ PBXContainerItemProxy.h \ PBXCopyFilesBuildPhase.h \ PBXFileReference.h \ PBXFrameworksBuildPhase.h \ PBXFrameworkTarget.h \ PBXFileSystemSynchronizedRootGroup.h \ PBXGroup.h \ PBXHeadersBuildPhase.h \ PBXNativeTarget.h \ PBXProject.h \ PBXReferenceProxy.h \ PBXResourcesBuildPhase.h \ PBXRezBuildPhase.h \ PBXShellScriptBuildPhase.h \ PBXSourcesBuildPhase.h \ PBXTargetDependency.h \ PBXVariantGroup.h \ XCAbstractDelegate.h \ XCBuildConfiguration.h \ XCConfigurationList.h \ XCVersionGroup.h \ XCWorkspace.h \ XCFileRef.h \ XCWorkspaceParser.h \ PBXLegacyTarget.h \ GSXCBuildOperation.h \ GSXCBuildDelegate.h \ GSXCGenerator.h \ NSObject+KeyExtraction.h \ XCode.h \ # # Class files # XCode_OBJC_FILES = \ GSXCBuildDatabase.m \ GSXCBuildContext.m \ NSArray+Additions.m \ NSString+PBXAdditions.m \ PBXBuildPhase.m \ PBXTarget.m \ PBXApplicationTarget.m \ PBXAggregateTarget.m \ PBXBuildFile.m \ PBXBuildRule.m \ PBXBundleTarget.m \ PBXCoder.m \ PBXCommon.m \ PBXContainerItemProxy.m \ PBXContainer.m \ PBXCopyFilesBuildPhase.m \ PBXFileReference.m \ PBXFileSystemSynchronizedRootGroup.m \ PBXFrameworksBuildPhase.m \ PBXFrameworkTarget.m \ PBXGroup.m \ PBXHeadersBuildPhase.m \ PBXNativeTarget.m \ PBXProject.m \ PBXReferenceProxy.m \ PBXResourcesBuildPhase.m \ PBXRezBuildPhase.m \ PBXShellScriptBuildPhase.m \ PBXSourcesBuildPhase.m \ PBXTargetDependency.m \ PBXVariantGroup.m \ XCAbstractDelegate.m \ XCBuildConfiguration.m \ XCConfigurationList.m \ XCVersionGroup.m \ XCWorkspace.m \ XCFileRef.m \ XCWorkspaceParser.m \ PBXLegacyTarget.m \ GSXCBuildOperation.m \ GSXCGenerator.m \ xcsystem.m \ NSObject+KeyExtraction.m \ # # Makefiles # -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/framework.make -include GNUmakefile.postamble libs-xcode-XCode-0_5_0/XCode/GNUmakefile.postamble000066400000000000000000000012441475431643200217620ustar00rootroot00000000000000# # GNUmakefile.postamble - Generated by ProjectCenter # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: libs-xcode-XCode-0_5_0/XCode/GNUmakefile.preamble000066400000000000000000000014071475431643200215640ustar00rootroot00000000000000# # GNUmakefile.preamble - Generated by ProjectCenter # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to Objective C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to C compiler ADDITIONAL_CFLAGS += # Additional flags to pass to the linker ADDITIONAL_LDFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += # Additional libraries to link ADDITIONAL_GUI_LIBS += ifeq ($(GNUSTEP_TARGET_OS),mingw32) XCode_OBJC_FILES += setenv.m else ifeq ($(GNUSTEP_TARGET_OS),mingw64) XCode_OBJC_FILES += setenv.m else ifeq ($(GNUSTEP_TARGET_OS),windows) XCode_OBJC_FILES += setenv.m endif libs-xcode-XCode-0_5_0/XCode/GSXBuildContext.m000066400000000000000000000027671475431643200211020ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "GSXCBuildContext.h" id _sharedBuildContext = nil; @implementation GSXCBuildContext + (id) sharedBuildContext { if(_sharedBuildContext == nil) { _sharedBuildContext = [[GSXBuildContext alloc] init]; } return _sharedBuildContext; } - (NSMutableDictionary *) contextDictionaryForProject: (NSString *)projectName { return [contextDictionary objectForKey: projectName]; } - (void) createContextForProject: (NSString *)name { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; [contextDictionary setObject: dict forKey: name]; } @end libs-xcode-XCode-0_5_0/XCode/GSXCBuildContext.h000066400000000000000000000030441475431643200211650ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @interface GSXCBuildContext : NSObject { NSMutableDictionary *contextDictionary; NSMutableDictionary *currentContext; NSMutableArray *stack; NSDictionary *config; } + (id) sharedBuildContext; - (NSMutableDictionary *) currentContext; - (NSMutableDictionary *) contextDictionaryForName: (NSString *)name; - (NSMutableDictionary *) popCurrentContext; - (NSDictionary *) config; - (NSDictionary *) configForTargetName: (NSString *)name; - (void) setObject: (id)object forKey: (id)key; - (id) objectForKey: (id)key; - (void) addEntriesFromDictionary: (NSDictionary *)dict; @end libs-xcode-XCode-0_5_0/XCode/GSXCBuildContext.m000066400000000000000000000062411475431643200211740ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "GSXCBuildContext.h" id _sharedBuildContext = nil; @implementation GSXCBuildContext + (id) sharedBuildContext { if(_sharedBuildContext == nil) { _sharedBuildContext = [[GSXCBuildContext alloc] init]; } return _sharedBuildContext; } - (id) init { if((self = [super init]) != nil) { stack = [[NSMutableArray alloc] initWithCapacity: 10]; contextDictionary = [[NSMutableDictionary alloc] init]; config = [[NSDictionary alloc] initWithContentsOfFile: @"buildtool.plist"]; NSDebugLog(@"%@",config); } return self; } - (void) dealloc { RELEASE(stack); RELEASE(contextDictionary); RELEASE(config); [super dealloc]; } - (NSDictionary *) config { return config; } - (NSDictionary *) configForTargetName: (NSString *)name { NSDictionary *targetDict = [config objectForKey: name]; NSMutableDictionary *result = [NSMutableDictionary dictionaryWithDictionary: config]; if (targetDict != nil) { [result addEntriesFromDictionary: targetDict]; // override existing entries. } return result; } - (NSMutableDictionary *) currentContext { return currentContext; } - (NSMutableDictionary *) contextDictionaryForName: (NSString *)name { currentContext = [contextDictionary objectForKey: name]; if(currentContext == nil) { currentContext = [NSMutableDictionary dictionary]; [contextDictionary setObject: currentContext forKey: name]; [contextDictionary setObject: name forKey: @"TARGET_NAME"]; [stack addObject: currentContext]; } return currentContext; } - (NSMutableDictionary *) popCurrentContext { NSMutableDictionary *popped = [stack lastObject]; [stack removeLastObject]; currentContext = [stack lastObject]; return popped; } - (void) setObject: (id)object forKey: (id)key { [currentContext setObject: object forKey: key]; } - (id) objectForKey: (id)key { return [currentContext objectForKey: key]; } - (void) addEntriesFromDictionary: (NSDictionary *)dict; { [currentContext addEntriesFromDictionary: dict]; } - (NSString *) description { return [NSString stringWithFormat: @"%@ -- contextDictionary = %@, \n currentContext = %@, \n stack = %@ \n\n", [super description], contextDictionary, currentContext, stack]; } @end libs-xcode-XCode-0_5_0/XCode/GSXCBuildDatabase.h000066400000000000000000000046601475431643200212520ustar00rootroot00000000000000/* Copyright (C) 2022 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: Nov 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef GSXCBuildDatabase_H_INCLUDE #define GSXCBuildDatabase_H_INCLUDE #import @class NSMutableDictionary, NSMutableArray, PBXTarget; @class NSDate, PBXBuildFile, PBXFileReference; @interface GSXCRecord : NSObject { NSMutableDictionary *_dictionary; } + (instancetype) recordWithContentsOfFile: (NSString *)path; - (instancetype) initWithContentsOfFile: (NSString *)path; - (instancetype) initWithDictionary: (NSDictionary *)dict; - (NSDictionary *) dictionary; @end @interface GSXCFileRecord : GSXCRecord { NSString *_fileName; NSDate *_dateModified; NSDate *_dateBuilt; PBXBuildFile *_buildFile; PBXFileReference *_fileReference; } - (instancetype) initWithDictonary: (NSDictionary *)dict; - (instancetype) initWithFile: (PBXBuildFile *)f path: (NSString *)path; + (instancetype) recordWithBuildFile: (PBXBuildFile *)f path: (NSString *)path; - (void) setFileName: (NSString *)fn; - (NSString *) fileName; - (void) setDateModified: (NSDate *)d; - (NSDate *) dateModified; - (void) setDateBuilt: (NSDate *)d; - (NSDate *) dateBuilt; - (PBXFileReference *) fileReference; @end @interface GSXCBuildDatabase : NSObject { NSMutableArray *_records; PBXTarget *_target; } + (instancetype) buildDatabaseWithTarget: (PBXTarget *)target; - (instancetype) initWithTarget: (PBXTarget *)target; - (void) setTarget: (PBXTarget *)t; - (PBXTarget *) target; - (void) addRecord: (GSXCRecord *)record; - (NSArray *) files; - (BOOL) isEmpty; @end #endif // GSXCBuildDatabase_H_INCLUDE libs-xcode-XCode-0_5_0/XCode/GSXCBuildDatabase.m000066400000000000000000000174421475431643200212610ustar00rootroot00000000000000/* Copyright (C) 2022 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: Nov 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import #import #import #import #import #import #import #import "GSXCColors.h" #import "xcsystem.h" @implementation GSXCRecord : NSObject + (instancetype) recordWithContentsOfFile: (NSString *)path { return [[self alloc] initWithContentsOfFile: path]; } - (instancetype) initWithContentsOfFile: (NSString *)path { NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: path]; return [self initWithDictionary: dict]; } - (instancetype) initWithDictionary: (NSDictionary *)dict { self = [super init]; if (self != nil) { ASSIGN(_dictionary, [dict mutableCopy]); } return self; } - (instancetype) init { self = [super init]; if (self != nil) { ASSIGN(_dictionary, [NSMutableDictionary dictionary]); } return self; } - (void) dealloc { RELEASE(_dictionary); [super dealloc]; } - (id) copyWithZone: (NSZone *)z { Class c = [self class]; id copy = [[c alloc] initWithDictionary: _dictionary]; return copy; } - (NSDictionary *) dictionary { return [_dictionary copy]; } @end @implementation GSXCFileRecord : GSXCRecord - (instancetype) initWithDictonary: (NSDictionary *)dict { self = [super initWithDictionary: dict]; if (self != nil) { NSString *fn = [dict objectForKey: @"fileName"]; NSDate *dm = [dict objectForKey: @"dateModified"]; NSDate *db = [dict objectForKey: @"dateBuilt"]; [self setFileName: fn]; [self setDateModified: dm]; [self setDateBuilt: db]; } return self; } - (instancetype) initWithFile: (PBXBuildFile *)f path: (NSString *)path { self = [super init]; if (self != nil) { NSError *error = nil; NSFileManager *mgr = [NSFileManager defaultManager]; PBXFileReference *fr = [f fileRef]; NSString *fullPath = [fr buildPath]; NSString *fileName = [fullPath lastPathComponent]; NSDictionary *attrs = [mgr attributesOfItemAtPath: fullPath error: &error]; ASSIGN(_fileReference, fr); [self setFileName: fileName]; if (error == nil) { NSDate *srcModified = [attrs objectForKey: NSFileModificationDate]; NSString *outputPath = [path stringByAppendingPathComponent: [fileName stringByAppendingString: @".o"]]; NSDictionary *objAttrs = [mgr attributesOfItemAtPath: outputPath error: &error]; if (srcModified == nil) { srcModified = [attrs objectForKey: NSFileCreationDate]; [self setDateModified: srcModified]; } else { [self setDateModified: srcModified]; } if (error == nil) { NSDate *objModified = [objAttrs objectForKey: NSFileModificationDate]; if (objModified == nil) { objModified = [objAttrs objectForKey: NSFileCreationDate]; } [self setDateBuilt: objModified]; } else { [self setDateBuilt: [NSDate distantPast]]; } } else { NSDebugLog(@"file = %@, error = %@", fullPath, error); } NSDebugLog(@"%@ - %@, %@", _fileName, _dateModified, _dateBuilt); } return self; } + (instancetype) recordWithBuildFile: (PBXBuildFile *)f path: (NSString *)path { return AUTORELEASE( [[self alloc] initWithFile: f path: path] ); } - (id) copyWithZone: (NSZone *)z { Class c = [self class]; id copy = [[c alloc] initWithDictionary: _dictionary]; return copy; } - (void) dealloc { RELEASE(_fileName); RELEASE(_dateModified); RELEASE(_dateBuilt); [super dealloc]; } - (void) setFileName: (NSString *)fn { [_dictionary setObject: fn forKey: @"fileName"]; ASSIGN(_fileName, fn); } - (NSString *) fileName { return _fileName; } - (void) setDateModified: (NSDate *)d { [_dictionary setObject: d forKey: @"dateModified"]; ASSIGN(_dateModified, d); } - (NSDate *) dateModified { return _dateModified; } - (void) setDateBuilt: (NSDate *)d { [_dictionary setObject: d forKey: @"dateBuilt"]; ASSIGN(_dateBuilt, d); } - (NSDate *) dateBuilt { return _dateBuilt; } - (PBXFileReference *) fileReference { return _fileReference; } @end @implementation GSXCBuildDatabase : NSObject + (instancetype) buildDatabaseWithTarget: (PBXTarget *)target { return AUTORELEASE( [[self alloc] initWithTarget: target] ); } - (BOOL) _construct { GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; NSFileManager *mgr = [NSFileManager defaultManager]; NSEnumerator *en = [[_target buildPhases] objectEnumerator]; PBXBuildPhase *p = nil; NSString *buildDir = [ctx objectForKey: @"TARGET_BUILD_DIR"]; if (buildDir == nil) { buildDir = @"./build"; } // if build dir doesn't exist, then it's a fresh build... just return. if ([mgr fileExistsAtPath: buildDir] == NO) { return NO; } buildDir = [buildDir stringByAppendingPathComponent: [_target name]]; xcprintf("=== Evaluating existing build... %s\n", [[_target name] cStringUsingEncoding: NSUTF8StringEncoding]); while ( (p = [en nextObject]) != nil ) { NSDebugLog(@"Phase = %@", p); if ([p isKindOfClass: [PBXSourcesBuildPhase class]]) { NSArray *files = [p files]; NSEnumerator *fen = [files objectEnumerator]; PBXBuildFile *bf = nil; while ( (bf = [fen nextObject]) != nil ) { GSXCFileRecord *fr = [GSXCFileRecord recordWithBuildFile: bf path: buildDir]; if ([[fr dateModified] compare: [fr dateBuilt]] == NSOrderedDescending) { xcprintf("\t* Checking %s%s%s%s - %smodified%s\n", BOLD, CYAN, [[fr fileName] cString], RESET, GREEN, RESET); [self addRecord: fr]; } else { xcprintf("\t* Checking %s%s%s%s - %salready built%s\n", BOLD, CYAN, [[fr fileName] cString], RESET, YELLOW, RESET); } } } } return YES; } - (instancetype) init { self = [super init]; if (self != nil) { _records = [[NSMutableArray alloc] initWithCapacity: 10]; [self setTarget: nil]; } return self; } - (instancetype) initWithTarget: (PBXTarget *)target { self = [super init]; if (self != nil) { _records = [[NSMutableArray alloc] initWithCapacity: 10]; [self setTarget: target]; if( [self _construct] == NO ) { return nil; } } return self; } - (void) dealloc { RELEASE(_records); _target = nil; [super dealloc]; } - (void) setTarget: (PBXTarget *)target { _target = target; } - (PBXTarget *) target { return _target; } - (void) addRecord: (GSXCRecord *)record { [_records addObject: record]; } - (NSArray *) files { NSMutableArray *array = [NSMutableArray arrayWithCapacity: [_records count]]; NSEnumerator *en = [_records objectEnumerator]; id f = nil; while ((f = [en nextObject]) != nil) { id fr = [f fileReference]; [array addObject: fr]; } return array; } - (BOOL) isEmpty { return ([_records count] == 0); } @end libs-xcode-XCode-0_5_0/XCode/GSXCBuildDelegate.h000066400000000000000000000024371475431643200212600ustar00rootroot00000000000000/* Definition of protocol GSXCBuildDelegate Copyright (C) 2022 Free Software Foundation, Inc. By: Gregory John Casamento Date: 25-01-2022 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef _GSXCBuildDelegate_h_INCLUDE #define _GSXCBuildDelegate_h_INCLUDE #import #import "PBXProject.h" #if defined(__cplusplus) extern "C" { #endif @protocol GSXCBuildDelegate @optional - (void) project: (PBXProject *)project publishMessage: (NSString *)message; @end #if defined(__cplusplus) } #endif #endif /* _GSXCBuildDelegate_h_INCLUDE */ libs-xcode-XCode-0_5_0/XCode/GSXCBuildOperation.h000066400000000000000000000026541475431643200215070ustar00rootroot00000000000000/* Definition of class GSXCBuildTask Copyright (C) 2022 Free Software Foundation, Inc. By: Gregory John Casamento Date: 24-01-2022 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef _GSXCBuildTask_h_INCLUDE #define _GSXCBuildTask_h_INCLUDE #import #import "GSXCCommon.h" @class PBXBuildFile; #if defined(__cplusplus) extern "C" { #endif @interface GSXCBuildOperation : NSOperation { PBXBuildFile *_file; } + (instancetype) operationWithFile: (PBXBuildFile *)file; - (instancetype) initWithFile: (PBXBuildFile *)file; - (PBXBuildFile *) file; - (void) setFile: (PBXBuildFile *)file; @end #if defined(__cplusplus) } #endif #endif /* _GSXCBuildTask_h_INCLUDE */ libs-xcode-XCode-0_5_0/XCode/GSXCBuildOperation.m000066400000000000000000000026441475431643200215130ustar00rootroot00000000000000/* Implementation of class GSXCBuildTask Copyright (C) 2022 Free Software Foundation, Inc. By: Gregory John Casamento Date: 24-01-2022 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "GSXCBuildOperation.h" #import "PBXBuildFile.h" @implementation GSXCBuildOperation + (instancetype) operationWithFile: (PBXBuildFile *)file { return AUTORELEASE([[self alloc] initWithFile: file]); } - (instancetype) initWithFile: (PBXBuildFile *)file { if ((self = [super init]) != nil) { [self setFile: file]; } return self; } - (PBXBuildFile *) file { return _file; } - (void) setFile: (PBXBuildFile *)file { ASSIGN(_file, file); } - (void) main { [_file build]; } @end libs-xcode-XCode-0_5_0/XCode/GSXCColors.h000066400000000000000000000036141475431643200200250ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ /* This file defines the colors used in parts of libs-xcode for output */ // Reset #define RESET "\033[0m" // Reset text // Style #define REGULAR "\033[0;31m" // Regular #define BOLD "\033[1;31m" // Bold #define LOW_INTENSITY "\033[2;31m" // Low Intensity #define ITALIC "\033[3;31m" // Italic #define UNDERLINE "\033[4;31m" // Underline #define BLINKING "\033[5;31m" // Blinking #define REVERSE "\033[6;31m" // Reverse #define BACKGROUND "\033[7;31m" // Background #define INVISIBLE "\033[8;31m" // Invisible // Colors #define BLACK "\033[0;30m" // Black #define RED "\033[0;31m" // Red #define GREEN "\033[0;32m" // Green #define YELLOW "\033[0;33m" // Yellow #define BLUE "\033[0;34m" // Blue #define MAGENTA "\033[0;35m" // Magenta #define CYAN "\033[0;36m" // Cyan #define WHITE "\033[0;37m" // White libs-xcode-XCode-0_5_0/XCode/GSXCCommon.h000066400000000000000000000026731475431643200200200ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "GSXCColors.h" #import "GSXCBuildContext.h" #import "xcsystem.h" // product types... #define LIBRARY_TYPE @"com.apple.product-type.library.static" #define FRAMEWORK_TYPE @"com.apple.product-type.framework" #define DYNAMIC_LIBRARY_TYPE @"com.apple.product-type.library.dynamic" #define BUNDLE_TYPE @"com.apple.product-type.bundle" #define TOOL_TYPE @"com.apple.product-type.tool" #define APPLICATION_TYPE @"com.apple.product-type.application" #define TEST_TYPE @"com.apple.product-type.bundle.unit-test" libs-xcode-XCode-0_5_0/XCode/GSXCGenerator.h000066400000000000000000000023111475431643200205030ustar00rootroot00000000000000/* Copyright (C) 2022 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 Apr 13 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "GSXCCommon.h" @class PBXTarget; @interface GSXCGenerator : NSObject { PBXTarget *_target; } - (instancetype) initWithTarget: (PBXTarget *)target; - (PBXTarget *) target; - (void) setTarget: (PBXTarget *)target; - (BOOL) generate; @end libs-xcode-XCode-0_5_0/XCode/GSXCGenerator.m000066400000000000000000000012231475431643200205110ustar00rootroot00000000000000// Released under the terms of LGPLv2.1, please see COPYING.LIB #import #import #import "GSXCGenerator.h" #import "GSXCCommon.h" #import "PBXTarget.h" @implementation GSXCGenerator - (instancetype) initWithTarget: (PBXTarget *)target { self = [super init]; if (self != nil) { [self setTarget: target]; } return self; } - (void) dealloc { RELEASE(_target); [super dealloc]; } - (void) setTarget: (PBXTarget *)target { ASSIGN(_target, target); } - (PBXTarget *) target { return _target; } - (BOOL) generate { return ([self notImplemented: _cmd] != nil); } @end libs-xcode-XCode-0_5_0/XCode/GSXCTask.h000066400000000000000000000017571475431643200174740ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "GSXCCommon.h" #import libs-xcode-XCode-0_5_0/XCode/GSXCTask.m000066400000000000000000000000001475431643200174550ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/XCode/NSArray+Additions.h000066400000000000000000000026651475431643200213350ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @interface NSArray (Additions) - (NSString *) implodeArrayWithSeparator: (NSString *)separator; - (NSArray *) arrayByRemovingDuplicateEntries; - (NSString *) removeDuplicatesAndImplodeWithSeparator: (NSString *)separator; - (NSArray *) arrayByAddingQuotationMarksToEntries; - (NSString *) arrayToLinkList; - (NSString *) arrayToIncludeList; - (NSString *) arrayToList; @end @interface NSMutableArray (Additions) - (void) prependObjectsFromArray: (NSArray *)array; @end libs-xcode-XCode-0_5_0/XCode/NSArray+Additions.m000066400000000000000000000112751475431643200213370ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXBuildFile.h" #import "NSArray+Additions.h" #import "NSString+PBXAdditions.h" @implementation NSArray (Additions) - (NSString *) implodeArrayWithSeparator: (NSString *)separator { NSString *result = @""; NSEnumerator *en = [self objectEnumerator]; id object = nil; while((object = [en nextObject]) != nil) { NSString *obj = [separator stringByAppendingString: object]; result = [result stringByAppendingString: obj]; } return result; } - (NSArray *) arrayByRemovingDuplicateEntries { NSArray *result = [NSArray array]; NSEnumerator *en = [self objectEnumerator]; id o = nil; while ((o = [en nextObject]) != nil) { if ([result containsObject: o] == NO) { result = [result arrayByAddingObject: o]; } } return result; } - (NSString *) removeDuplicatesAndImplodeWithSeparator: (NSString *)separator { NSArray *result = [self arrayByRemovingDuplicateEntries]; return [result implodeArrayWithSeparator: separator]; } - (NSArray *) arrayByAddingQuotationMarksToEntries { NSEnumerator *en = [self objectEnumerator]; NSString *obj = nil; NSMutableArray *result = [NSMutableArray arrayWithCapacity: [self count]]; while ((obj = [en nextObject]) != nil) { NSString *s = [obj stringByAddingQuotationMarks]; [result addObject: s]; } return [NSArray arrayWithArray: result]; } - (NSString *) arrayToLinkList { NSString *result = @""; NSEnumerator *en = [self objectEnumerator]; NSString *aname = nil; while((aname = [en nextObject]) != nil) { if ([aname isEqualToString: [self firstObject]] == YES) { result = [result stringByAppendingString: [NSString stringWithFormat: @"%@ ", aname]]; } else { result = [result stringByAppendingString: [NSString stringWithFormat: @"\t%@ ", aname]]; } if ([aname isEqualToString: [self lastObject]] == NO) { result = [result stringByAppendingString: @"\\\n"]; } } return result; } - (NSString *) arrayToIncludeList { NSString *result = @"-I. \\\n"; NSEnumerator *en = [self objectEnumerator]; NSString *aname = nil; while((aname = [en nextObject]) != nil) { result = [result stringByAppendingString: [NSString stringWithFormat: @"\t-I./%@ ", aname]]; if ([aname isEqualToString: [self lastObject]] == NO) { result = [result stringByAppendingString: @"\\\n"]; } } return result; } - (NSString *) arrayToList { NSString *result = @""; NSEnumerator *en = [self objectEnumerator]; id o = nil; while((o = [en nextObject]) != nil) { NSString *aname = nil; if ([o isKindOfClass: [NSString class]]) { aname = o; } else if ([o isKindOfClass: [PBXBuildFile class]]) { PBXBuildFile *f = o; PBXFileReference *r = [f fileRef]; aname = [r path]; } if (aname != nil) { if ([aname isEqualToString: [self firstObject]] == YES) { result = [result stringByAppendingString: [NSString stringWithFormat: @"%@ ", aname]]; } else { result = [result stringByAppendingString: [NSString stringWithFormat: @"\t%@ ", aname]]; } if ([aname isEqualToString: [self lastObject]] == NO) { result = [result stringByAppendingString: @"\\\n"]; } } } return result; } @end @implementation NSMutableArray (Additional) - (void) prependObjectsFromArray: (NSArray *)array { NSEnumerator *en = [array objectEnumerator]; id o = nil; while ((o = [en nextObject]) != nil) { [self insertObject: o atIndex: 0]; } } @end libs-xcode-XCode-0_5_0/XCode/NSObject+KeyExtraction.h000066400000000000000000000022231475431643200223260ustar00rootroot00000000000000/* Copyright (C) 2024 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2024 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @interface NSObject (KeyExtraction) + (NSArray *) skippedKeys; - (NSArray *) keysForObject: (id)object; - (NSDictionary *) recursiveKeysAndValuesForObject: (id)object; - (NSDictionary *) allKeysAndValues; @end libs-xcode-XCode-0_5_0/XCode/NSObject+KeyExtraction.m000066400000000000000000000256551475431643200223510ustar00rootroot00000000000000/* Copyright (C) 2024 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2024 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import #import #import "NSObject+KeyExtraction.h" #import "NSString+PBXAdditions.h" // // Check dictionary to see if it's equvalent... // @interface NSDictionary (Private) - (BOOL) isEqualDictionary: (NSDictionary *)dict; @end @implementation NSDictionary (Private) - (BOOL) isEqualDictionary: (NSDictionary *)dict { NSEnumerator *en = [self keyEnumerator]; id k = nil; BOOL result = YES; while ((k = [en nextObject]) != nil) { id v1 = [self objectForKey: k]; id v2 = [dict objectForKey: k]; if ([v1 isKindOfClass: [NSDictionary class]] && [v2 isKindOfClass: [NSDictionary class]]) { if ([v1 isEqualToDictionary: v2] == NO) { result = NO; break; } } else if ([v1 isEqual: v2] == NO) { result = NO; break; } } return result; } @end // Function to generate a 24-character GUID (uppercase, alphanumeric, no dashes) NSString *generateGUID() { return [[NSUUID UUID] UUIDString]; } // Move PBXContainer information to the top level dictionary... id moveContainerProperties(NSDictionary *input) { NSMutableDictionary *result = [NSMutableDictionary dictionaryWithDictionary: input]; NSMutableDictionary *objects = [NSMutableDictionary dictionaryWithDictionary: [result objectForKey: @"objects"]]; NSEnumerator *en = [objects keyEnumerator]; id key = nil; id keyToChange = nil; // NSLog(@"result = %@", result); while ((key = [en nextObject]) != nil) { id d = [objects objectForKey: key]; if ([d isKindOfClass: [NSDictionary class]]) { NSString *cn = [d objectForKey: @"isa"]; if ([cn isEqualToString: @"PBXContainer"]) { keyToChange = key; break; } } } // Update objects... if (keyToChange != nil) { NSMutableDictionary *containerDict = [objects objectForKey: keyToChange]; [containerDict removeObjectForKey: @"rootObject"]; [containerDict removeObjectForKey: @"isa"]; [containerDict removeObjectForKey: @"objects"]; [objects removeObjectForKey: keyToChange]; [result addEntriesFromDictionary: containerDict]; [result setObject: objects forKey: @"objects"]; } // NSLog(@"result = %@", result); return result; } NSString *guidInCachedObjects(NSDictionary *objects, NSDictionary *dict) { NSString *guid = nil; NSEnumerator *en = [objects keyEnumerator]; NSString *g = nil; while ((g = [en nextObject]) != nil) { NSDictionary *d = [objects objectForKey: g]; if ([dict isEqualToDictionary: d]) { guid = g; break; } } return guid; } // Recursive function to flatten the property list id flattenPropertyList(id propertyList, NSMutableDictionary *objects, NSString **rootObjectGUID) { if ([propertyList isKindOfClass:[NSDictionary class]]) { NSDictionary *dict = (NSDictionary *)propertyList; // Check if the dictionary has an "isa" element if ([dict objectForKey:@"isa"]) { // Generate a GUID for this dictionary NSString *guid = generateGUID(); // If the "isa" is "PBXProject", set the rootObjectGUID if ([[dict objectForKey:@"isa"] isEqualToString:@"PBXProject"]) { *rootObjectGUID = guid; } // Add the dictionary to the objects array with its GUID NSMutableDictionary *flattenedDict = [NSMutableDictionary dictionary]; NSEnumerator *en = [dict keyEnumerator]; id key = nil; while ((key = [en nextObject]) != nil) { [flattenedDict setObject: flattenPropertyList([dict objectForKey:key], objects, rootObjectGUID) forKey: key]; } NSString *existingGuid = guidInCachedObjects(objects, flattenedDict); if (existingGuid != nil) { guid = existingGuid; } else { [objects setObject:flattenedDict forKey:guid]; } // Return the GUID to replace the dictionary return guid; } else { // Recursively process each value in the dictionary NSMutableDictionary *processedDict = [NSMutableDictionary dictionary]; NSEnumerator *en = [dict keyEnumerator]; id key = nil; while ((key = [en nextObject]) != nil) { [processedDict setObject: flattenPropertyList([dict objectForKey:key], objects, rootObjectGUID) forKey: key]; } return processedDict; } } else if ([propertyList isKindOfClass:[NSArray class]]) { // Recursively process each item in the array NSMutableArray *processedArray = [NSMutableArray array]; NSEnumerator *en = [propertyList objectEnumerator]; id item = nil; while((item = [en nextObject]) != nil) { [processedArray addObject:flattenPropertyList(item, objects, rootObjectGUID)]; } return processedArray; } else { // For non-collection types, return the item as-is return propertyList; } } // Main function to initiate the flattening process NSDictionary *flattenPlist(id propertyList) { NSMutableDictionary *objects = [NSMutableDictionary dictionary]; NSString *rootObjectGUID = nil; NSMutableDictionary *results = [NSMutableDictionary dictionary]; // Flatten the property list and find the rootObjectGUID flattenPropertyList(propertyList, objects, &rootObjectGUID); // Put the results together... [results setObject: rootObjectGUID forKey: @"rootObject"]; [results setObject: objects forKey: @"objects"]; // Return the final structure return results; } @implementation NSObject (KeyExtraction) + (void) getAllMethodsForClass: (Class)cls intoArray: (NSMutableArray *)methodsArray { if (cls == nil || cls == [NSObject class]) { return; } unsigned int methodCount = 0; Method *methods = class_copyMethodList(cls, &methodCount); unsigned int i = 0; for (i = 0; i < methodCount; i++) { Method method = methods[i]; [methodsArray addObject:NSStringFromSelector(method_getName(method))]; } free(methods); // Don't forget to free the list // Recursively call this method for the superclass [self getAllMethodsForClass:class_getSuperclass(cls) intoArray:methodsArray]; } + (NSArray *) recursiveGetAllMethodsForClass: (Class)cls { NSMutableArray *methodsArray = [NSMutableArray array]; [self getAllMethodsForClass: cls intoArray: methodsArray]; return [methodsArray copy]; } + (NSArray *) skippedKeys { return [NSArray arrayWithObjects: @"context", // @"buildConfigurationList", @"buildConfigurations", @"array", @"valueforKey", @"objectatIndexedSubscript", @"totalFiles", @"filename", @"currentFile", @"parameter", @"showEnvVarsInLog", nil]; } - (NSArray *) keysForObject: (id)object { NSArray *methods = [NSObject recursiveGetAllMethodsForClass: [object class]]; NSEnumerator *en = [methods objectEnumerator]; NSString *selectorName = nil; NSMutableArray *result = [NSMutableArray arrayWithCapacity: [methods count]]; while ((selectorName = [en nextObject]) != nil) { if ([selectorName hasPrefix: @"set"] && [selectorName isEqualToString: @"settings"] == NO) { NSString *keyName = [selectorName substringFromIndex: 3]; keyName = [keyName stringByReplacingOccurrencesOfString: @":" withString: @""]; keyName = [keyName lowercaseFirstCharacter]; [result addObject: keyName]; } } return result; } - (NSDictionary *) recursiveKeysAndValuesForObject: (id)object { NSMutableDictionary *keysAndValues = nil; if (object && [object isKindOfClass: [NSNull class]] == NO) { NSArray *properties = [self keysForObject: object]; NSEnumerator *pen = [properties objectEnumerator]; id key = nil; keysAndValues = [NSMutableDictionary dictionary]; while ((key = [pen nextObject]) != nil) { if ([[NSObject skippedKeys] containsObject: key]) { continue; } NS_DURING { id value = [object valueForKey: key]; if ([value isKindOfClass: [NSArray class]]) { NSMutableArray *arrayValues = [NSMutableArray array]; NSEnumerator *en = [value objectEnumerator]; id item = nil; while ((item = [en nextObject]) != nil) { [arrayValues addObject: [self recursiveKeysAndValuesForObject: item]]; } [keysAndValues setObject: arrayValues forKey: key]; } else if ([value isKindOfClass: [NSDictionary class]] // add a dictionary representing a class... && [value objectForKey: @"isa"] != nil) { NSMutableDictionary *dictValues = [NSMutableDictionary dictionary]; NSEnumerator *en = [value keyEnumerator]; id dictKey = nil; while ((dictKey = [en nextObject]) != nil) { id dictValue = [value objectForKey: dictKey]; [dictValues setObject: [self recursiveKeysAndValuesForObject: dictValue] forKey: dictKey]; } [keysAndValues setObject: dictValues forKey: key]; } else if ([value isKindOfClass: [NSDictionary class]] // add a simple dictionary... && [value objectForKey: @"isa"] == nil) { [keysAndValues setObject: value forKey: key]; } else if ([value isKindOfClass: [NSObject class]] && ![value isKindOfClass: [NSString class]] && ![value isKindOfClass: [NSNumber class]]) { [keysAndValues setObject: NSStringFromClass([object class]) forKey: @"isa"]; [keysAndValues setObject: [self recursiveKeysAndValuesForObject: value] forKey: key]; } else { [keysAndValues setObject: NSStringFromClass([object class]) forKey: @"isa"]; if (value) { [keysAndValues setObject: value forKey: key]; } } } NS_HANDLER { NSLog(@"Exception %@ while retrieving value for key '%@' on class %@", localException, key, NSStringFromClass([object class])); } NS_ENDHANDLER; } } // NSLog(@"missingKeys are %@", missingKeys); return keysAndValues; } - (NSDictionary *) allKeysAndValues { id r = flattenPlist([self recursiveKeysAndValuesForObject: self]); NSMutableDictionary *d = [NSMutableDictionary dictionaryWithDictionary: r]; return moveContainerProperties(d); } @end libs-xcode-XCode-0_5_0/XCode/NSString+PBXAdditions.h000066400000000000000000000035271475431643200220750ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @interface NSString (PBXAdditions) - (NSString *) firstPathComponent; - (NSString *) stringByReplacingPathExtensionWith: (NSString *)ext; - (NSString *) stringByEscapingSpecialCharacters; - (NSString *) stringByEliminatingSpecialCharacters; - (NSString *) stringByCapitalizingFirstCharacter; - (NSString *) stringByDeletingFirstPathComponent; - (NSString *) stringByReplacingEnvironmentVariablesWithValues; - (NSString *) stringByAddingQuotationMarks; - (NSString *) execPathForString; + (NSString *) stringForCommand: (NSString *)command; + (NSString *) stringForEnvironmentVariable: (char *)envvar; + (NSString *) stringForEnvironmentVariable: (NSString *)v defaultValue: (NSString *)d; - (NSString *) stringByTrimmingTrailingCharactersInSet: (NSCharacterSet *)characterSet; - (NSString *) stringByResolvingPath; - (NSString *) lowercaseFirstCharacter; @end libs-xcode-XCode-0_5_0/XCode/NSString+PBXAdditions.m000066400000000000000000000231211475431643200220720ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import #import #import #import #import "GSXCBuildContext.h" #import "NSString+PBXAdditions.h" #import "GSXCBuildContext.h" #ifdef _MSC_VER #import #import #define popen _popen #else #import #endif extern char **environ; static NSString *_cachedRootPath = nil; @implementation NSString (PBXAdditions) - (NSString *) firstPathComponent { NSArray *components = [self pathComponents]; return ([components count] > 0)?[components objectAtIndex: 0]:@""; } - (NSString *) stringByReplacingPathExtensionWith: (NSString *)ext { NSString *result = [self stringByDeletingPathExtension]; result = [result stringByAppendingPathExtension: ext]; return result; } - (NSString *) stringByEscapingSpecialCharacters { NSString *result = nil; result = [self stringByReplacingOccurrencesOfString: @" " withString: @"_"]; result = [self stringByReplacingOccurrencesOfString: @"(" withString: @"\\)"]; result = [self stringByReplacingOccurrencesOfString: @")" withString: @"\\)"]; result = [self stringByReplacingOccurrencesOfString: @"[" withString: @"\\["]; result = [self stringByReplacingOccurrencesOfString: @"]" withString: @"\\]"]; result = [self stringByReplacingOccurrencesOfString: @"{" withString: @"\\{"]; result = [self stringByReplacingOccurrencesOfString: @"}" withString: @"\\}"]; return result; } - (NSString *) stringByEliminatingSpecialCharacters { NSString *cs = @"()[]/\\| "; NSString *result = @""; NSUInteger l = [self length]; NSUInteger i = 0; for (i = 0; i < l; i++) { NSString *c = [NSString stringWithFormat: @"%c",[self characterAtIndex: i]]; if ([cs containsString: c]) { continue; } result = [result stringByAppendingString: c]; } return result; } - (NSString *) stringByCapitalizingFirstCharacter { unichar c = [self characterAtIndex: 0]; NSRange range = NSMakeRange(0,1); NSString *oneChar = [[NSString stringWithFormat:@"%C",c] uppercaseString]; NSString *name = [self stringByReplacingCharactersInRange: range withString: oneChar]; return name; } - (NSString *) stringByDeletingFirstPathComponent { NSArray *components = [self pathComponents]; NSString *firstComponent = [self firstPathComponent]; NSString *result = @""; NSEnumerator *en = [components objectEnumerator]; NSString *c = nil; while ((c = [en nextObject]) != nil) { if ([c isEqualToString: firstComponent]) continue; result = [result stringByAppendingPathComponent: c]; } return result; } - (NSString *) stringByReplacingEnvironmentVariablesWithValues { NSString *result = nil; NSMutableDictionary *dict = [NSMutableDictionary dictionary]; result = [NSString stringWithString: self]; // autoreleased copy // Get env vars... char **env = NULL; for (env = environ; *env != 0; env++) { char *thisEnv = *env; NSString *envStr = [NSString stringWithCString: thisEnv encoding: NSUTF8StringEncoding]; NSArray *components = [envStr componentsSeparatedByString: @"="]; [dict setObject: [components lastObject] forKey: [components firstObject]]; } // Replace all variables in the plist with the values... NSArray *keys = [dict allKeys]; NSEnumerator *en = [keys objectEnumerator]; NSString *k = nil; while ((k = [en nextObject]) != nil) { NSString *v = [dict objectForKey: k]; result = [result stringByReplacingOccurrencesOfString: [NSString stringWithFormat: @"$(%@)",k] withString: v]; result = [result stringByReplacingOccurrencesOfString: [NSString stringWithFormat: @"$%@",k] withString: v]; } return result; } - (NSString *) stringByAddingQuotationMarks { return [NSString stringWithFormat: @"'%@'", self]; } - (NSString *) findRootPath { NSString *result = nil; // static NSString *_cachedRootPath = nil; if (_cachedRootPath == nil) { NSString *driveLetters = @"cdefghijklmnopqrstuvwxyz", *b = nil; NSArray *base = [NSArray arrayWithObjects: @"/msys64", @"/tools/msys64", nil]; NSEnumerator *en = [base objectEnumerator]; NSFileManager *fm = [NSFileManager defaultManager]; while ((b = [en nextObject]) != nil) { NSUInteger i = 0; for(i = 0; i < [driveLetters length]; i++) { unichar letter = [driveLetters characterAtIndex: i]; result = [NSString stringWithFormat: @"%c:%@", letter, b]; if ([fm fileExistsAtPath: result]) { ASSIGN(_cachedRootPath, result); break; } } } } else { result = _cachedRootPath; } NSDebugLog(@"root path = %@", result); return result; } - (NSString *) execPathForString { NSString *result = nil; NSString *cmd = self; GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; NSDictionary *dict = [ctx config]; NSString *setupScript = [dict objectForKey: @"setupScript"]; #ifdef _WIN32 NSString *rootPath = [self findRootPath]; if (setupScript != nil) { result = [NSString stringWithFormat: @"%@/usr/bin/bash -c \"%@ > /dev/null && %@\"", rootPath, setupScript, cmd]; } else { result = [NSString stringWithFormat: @"%@/usr/bin/bash -c \"%@\"", rootPath, cmd]; } #else if (setupScript != nil) { result = [NSString stringWithFormat: @"%@ > /dev/null && %@", setupScript, cmd]; } else { result = [cmd copy]; } #endif NSDebugLog(@"%@", result); return result; } + (NSString *) stringForCommand: (NSString *)command { NSString *output = nil; char string[2048]; const char *cmd_string; FILE *fp; NSString *cmd = [command execPathForString]; cmd_string = [cmd cString]; /* Open the command for reading. */ fp = popen(cmd_string, "r"); if (fp != NULL) { output = @""; /* Read the output a line at a time - output it. */ while (fgets(string, sizeof(string) - 1, fp) != NULL) { int len = strlen(string); int i = 0; for(i = 0; i < len; i++) { if(string[i] == '\n') { string[i] = '\0'; } } output = [output stringByAppendingString: [NSString stringWithCString: string]]; } fclose(fp); } output = [output stringByTrimmingTrailingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]]; return output; } + (NSString *) stringForEnvironmentVariable: (char *)envvar { NSString *v = [NSString stringWithCString: envvar]; return [self stringForEnvironmentVariable: v defaultValue: nil]; } + (NSString *) stringForEnvironmentVariable: (NSString *)v defaultValue: (NSString *)d { NSProcessInfo *pi = [NSProcessInfo processInfo]; NSDictionary *e = [pi environment]; NSString *r = [e objectForKey: v]; if (r == nil) { r = d; } return r; } - (NSString *) stringByTrimmingTrailingCharactersInSet:(NSCharacterSet *)characterSet { NSRange rangeOfLastWantedCharacter = [self rangeOfCharacterFromSet:[characterSet invertedSet] options:NSBackwardsSearch]; if (rangeOfLastWantedCharacter.location == NSNotFound) { return @""; } return [self substringToIndex:rangeOfLastWantedCharacter.location+1]; // non-inclusive } - (NSString *) stringByResolvingPath { #ifndef __MINGW32__ NSString *expandedPath = [[self stringByExpandingTildeInPath] stringByStandardizingPath]; const char *cpath = [expandedPath cStringUsingEncoding: NSUTF8StringEncoding]; char *resolved = NULL; char *returnValue = realpath(cpath, resolved); if (returnValue == NULL && resolved != NULL) { NSLog(@"Error with path %s", resolved); return nil; } return [NSString stringWithCString: returnValue encoding: NSUTF8StringEncoding]; #else return self; #endif } - (NSString *) lowercaseFirstCharacter { // Lowercase the first letter of the class to make the element name NSString *first = [[self substringToIndex: 1] lowercaseString]; NSString *rest = [self substringFromIndex: 1]; NSString *result = [NSString stringWithFormat: @"%@%@", first, rest]; return result; } @end libs-xcode-XCode-0_5_0/XCode/PBXAggregateTarget.h000066400000000000000000000021471475431643200215060ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "XCConfigurationList.h" #import "PBXTarget.h" @interface PBXAggregateTarget : PBXTarget @end libs-xcode-XCode-0_5_0/XCode/PBXAggregateTarget.m000066400000000000000000000020661475431643200215130ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXAggregateTarget.h" @implementation PBXAggregateTarget - (BOOL) build { return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXApplicationTarget.h000066400000000000000000000020771475431643200220650ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXNativeTarget.h" @interface PBXApplicationTarget : PBXNativeTarget @end libs-xcode-XCode-0_5_0/XCode/PBXApplicationTarget.m000066400000000000000000000022261475431643200220660ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXApplicationTarget.h" @implementation PBXApplicationTarget - (id) init { self = [super init]; if(self) { [self setProductType: APPLICATION_TYPE]; } return self; } @end libs-xcode-XCode-0_5_0/XCode/PBXBuildFile.h000066400000000000000000000033561475431643200203130ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXFileReference.h" @class PBXNativeTarget; @interface PBXBuildFile : NSObject { PBXFileReference *_fileRef; NSMutableDictionary *_settings; PBXNativeTarget *_target; NSString *_platformFilter; NSUInteger _totalFiles; NSUInteger _currentFile; } // Methods.... - (PBXFileReference *) fileRef; // getter - (void) setFileRef: (PBXFileReference *)object; // setter - (NSMutableDictionary *) settings; // getter - (void) setSettings: (NSMutableDictionary *)object; // setter - (void) setPlatformFilter: (NSString *)f; - (void) setTarget: (PBXNativeTarget *)t; - (void) setTotalFiles: (NSUInteger)t; - (void) setCurrentFile: (NSUInteger)n; - (NSString *) path; - (NSString *) buildPath; - (BOOL) build; - (BOOL) generate; @end libs-xcode-XCode-0_5_0/XCode/PBXBuildFile.m000066400000000000000000000044651475431643200203220ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXBuildFile.h" #import "PBXNativeTarget.h" @implementation PBXBuildFile // Methods.... - (void) setPlatformFilter: (NSString *)f { ASSIGN(_platformFilter, f); } - (PBXFileReference *) fileRef // getter { return _fileRef; } - (void) setFileRef: (PBXFileReference *)object; // setter { ASSIGN(_fileRef,object); } - (NSMutableDictionary *) settings // getter { return _settings; } - (void) setSettings: (NSMutableDictionary *)object; // setter { ASSIGN(_settings,object); } - (void) applySettings { // xcputs("%@",settings); } - (NSString *) buildPath { return [_fileRef buildPath]; } - (NSString *) path { return [_fileRef path]; } - (void) setTarget: (PBXNativeTarget *)t { _target = t; } - (void) setTotalFiles: (NSUInteger)t { _totalFiles = t; } - (void) setCurrentFile: (NSUInteger)n { _currentFile = n; } - (BOOL) build { [self applySettings]; [_fileRef setTarget: _target]; [_fileRef setTotalFiles: _totalFiles]; [_fileRef setCurrentFile: _currentFile]; return [_fileRef build]; } - (BOOL) generate { [self applySettings]; xcputs([[NSString stringWithFormat: @"\t* Creating entry for %@",[_fileRef buildPath]] cString]); [_fileRef setTarget: _target]; return [_fileRef generate]; } - (NSString *) description { NSString *s = [super description]; return [s stringByAppendingFormat: @" <%@>", _fileRef]; } @end libs-xcode-XCode-0_5_0/XCode/PBXBuildPhase.h000066400000000000000000000043051475431643200204670ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __PBXBuildPhase_h_GNUSTEP_INCLUDE #define __PBXBuildPhase_h_GNUSTEP_INCLUDE #import // Local includes #import "PBXCoder.h" #import "PBXNativeTarget.h" @interface PBXBuildPhase : NSObject { NSMutableArray *_files; NSString *_buildActionMask; NSString *_runOnlyForDeploymentPostprocessing; BOOL _showEnvVarsInLog; PBXNativeTarget *_target; NSString *_name; } - (instancetype) initWithFiles: (NSMutableArray *)files buildActionMask: (NSString *)buildActionMask runOnlyForDeployment: (NSString *)runOnlyForDeployment target: (PBXNativeTarget *)target name: (NSString *)name; // Methods.... - (NSMutableArray *) files; // getter - (void) setFiles: (NSMutableArray *)object; // setter - (NSString *) buildActionMask; // getter - (void) setBuildActionMask: (NSString *)object; // setter - (NSString *) runOnlyForDeploymentPostprocessing; // getter - (void) setRunOnlyForDeploymentPostprocessing: (NSString *)object; // setter - (BOOL) showEnvVarsInLog; // setter - (void) setShowEnvVarsInLog: (BOOL)flag; - (void) setTarget: (PBXNativeTarget *)t; - (PBXNativeTarget *) target; - (void) setName: (NSString *)n; - (NSString *) name; // build - (BOOL) build; - (BOOL) generate; - (BOOL) link; @end #endif libs-xcode-XCode-0_5_0/XCode/PBXBuildPhase.m000066400000000000000000000055641475431643200205040ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXBuildPhase.h" @implementation PBXBuildPhase - (instancetype) initWithFiles: (NSMutableArray *)files buildActionMask: (NSString *)buildActionMask runOnlyForDeployment: (NSString *)runOnlyForDeployment target: (PBXNativeTarget *)target name: (NSString *)name { self = [super init]; if (self != nil) { [self setFiles: files]; [self setBuildActionMask: buildActionMask]; [self setRunOnlyForDeploymentPostprocessing: runOnlyForDeployment]; [self setTarget: target]; [self setName: name]; } return self; } - (void) dealloc { RELEASE(_files); RELEASE(_buildActionMask); RELEASE(_runOnlyForDeploymentPostprocessing); RELEASE(_target); RELEASE(_name); [super dealloc]; } // Methods.... - (NSMutableArray *) files // getter { return _files; } - (void) setFiles: (NSMutableArray *)object; // setter { ASSIGN(_files,object); } - (NSString *) buildActionMask // getter { return _buildActionMask; } - (void) setBuildActionMask: (NSString *)object; // setter { ASSIGN(_buildActionMask,object); } - (NSString *) runOnlyForDeploymentPostprocessing // getter { return _runOnlyForDeploymentPostprocessing; } - (void) setRunOnlyForDeploymentPostprocessing: (NSString *)object; // setter { ASSIGN(_runOnlyForDeploymentPostprocessing,object); } - (BOOL) showEnvVarsInLog; // setter { return _showEnvVarsInLog; } - (void) setShowEnvVarsInLog: (BOOL)flag { _showEnvVarsInLog = flag; } - (void) setTarget: (PBXNativeTarget *)t { _target = t; } - (PBXNativeTarget *) target { return _target; } - (void) setName: (NSString *)n { ASSIGN(_name, n); } - (NSString *) name { return _name; } - (BOOL) build { NSDebugLog(@"Abstract build... %@, %@", self, _files); return YES; } - (BOOL) generate { NSLog(@"Abstract generate... %@, %@", self, _files); return YES; } - (BOOL) link { NSLog(@"Abstract link... %@, %@", self, _files); return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXBuildRule.h000066400000000000000000000036161475431643200203420ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" @interface PBXBuildRule : NSObject { NSString *_fileType; NSString *_isEditable; NSMutableArray *_outputFiles; NSString *_compilerSpec; NSString *_script; NSMutableArray *_inputFiles; NSString *_filePatterns; } // Methods.... - (NSString *) fileType; // getter - (void) setFileType: (NSString *)object; // setter - (NSString *) isEditable; // getter - (void) setIsEditable: (NSString *)object; // setter - (NSMutableArray *) outputFiles; // getter - (void) setOutputFiles: (NSMutableArray *)object; // setter - (NSMutableArray *) inputFiles; // getter - (void) setInputFiles: (NSMutableArray *)object; // setter - (NSString *) compilerSpec; // getter - (void) setCompilerSpec: (NSString *)object; // setter - (NSString *) script; // getter - (void) setScript: (NSString *)object; // setter - (NSString *) filePatterns; // getter - (void) setFilePatterns: (NSString *)object; // setter @end libs-xcode-XCode-0_5_0/XCode/PBXBuildRule.m000066400000000000000000000044231475431643200203440ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXBuildRule.h" @implementation PBXBuildRule - (void) dealloc { RELEASE(_fileType); RELEASE(_isEditable); RELEASE(_outputFiles); RELEASE(_compilerSpec); RELEASE(_script); RELEASE(_inputFiles); [super dealloc]; } // Methods.... - (NSString *) fileType // getter { return _fileType; } - (void) setFileType: (NSString *)object; // setter { ASSIGN(_fileType,object); } - (NSString *) isEditable // getter { return _isEditable; } - (void) setIsEditable: (NSString *)object; // setter { ASSIGN(_isEditable,object); } - (NSMutableArray *) outputFiles // getter { return _outputFiles; } - (void) setOutputFiles: (NSMutableArray *)object; // setter { ASSIGN(_outputFiles,object); } - (NSMutableArray *) inputFiles // getter { return _inputFiles; } - (void) setInputFiles: (NSMutableArray *)object; // setter { ASSIGN(_inputFiles,object); } - (NSString *) compilerSpec // getter { return _compilerSpec; } - (void) setCompilerSpec: (NSString *)object; // setter { ASSIGN(_compilerSpec,object); } - (NSString *) script // getter { return _compilerSpec; } - (void) setScript: (NSString *)object; // setter { ASSIGN(_script,object); } - (NSString *) filePatterns // getter { return _filePatterns; } - (void) setFilePatterns: (NSString *)object; // setter { ASSIGN(_filePatterns,object); } @end libs-xcode-XCode-0_5_0/XCode/PBXBundleTarget.h000066400000000000000000000020721475431643200210260ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXNativeTarget.h" @interface PBXBundleTarget : PBXNativeTarget @end libs-xcode-XCode-0_5_0/XCode/PBXBundleTarget.m000066400000000000000000000022071475431643200210330ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXBundleTarget.h" @implementation PBXBundleTarget - (id) init { self = [super init]; if(self) { [self setProductType: BUNDLE_TYPE]; } return self; } @end libs-xcode-XCode-0_5_0/XCode/PBXCoder.h000066400000000000000000000040741475431643200175060ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @class XCAbstractDelegate; @interface PBXCoder : NSObject { // Objects... NSString *_fileName; NSString *_projectRoot; NSMutableDictionary *_dictionary; NSMutableDictionary *_objects; NSMutableDictionary *_objectCache; NSMutableDictionary *_parents; XCAbstractDelegate *_delegate; // Archiving... id _rootObject; } // Unarchiving... + (instancetype) unarchiveWithProjectFile: (NSString *)name; - (instancetype) initWithProjectFile: (NSString *)name; - (instancetype) initWithContentsOfFile: (NSString *)name; - (id) unarchive; - (id) unarchiveObjectForKey: (NSString *)key; - (id) unarchiveFromDictionary: (NSDictionary *)dictionary; - (NSMutableArray *) resolveArrayMembers: (NSMutableArray *)array; - (id) applyKeysAndValuesFromDictionary: (NSDictionary *)dictionary toObject: (id)object; - (NSString *) projectRoot; // Delegate - (XCAbstractDelegate *) delegate; - (void) setDelegate: (XCAbstractDelegate *)delegate; // Archiving... + (instancetype) archiveWithRootObject: (id)obj; - (instancetype) initWithRootObject: (id)obj; - (id) archive; @end libs-xcode-XCode-0_5_0/XCode/PBXCoder.m000066400000000000000000000142011475431643200175040ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "NSObject+KeyExtraction.h" #import "PBXCoder.h" #import "PBXContainer.h" #import "PBXCommon.h" #import "NSString+PBXAdditions.h" #import "GSXCBuildContext.h" #ifdef _WIN32 #import "setenv.h" #endif #define DEBUG 1 @implementation PBXCoder // Delegate... - (XCAbstractDelegate *) delegate { return _delegate; } - (void) setDelegate: (XCAbstractDelegate *)delegate { _delegate = delegate; // weak since we don't retain the delegate... } // Methods for unarchiving a pbxproj file... + (instancetype) unarchiveWithProjectFile: (NSString *)name { return AUTORELEASE([[self alloc] initWithProjectFile: name]); } - (instancetype) initWithContentsOfFile: (NSString *)name { if((self = [super init]) != nil) { _objectCache = [[NSMutableDictionary alloc] initWithCapacity: 10]; ASSIGN(_fileName, name); ASSIGN(_projectRoot, [[_fileName stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]); ASSIGN(_dictionary, [NSMutableDictionary dictionaryWithContentsOfFile: _fileName]); ASSIGN(_objects, [_dictionary objectForKey: @"objects"]); _parents = [[NSMutableDictionary alloc] initWithCapacity: 10]; [[GSXCBuildContext sharedBuildContext] setObject: _objects forKey: @"objects"]; setenv("PROJECT_DIR","./",1); setenv("PROJECT_ROOT","./",1); setenv("SRCROOT","./",1); } return self; } - (instancetype) initWithProjectFile: (NSString *)name { NSString *newName = [name stringByAppendingPathComponent: @"project.pbxproj"]; return [self initWithContentsOfFile: newName]; } - (void) dealloc { RELEASE(_objectCache); RELEASE(_fileName); RELEASE(_dictionary); RELEASE(_objects); RELEASE(_parents); DESTROY(_rootObject); [super dealloc]; } - (id) unarchive { return [self unarchiveFromDictionary: _dictionary]; } - (id) unarchiveFromDictionary: (NSDictionary *)dict { id object = nil; NSString *isaValue = [dict objectForKey: @"isa"]; NSString *className = (isaValue == nil) ? @"PBXContainer" : isaValue; Class classInstance = NSClassFromString(className); if(classInstance == nil) { xcputs([[NSString stringWithFormat: @"Unknown class: %@",className] cString]); return nil; } object = AUTORELEASE([[classInstance alloc] init]); object = [self applyKeysAndValuesFromDictionary: dict toObject: object]; if([object isKindOfClass: [PBXContainer class]]) { [object setObjects: _objectCache]; [object setFilename: _fileName]; ASSIGN(_rootObject, object); } return object; } - (id) unarchiveObjectForKey: (NSString *)key { id obj = [_objectCache objectForKey: key]; if(obj != nil) { return obj; } // cache the object, if it exists in objects... if not return nil NSDictionary *dict = [_objects objectForKey: key]; if(dict != nil) { obj = [self unarchiveFromDictionary: dict]; [_objectCache setObject: obj forKey: key]; } return obj; } - (NSMutableArray *) resolveArrayMembers: (NSMutableArray *)array { NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity: 10]; NSEnumerator *en = [array objectEnumerator]; id key = nil; while((key = [en nextObject]) != nil) { id obj = [self unarchiveObjectForKey: key]; if(obj != nil) { [result addObject: obj]; } } return result; } - (id) applyKeysAndValuesFromDictionary: (NSDictionary *)dict toObject: (id)object { NSEnumerator *en = [dict keyEnumerator]; NSString *key = nil; while((key = [en nextObject]) != nil) { // continue if it's the isa pointer... if([key isEqualToString: @"isa"]) { continue; } id value = [dict objectForKey: key]; if(value != nil) { NS_DURING { // if it's an array, resolve the indexes of the array.... if([value isKindOfClass: [NSMutableArray class]]) { value = [self resolveArrayMembers: value]; } // search the global dictionary... if([key isEqualToString: @"containerPortal"] == NO && [key isEqualToString: @"remoteGlobalIDString"] == NO) { id newValue = [self unarchiveObjectForKey: value]; if(newValue != nil) { value = newValue; } } else { value = [_objectCache objectForKey: key]; } if(value != nil) { id currentValue = [object valueForKey: key]; if(currentValue == nil) { [object setValue: value forKey: key]; } } } NS_HANDLER { xcputs([[NSString stringWithFormat: @"%@, key = %@, value = %@, object = %@", [localException reason], key, value, object] cString]); } NS_ENDHANDLER; } } return object; } - (NSString *) projectRoot { return _projectRoot; } - (NSString *) fileName { return _fileName; } - (NSDictionary *) dictionary { return _dictionary; } - (NSDictionary *) objects { return _objects; } // Archiving methods... + (id) archiveWithRootObject: (id)root { PBXCoder *coder = [[self alloc] initWithRootObject: root]; return [coder archive]; } - (instancetype) initWithRootObject: (id)root { self = [super init]; if (self != nil) { ASSIGN(_rootObject, root); } return self; } - (id) archive { return [_rootObject allKeysAndValues]; } @end libs-xcode-XCode-0_5_0/XCode/PBXCommon.h000066400000000000000000000020201475431643200176670ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #include #include #import "GSXCCommon.h" libs-xcode-XCode-0_5_0/XCode/PBXCommon.m000066400000000000000000000016661475431643200177130ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ libs-xcode-XCode-0_5_0/XCode/PBXContainer.h000066400000000000000000000044331475431643200203730ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __PBXContainer_h_GNUSTEP_INCLUDE #define __PBXContainer_h_GNUSTEP_INCLUDE #import #import "PBXCoder.h" @interface PBXContainer : NSObject { NSString *_archiveVersion; NSMutableDictionary *_classes; NSString *_objectVersion; NSMutableDictionary *_objects; id _rootObject; NSString *_filename; NSString *_parameter; NSString *_workspaceLink; NSString *_workspaceLibs; NSString *_workspaceIncludes; } - (instancetype) initWithRootObject: (id)object; - (void) setWorkspaceIncludes: (NSString *)i; - (NSString *) workspaceIncludes; - (void) setWorkspaceLibs: (NSString *)l; - (NSString *) workspaceLibs; - (void) setWorkspaceLink: (NSString *)w; - (NSString *) workspaceLink; - (void) setParameter: (NSString *)p; - (NSString *) parameter; - (void) setArchiveVersion: (NSString *)version; - (NSString *) archiveVersion; - (void) setClasses: (NSMutableDictionary *)dict; - (NSMutableDictionary *) classes; - (void) setObjectVersion: (NSString *)version; - (NSString *) objectVersion; - (void) setObjects: (NSMutableDictionary *)dict; - (NSMutableDictionary *) objects; - (void) setRootObject: (id)object; - (id) rootObject; - (void) setFilename: (NSString *)fn; - (NSString *) filename; // Build... - (BOOL) build; - (BOOL) clean; - (BOOL) install; - (BOOL) generate; - (BOOL) link; - (BOOL) save; @end #endif libs-xcode-XCode-0_5_0/XCode/PBXContainer.m000066400000000000000000000143561475431643200204050ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXContainer.h" #import "PBXCommon.h" #import "PBXProject.h" #import "PBXFileReference.h" @implementation PBXContainer - (instancetype) init { self = [super init]; if (self != nil) { _archiveVersion = @"1"; _classes = [[NSMutableDictionary alloc] init]; _objectVersion = @"56"; _objects = [[NSMutableDictionary alloc] init]; _rootObject = nil; _filename = nil; _parameter = nil; _workspaceLink = nil; _workspaceLibs = nil; _workspaceIncludes = nil; } return self; } - (instancetype) initWithRootObject: (id)object { self = [self init]; if (self != nil) { [self setRootObject: object]; } return self; } - (void) dealloc { RELEASE(_archiveVersion); RELEASE(_classes); RELEASE(_objectVersion); RELEASE(_objects); RELEASE(_filename); RELEASE(_parameter); RELEASE(_workspaceLink); RELEASE(_workspaceLibs); RELEASE(_workspaceIncludes); [super dealloc]; } - (void) setWorkspaceIncludes: (NSString *)i { ASSIGN(_workspaceIncludes, i); } - (NSString *) workspaceIncludes { return _workspaceIncludes; } - (void) setWorkspaceLibs: (NSString *)l { ASSIGN(_workspaceLibs, l); } - (NSString *) workspaceLibs { return _workspaceLibs; } - (void) setWorkspaceLink: (NSString *)w { ASSIGN(_workspaceLink, w); } - (NSString *) workspaceLink { return _workspaceLink; } - (void) setParameter: (NSString *)p { ASSIGN(_parameter, p); } - (NSString *) parameter { return _parameter; } - (void) setFilename: (NSString *)fn { ASSIGN(_filename, fn); } - (NSString *) filename { return _filename; } - (void) setArchiveVersion: (NSString *)version { ASSIGN(_archiveVersion,version); } - (NSString *) archiveVersion { return _archiveVersion; } - (void) setClasses: (NSMutableDictionary *)dict { ASSIGN(_classes,dict); } - (NSMutableDictionary *) classes { return _classes; } - (void) setObjectVersion: (NSString *)version { ASSIGN(_objectVersion,version); } - (NSString *) objectVersion { return _objectVersion; } - (void) setObjects: (NSMutableDictionary *)dict { ASSIGN(_objects,dict); } - (NSMutableDictionary *) objects { return _objects; } - (id) rootObject { return _rootObject; } - (void) setRootObject: (id)object { ASSIGN(_rootObject, object); } - (void) collectHeaderFileReferences { NSString *includeDirs = @""; NSMutableArray *dirs = [NSMutableArray array]; NSArray *array = [_objects allValues]; NSEnumerator *en = [array objectEnumerator]; id obj = nil; NSMutableDictionary *context = [NSMutableDictionary dictionary]; while((obj = [en nextObject]) != nil) { if([obj isKindOfClass:[PBXFileReference class]]) { if([[obj lastKnownFileType] isEqualToString:@"sourcecode.c.h"]) { NSString *includePath = [[obj path] stringByDeletingLastPathComponent]; if([includePath isEqualToString:@""] == NO) { if([dirs containsObject:includePath] == NO) { [dirs addObject:includePath]; includeDirs = [includeDirs stringByAppendingFormat: @" -I./%@ ",includePath]; } } } } } // Add to the dictionary... [context setObject: includeDirs forKey:@"INCLUDE_DIRS"]; // Add workspace info to the context... if (_workspaceLink != nil) { [context setObject: _workspaceLink forKey: @"WORKSPACE_LINK_LINE"]; } NSDebugLog(@"\n\n\nlibs = %@\n\n\n", _workspaceLibs); if (_workspaceLibs != nil) { [context setObject: _workspaceLibs forKey: @"WORKSPACE_LIBS_LINE"]; } if (_workspaceIncludes != nil) { [context setObject: _workspaceIncludes forKey: @"WORKSPACE_INCLUDE_LINE"]; } [_rootObject setContext: context]; } - (BOOL) build { [self collectHeaderFileReferences]; [_rootObject setContainer: self]; return [_rootObject build]; } - (BOOL) clean { return [_rootObject clean]; } - (BOOL) install { return [_rootObject install]; } - (BOOL) generate { [self collectHeaderFileReferences]; [_rootObject setContainer: self]; return [_rootObject generate]; } - (BOOL) link { // Likely need to collect .o artifacts... [_rootObject setContainer: self]; return [_rootObject link]; } - (BOOL) save { NSString *fn = [[self filename] stringByDeletingLastPathComponent]; NSString *of = @"project.pbxproj"; NSString *dn = _parameter; NSFileManager *fm = [NSFileManager defaultManager]; NSError *error = nil; BOOL created = [fm createDirectoryAtPath: dn withIntermediateDirectories: YES attributes: NULL error: &error]; xcprintf("=== Saving Project %s%s%s%s -> %s%s%s\n", BOLD, YELLOW, [fn cString], RESET, GREEN, [dn cString], RESET); // Clear the cached objects dictionary; [_rootObject save]; // Setup to save... // Save the project... if (created && !error) { PBXCoder *coder = [[PBXCoder alloc] initWithRootObject: self]; NSDictionary *dictionary = [coder archive]; NSString *path = [dn stringByAppendingPathComponent: of]; BOOL result = [dictionary writeToFile: path atomically: YES]; if (result) { xcprintf("=== Done Saving Project %s%s%s%s\n", BOLD, GREEN, [dn cString], RESET); } else { xcprintf("=== Error Saving Project %s%s%s%s\n", BOLD, GREEN, [dn cString], RESET); } return result; } else { xcprintf("=== Error creating directory %s", dn); } return NO; } @end libs-xcode-XCode-0_5_0/XCode/PBXContainerItemProxy.h000066400000000000000000000032071475431643200222520ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXFileReference.h" @interface PBXContainerItemProxy : NSObject { NSString *proxyType; NSString *remoteGlobalIDString; id containerPortal; NSString *remoteInfo; } // Methods.... - (NSString *) proxyType; // getter - (void) setProxyType: (NSString *)object; // setter - (NSString *) remoteGlobalIDString; // getter - (void) setRemoteGlobalIDString: (NSString *)object; // setter - (id) containerPortal; // getter - (void) setContainerPortal: (id)object; // setter - (NSString *) remoteInfo; // getter - (void) setRemoteInfo: (NSString *)object; // setter - (BOOL) build; - (BOOL) generate; - (BOOL) clean; - (BOOL) save; @end libs-xcode-XCode-0_5_0/XCode/PBXContainerItemProxy.m000066400000000000000000000056611475431643200222650ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXContainerItemProxy.h" #import "PBXCoder.h" #import "PBXContainer.h" #import "GSXCBuildContext.h" @implementation PBXContainerItemProxy - (void) dealloc { RELEASE(proxyType); RELEASE(remoteGlobalIDString); RELEASE(containerPortal); RELEASE(remoteInfo); [super dealloc]; } // Methods.... - (NSString *) proxyType // getter { return proxyType; } - (void) setProxyType: (NSString *)object; // setter { ASSIGN(proxyType,object); } - (NSString *) remoteGlobalIDString // getter { return remoteGlobalIDString; } - (void) setRemoteGlobalIDString: (NSString *)object; // setter { ASSIGN(remoteGlobalIDString,object); } - (id) containerPortal // getter { return containerPortal; } - (void) setContainerPortal: (id)object; // setter { ASSIGN(containerPortal,object); } - (NSString *) remoteInfo // getter { return remoteInfo; } - (void) setRemoteInfo: (NSString *)object; // setter { ASSIGN(remoteInfo,object); } - (BOOL) build { PBXContainer *currentContainer = [[GSXCBuildContext sharedBuildContext] objectForKey: @"CONTAINER"]; NSFileManager *mgr = [NSFileManager defaultManager]; containerPortal = [[currentContainer objects] objectForKey: containerPortal]; if([containerPortal isKindOfClass: [PBXFileReference class]]) { xcputs([[NSString stringWithFormat: @"=== Proxy Reading %s%@%s", GREEN, [containerPortal path], RESET] cString]); NSString *dir = [mgr currentDirectoryPath]; PBXCoder *coder = [[PBXCoder alloc] initWithProjectFile: [containerPortal path]]; [mgr changeCurrentDirectoryPath: [coder projectRoot]]; PBXContainer *container = [coder unarchive]; [container setFilename: [containerPortal path]]; BOOL result = [container build]; [mgr changeCurrentDirectoryPath: dir]; return result; } else { return YES; } return NO; } - (BOOL) save { return YES; } - (BOOL) generate { return YES; } - (BOOL) clean { return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXCopyFilesBuildPhase.h000066400000000000000000000025261475431643200223100ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @interface PBXCopyFilesBuildPhase : PBXBuildPhase { NSString *dstPath; NSString *dstSubfolderSpec; } // Methods.... - (NSString *) dstPath; // getter - (void) setDstPath: (NSString *)object; // setter - (NSString *) dstSubfolderSpec; // getter - (void) setDstSubfolderSpec: (NSString *)object; // setter @end libs-xcode-XCode-0_5_0/XCode/PBXCopyFilesBuildPhase.m000066400000000000000000000026121475431643200223110ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXCopyFilesBuildPhase.h" @implementation PBXCopyFilesBuildPhase // Methods.... - (NSString *) dstPath // getter { return dstPath; } - (void) setDstPath: (NSString *)object; // setter { ASSIGN(dstPath,object); } - (NSString *) dstSubfolderSpec // getter { return dstSubfolderSpec; } - (void) setDstSubfolderSpec: (NSString *)object; // setter { ASSIGN(dstSubfolderSpec,object); } - (BOOL) generate { return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXFileReference.h000066400000000000000000000056461475431643200211560ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __PBXFileReference_h_GNUSTEP_INCLUDE #define __PBXFileReference_h_GNUSTEP_INCLUDE #import // Local includes #import "PBXCoder.h" @class PBXNativeTarget; @interface PBXFileReference : NSObject { NSString *_sourceTree; NSString *_lastKnownFileType; NSString *_path; NSString *_fileEncoding; NSString *_explicitFileType; NSString *_usesTabs; NSString *_indentWidth; NSString *_tabWidth; NSString *_name; NSString *_includeInIndex; NSString *_comments; NSString *_plistStructureDefinitionIdentifier; NSString *_xcLanguageSpecificationIdentifier; NSString *_lineEnding; NSString *_wrapsLines; PBXNativeTarget *_target; NSUInteger _totalFiles; NSUInteger _currentFile; } + (NSString *) fileTypeFromPath: (NSString *)path; + (NSString *) extForFileType: (NSString *)type; - (instancetype) initWithPath: (NSString *)path; - (void) setTotalFiles: (NSUInteger)t; - (void) setCurrentFile: (NSUInteger)n; - (NSString *) sourceTree; // getter - (void) setSourceTree: (NSString *)object; // setter - (NSString *) lastKnownFileType; // getter - (void) setLastKnownFileType: (NSString *)object; // setter - (NSString *) path; // getter - (void) setPath: (NSString *)object; // setter - (NSString *) fileEncoding; // getter - (void) setFileEncoding: (NSString *)object; // setter - (NSString *) explicitFileType; - (void) setExplicitFileType: (NSString *)object; - (NSString *) name; - (void) setName: (NSString *)object; - (void) setPlistStructureDefinitionIdentifier: (NSString *)object; - (NSString *) xcLanguageSpecificationIdentifier; - (void) setXcLanguageSpecificationIdentifier: (NSString *)object; - (NSString *) lineEnding; - (void) setLineEnding: (NSString *)object; - (void) setTarget: (PBXNativeTarget *)t; - (void) setWrapsLines: (NSString *)o; - (NSString *) includeInIndex; - (void) setIncludeInIndex: (NSString *)includeInIndex; - (NSString *) productName; // Build methods... - (NSString *) buildPath; - (BOOL) build; - (BOOL) generate; @end #endif libs-xcode-XCode-0_5_0/XCode/PBXFileReference.m000066400000000000000000000773141475431643200211640ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // #import #import "PBXCommon.h" #import "PBXFileReference.h" #import "PBXGroup.h" #import "GSXCBuildContext.h" #import "NSArray+Additions.h" #import "NSString+PBXAdditions.h" #import "PBXNativeTarget.h" #import "XCConfigurationList.h" #import "XCBuildConfiguration.h" extern char **environ; static NSLock *lock = nil; @implementation PBXFileReference + (void) initialize { lock = [[NSLock alloc] init]; } + (NSString *) fileTypeFromPath: (NSString *)path { NSString *result = @"compiled.mach-o.executable"; NSString *ext = [path pathExtension]; if ([ext isEqualToString: @"m"]) { result = @"sourcecode.c.objc"; } else if ([ext isEqualToString: @"c"]) { result = @"sourcecode.c.c"; } else if ([ext isEqualToString: @"cc"] || [ext isEqualToString: @"cpp"] || [ext isEqualToString: @"C"] || [ext isEqualToString: @"cxx"]) { result = @"sourcecode.cpp.cpp"; } else if ([ext isEqualToString: @"mm"]) { result = @"sourcecode.cpp.objcpp"; } else if ([ext isEqualToString: @"lex.yy"]) { result = @"sourcecode.lex"; } else if ([ext isEqualToString: @"yy.tab"]) { result = @"sourcecode.yacc"; } else if ([ext isEqualToString: @"app"]) { result = @"file.xib"; } else if ([ext isEqualToString: @"nib"]) { result = @"file.nib"; } else if ([ext isEqualToString: @"gorm"]) { result = @"file.gorm"; // GS specific } else if ([ext isEqualToString: @"entitlements"]) { result = @"text.plist.entitlements"; } return result; } + (NSString *) extForFileType: (NSString *)type { NSString *result = @""; if ([type isEqualToString: @"sourcecode.c.objc"]) { result = @"m"; } else if ([type isEqualToString: @"sourcecode.c.c"]) { result = @"c"; } else if ([type isEqualToString: @"sourcecode.cpp.cpp"]) { result = @"cc"; } else if ([type isEqualToString: @"sourcecode.cpp.objcpp"]) { result = @"mm"; } else if ([type isEqualToString: @"sourcecode.lex"]) { result = @"lex.yy"; } else if ([type isEqualToString: @"sourcecode.yacc"]) { result = @"yy.tab"; } else if ([type isEqualToString: @"wrapper.application"]) { result = @"app"; } else if ([type isEqualToString: @"file.xib"]) { result = @"xib"; } else if ([type isEqualToString: @"file.nib"]) { result = @"nib"; } else if ([type isEqualToString: @"file.gorm"]) { result = @"gorm"; } else if ([type isEqualToString: @"text.plist.entitlements"]) { result = @"entitlements"; } return result; } - (instancetype) initWithPath: (NSString *)path { self = [super init]; if (self != nil) { NSString *fileType = [PBXFileReference fileTypeFromPath: [path lastPathComponent]]; if ([fileType isEqualToString: @"compiled.mach-o.executable"]) { [self setIncludeInIndex: @"0"]; } if ([fileType isEqualToString: @"wrapper.application"]) { [self setExplicitFileType: fileType]; } else { [self setLastKnownFileType: fileType]; } ASSIGN(_path, path); [self setSourceTree: @""]; } return self; } - (void) dealloc { RELEASE(_sourceTree); RELEASE(_lastKnownFileType); RELEASE(_path); RELEASE(_fileEncoding); RELEASE(_explicitFileType); RELEASE(_usesTabs); RELEASE(_indentWidth); RELEASE(_tabWidth); RELEASE(_name); RELEASE(_includeInIndex); RELEASE(_comments); RELEASE(_plistStructureDefinitionIdentifier); RELEASE(_xcLanguageSpecificationIdentifier); RELEASE(_lineEnding); RELEASE(_wrapsLines); [super dealloc]; } - (void) setTotalFiles: (NSUInteger)t { _totalFiles = t; } - (void) setCurrentFile: (NSUInteger)n { _currentFile = n; } - (void) setWrapsLines: (NSString *)o { ASSIGN(_wrapsLines, o); } - (NSString *) sourceTree // getter { return _sourceTree; } - (void) setSourceTree: (NSString *)object; // setter { ASSIGN(_sourceTree,object); } - (NSString *) lastKnownFileType // getter { return _lastKnownFileType; } - (void) setLastKnownFileType: (NSString *)object; // setter { ASSIGN(_lastKnownFileType,object); } - (NSString *) path // getter { return _path; } - (void) setPath: (NSString *)object; // setter { ASSIGN(_path,object); } - (NSString *) fileEncoding // getter { return _fileEncoding; } - (void) setFileEncoding: (NSString *)object; // setter { ASSIGN(_fileEncoding,object); } - (NSString *) explicitFileType { return _explicitFileType; } - (void) setExplicitFileType: (NSString *)object { ASSIGN(_explicitFileType,object); } - (NSString *) name; { return _name; } - (void) setName: (NSString *)object { ASSIGN(_name,object); } - (NSString *) plistStructureDefinitionIdentifier { return _plistStructureDefinitionIdentifier; } - (void) setPlistStructureDefinitionIdentifier: (NSString *)object { ASSIGN(_plistStructureDefinitionIdentifier,object); } - (NSString *) xcLanguageSpecificationIdentifier { return _xcLanguageSpecificationIdentifier; } - (void) setXcLanguageSpecificationIdentifier: (NSString *)object { ASSIGN(_xcLanguageSpecificationIdentifier, object); } - (NSString *) lineEnding { return _lineEnding; } - (void) setLineEnding: (NSString *)object { ASSIGN(_lineEnding,object); } - (void) setTarget: (PBXNativeTarget *)t { _target = t; } - (NSString *) includeInIndex { return _includeInIndex; } - (void) setIncludeInIndex: (NSString *)includeInIndex { ASSIGN(_includeInIndex, includeInIndex); } - (NSString *) _resolvePathFor: (id)object withGroup: (PBXGroup *)group found: (BOOL *)found { NSString *result = @""; NSArray *children = [group children]; NSEnumerator *en = [children objectEnumerator]; id file = nil; while((file = [en nextObject]) != nil && *found == NO) { if([[file path] isEqualToString: [self path]]) // have we found ourselves?? { NSString *filePath = ([file path] == nil)?@"":[file path]; result = filePath; *found = YES; break; } else if([file isKindOfClass: [PBXGroup class]]) { NSString *filePath = ([file path] == nil)?@"":[file path]; result = [filePath stringByAppendingPathComponent: [self _resolvePathFor: object withGroup: file found: found]]; } } return result; } - (NSArray *) _allSubdirsAtPath: (NSString *)apath { NSMutableArray *results = [NSMutableArray arrayWithCapacity:10]; NSFileManager *manager = [[NSFileManager alloc] init]; NSDirectoryEnumerator *en = [manager enumeratorAtPath:apath]; NSString *filename = nil; NSDebugLog(@"apath = %@", apath); NSDebugLog(@"cwd = %@", [manager currentDirectoryPath]); while((filename = [en nextObject]) != nil) { BOOL isDir = NO; NSString *dirToAdd = nil; [manager fileExistsAtPath: filename isDirectory: &isDir]; if (isDir == NO) { if ([filename isEqualToString: @""]) { dirToAdd = @"."; } if ([[filename pathComponents] count] > 2) { continue; } if ([[filename pathExtension] isEqualToString: @"h"]) { NSDebugLog(@"filename = %@", filename); dirToAdd = [filename stringByDeletingLastPathComponent]; } } else { NSDebugLog(@"dir = %@", filename); continue; } if (dirToAdd == nil) { continue; } if ([results containsObject: dirToAdd] == NO) // [dirToAdd stringByAddingQuotationMarks]] == NO) { NSString *ext = [dirToAdd pathExtension]; if ([ext isEqualToString: @"app"] || [ext isEqualToString: @"xcassets"] || [ext isEqualToString: @"lproj"] || [dirToAdd containsString: @"build"] || [dirToAdd containsString: @"pbxbuild"] || [dirToAdd containsString: @"xcassets"] || [dirToAdd containsString: @"lproj"] || [dirToAdd containsString: @"xcodeproj"] || [dirToAdd containsString: @".git"]) { continue; } if ([dirToAdd isEqualToString: @""] == NO) { [results addObject: dirToAdd]; // [dirToAdd stringByAddingQuotationMarks]]; NSDebugLog(@"adding dirToAdd = %@", dirToAdd); } } } // For some reason repeating the first -I directive helps resolve some issues with // finding headers. id o = [results count] > 1 ? [results objectAtIndex: 1] : @"."; o = [o isEqualToString: @""] ? @"." : o; [results addObject: o]; results = [[results arrayByRemovingDuplicateEntries] mutableCopy]; NSDebugLog(@"results = %@", results); RELEASE(manager); return results; } - (NSString *) productName { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *ctx = [context currentContext]; XCConfigurationList *xcl = [ctx objectForKey: @"buildConfig"]; XCBuildConfiguration *xbc = [xcl defaultConfiguration]; NSDictionary *bs = [xbc buildSettings]; NSString *productName = [bs objectForKey: @"PRODUCT_NAME"]; return productName; } - (NSString *) buildPath { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; PBXGroup *mainGroup = [context objectForKey: @"MAIN_GROUP"]; BOOL found = NO; NSString *result = nil, *r = nil; NSDictionary *plistFile = [context config]; NSDictionary *remappedSource = [plistFile objectForKey: @"remappedSource"]; // Resolve path for the current file reference... result = [self _resolvePathFor: self withGroup: mainGroup found: &found]; if ((r = [remappedSource objectForKey: result]) != nil) { xcputs([[NSString stringWithFormat: @"\t+ Remapped %s%s%@%s to -> %s%s%@%s", BOLD, YELLOW, result, RESET, BOLD, GREEN, r, RESET] cString]); result = r; } return result; } - (NSArray *) substituteSearchPaths: (NSArray *)array buildPath: (NSString *)buildPath { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSMutableArray *result = [NSMutableArray arrayWithCapacity: [array count]]; NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity: [array count]]; XCConfigurationList *list = [context objectForKey: @"buildConfig"]; NSMutableArray *allHeaders = [NSMutableArray arrayWithArray: array]; NSDictionary *plistFile = [context config]; NSArray *headerPaths = [plistFile objectForKey: @"headerPaths"]; XCBuildConfiguration *config = [[list buildConfigurations] objectAtIndex: 0]; NSDictionary *buildSettings = [config buildSettings]; NSMutableArray *headers = [buildSettings objectForKey: @"HEADER_SEARCH_PATHS"]; if ([headers isKindOfClass: [NSArray class]] && headers != nil) { [allHeaders addObjectsFromArray: headers]; } if ([headerPaths isKindOfClass: [NSArray class]] && headerPaths != nil) { [allHeaders prependObjectsFromArray: headerPaths]; } // get environment variables... char **env = NULL; for (env = environ; *env != 0; env++) { char *thisEnv = *env; NSString *envStr = [NSString stringWithCString: thisEnv encoding: NSUTF8StringEncoding]; NSArray *components = [envStr componentsSeparatedByString: @"="]; [dict setObject: [[components lastObject] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]] forKey: [[components firstObject] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]]]; } // Get project root NSString *projDir = [NSString stringForEnvironmentVariable: @"PROJECT_ROOT" defaultValue: @"."]; NSEnumerator *en = [allHeaders objectEnumerator]; NSString *s = nil; while ((s = [en nextObject]) != nil) { if ([s isEqualToString: @"$(inherited)"]) continue; NSString *o = [s stringByReplacingOccurrencesOfString: @"$(PROJECT_DIR)" withString: projDir]; o = [o stringByReplacingOccurrencesOfString: @"${PROJECT_DIR}" withString: projDir]; NSString *q = [o stringByReplacingEnvironmentVariablesWithValues]; if ([result containsObject: o] == NO) { [result addObject: o]; [result addObject: q]; } } return result; } - (NSArray *) _addParentPath: (NSString *)parent toPaths: (NSArray *)paths { NSMutableArray *result = [NSMutableArray arrayWithCapacity: [paths count]]; NSEnumerator *en = [paths objectEnumerator]; NSString *p = nil; [result addObject: parent]; while((p = [en nextObject]) != nil) { NSString *newPath = [parent stringByAppendingPathComponent: p]; [result addObject: newPath]; } return result; } - (NSString *) _headerStringForPath: (NSString *)apath { BOOL isDir; NSFileManager *manager = [NSFileManager defaultManager]; NSArray *result = [NSArray array]; [manager fileExistsAtPath:apath isDirectory:&isDir]; if (isDir) { result = [self _allSubdirsAtPath: apath]; result = [result arrayByAddingObjectsFromArray: [self _addParentPath: apath toPaths: result]]; result = [result arrayByAddingObject: apath]; result = [result arrayByRemovingDuplicateEntries]; result = [result arrayByAddingQuotationMarksToEntries]; } return [result removeDuplicatesAndImplodeWithSeparator: @" -I"]; } - (NSString *) _compiler { NSString *compiler = nil; compiler = [NSString stringForEnvironmentVariable: @"CC" defaultValue: @"`gnustep-config --variable=CC` " @"`gnustep-config --objc-flags`"]; return compiler; } - (NSMutableArray *) _arrayForKey: (NSString *)keyName { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSMutableArray *result = [context objectForKey: keyName]; if (result == nil) { result = [NSMutableArray array]; [context setObject: result forKey: keyName]; } return result; } - (BOOL) buildWithPath: (NSString *)bp andFileType: (NSString *)ft { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; // NSString *of = [context objectForKey: @"OUTPUT_FILES"]; NSDictionary *config = [context config]; NSString *ctarget = [config objectForKey: @"target"]; NSString *additionalCFlags = [config objectForKey: @"additionalCFlags"]; NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; // NSString *outputFiles = (of == nil)?@"":of; int result = 0; NSError *error = nil; NSFileManager *manager = [NSFileManager defaultManager]; NSDictionary *ctx = [context currentContext]; XCConfigurationList *xcl = [ctx objectForKey: @"buildConfig"]; XCBuildConfiguration *xbc = [xcl defaultConfiguration]; NSDictionary *bs = [xbc buildSettings]; NSDictionary *plistFile = [context config]; NSArray *skippedSource = [plistFile objectForKey: @"skippedSource"]; NSString *buildType = [config objectForKey: @"buildType"]; if (additionalCFlags == nil) { additionalCFlags = @""; } if ([skippedSource containsObject: bp]) { xcprintf("skipping file.\n"); return YES; } // Show the build percentage during linear build... if ([buildType isEqualToString: @"linear"] || buildType == nil) { CGFloat perc = 100.0 * ((CGFloat)_currentFile / (CGFloat)_totalFiles); xcprintf("%s",[[NSString stringWithFormat: @"\t* Building %s%s%@%s (%ld / %ld) - ( %3.2f%% )... ", BOLD, MAGENTA, bp, RESET, (long)_currentFile, (long)_totalFiles, perc] cString]); } if(modified == nil) { modified = @"NO"; [context setObject: @"NO" forKey: @"MODIFIED_FLAG"]; } if([ft isEqualToString: @"sourcecode.c.objc"] || [ft isEqualToString: @"sourcecode.c.c"] || [ft isEqualToString: @"sourcecode.cpp.cpp"] || [ft isEqualToString: @"sourcecode.cpp.objcpp"]) { NSString *proj_root = [bs objectForKey: @"PROJECT_ROOT"]; if (proj_root == nil || [proj_root isEqualToString: @""]) { proj_root = @"."; } if ([ft isEqualToString: @"sourcecode.cpp.cpp"] || [ft isEqualToString: @"sourcecode.cpp.objcpp"]) { [context setObject: @"YES" forKey: @"LINK_WITH_CPP"]; } NSString *compiler = [self _compiler]; NSString *buildPath = [proj_root stringByAppendingPathComponent: bp]; NSArray *localHeaderPathsArray = [self _allSubdirsAtPath:@"."]; NSString *fileName = [_path lastPathComponent]; NSString *buildDir = [NSString stringForEnvironmentVariable: @"TARGET_BUILD_DIR" defaultValue: @"build"]; NSString *additionalHeaderDirs = [context objectForKey:@"INCLUDE_DIRS"]; NSString *derivedSrcHeaderDir = [context objectForKey: @"DERIVED_SOURCE_HEADER_DIR"]; NSString *headerSearchPaths = [[self substituteSearchPaths: [context objectForKey: @"HEADER_SEARCH_PATHS"] buildPath: buildPath] removeDuplicatesAndImplodeWithSeparator: @" -I"]; NSString *warningCflags = [[context objectForKey: @"WARNING_CFLAGS"] removeDuplicatesAndImplodeWithSeparator: @" "]; NSString *wsIncDirs = [context objectForKey: @"WORKSPACE_INCLUDE_LINE"]; NSString *usePCHFlag = [bs objectForKey: @"GCC_PRECOMPILE_PREFIX_HEADER"]; NSString *localHeaderPaths = [localHeaderPathsArray implodeArrayWithSeparator:@" -I"]; buildDir = [buildDir stringByAppendingPathComponent: [_target name]]; // blank these out if they are not used... if(headerSearchPaths == nil) { headerSearchPaths = @""; } if(localHeaderPaths == nil) { localHeaderPaths = @""; } if(warningCflags == nil) { warningCflags = @""; } // if the workspace has added include dirs if (wsIncDirs != nil) { headerSearchPaths = [headerSearchPaths stringByAppendingString: wsIncDirs]; NSDebugLog(@"\n\n\nheaders = %@\n\n\n", headerSearchPaths); } // If we have derived sources, then get the header directory and add it to the search path.... if(derivedSrcHeaderDir != nil) { if([[derivedSrcHeaderDir pathComponents] count] > 1) { headerSearchPaths = [headerSearchPaths stringByAppendingString: [NSString stringWithFormat: @" -I'%@' ", [derivedSrcHeaderDir stringByDeletingLastPathComponent]]]; } } // If we have additional header dirs specified... then add them. if(additionalHeaderDirs != nil) { headerSearchPaths = [headerSearchPaths stringByAppendingString: additionalHeaderDirs]; headerSearchPaths = [headerSearchPaths stringByAppendingString: localHeaderPaths]; } [lock lock]; NSString *outputPath = [buildDir stringByAppendingPathComponent: [fileName stringByAppendingString: @".o"]]; [lock unlock]; NSString *objCflags = @""; if([ft isEqualToString: @"sourcecode.c.objc"]) { objCflags = @""; } NSString *std = [NSString stringForEnvironmentVariable: @"GCC_C_LANGUAGE_STANDARD" defaultValue: @""]; if ([std length] > 0) { if([std isEqualToString:@"compiler-default"] == YES) { std = @"gnu99"; } objCflags = [NSString stringWithFormat: @"%@ -std=%@", objCflags, std]; } // remove flags incompatible with gnustep... objCflags = [objCflags stringByReplacingOccurrencesOfString: @"-std=gnu11" withString: @""]; headerSearchPaths = [headerSearchPaths stringByReplacingEnvironmentVariablesWithValues]; NSString *configString = [context objectForKey: @"CONFIG_STRING"]; NSString *buildTemplate = nil; buildTemplate = @"%@ 2> %@ -c %@ %@ %@ %@ %@ %@ %@ -o %@"; if ([ctarget isEqualToString: @"msvc"]) { buildTemplate = @"%@ 2> %@ -c %@ %@ %@ -D_CRT_SECURE_NO_WARNINGS %@ %@ %@ %@ -o %@"; } if ([usePCHFlag isEqualToString: @"YES"]) { NSString *pchFile = [bs objectForKey: @"GCC_PREFIX_HEADER"]; if (![pchFile isEqualToString: @""] && pchFile != nil) { buildTemplate = [buildTemplate stringByAppendingString: [NSString stringWithFormat: @" -include %@", pchFile]]; } } NSString *compilePath = bp; NSString *subdirHeaderSearchPaths = [self _headerStringForPath: compilePath]; NSString *parentHeaderSearchPaths = [self _headerStringForPath: [[compilePath pathComponents] firstObject]]; NSString *errorOutPath = [outputPath stringByAppendingString: @".err"]; NSString *buildCommand = [NSString stringWithFormat: buildTemplate, compiler, [errorOutPath stringByAddingQuotationMarks], [compilePath stringByAddingQuotationMarks], objCflags, additionalCFlags, configString, parentHeaderSearchPaths, headerSearchPaths, subdirHeaderSearchPaths, [outputPath stringByAddingQuotationMarks]]; NSDictionary *buildPathAttributes = [manager attributesOfItemAtPath: buildPath error: &error]; NSDictionary *outputPathAttributes = [manager attributesOfItemAtPath: outputPath error: &error]; NSDate *buildPathDate = [buildPathAttributes fileModificationDate]; NSDate *outputPathDate = [outputPathAttributes fileModificationDate]; buildCommand = [buildCommand stringByReplacingOccurrencesOfString: @"$(inherited)" withString: @"."]; NSDebugLog(@"%@", buildCommand); if (outputPathDate != nil) { if([buildPathDate compare: outputPathDate] == NSOrderedDescending) { result = xcsystem(buildCommand); if([modified isEqualToString: @"NO"]) { modified = @"YES"; [context setObject: @"YES" forKey: @"MODIFIED_FLAG"]; } if (result == 0) { if ([buildType isEqualToString: @"linear"] || buildType == nil) { xcprintf("%srebuilt%s\n", GREEN, RESET); } } } else { if ([buildType isEqualToString: @"linear"] || buildType == nil) { xcprintf("%sexists%s\n", YELLOW, RESET); } } } else { result = xcsystem(buildCommand); if([modified isEqualToString: @"NO"]) { modified = @"YES"; [context setObject: @"YES" forKey: @"MODIFIED_FLAG"]; } if (result == 0) { if ([buildType isEqualToString: @"linear"] || buildType == nil) { xcprintf("%ssuccess%s\n", GREEN, RESET); } } } // If the result is not successful, show the error... if (result != 0) { if ([buildType isEqualToString: @"linear"] || buildType == nil) { xcprintf("%serror%s\n\n", RED, RESET); } NSString *errorString = [NSString stringWithContentsOfFile: errorOutPath]; [NSException raise: NSGenericException format: @"\n%sCommand:%s %@\n%sMessage:%s %@\n", YELLOW, RESET, buildCommand, RED, RESET, errorString]; } // [context setObject: outputFiles forKey: @"OUTPUT_FILES"]; } else if ([ft isEqualToString: @"sourcecode.lex"] || [_explicitFileType isEqualToString: @"sourcecode.lex"]) { NSString *ex = [bp pathExtension]; NSString *nx = [ex substringFromIndex: [ex length] - 1]; NSString *op = [@"lex.yy" stringByAppendingPathExtension: nx]; NSString *fp = [[bp stringByDeletingLastPathComponent] stringByAppendingPathComponent: op]; NSString *command = [NSString stringWithFormat: @"flex > /dev/null 2> /dev/null -o %@ %@", fp, bp]; NSInteger f = 0; xcprintf("%s%sprocessing%s\n", BOLD, YELLOW, RESET); f = xcsystem(command); if (f == 0) { return [self buildWithPath: fp andFileType: @"sourcecode.c.objc"]; } } else if ([ft isEqualToString: @"sourcecode.yacc"] || [_explicitFileType isEqualToString: @"sourcecode.yacc"]) { NSString *ex = [bp pathExtension]; NSString *nx = [ex substringFromIndex: [ex length] - 1]; NSString *op = [@"y.tab" stringByAppendingPathExtension: nx]; NSString *fp = [[bp stringByDeletingLastPathComponent] stringByAppendingPathComponent: op]; NSString *command = [NSString stringWithFormat: @"bison > /dev/null 2> /dev/null -o %@ %@", fp, bp]; NSInteger f = 0; xcprintf("%s%sprocessing%s\n", BOLD, YELLOW, RESET); f = xcsystem(command); if (f == 0) { return [self buildWithPath: fp andFileType: @"sourcecode.c.objc"]; } } else { NSLog(@"Unknown file type... %@", ft); } fflush(stdout); return (result == 0); } - (BOOL) build { NSString *ft = (_explicitFileType == nil) ? _lastKnownFileType : _explicitFileType; return [self buildWithPath: [self buildPath] andFileType: ft]; } - (BOOL) generate { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSMutableArray *objcFiles = [self _arrayForKey: @"OBJC_FILES"]; NSMutableArray *cFiles = [self _arrayForKey: @"C_FILES"]; NSMutableArray *cppFiles = [self _arrayForKey: @"CPP_FILES"]; // NSMutableArray *hFiles = [self _arrayForKey: @"HEADERS"]; NSMutableArray *objcppFiles = [self _arrayForKey: @"OBJCPP_FILES"]; NSMutableArray *addlIncDirs = [self _arrayForKey: @"ADDITIONAL_INCLUDE_DIRS"]; NSString *of = [context objectForKey: @"OUTPUT_FILES"]; NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; NSString *outputFiles = (of == nil)?@"":of; int result = 0; NSFileManager *manager = [NSFileManager defaultManager]; // NSDebugLog(@"*** %@", _sourceTree); if(modified == nil) { modified = @"NO"; [context setObject: @"NO" forKey: @"MODIFIED_FLAG"]; } // Get project root NSString *projDir = [NSString stringForEnvironmentVariable: @"PROJECT_ROOT" defaultValue: @"."]; NSString *buildPath = [projDir stringByAppendingPathComponent: [self buildPath]]; NSArray *localHeaderPathsArray = [self _allSubdirsAtPath: @"."]; NSString *buildDir = [NSString stringForEnvironmentVariable: @"TARGET_BUILD_DIR" defaultValue: @"build"]; buildDir = [buildDir stringByAppendingPathComponent: [self productName]]; NSString *additionalHeaderDirs = [context objectForKey:@"INCLUDE_DIRS"]; NSString *derivedSrcHeaderDir = [context objectForKey: @"DERIVED_SOURCE_HEADER_DIR"]; NSString *headerSearchPaths = [[context objectForKey: @"HEADER_SEARCH_PATHS"] removeDuplicatesAndImplodeWithSeparator: @" -I"]; NSString *warningCflags = [[context objectForKey: @"WARNING_CFLAGS"] removeDuplicatesAndImplodeWithSeparator: @" "]; NSString *localHeaderPaths = [localHeaderPathsArray removeDuplicatesAndImplodeWithSeparator:@" -I"]; NSDebugLog(@"localHeaderPathsArray = %@, %@", localHeaderPathsArray, localHeaderPaths); NSDebugLog(@"Build path = %@, %@", [self buildPath], [[self buildPath] stringByDeletingFirstPathComponent]); // blank these out if they are not used... if(headerSearchPaths == nil) { headerSearchPaths = @""; } if(localHeaderPaths == nil) { localHeaderPaths = @""; } if(warningCflags == nil) { warningCflags = @""; } // If we have derived sources, then get the header directory and add it to the search path.... if(derivedSrcHeaderDir != nil) { if([[derivedSrcHeaderDir pathComponents] count] > 1) { headerSearchPaths = [headerSearchPaths stringByAppendingString: [NSString stringWithFormat: @" -I%@ ", [derivedSrcHeaderDir stringByDeletingLastPathComponent]]]; } } // If we have additional header dirs specified... then add them. if(additionalHeaderDirs != nil) { headerSearchPaths = [headerSearchPaths stringByAppendingString: additionalHeaderDirs]; headerSearchPaths = [headerSearchPaths stringByAppendingString: localHeaderPaths]; } // Sometimes, for some incomprehensible reason, the buildpath doesn't // need the project dir pre-pended. This could be due to differences // in different version of xcode. It must be removed to successfully // compile the application... if([manager fileExistsAtPath:buildPath] == NO) { buildPath = [self path]; } NSString *objCflags = @""; if([_lastKnownFileType isEqualToString: @"sourcecode.c.objc"]) { // objCflags = @"-fconstant-string-class=NSConstantString"; objCflags = @""; } if([_lastKnownFileType isEqualToString: @"sourcecode.cpp.objcpp"]) { objCflags = [objCflags stringByReplacingOccurrencesOfString: @"-std=gnu99" withString: @""]; } // remove flags incompatible with gnustep... objCflags = [objCflags stringByReplacingOccurrencesOfString: @"-std=gnu11" withString: @""]; // get compile path BOOL exists = [manager fileExistsAtPath: [self buildPath]]; NSString *compilePath = ([[[self buildPath] pathComponents] count] > 1 && !exists) ? [[[self buildPath] stringByDeletingFirstPathComponent] stringByEscapingSpecialCharacters] : [self buildPath]; [context setObject: outputFiles forKey: @"OUTPUT_FILES"]; if ([_lastKnownFileType isEqualToString: @"sourcecode.c.objc"]) { [objcFiles addObject: compilePath]; } if ([_lastKnownFileType isEqualToString: @"sourcecode.c.c"]) { [cFiles addObject: compilePath]; } if ([_lastKnownFileType isEqualToString: @"sourcecode.cpp.cpp"]) { [cppFiles addObject: compilePath]; } if ([_lastKnownFileType isEqualToString: @"sourcecode.cpp.objcpp"]) { [objcppFiles addObject: compilePath]; } if ([_lastKnownFileType isEqualToString: @"sourcexode.c.h"]) { } NSString *includePath = [compilePath stringByDeletingLastPathComponent]; NSDebugLog(@"%@", includePath); if (includePath != nil && [includePath isEqualToString: @""] == NO) { if ([addlIncDirs containsObject: includePath] == NO) { [addlIncDirs addObject: includePath]; } } NSDebugLog(@"Additional includes %@", addlIncDirs); return (result == 0); } - (NSString *) description { NSString *s = [super description]; return [s stringByAppendingFormat: @" <%@, %@>", _path, _lastKnownFileType]; } @end libs-xcode-XCode-0_5_0/XCode/PBXFileSystemSynchronizedRootGroup.h000066400000000000000000000002111475431643200250040ustar00rootroot00000000000000#import // Local includes #import "PBXGroup.h" @interface PBXFileSystemSynchronizedRootGroup : PBXGroup @end libs-xcode-XCode-0_5_0/XCode/PBXFileSystemSynchronizedRootGroup.m000066400000000000000000000046751475431643200250330ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2024 November This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXFileSystemSynchronizedRootGroup.h" #import "PBXFileReference.h" #import "PBXBuildFile.h" #import "NSString+PBXAdditions.h" @implementation PBXFileSystemSynchronizedRootGroup - (NSMutableArray *) synchronizedChildren { NSFileManager *fm = [NSFileManager defaultManager]; NSDirectoryEnumerator *den = [fm enumeratorAtPath: _path]; NSMutableArray *result = [NSMutableArray array]; NSString *filePath = nil; NSMutableArray *fp = [NSMutableArray array]; while ((filePath = [den nextObject]) != nil) { BOOL isDir = NO; NSString *fullPath = [_path stringByAppendingPathComponent: filePath]; if ([fm fileExistsAtPath: fullPath isDirectory: &isDir] && isDir == NO) { PBXBuildFile *buildFile = [[PBXBuildFile alloc] init]; PBXFileReference *fileRef = nil; NSString *fpc = [filePath firstPathComponent]; NSString *path = filePath; AUTORELEASE(buildFile); if ([[fpc pathExtension] isEqualToString: @"xcassets"]) { path = fpc; } if ([fp containsObject: path] == NO) { fileRef = [[PBXFileReference alloc] initWithPath: path]; // NSLog(@"fileRef = %@", fileRef); AUTORELEASE(fileRef); [buildFile setFileRef: fileRef]; [result addObject: buildFile]; [fp addObject: path]; } } } // NSLog(@"result = %@", result); return result; } - (void) setPath: (NSString *)path { [super setPath: path]; [self setChildren: [self synchronizedChildren]]; } @end libs-xcode-XCode-0_5_0/XCode/PBXFrameworkTarget.h000066400000000000000000000020761475431643200215560ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXNativeTarget.h" @interface PBXFrameworkTarget : PBXNativeTarget @end libs-xcode-XCode-0_5_0/XCode/PBXFrameworkTarget.m000066400000000000000000000022211475431643200215530ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXFrameworkTarget.h" @implementation PBXFrameworkTarget - (id) init { self = [super init]; if(self) { [self setProductType: FRAMEWORK_TYPE]; } return self; } @end libs-xcode-XCode-0_5_0/XCode/PBXFrameworksBuildPhase.h000066400000000000000000000021241475431643200225250ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @interface PBXFrameworksBuildPhase : PBXBuildPhase @end libs-xcode-XCode-0_5_0/XCode/PBXFrameworksBuildPhase.m000066400000000000000000000732401475431643200225410ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXFrameworksBuildPhase.h" #import "PBXFileReference.h" #import "PBXBuildFile.h" #import "GSXCBuildContext.h" #import "NSArray+Additions.h" #import "NSString+PBXAdditions.h" #import "PBXTarget.h" #import "GSXCCommon.h" #import @implementation PBXFrameworksBuildPhase - (NSString *) _gsConfigString { NSString *configString = nil; configString = @"gnustep-config"; return configString; } - (NSString *) linkerForBuild { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; BOOL linkWithCpp = [[context objectForKey: @"LINK_WITH_CPP"] isEqualToString: @"YES"]; NSString *compiler = [NSString stringWithFormat: @"`%@ --variable=CC`", [self _gsConfigString]]; if (linkWithCpp) { compiler = [NSString stringWithFormat: @"`%@ --variable=CXX`", [self _gsConfigString]]; } return compiler; } - (NSString *) processOutputFilesString { NSString *outputFiles = [[GSXCBuildContext sharedBuildContext] objectForKey: @"OUTPUT_FILES"]; return outputFiles; } - (void) generateDummyClass { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *executableName = [context objectForKey: @"EXECUTABLE_NAME"]; NSString *outputDir = [[context objectForKey: @"PROJECT_ROOT"] stringByAppendingPathComponent: @"derived_src"]; NSString *fileName = [NSString stringWithFormat: @"NSFramework_%@.m",executableName]; NSString *outputPath = [outputDir stringByAppendingPathComponent: fileName]; NSString *buildDir = [context objectForKey: @"TARGET_BUILD_DIR"]; NSString *objDir = [context objectForKey: @"BUILT_PRODUCTS_DIR"]; NSString *scriptPath = [[NSBundle bundleForClass: [self class]] pathForResource: @"create-dummy-class" ofType: @"sh"]; NSString *of = [self processOutputFilesString]; NSString *outputFiles = (of == nil)?@"":of; NSString *files = [outputFiles stringByReplacingOccurrencesOfString: @"'" withString: @""]; objDir = (objDir == nil) ? buildDir : objDir; BOOL f = NO; NSString *classesCommand = [NSString stringWithFormat: @"%@ '%@' '%@'", scriptPath, files, executableName]; // NSLog(@"classesCommand = %@\n", classesCommand); // [context currentContext]); f = xcsystem(classesCommand) == 0; if( f ) { NSString *compiler = nil; NSString *buildPath = outputPath; NSString *objPath = [objDir stringByAppendingPathComponent: [fileName stringByAppendingString: @".o"]]; if([compiler isEqualToString: @""] || compiler == nil) { compiler = [self linkerForBuild]; } NSString *configString = [context objectForKey: @"CONFIG_STRING"]; NSString *buildTemplate = @"%@ %@ -c %@ -o %@"; NSString *buildCommand = [NSString stringWithFormat: buildTemplate, compiler, [buildPath stringByEscapingSpecialCharacters], configString, [objPath stringByEscapingSpecialCharacters]]; NSString *of = [self processOutputFilesString]; NSString *outputFiles = (of == nil)?@"":of; //NSLog(@"\t%@ %@",buildCommand, outputFiles); BOOL success = xcsystem(buildCommand) == 0; if (success) { outputFiles = [outputFiles stringByAppendingString: [NSString stringWithFormat: @" %@", objPath]]; [context setObject: outputFiles forKey: @"OUTPUT_FILES"]; } else { NSLog(@"** build of framework dummy class failed."); } } else { NSLog(@"** failed to run dummy class generation script"); } } - (NSString *) frameworkLinkString: (NSString*)framework { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *path = [[NSBundle bundleForClass: [self class]] pathForResource: @"Framework-mapping" ofType: @"plist"]; NSDictionary *propList = [[NSString stringWithContentsOfFile: path] propertyList]; NSMutableArray *ignored = [[propList objectForKey: @"Ignored"] mutableCopy]; NSMutableDictionary *mapped = [[propList objectForKey: @"Mapped"] mutableCopy]; NSDictionary *configDict = [context configForTargetName: [[self target] name]]; NSString *result = nil; NSString *fw = [framework copy]; if ([fw hasPrefix: @"lib"]) { fw = [fw stringByReplacingCharactersInRange: NSMakeRange(0,3) withString: @""]; } NSDebugLog(@"\t* config = %@", configDict); NSDebugLog(@"\t* target = %@", [[self target] name]); if ([configDict objectForKey: @"mapped"] != nil) { [mapped addEntriesFromDictionary: [configDict objectForKey: @"mapped"]]; } if ([configDict objectForKey: @"ignored"] != nil) { [ignored addObjectsFromArray: [configDict objectForKey: @"ignored"]]; } NSDebugLog(@"path = %@", path); NSDebugLog(@"%@", fw); if ([ignored containsObject: fw]) { xcprintf("\t- Ignored: %s\n",[fw cString]); return @""; } else { NSDebugLog(@"%@ not found in %@", fw, ignored); } result = [mapped objectForKey: fw]; if (result == nil) { result = [NSString stringWithFormat: @"-l%@ ", fw]; xcprintf("\t* Linking: %s\n", [result cString]); } else { result = [result stringByAppendingString: @" "]; xcprintf("\t+ Remapped: %s -> %s\n", [fw cString], [result cString]); } return result; } - (NSString *) linkString { NSString *cfgString = [self _gsConfigString]; NSString *systemLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_SYSTEM_LIBRARIES`", cfgString]; NSString *localLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_LOCAL_LIBRARIES`", cfgString]; NSString *userLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_USER_LIBRARIES`", cfgString]; NSString *buildDir = [NSString stringForEnvironmentVariable: @"TARGET_BUILD_DIR" defaultValue: @"build"]; NSString *uninstalledProductsDir = [buildDir stringByAppendingPathComponent: @"Products"]; NSString *linkString = [NSString stringWithFormat: @"-L/usr/local/lib -L/opt/local/lib -L%@ -L%@ -L%@ ", userLibDir, localLibDir, systemLibDir];; NSFileManager *manager = [NSFileManager defaultManager]; NSDirectoryEnumerator *dirEnumerator = [manager enumeratorAtPath:uninstalledProductsDir]; NSEnumerator *en = [_files objectEnumerator]; id file = nil; NSString *lpath = nil; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *configDict = [context configForTargetName: [[self target] name]]; NSArray *linkerPaths = [configDict objectForKey: @"linkerPaths"]; NSString *wsLink = [context objectForKey: @"WORKSPACE_LINK_LINE"]; NSString *wsLibs = [context objectForKey: @"WORKSPACE_LIBS_LINE"]; // If the workspace link string exists, add it... if (wsLink != nil) { linkString = [linkString stringByAppendingString: wsLink]; NSDebugLog(@"linkString = %@", linkString); } if (wsLibs != nil) { linkString = [linkString stringByAppendingString: wsLibs]; xcprintf("\t* Linking from Workspace: %s\n", [wsLibs cString]); NSDebugLog(@"linkString = %@", linkString); } en = [linkerPaths objectEnumerator]; while((lpath = [en nextObject]) != nil) { linkString = [linkString stringByAppendingString: [NSString stringWithFormat: @"-L%@ ", lpath]]; } en = [_files objectEnumerator]; while((file = [en nextObject]) != nil) { PBXFileReference *fileRef = [file fileRef]; NSString *name = [[[fileRef path] lastPathComponent] stringByDeletingPathExtension]; linkString = [linkString stringByAppendingString: [self frameworkLinkString: name]]; } // Find any frameworks and add them to the -L directive... while((file = [dirEnumerator nextObject]) != nil) { NSString *ext = [file pathExtension]; if([ext isEqualToString:@"framework"]) { NSString *headerDir = [file stringByAppendingPathComponent:@"Headers"]; linkString = [linkString stringByAppendingString: [NSString stringWithFormat:@"-I%@ ", [uninstalledProductsDir stringByAppendingPathComponent:headerDir]]]; linkString = [linkString stringByAppendingString: [NSString stringWithFormat:@"-L%@ ", [uninstalledProductsDir stringByAppendingPathComponent:file]]]; } } NSArray *otherLDFlags = [context objectForKey: @"OTHER_LDFLAGS"]; NSDebugLog(@"OTHER_LDFLAGS = %@", otherLDFlags); en = [otherLDFlags objectEnumerator]; while((file = [en nextObject]) != nil) { if ([file isEqualToString: @"-framework"]) { NSString *framework = [en nextObject]; linkString = [linkString stringByAppendingString: [self frameworkLinkString: framework]]; } } // linkString = [linkString stringByAppendingString: @" -lpthread -lobjc -lm "]; linkString = [linkString stringByAppendingString: @" -lobjc "]; // Do substitutions and additions for buildtool.plist... NSDictionary *substitutionList = [configDict objectForKey: @"substitutions"]; NSArray *additionalFlags = [configDict objectForKey: @"additional"]; // NSNumber *flag = [configDict objectForKey: @"translateDylibs"]; NSDebugLog(@"%@",configDict); NSDebugLog(@"%@", additionalFlags); if (additionalFlags != nil) { [context setObject: additionalFlags forKey: @"ADDITIONAL_OBJC_LIBS"]; } // Replace anything that needs substitution... not all libraries on macos map directly... en = [[substitutionList allKeys] objectEnumerator]; id o = nil; while ((o = [en nextObject]) != nil) { NSString *r = [substitutionList objectForKey: o]; linkString = [linkString stringByReplacingOccurrencesOfString: o withString: r]; } // Add any additional libs... en = [additionalFlags objectEnumerator]; o = nil; while ((o = [en nextObject]) != nil) { linkString = [linkString stringByAppendingFormat: @" %@ ", o]; xcprintf("\t+ Additional: %s\n",[o cString]); } return linkString; } - (BOOL) buildTool { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *cfgString = [self _gsConfigString]; xcputs([[NSString stringWithFormat: @"=== Executing Frameworks / Linking Build Phase (Tool)"] cString]); NSString *compiler = [self linkerForBuild]; NSString *outputFiles = [self processOutputFilesString]; NSString *outputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; NSString *executableName = [context objectForKey: @"EXECUTABLE_NAME"]; NSString *outputPath = [outputDir stringByAppendingPathComponent: executableName]; NSString *linkString = [self linkString]; linkString = [linkString stringByAppendingString: [NSString stringWithFormat: @" `%@ --base-libs` `%@ --variable=LDFLAGS` -lgnustep-base ", cfgString, cfgString]]; NSProcessInfo *pi = [NSProcessInfo processInfo]; NSUInteger os = [pi operatingSystem]; NSString *command = [NSString stringWithFormat: @"%@ -rdynamic -shared-libgcc -fgnu-runtime -o \"%@\" %@ %@", compiler, outputPath, outputFiles, linkString]; if (os == NSWindowsNTOperatingSystem || os == NSWindows95OperatingSystem) { outputPath = [outputPath stringByAppendingPathExtension: @"exe"]; command = [NSString stringWithFormat: @"%@ -shared-libgcc -fgnu-runtime -o \"%@\" %@ %@", compiler, outputPath, outputFiles, linkString]; } NSDebugLog(@"command = %@", command); NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; int result = 0; if([modified isEqualToString: @"YES"]) { result = xcsystem(command); if (result != 0) { NSLog(@"%sReturn Value:%s %d", RED, RESET, result); NSLog(@"%sCommand:%s %s%@%s", RED, RESET, GREEN, command, RESET); } } else { xcputs([[NSString stringWithFormat: @"\t** Nothing to be done for %@, no modifications.",outputPath] cString]); } xcputs("=== Frameworks / Linking Build Phase Completed"); return (result == 0); } - (BOOL) buildApp { xcputs("=== Executing Frameworks / Linking Build Phase (Application)"); GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *compiler = [self linkerForBuild]; NSString *outputFiles = [self processOutputFilesString]; NSString *outputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; // NSString *errorPath = [outputDir stringByAppendingPathComponent: @"linker.err"]; NSString *executableName = [context objectForKey: @"EXECUTABLE_NAME"]; NSString *outputPath = [outputDir stringByAppendingPathComponent: executableName]; NSString *linkString = [self linkString]; NSString *cfgString = [self _gsConfigString]; NSProcessInfo *pi = [NSProcessInfo processInfo]; NSUInteger os = [pi operatingSystem]; NSDebugLog(@"Output files = %@", outputFiles); if (outputFiles == nil) { xcputs("\t++++ No object files found. Nothing to link ++++\n"); return YES; } linkString = [NSString stringWithFormat: [linkString stringByAppendingString: @" `%@ --objc-flags --objc-libs " \ @"--base-libs --gui-libs` `%@ --variable=LDFLAGS` " \ @"-lgnustep-base -lgnustep-gui "], cfgString, cfgString]; NSDebugLog(@"LINK: %@", linkString); NSString *command = nil; if (os == NSWindowsNTOperatingSystem || os == NSWindows95OperatingSystem) { outputPath = [outputPath stringByAppendingPathExtension: @"exe"]; command = [NSString stringWithFormat: @"%@ -shared-libgcc -fgnu-runtime -o \"%@\" %@ %@", compiler, outputPath, outputFiles, linkString]; } else { command = [NSString stringWithFormat: @"%@ -rdynamic -shared-libgcc -fgnu-runtime -o \"%@\" %@ %@", compiler, outputPath, outputFiles, linkString]; } // NSLog(@"Link command = %@", command); // NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; int result = 0; if(YES) // [modified isEqualToString: @"YES"]) { xcputs([[NSString stringWithFormat: @"\t* Linking \"%@\"",outputPath] cString]); result = xcsystem(command); } else { xcputs([[NSString stringWithFormat: @"\t** Nothing to be done for \"%@\", no modifications.",outputPath] cString]); } xcputs("=== Frameworks / Linking Build Phase Completed"); fflush(stdout); return (result == 0); } - (NSString *) _execName { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *name = [context objectForKey: @"EXECUTABLE_NAME"]; if( name == nil ) { name = [context objectForKey: @"PRODUCT_NAME"]; if ( name == nil ) { name = [context objectForKey: @"TARGET_NAME"]; } } return name; } - (NSString *) _productOutputDir { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *outputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; if( outputDir == nil ) { outputDir = [@"./build" stringByAppendingPathComponent: [self _execName]]; outputDir = [outputDir stringByAppendingPathComponent: @"Products"]; } return outputDir; } - (BOOL) buildStaticLib { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; // NSDictionary *config = [context config]; // NSString *ctarget = [config objectForKey: @"target"]; // NSString *libext = [ctarget isEqualToString: @"msvc"] ? @"lib" : @"a"; // NSString *libpfx = [ctarget isEqualToString: @"msvc"] ? @"" : @"lib"; NSString *outputFiles = [self processOutputFilesString]; NSString *outputDir = [self _productOutputDir]; NSString *executableName = [[[_target productReference] path] lastPathComponent]; // [[NSString stringWithFormat: @"%@%@", libpfx,[self _execName]] // stringByReplacingPathExtensionWith: libext]; NSString *outputPath = [outputDir stringByAppendingPathComponent: executableName]; NSString *commandTemplate = @"ar rc %@ %@; ranlib %@"; NSString *command = [NSString stringWithFormat: commandTemplate, outputPath, outputFiles, outputPath]; NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; int result = 0; xcputs("=== Executing Frameworks / Archiving Build Phase (Static Library)"); if([modified isEqualToString: @"YES"]) { xcputs([[NSString stringWithFormat: @"\t* Linking %@",outputPath] cString]); result = xcsystem(command); } else { xcputs([[NSString stringWithFormat: @"\t** Nothing to be done for %@, no modifications.",outputPath] cString]); } xcputs("=== Frameworks / Linking Build Phase Completed"); return (result == 0); } - (BOOL) buildDynamicLib { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *config = [context config]; NSString *ctarget = [config objectForKey: @"target"]; NSString *outputFiles = [self processOutputFilesString]; NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; NSString *outputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; NSString *executableName = [context objectForKey: @"EXECUTABLE_NAME"]; NSString *executableNameStripped = [executableName stringByDeletingPathExtension]; NSString *libName = [NSString stringWithFormat: @"%@.so",executableNameStripped]; NSString *outputPath = [outputDir stringByAppendingPathComponent: libName]; NSString *libraryPath = [outputDir stringByAppendingPathComponent: libName]; NSString *cfgString = [self _gsConfigString]; NSString *systemLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_SYSTEM_LIBRARIES`", cfgString]; NSString *localLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_LOCAL_LIBRARIES`", cfgString]; NSString *userLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_USER_LIBRARIES`", cfgString]; NSProcessInfo *pi = [NSProcessInfo processInfo]; NSUInteger os = [pi operatingSystem]; NSString *compiler = [self linkerForBuild]; NSString *command = nil; NSString *commandTemplate = nil; NSInteger result = 0; xcputs("=== Executing Frameworks / Linking Build Phase (Dynamic Library"); if (os == NSWindowsNTOperatingSystem || os == NSWindows95OperatingSystem) { if ([ctarget containsString: @"msvc"]) { outputPath = [outputPath stringByReplacingOccurrencesOfString: @"lib" withString: @""]; NSString *msvcLibname = [outputPath stringByAppendingPathExtension: @"lib"]; NSString *dllLibname = [libraryPath stringByReplacingPathExtensionWith: @"dll"]; commandTemplate = @"%@ -g -Wl,-dll -Wl,implib:%@ -o %@ %@ `gnustep-config --base-libs` " @"-L%@ -L%@ -L%@"; libraryPath = [outputDir stringByAppendingPathComponent: msvcLibname]; command = [NSString stringWithFormat: commandTemplate, compiler, libraryPath, dllLibname, outputFiles, userLibDir, localLibDir, systemLibDir]; } else { commandTemplate = @"%@ -shared -Wl,-soname,lib%@.so " @"-shared-libgcc -o %@ %@ " @"-L%@ -L%@ -L%@"; command = [NSString stringWithFormat: commandTemplate, compiler, executableName, libraryPath, outputFiles, userLibDir, localLibDir, systemLibDir]; } } else { commandTemplate = @"%@ -shared -Wl,-soname,lib%@.so -rdynamic " @"-shared-libgcc -o %@ %@ " @"-L%@ -L%@ -L%@"; command = [NSString stringWithFormat: commandTemplate, compiler, executableName, libraryPath, outputFiles, userLibDir, localLibDir, systemLibDir]; } if([modified isEqualToString: @"YES"]) { xcputs([[NSString stringWithFormat: @"\t* Linking %@",outputPath] cString]); result = xcsystem(command); } else { xcputs([[NSString stringWithFormat: @"\t** Nothing to be done for %@, no modifications.",outputPath] cString]); } xcputs("=== Frameworks / Linking Build Phase Completed"); return (result == 0); } - (BOOL) buildFramework { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *config = [context config]; NSString *ctarget = [config objectForKey: @"target"]; NSInteger result = 0; xcputs("=== Executing Frameworks / Linking Build Phase (Framework)"); [self generateDummyClass]; NSString *outputFiles = [self processOutputFilesString]; NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; NSString *outputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; NSString *executableName = [context objectForKey: @"EXECUTABLE_NAME"]; NSString *outputPath = [outputDir stringByAppendingPathComponent: executableName]; NSString *frameworkVersion = [NSString stringForEnvironmentVariable: "FRAMEWORK_VERSION"]; if (frameworkVersion == nil) { frameworkVersion = @"0"; } NSString *libNameWithVersion = [NSString stringWithFormat: @"lib%@.so.%@", executableName,frameworkVersion]; NSString *libName = [NSString stringWithFormat: @"lib%@.so",executableName]; NSString *libraryPath = [outputDir stringByAppendingPathComponent: libNameWithVersion]; NSString *libraryPathNoVersion = [outputDir stringByAppendingPathComponent: libName]; NSString *cfgString = [self _gsConfigString]; NSString *systemLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_SYSTEM_LIBRARIES`", cfgString]; NSString *localLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_LOCAL_LIBRARIES`", cfgString]; NSString *userLibDir = [NSString stringWithFormat: @"`%@ --variable=GNUSTEP_USER_LIBRARIES`", cfgString]; NSString *frameworkRoot = [context objectForKey: @"FRAMEWORK_DIR"]; NSString *libraryLink = [frameworkRoot stringByAppendingPathComponent: libName]; NSString *execLink = [frameworkRoot stringByAppendingPathComponent: executableName]; NSProcessInfo *pi = [NSProcessInfo processInfo]; NSUInteger os = [pi operatingSystem]; NSString *compiler = [self linkerForBuild]; NSString *command = nil; NSString *commandTemplate = nil; if (os == NSWindowsNTOperatingSystem || os == NSWindows95OperatingSystem) { if ([ctarget containsString: @"msvc"]) { NSString *msvcLibname = [outputPath stringByAppendingPathExtension: @"lib"]; NSString *dllLibname = [libraryPathNoVersion stringByReplacingPathExtensionWith: @"dll"]; commandTemplate = @"%@ -g -Wl,-dll -Wl,implib:%@ -o %@ %@ " @"-L%@ -L%@ -L%@ " @"`gnustep-config --gui-libs` "; libraryPath = msvcLibname; command = [NSString stringWithFormat: commandTemplate, compiler, libraryPath, dllLibname, outputFiles, userLibDir, localLibDir, systemLibDir]; } else { commandTemplate = @"%@ -shared -Wl,-soname,lib%@.so " @"-shared-libgcc -o %@ %@ " @"-L%@ -L%@ -L%@ " @"`gnustep-config --gui-libs` "; command = [NSString stringWithFormat: commandTemplate, compiler, executableName, libraryPath, outputFiles, userLibDir, localLibDir, systemLibDir]; } } else { commandTemplate = @"%@ -shared -Wl,-soname,lib%@.so.%@ -rdynamic " @"-shared-libgcc -o %@ %@ " @"-L%@ -L%@ -L%@"; command = [NSString stringWithFormat: commandTemplate, compiler, executableName, frameworkVersion, libraryPath, outputFiles, userLibDir, localLibDir, systemLibDir]; } // Create link to library... [[NSFileManager defaultManager] createSymbolicLinkAtPath: outputPath pathContent: libName]; [[NSFileManager defaultManager] createSymbolicLinkAtPath: libraryPathNoVersion pathContent: libNameWithVersion]; [[NSFileManager defaultManager] createSymbolicLinkAtPath: libraryLink pathContent: [NSString stringWithFormat: @"Versions/Current/%@",libName]]; [[NSFileManager defaultManager] createSymbolicLinkAtPath: execLink pathContent: [NSString stringWithFormat: @"Versions/Current/%@",executableName]]; // NSLog(@"Link command = %@", command); if([modified isEqualToString: @"YES"]) { xcputs([[NSString stringWithFormat: @"\t* Linking %@",outputPath] cString]); result = xcsystem(command); } else { xcputs([[NSString stringWithFormat: @"\t** Nothing to be done for %@, no modifications.",outputPath] cString]); } xcputs("=== Frameworks / Linking Build Phase Completed"); return (result == 0); } - (BOOL) buildBundle { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; xcputs("=== Executing Frameworks / Linking Build Phase (Bundle)"); NSString *compiler = [self linkerForBuild]; NSString *outputFiles = [self processOutputFilesString]; NSString *outputDir = [NSString stringWithCString: getenv("PRODUCT_OUTPUT_DIR")]; NSString *executableName = [NSString stringWithCString: getenv("EXECUTABLE_NAME")]; NSString *outputPath = [outputDir stringByAppendingPathComponent: executableName]; NSString *linkString = [self linkString]; NSProcessInfo *pi = [NSProcessInfo processInfo]; NSUInteger os = [pi operatingSystem]; NSString *command = [NSString stringWithFormat: @"%@ -rdynamic -shared -o \"%@\" %@ %@", compiler, outputPath, outputFiles, linkString]; if (os == NSWindowsNTOperatingSystem || os == NSWindows95OperatingSystem) { command = [NSString stringWithFormat: @"%@ -shared -o \"%@\" %@ %@", compiler, outputPath, outputFiles, linkString]; } NSString *modified = [context objectForKey: @"MODIFIED_FLAG"]; int result = 0; if([modified isEqualToString: @"YES"]) { xcputs([[NSString stringWithFormat: @"\t* Linking %@",outputPath] cString]); result = xcsystem(command); } else { xcputs([[NSString stringWithFormat: @"\t** Nothing to be done for %@, no modifications.",outputPath] cString]); } xcputs("=== Frameworks / Linking Build Phase Completed"); return (result == 0); } - (BOOL) buildTest { xcputs("=== Build tests... currently unsupported..."); return YES; } - (BOOL) build { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *productType = [context objectForKey: @"PRODUCT_TYPE"]; if([productType isEqualToString: APPLICATION_TYPE]) { return [self buildApp]; } else if([productType isEqualToString: TOOL_TYPE]) { return [self buildTool]; } else if([productType isEqualToString: LIBRARY_TYPE]) { return [self buildStaticLib]; } else if([productType isEqualToString: DYNAMIC_LIBRARY_TYPE]) { return [self buildDynamicLib]; } else if([productType isEqualToString: FRAMEWORK_TYPE]) { return [self buildFramework]; } else if([productType isEqualToString: BUNDLE_TYPE]) { return [self buildBundle]; } else if([productType isEqualToString: TEST_TYPE]) { return [self buildTest]; } else { xcputs([[NSString stringWithFormat: @"***** ERROR: Unknown product type: %@",productType] cString]); } return NO; } - (BOOL) generate { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *productType = [context objectForKey: @"PRODUCT_TYPE"]; NSDictionary *configDict = [context configForTargetName: [[self target] name]]; NSArray *additionalFlags = [configDict objectForKey: @"additional"]; NSDebugLog(@"%@", additionalFlags); if (additionalFlags != nil) { [context setObject: additionalFlags forKey: @"ADDITIONAL_OBJC_LIBS"]; } xcprintf("\t* Adding product type entry: %s\n", [productType cStringUsingEncoding: NSUTF8StringEncoding]); if([productType isEqualToString: APPLICATION_TYPE]) { [context setObject: @"application" forKey: @"PROJECT_TYPE"]; } else if([productType isEqualToString: TOOL_TYPE]) { [context setObject: @"tool" forKey: @"PROJECT_TYPE"]; } else if([productType isEqualToString: LIBRARY_TYPE]) { [context setObject: @"library" forKey: @"PROJECT_TYPE"]; } else if([productType isEqualToString: DYNAMIC_LIBRARY_TYPE]) { [context setObject: @"library" forKey: @"PROJECT_TYPE"]; } else if([productType isEqualToString: FRAMEWORK_TYPE]) { [context setObject: @"framework" forKey: @"PROJECT_TYPE"]; } else if([productType isEqualToString: BUNDLE_TYPE]) { [context setObject: @"bundle" forKey: @"PROJECT_TYPE"]; } else if([productType isEqualToString: TEST_TYPE]) { [context setObject: @"test" forKey: @"PROJECT_TYPE"]; } else { xcputs([[NSString stringWithFormat: @"***** ERROR: Unknown product type: %@",productType] cString]); } return YES; } - (BOOL) link { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; [context setObject: @"YES" forKey: @"MODIFIED_FLAG"]; return [self build]; } @end libs-xcode-XCode-0_5_0/XCode/PBXGroup.h000066400000000000000000000030421475431643200175400ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" @interface PBXGroup : NSObject { NSString *_sourceTree; NSMutableArray *_children; NSString *_name; NSString *_tabWidth; NSString *_usesTabs; NSString *_path; } // Methods.... - (NSString *) sourceTree; // getter - (void) setSourceTree: (NSString *)object; // setter - (NSMutableArray *) children; // getter - (void) setChildren: (NSMutableArray *)object; // setter - (NSString *) name; // getter - (void) setName: (NSString *)object; // setter - (NSString *) path; // getter - (void) setPath: (NSString *)object; // setter @end libs-xcode-XCode-0_5_0/XCode/PBXGroup.m000066400000000000000000000040301475431643200175430ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXGroup.h" @implementation PBXGroup - (instancetype) init { self = [super init]; if (self != nil) { [self setSourceTree: @""]; // default value } return self; } - (void) dealloc { RELEASE(_sourceTree); RELEASE(_children); RELEASE(_name); RELEASE(_tabWidth); RELEASE(_usesTabs); RELEASE(_path); [super dealloc]; } // Methods.... - (NSString *) sourceTree // getter { return _sourceTree; } - (void) setSourceTree: (NSString *)object; // setter { ASSIGN(_sourceTree, object); } - (NSMutableArray *) children // getter { return _children; } - (void) setChildren: (NSMutableArray *)object; // setter { ASSIGN(_children, object); } - (NSString *) name // getter { return _name; } - (void) setName: (NSString *)object; // setter { ASSIGN(_name, object); } - (NSString *) path // getter { return _path; } - (void) setPath: (NSString *)object; // setter { ASSIGN(_path, object); } - (NSString *) description { return [NSString stringWithFormat: @"<%@ - name = %@, path = %@>", [super description], _name, _path]; } @end libs-xcode-XCode-0_5_0/XCode/PBXHeadersBuildPhase.h000066400000000000000000000021211475431643200217550ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @interface PBXHeadersBuildPhase : PBXBuildPhase @end libs-xcode-XCode-0_5_0/XCode/PBXHeadersBuildPhase.m000066400000000000000000000122631475431643200217720ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXHeadersBuildPhase.h" #import "PBXFileReference.h" #import "PBXBuildFile.h" #import "GSXCBuildContext.h" #import "GSXCCommon.h" @implementation PBXHeadersBuildPhase - (BOOL) build { xcputs("=== Executing Headers Build Phase"); NSString *productType = [[GSXCBuildContext sharedBuildContext] objectForKey: @"PRODUCT_TYPE"]; if([productType isEqualToString: BUNDLE_TYPE] || [productType isEqualToString: TOOL_TYPE] || [productType isEqualToString: APPLICATION_TYPE]) { xcputs([[NSString stringWithFormat: @"\t* %s%sWARN%s: No need to process headers for product type %@",BOLD, YELLOW, RESET, productType] cString]); return YES; } xcputs([[NSString stringWithFormat: @"\t* Copying headers to derived sources folder..."] cString]); NSFileManager *defaultManager = [NSFileManager defaultManager]; id file = nil; BOOL result = YES; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSError *error = nil; NSArray *synchronizedFiles = [_target synchronizedHeaders]; NSArray *files = [_files arrayByAddingObjectsFromArray: synchronizedFiles]; NSEnumerator *en = [files objectEnumerator]; NSString *derivedSourceHeaderDir = [context objectForKey: @"DERIVED_SOURCE_HEADER_DIR"]; while((file = [en nextObject]) != nil && result) { NSString *path = [[file fileRef] path]; NSString *srcFile = [[file fileRef] buildPath]; NSString *dstFile = [derivedSourceHeaderDir stringByAppendingPathComponent: [path lastPathComponent]]; BOOL copyResult = [defaultManager copyItemAtPath: srcFile toPath: dstFile error: &error]; xcputs([[NSString stringWithFormat: @"\tCopy %s%@%s -> %s%@%s", YELLOW, srcFile, RESET, GREEN, dstFile, RESET] cString]); if(!copyResult) { xcputs([[NSString stringWithFormat: @"\t* Already exists"] cString]); } } // Only copy into the framework header folder, if it's a framework... if([productType isEqualToString: FRAMEWORK_TYPE]) { xcputs([[NSString stringWithFormat: @"\t* Copying headers to framework header folder..."] cString]); en = [_files objectEnumerator]; NSString *headerDir = [context objectForKey: @"HEADER_DIR"]; while((file = [en nextObject]) != nil && result) { NSString *path = [[file fileRef] path]; NSString *srcFile = [[file fileRef] buildPath]; NSString *dstFile = [headerDir stringByAppendingPathComponent: [path lastPathComponent]]; BOOL copyResult = [defaultManager copyItemAtPath: srcFile toPath: dstFile error: &error]; xcputs([[NSString stringWithFormat: @"\tCopy %s%@%s -> %s%@%s", YELLOW, srcFile, RESET, GREEN, dstFile, RESET] cString]); if(!copyResult) { xcputs([[NSString stringWithFormat: @"\t* Already exists"] cString]); } } } xcputs([[NSString stringWithFormat: @"=== Completed Headers Build Phase"] cString]); return result; } - (BOOL) generate { xcputs("=== Executing Headers Build Phase (Generate)"); NSString *productType = [[GSXCBuildContext sharedBuildContext] objectForKey: @"PRODUCT_TYPE"]; if([productType isEqualToString: BUNDLE_TYPE] || [productType isEqualToString: TOOL_TYPE] || [productType isEqualToString: APPLICATION_TYPE]) { xcputs([[NSString stringWithFormat: @"\t* %s%sWARN%s: No need to process headers for product type %@",BOLD, YELLOW, RESET, productType] cString]); return YES; } BOOL result = YES; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; // NSString *derivedSourceHeaderDir = [context objectForKey: @"DERIVED_SOURCE_HEADER_DIR"]; [context setObject: _files forKey: @"DERIVED_HEADERS"]; xcputs([[NSString stringWithFormat: @"\tAdding entry for derived header files"] cString]); // Only copy into the framework header folder, if it's a framework... if([productType isEqualToString: FRAMEWORK_TYPE]) { // NSString *headerDir = [context objectForKey: @"HEADER_DIR"]; [context setObject: _files forKey: @"HEADERS"]; xcputs([[NSString stringWithFormat: @"\tAdding entry for derived header"] cString]); } xcputs([[NSString stringWithFormat: @"=== Completed Headers Build Phase (Generate)"] cString]); return result; } - (BOOL) link { return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXLegacyTarget.h000066400000000000000000000030071475431643200210200ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXTarget.h" @class NSString; @class NSMutableArray; @interface PBXLegacyTarget : PBXTarget { NSString *_buildArgumentsString; NSString *_buildToolPath; // NSMutableArray *_dependencies; BOOL _passBuildSettingsInEnvironment; } - (NSString *) buildArgumentsString; - (void) setBuildArgumentsString: (NSString *)string; - (NSString *) buildToolPath; - (void) setBuildToolPath: (NSString *)path; /* - (NSArray *) dependencies; - (void) setDependencies: (NSArray *)deps; */ - (BOOL) passBuildSettingsInEnvironment; - (void) setPassBuildSettingsInEnvironment: (BOOL)f; @end libs-xcode-XCode-0_5_0/XCode/PBXLegacyTarget.m000066400000000000000000000042101475431643200210220ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXLegacyTarget.h" #import #import #import "xcsystem.h" @implementation PBXLegacyTarget - (void) dealloc { RELEASE(_buildArgumentsString); RELEASE(_buildToolPath); // RELEASE(_dependencies); [super dealloc]; } - (NSString *) buildArgumentsString { return _buildArgumentsString; } - (void) setBuildArgumentsString: (NSString *)string { ASSIGN(_buildArgumentsString, string); } - (NSString *) buildToolPath { return _buildToolPath; } - (void) setBuildToolPath: (NSString *)path { ASSIGN(_buildToolPath, path); } /* - (NSArray *) dependencies { return _dependencies; } - (void) setDependencies: (NSArray *)deps { ASSIGN(_dependencies, deps); } */ - (BOOL) passBuildSettingsInEnvironment { return _passBuildSettingsInEnvironment; } - (void) setPassBuildSettingsInEnvironment: (BOOL)f { _passBuildSettingsInEnvironment = f; } - (BOOL) build { return xcsystem(_buildToolPath); } - (BOOL) clean { NSString *build_cmd = [_buildToolPath stringByAppendingString: @" clean"]; return xcsystem(build_cmd); } - (BOOL) install { NSString *build_cmd = [_buildToolPath stringByAppendingString: @" install"]; return xcsystem(build_cmd); } @end libs-xcode-XCode-0_5_0/XCode/PBXNativeTarget.h000066400000000000000000000036171475431643200210510ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "XCConfigurationList.h" #import "PBXFileReference.h" #import "PBXTarget.h" @interface PBXNativeTarget : PBXTarget { PBXFileReference *_productReference; NSString *_productInstallPath; NSMutableArray *_buildRules; NSString *_comments; NSString *_productSettingsXML; XCConfigurationList *_xcConfigurationList; } // Methods.... - (PBXFileReference *) productReference; // getter - (void) setProductReference: (PBXFileReference *)object; // setter - (NSString *) productInstallPath; // getter - (void) setProductInstallPath: (NSString *)object; // setter - (NSMutableArray *) buildRules; // getter - (void) setBuildRules: (NSMutableArray *)object; // setter - (NSString *) productSettingsXML; // getter - (void) setProductSettingsXML: (NSString *)object; // setter // - (XCConfigurationList *) buildConfigurationList; // - (void) setBuildConfigurationList: (XCConfigurationList *)list; @end libs-xcode-XCode-0_5_0/XCode/PBXNativeTarget.m000066400000000000000000000724271475431643200210630ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXNativeTarget.h" #import "PBXProject.h" #import "PBXContainer.h" #import "GSXCCommon.h" #import "GSXCBuildContext.h" #import "GSXCGenerator.h" #import "NSString+PBXAdditions.h" #ifdef _WIN32 #import "setenv.h" #endif @implementation PBXNativeTarget - (void) dealloc { RELEASE(_productReference); RELEASE(_productInstallPath); RELEASE(_buildRules); RELEASE(_comments); RELEASE(_productSettingsXML); [super dealloc]; } // Methods.... - (PBXFileReference *) productReference // getter { return _productReference; } - (void) setProductReference: (PBXFileReference *)object; // setter { ASSIGN(_productReference,object); } - (NSString *) productInstallPath // getter { return _productInstallPath; } - (void) setProductInstallPath: (NSString *)object; // setter { ASSIGN(_productInstallPath,object); } - (NSMutableArray *) buildRules // getter { return _buildRules; } - (void) setBuildRules: (NSMutableArray *)object; // setter { ASSIGN(_buildRules,object); } - (NSString *) productSettingsXML // getter { return _productSettingsXML; } - (void) setProductSettingsXML: (NSString *)object // setter { ASSIGN(_productSettingsXML,object); } /* - (XCConfigurationList *) buildConfigurationList { return xcConfigurationList; } - (void) setBuildConfigurationList: (XCConfigurationList *)list { NSLog(@"build config list = %@",list); ASSIGN(xcConfigurationList, list); } */ - (void) _productWrapper { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *buildDir = @"./build"; NSString *aname = [self name]; buildDir = [buildDir stringByAppendingPathComponent: aname]; NSString *uninstalledProductsDir = [buildDir stringByAppendingPathComponent: @"Products"]; NSString *fullPath = [[buildDir stringByAppendingPathComponent: @"Products"] stringByAppendingPathComponent: [_productReference path]]; NSError *error = nil; // Set up some target specific vars, based on the build dir... [context setObject: buildDir forKey: @"TARGET_BUILD_DIR"]; [context setObject: aname forKey: @"TARGET_NAME"]; [context setObject: uninstalledProductsDir forKey: @"BUILT_PRODUCTS_DIR"]; // Create directories... [[NSFileManager defaultManager] createDirectoryAtPath:uninstalledProductsDir withIntermediateDirectories:YES attributes:nil error:&error]; setenv("inherited","",1); // probably from a parent project or target.. if([_productType isEqualToString: BUNDLE_TYPE] || [_productType isEqualToString: APPLICATION_TYPE]) { NSString *execName = [[fullPath lastPathComponent] stringByDeletingPathExtension]; // Create directories... [[NSFileManager defaultManager] createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:nil error:&error]; setenv("PRODUCT_OUTPUT_DIR",[fullPath cString],1); setenv("PRODUCT_NAME",[execName cString],1); setenv("EXECUTABLE_NAME",[execName cString],1); [context setObject: fullPath forKey: @"PRODUCT_OUTPUT_DIR"]; [context setObject: execName forKey: @"PRODUCT_NAME"]; [context setObject: execName forKey: @"EXECUTABLE_NAME"]; } else if([_productType isEqualToString: FRAMEWORK_TYPE]) { NSString *dir = [NSString stringForEnvironmentVariable: @"PROJECT_ROOT" defaultValue: @"./"]; NSString *derivedSourceDir = [dir stringByAppendingPathComponent: @"derived_src"]; NSString *execName = [[fullPath lastPathComponent] stringByDeletingPathExtension]; NSString *derivedSourceHeaderDir = [derivedSourceDir stringByAppendingPathComponent: execName]; NSString *frameworkVersion = [NSString stringForEnvironmentVariable: @"FRAMEWORK_VERSION" defaultValue: @"0"]; [context setObject: [NSString stringWithString: fullPath] forKey: @"FRAMEWORK_DIR"]; // Above "Versions" NSString *headersLink = [fullPath stringByAppendingPathComponent: @"Headers"]; NSString *resourcesLink = [fullPath stringByAppendingPathComponent: @"Resources"]; // Below "Versions" fullPath = [fullPath stringByAppendingPathComponent: @"Versions"]; NSString *currentLink = [fullPath stringByAppendingPathComponent: @"Current"]; fullPath = [fullPath stringByAppendingPathComponent: frameworkVersion]; NSString *headerDir = [fullPath stringByAppendingPathComponent: @"Headers"]; NSString *resourceDir = [fullPath stringByAppendingPathComponent: @"Resources"]; // Create directories... [[NSFileManager defaultManager] createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:nil error:&error]; [[NSFileManager defaultManager] createDirectoryAtPath:derivedSourceHeaderDir withIntermediateDirectories:YES attributes:nil error:&error]; [[NSFileManager defaultManager] createDirectoryAtPath:headerDir withIntermediateDirectories:YES attributes:nil error:&error]; // Create links.... [[NSFileManager defaultManager] createSymbolicLinkAtPath: currentLink pathContent: frameworkVersion]; [[NSFileManager defaultManager] createSymbolicLinkAtPath: headersLink pathContent: @"Versions/Current/Headers"]; [[NSFileManager defaultManager] createSymbolicLinkAtPath: resourcesLink pathContent: @"Versions/Current/Resources"]; // Things to pass on to the next phase... [context setObject: headerDir forKey: @"HEADER_DIR"]; [context setObject: resourceDir forKey: @"RESOURCE_DIR"]; [context setObject: derivedSourceHeaderDir forKey: @"DERIVED_SOURCE_HEADER_DIR"]; [context setObject: derivedSourceDir forKey: @"DERIVED_SOURCES_DIR"]; setenv("PRODUCT_OUTPUT_DIR",[fullPath cString],1); setenv("PRODUCT_NAME",[execName cString],1); setenv("EXECUTABLE_NAME",[execName cString],1); [context setObject: fullPath forKey: @"PRODUCT_OUTPUT_DIR"]; [context setObject: execName forKey: @"PRODUCT_NAME"]; [context setObject: execName forKey: @"EXECUTABLE_NAME"]; } else if([_productType isEqualToString: LIBRARY_TYPE]) { NSString *fileName = [fullPath lastPathComponent]; NSString *path = [fullPath stringByDeletingLastPathComponent]; NSString *dir = [NSString stringForEnvironmentVariable: @"PROJECT_ROOT" defaultValue: @"./"]; NSString *derivedSourceDir = [dir stringByAppendingPathComponent: @"derived_src"]; NSString *derivedSourceHeaderDir = derivedSourceDir; setenv("PRODUCT_OUTPUT_DIR",[path cString],1); setenv("PRODUCT_NAME",[fileName cString],1); setenv("EXECUTABLE_NAME",[fileName cString],1); [context setObject: derivedSourceHeaderDir forKey: @"DERIVED_SOURCE_HEADER_DIR"]; [context setObject: derivedSourceDir forKey: @"DERIVED_SOURCES_DIR"]; [[NSFileManager defaultManager] createDirectoryAtPath:derivedSourceHeaderDir withIntermediateDirectories:YES attributes:nil error:&error]; } else // For non bundled packages { NSString *fileName = [fullPath lastPathComponent]; NSString *path = [fullPath stringByDeletingLastPathComponent]; NSString *dir = [NSString stringForEnvironmentVariable: @"PROJECT_ROOT" defaultValue: @"./"]; NSString *derivedSourceDir = [dir stringByAppendingPathComponent: @"derived_src"]; NSString *derivedSourceHeaderDir = derivedSourceDir; setenv("PRODUCT_OUTPUT_DIR",[path cString],1); setenv("PRODUCT_NAME",[fileName cString],1); setenv("EXECUTABLE_NAME",[fileName cString],1); [context setObject: derivedSourceHeaderDir forKey: @"DERIVED_SOURCE_HEADER_DIR"]; [context setObject: derivedSourceDir forKey: @"DERIVED_SOURCES_DIR"]; [context setObject: path forKey: @"PRODUCT_OUTPUT_DIR"]; [context setObject: fileName forKey: @"PRODUCT_NAME"]; [context setObject: fileName forKey: @"EXECUTABLE_NAME"]; } } - (BOOL) build { BOOL result = YES; NSEnumerator *en = nil; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *plistFile = [NSDictionary dictionaryWithContentsOfFile: @"buildtool.plist"]; NSArray *skippedTarget = [plistFile objectForKey: @"skippedTarget"]; // call super to set up common data structures... if(![super build]) { return NO; } if ([skippedTarget containsObject: [self name]]) { xcputs([[NSString stringWithFormat: @"=== Skipping Target %s%@%s", YELLOW, _name, RESET] cString]); return YES; } xcputs([[NSString stringWithFormat: @"=== Building Target %s%@%s", GREEN, _name, RESET] cString]); [_buildConfigurationList applyDefaultConfiguration]; [context setObject: _buildConfigurationList forKey: @"buildConfig"]; [context setObject: _productType forKey: @"PRODUCT_TYPE"]; if(_productSettingsXML != nil) { [context setObject: _productSettingsXML forKey: @"PRODUCT_SETTINGS_XML"]; } xcputs([[NSString stringWithFormat: @"=== Checking Dependencies"] cString]); id dependency = nil; en = [_dependencies objectEnumerator]; while((dependency = [en nextObject]) != nil && result) { result = [dependency build]; } xcputs([[NSString stringWithFormat: @"=== Done."] cString]); xcputs([[NSString stringWithFormat: @"=== Executing build phases..."] cString]); [self _productWrapper]; id phase = nil; en = [_buildPhases objectEnumerator]; while((phase = [en nextObject]) != nil && result) { NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init]; [phase setTarget: self]; result = [phase build]; if(NO == result) { xcputs([[NSString stringWithFormat: @"*** Failed build phase: %@",phase] cString]); } RELEASE(p); } xcputs([[NSString stringWithFormat: @"=== Done..."] cString]); xcputs([[NSString stringWithFormat: @"=== Completed Executing Target %@", _name] cString]); return result; } - (BOOL) clean { xcputs([[NSString stringWithFormat: @"=== Cleaning Target %@",_name] cString]); NSString *buildDir = @"./build"; buildDir = [buildDir stringByAppendingPathComponent: [self name]]; NSString *command = [NSString stringWithFormat: @"rm -rf \"%@\"",buildDir]; xcputs([[NSString stringWithFormat: @"Cleaning build directory"] cString]); int result = xcsystem(command); if(result == 0) { if([[NSFileManager defaultManager] fileExistsAtPath: @"derived_src"]) { command = @"rm -rf derived_src"; xcputs([[NSString stringWithFormat: @"Cleaning derived_src directory"] cString]); result = xcsystem(command); } } xcputs([[NSString stringWithFormat: @"=== Completed Cleaning Target %@",_name] cString]); return (result == 0); } - (BOOL) installTool { NSString *buildDir = @"./build"; NSString *outputDir = [buildDir stringByAppendingPathComponent: [self name]]; NSString *uninstalledProductsDir = [outputDir stringByAppendingPathComponent: @"Products"]; NSString *fullPath = [uninstalledProductsDir stringByAppendingPathComponent: [_productReference path]]; NSString *fileName = [fullPath lastPathComponent]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error = nil; NSString *installDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_TOOLS"]; NSString *installDest = [installDir stringByAppendingPathComponent: fileName]; NSLog(@"installDest = %@, fullPath = %@", installDest, fullPath); return [fileManager copyItemAtPath: fullPath toPath: installDest error: &error]; } - (BOOL) installApp { NSString *buildDir = @"./build"; NSString *outputDir = [buildDir stringByAppendingPathComponent: [self name]]; NSString *uninstalledProductsDir = [outputDir stringByAppendingPathComponent: @"Products"]; NSString *fullPath = [uninstalledProductsDir stringByAppendingPathComponent: [_productReference path]]; NSString *fileName = [fullPath lastPathComponent]; // NSString *execName = [fileName stringByDeletingPathExtension]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error = nil; NSString *cwd = [fileManager currentDirectoryPath]; NSLog(@"******* CWD = %@", cwd); NSString *installDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_APPS"]; NSString *installDest = [installDir stringByAppendingPathComponent: fileName]; return [fileManager copyItemAtPath: fullPath toPath: installDest error: &error]; } - (BOOL) installFramework { NSString *buildDir = @"./build"; NSString *outputDir = [buildDir stringByAppendingPathComponent: [self name]]; NSString *installDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_LIBRARY"]; NSString *libraryPath = installDir; // ([paths firstObject] != nil ? [paths firstObject] : @""); NSString *frameworkPath = [libraryPath stringByAppendingPathComponent: @"Frameworks"]; NSString *installDest = frameworkPath; NSString *productDir = [installDest stringByAppendingPathComponent: [_productReference path]]; NSString *headersDir = [libraryPath stringByAppendingPathComponent: @"Headers"]; NSString *librariesDir = [libraryPath stringByAppendingPathComponent: @"Libraries"]; NSString *frameworksLinkDir = [[[@"../Frameworks" stringByAppendingPathComponent: [_productReference path]] stringByAppendingPathComponent:@"Versions"] stringByAppendingPathComponent:@"Current"]; NSString *headersLinkDir = [[[@"../Frameworks" stringByAppendingPathComponent: [_productReference path]] stringByAppendingPathComponent:@"Versions"] stringByAppendingPathComponent:@"Current"]; NSString *uninstalledProductsDir = [outputDir stringByAppendingPathComponent: @"Products"]; NSString *fullPath = [uninstalledProductsDir stringByAppendingPathComponent: [_productReference path]]; NSError *error = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *fileName = [fullPath lastPathComponent]; NSString *execName = [fileName stringByDeletingPathExtension]; // Copy [fileManager removeItemAtPath: productDir error: NULL]; [fileManager copyItemAtPath: fullPath toPath: productDir error: &error]; // Create links... [fileManager removeItemAtPath: [headersDir stringByAppendingPathComponent: execName] error: NULL]; BOOL flag = [fileManager createSymbolicLinkAtPath: [headersDir stringByAppendingPathComponent: execName] pathContent: [headersLinkDir stringByAppendingPathComponent: @"Headers"]]; if(!flag) { xcputs([[NSString stringWithFormat: @"Error creating symbolic link..."] cString]); } [fileManager removeItemAtPath: [librariesDir stringByAppendingPathComponent: [NSString stringWithFormat: @"lib%@.so",execName]] error:NULL]; flag = [fileManager createSymbolicLinkAtPath: [librariesDir stringByAppendingPathComponent: [NSString stringWithFormat: @"lib%@.so",execName]] pathContent: [frameworksLinkDir stringByAppendingPathComponent: [NSString stringWithFormat: @"lib%@.so",execName]]]; if(!flag) { xcputs([[NSString stringWithFormat: @"Error creating symbolic link..."] cString]); } return flag; } - (BOOL) installLibrary { NSString *buildDir = @"./build"; NSString *outputDir = [buildDir stringByAppendingPathComponent: [self name]]; NSString *installDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_LIBRARIES"]; NSString *libraryPath = installDir; // ([paths firstObject] != nil ? [paths firstObject] : @""); NSString *headersDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_HEADERS"]; //[libraryPath stringByAppendingPathComponent: @"Headers"]; NSString *derivedSrcDir = @"derived_src"; NSString *derivedSrcHeaderDir = derivedSrcDir; NSString *libName = [[_productReference path] lastPathComponent]; NSString *destPath = [libraryPath stringByAppendingPathComponent: libName]; NSError *error = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *uninstalledProductsDir = [outputDir stringByAppendingPathComponent: @"Products"]; NSString *fullPath = [uninstalledProductsDir stringByAppendingPathComponent: libName]; NSString *cwd = [fileManager currentDirectoryPath]; NSLog(@"******* CWD = %@", cwd); BOOL f = NO; f = [fileManager fileExistsAtPath: fullPath]; if (f == YES) { xcputs([[NSString stringWithFormat: @"\tLibrary exists %@...", fullPath] cString]); } f = [fileManager fileExistsAtPath: destPath]; if (f == YES) { xcputs([[NSString stringWithFormat: @"\tLibrary already exists at path %@...", destPath] cString]); } else { xcputs([[NSString stringWithFormat: @"\tCopy static library %@ -> %@", fullPath, destPath] cString]); [fileManager copyItemAtPath: fullPath toPath: destPath error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"Error while copying library: %@", error] cString]); //return NO; } } // NSString *libName = [fullPath lastPathComponent]; NSString *libHeaderDir = [libName stringByReplacingOccurrencesOfString: @"lib" withString: @""]; libHeaderDir = [libHeaderDir stringByReplacingOccurrencesOfString: @".a" withString: @""]; libHeaderDir = [libHeaderDir stringByReplacingOccurrencesOfString: @".so" withString: @""]; NSString *libHeadersPath = [headersDir stringByAppendingPathComponent: libHeaderDir]; NSLog(@"headers path = %@", libHeadersPath); [fileManager createDirectoryAtPath: libHeadersPath withIntermediateDirectories: YES attributes: nil error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"Error while creating directory %@ : %@", libHeadersPath, error] cString]); return NO; } NSEnumerator *en = [fileManager enumeratorAtPath: derivedSrcHeaderDir]; id file = nil; while((file = [en nextObject]) != nil) { NSString *srcFile = [libHeaderDir stringByAppendingPathComponent: file]; NSString *destFile = [libHeadersPath stringByAppendingPathComponent: file]; xcputs([[NSString stringWithFormat: @"\tCopy %@ -> %@",srcFile,destFile] cString]); [fileManager copyItemAtPath: srcFile toPath: destFile error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"Error while copying header: %@", error] cString]); return NO; } } return YES; } - (BOOL) installDynamicLibrary { NSString *buildDir = @"./build"; NSString *outputDir = [buildDir stringByAppendingPathComponent: [self name]]; NSString *installDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_LIBRARIES"]; NSString *libraryPath = installDir; NSString *librariesDir = [libraryPath stringByAppendingPathComponent: @"Libraries"]; NSString *headersDir = [NSString stringForCommand: @"gnustep-config --variable=GNUSTEP_LOCAL_HEADERS"]; //[libraryPath stringByAppendingPathComponent: @"Headers"]; NSString *derivedSrcDir = @"derived_src"; NSString *derivedSrcHeaderDir = derivedSrcDir; NSString *destPath = [librariesDir stringByAppendingPathComponent: [_productReference path]]; NSError *error = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *uninstalledProductsDir = [outputDir stringByAppendingPathComponent: @"Products"]; NSString *fullPath = [uninstalledProductsDir stringByAppendingPathComponent: [_productReference path]]; xcputs([[NSString stringWithFormat: @"\tCopy dynamic library %@ -> %@",fullPath,destPath] cString]); [fileManager copyItemAtPath: fullPath toPath: destPath error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"Error while copying: (%@)", error] cString]); return NO; } NSString *libName = [fullPath lastPathComponent]; NSString *libHeaderDir = [libName stringByReplacingOccurrencesOfString: @"lib" withString: @""]; libHeaderDir = [libHeaderDir stringByReplacingOccurrencesOfString: @".a" withString: @""]; libHeaderDir = [libHeaderDir stringByReplacingOccurrencesOfString: @".so" withString: @""]; NSString *libHeadersPath = [headersDir stringByAppendingPathComponent: libHeaderDir]; [fileManager createDirectoryAtPath: libHeadersPath withIntermediateDirectories: YES attributes: nil error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"Error while creating directory %@ : (%@)",libHeadersPath, error] cString]); return NO; } NSEnumerator *en = [fileManager enumeratorAtPath: derivedSrcHeaderDir]; id file = nil; while((file = [en nextObject]) != nil) { NSString *srcFile = [libHeaderDir stringByAppendingPathComponent: file]; NSString *destFile = [libHeadersPath stringByAppendingPathComponent: file]; xcputs([[NSString stringWithFormat: @"\tCopy %@ -> %@",srcFile,destFile] cString]); [fileManager copyItemAtPath: srcFile toPath: destFile error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"Error while copying: (%@)", error] cString]); return NO; } } return YES; } - (BOOL) install { BOOL f = NO; xcputs([[NSString stringWithFormat: @"=== Installing Target %@",_name] cString]); if([_productType isEqualToString: TOOL_TYPE]) { f = [self installTool]; } else if([_productType isEqualToString: APPLICATION_TYPE]) { f = [self installApp]; } else if([_productType isEqualToString: FRAMEWORK_TYPE]) { f = [self installFramework]; } else if([_productType isEqualToString: LIBRARY_TYPE]) { f = [self installLibrary]; } else if([_productType isEqualToString: DYNAMIC_LIBRARY_TYPE]) { f = [self installDynamicLibrary]; } xcputs([[NSString stringWithFormat: @"=== Completed Installing Target %@",_name] cString]); return f; } - (GSXCGenerator *) _loadGeneratorBundleFromDirectory: (NSString *)dir withName: (NSString *)bname { NSString *bundleName = [bname stringByAppendingPathExtension: @"generator"]; NSString *bundlePath = [dir stringByAppendingPathComponent: bundleName]; NSBundle *generatorBundle = [NSBundle bundleWithPath: bundlePath]; if (generatorBundle != nil) { NSString *className = [[generatorBundle infoDictionary] objectForKey: @"NSPrincipalClass"]; if (className != nil) { Class cls = [generatorBundle classNamed: className]; if (cls != nil) { GSXCGenerator *generator = [[cls alloc] initWithTarget: self]; if (generator != nil) { return generator; } else { NSLog(@"Could not instantiate generator: %@", className); } } else { NSLog(@"Could not build class from string: %@", className); } } else { NSLog(@"NSPrincipalClass not specified in plist for bundle: %@", bundlePath); } } return nil; } - (BOOL) invokeGeneratorBundle { NSString *generatorName = [[_project container] parameter]; // @"Makefile"; // default if not specified... NSString *bundlesDir = nil; GSXCGenerator *generator = nil; bundlesDir = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject]; bundlesDir = [bundlesDir stringByAppendingPathComponent: @"Bundles"]; generator = [self _loadGeneratorBundleFromDirectory: bundlesDir withName: generatorName]; if (generator) return [generator generate]; bundlesDir = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSLocalDomainMask, YES) lastObject]; bundlesDir = [bundlesDir stringByAppendingPathComponent: @"Bundles"]; generator = [self _loadGeneratorBundleFromDirectory: bundlesDir withName: generatorName]; if (generator) return [generator generate]; bundlesDir = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, YES) lastObject]; bundlesDir = [bundlesDir stringByAppendingPathComponent: @"Bundles"]; generator = [self _loadGeneratorBundleFromDirectory: bundlesDir withName: generatorName]; if (generator) return [generator generate]; return NO; } - (BOOL) generate { BOOL result = YES; NSEnumerator *en = nil; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; id o = nil; xcputs([[NSString stringWithFormat: @"=== Generating Target: %@", _name] cString]); [[self buildConfigurationList] applyDefaultConfiguration]; [context setObject: _productType forKey: @"PRODUCT_TYPE"]; [context setObject: [self buildConfigurationList] forKey: @"buildConfig"]; if(_productSettingsXML != nil) { [context setObject: _productSettingsXML forKey: @"PRODUCT_SETTINGS_XML"]; } // Iterate over dependecies... xcputs([[NSString stringWithFormat: @"=== Checking Dependencies"] cString]); en = [[self dependencies] objectEnumerator]; while((o = [en nextObject]) != nil && result) { result = [o generate]; if(NO == result) { xcputs([[NSString stringWithFormat: @"*** Failed to generate dependency: %@", o] cString]); } } xcputs([[NSString stringWithFormat: @"=== Done."] cString]); // Interate over phases... xcputs([[NSString stringWithFormat: @"=== Interpreting build phases..."] cString]); en = [[self buildPhases] objectEnumerator]; while((o = [en nextObject]) != nil && result) { NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init]; NSDebugLog(@"Phase = %@", o); [o setTarget: self]; result = [o generate]; if(NO == result) { xcputs([[NSString stringWithFormat: @"*** Failed to generate build phase: %@", o] cString]); } RELEASE(p); } xcputs([[NSString stringWithFormat: @"=== Done..."] cString]); return [self invokeGeneratorBundle]; } - (BOOL) link { BOOL result = YES; NSEnumerator *en = nil; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *plistFile = [NSDictionary dictionaryWithContentsOfFile: @"buildtool.plist"]; NSArray *skippedTarget = [plistFile objectForKey: @"skippedTarget"]; if ([skippedTarget containsObject: [self name]]) { xcputs([[NSString stringWithFormat: @"=== Skipping Target %s%@%s", YELLOW, _name, RESET] cString]); return YES; } xcputs([[NSString stringWithFormat: @"=== Building Target %s%@%s", GREEN, _name, RESET] cString]); [_buildConfigurationList applyDefaultConfiguration]; [context setObject: _buildConfigurationList forKey: @"buildConfig"]; [context setObject: _productType forKey: @"PRODUCT_TYPE"]; if(_productSettingsXML != nil) { [context setObject: _productSettingsXML forKey: @"PRODUCT_SETTINGS_XML"]; } xcputs([[NSString stringWithFormat: @"=== Checking Dependencies"] cString]); id dependency = nil; en = [_dependencies objectEnumerator]; while((dependency = [en nextObject]) != nil && result) { result = [dependency build]; } xcputs([[NSString stringWithFormat: @"=== Done."] cString]); xcputs([[NSString stringWithFormat: @"=== Executing build phases..."] cString]); [self _productWrapper]; id phase = nil; en = [_buildPhases objectEnumerator]; while((phase = [en nextObject]) != nil && result) { NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init]; [phase setTarget: self]; result = [phase link]; if(NO == result) { xcputs([[NSString stringWithFormat: @"*** Failed build phase: %@",phase] cString]); } RELEASE(p); } xcputs([[NSString stringWithFormat: @"=== Done..."] cString]); xcputs([[NSString stringWithFormat: @"=== Completed Executing Target %@", _name] cString]); return result; } - (NSString *) description { return [NSString stringWithFormat: @"%@-%@", [super description], [self name]]; } @end libs-xcode-XCode-0_5_0/XCode/PBXProject.h000066400000000000000000000070651475431643200200630ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __PBXProject_h_GNUSTEP_INCLUDE #define __PBXProject_h_GNUSTEP_INCLUDE #import // Local includes #import "PBXCoder.h" #import "XCConfigurationList.h" #import "PBXGroup.h" #import "PBXGroup.h" @class PBXContainer; @interface PBXProject : NSObject { NSString *_developmentRegion; NSMutableArray *_knownRegions; NSString *_compatibilityVersion; NSMutableArray *_projectReferences; NSMutableArray *_targets; NSString *_projectDirPath; NSString *_projectRoot; XCConfigurationList *_buildConfigurationList; PBXGroup *_mainGroup; NSString *_hasScannedForEncodings; PBXGroup *_productRefGroup; PBXContainer *_container; NSDictionary *_attributes; NSDictionary *_ctx; NSString *_filename; NSMutableArray *_arrangedTargets; BOOL _minimizedProjectReferenceProxies; NSString *_preferredProjectObjectVersion; } // Methods.... - (BOOL) minimizedProjectReferenceProxies; // getter - (void) setMinimizedProjectReferenceProxies: (BOOL)flag; // setter - (NSString *) preferredProjectObjectVersion; // getter - (void) setPreferredProjectObjectVersion: (NSString *)object; // setter - (NSString *) developmentRegion; // getter - (void) setDevelopmentRegion: (NSString *)object; // setter - (NSMutableArray *) knownRegions; // getter - (void) setKnownRegions: (NSMutableArray *)object; // setter - (NSString *) compatibilityVersion; // getter - (void) setCompatibilityVersion: (NSString *)object; // setter - (NSMutableArray *) projectReferences; // getter - (void) setProjectReferences: (NSMutableArray *)object; // setter - (NSMutableArray *) targets; // getter - (void) setTargets: (NSMutableArray *)object; // setter - (NSString *) projectDirPath; // getter - (void) setProjectDirPath: (NSString *)object; // setter - (NSString *) projectRoot; // getter - (void) setProjectRoot: (NSString *)object; // setter - (XCConfigurationList *) buildConfigurationList; // getter - (void) setBuildConfigurationList: (XCConfigurationList *)object; // setter - (PBXGroup *) mainGroup; // getter - (void) setMainGroup: (PBXGroup *)object; // setter - (NSString *) hasScannedForEncodings; // getter - (void) setHasScannedForEncodings: (NSString *)object; // setter - (PBXGroup *) productRefGroup; // getter - (void) setProductRefGroup: (PBXGroup *)object; // setter - (PBXContainer *) container; - (void) setContainer: (PBXContainer *)container; - (void) setContext: (NSDictionary *)ctx; - (NSDictionary *) context; - (void) setFilename: (NSString *)fn; - (NSString *) filename; // calculate dependencies - (void) plan; // build - (BOOL) build; - (BOOL) clean; - (BOOL) install; - (BOOL) generate; - (BOOL) save; @end #endif libs-xcode-XCode-0_5_0/XCode/PBXProject.m000066400000000000000000000363431475431643200200710ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXProject.h" #import "PBXContainer.h" #import "PBXNativeTarget.h" #import "GSXCBuildContext.h" #import "NSString+PBXAdditions.h" #import "PBXTarget.h" #import "PBXTargetDependency.h" #import "XCBuildConfiguration.h" #import "XCConfigurationList.h" #ifndef _MSC_VER #import #endif #ifdef _WIN32 #import "setenv.h" #endif @interface PBXTarget (Private) - (NSArray *) prerequisiteTargets; @end @implementation PBXTarget (Private) - (NSArray *) prerequisiteTargets { NSMutableArray *result = [NSMutableArray arrayWithCapacity: [_dependencies count]]; NSEnumerator *en = [_dependencies objectEnumerator]; PBXTargetDependency *t = nil; while ((t = [en nextObject]) != nil) { id tg = [t target]; if (tg != nil) { [result addObject: tg]; xcputs([[NSString stringWithFormat: @"\t* %@ - Added to dependencies", tg] cString]); } } return result; } @end @interface PBXProject (Private) - (void) recurseTargetDependencies: (NSArray *)targets forTarget: (PBXTarget *)target result: (NSMutableArray *)result; - (NSMutableArray *) arrangedTargets; @end @implementation PBXProject (Private) - (void) recurseTargetDependencies: (NSArray *)targets forTarget: (PBXTarget *)target result: (NSMutableArray *)result { if ([targets count] == 0 && target != nil) { if ([result containsObject: target] == NO) { [result insertObject: target atIndex: 0]; } } if ([targets count] == 1 && target == nil) { if ([result containsObject: target] == NO) { [result insertObject: [targets firstObject] atIndex: 0]; } } else { NSEnumerator *en = [targets objectEnumerator]; PBXTarget *t = nil; while ((t = [en nextObject]) != nil) { NSArray *da = [t prerequisiteTargets]; [self recurseTargetDependencies: da forTarget: t result: result]; } } } - (NSMutableArray *) arrangedTargets { _arrangedTargets = [NSMutableArray arrayWithCapacity: 100]; [self recurseTargetDependencies: [self targets] forTarget: nil result: _arrangedTargets]; NSEnumerator *en = [[self targets] objectEnumerator]; id o = nil; while ((o = [en nextObject]) != nil) { if ([_arrangedTargets containsObject: o] == NO) { [_arrangedTargets addObject: o]; } } NSDebugLog(@"arrangedTarget = %ld, targets = %ld", [_arrangedTargets count], [[self targets] count]); return _arrangedTargets; } @end @implementation PBXProject - (instancetype) init { self = [super init]; if (self != nil) { // Set up defaults... [self setCompatibilityVersion: @"Xcode 14.0"]; [self setDevelopmentRegion: @"en"]; // [self setKnownRegions: [NSMutableArray arrayWithObjects: @"en", @"Base", nil]]; [self setProjectDirPath: @""]; [self setProjectRoot: @""]; [self setHasScannedForEncodings: @"0"]; // [self setTargets: [NSMutableArray array]]; } return self; } // Methods... - (BOOL) minimizedProjectReferenceProxies // getter { return _minimizedProjectReferenceProxies; } - (void) setMinimizedProjectReferenceProxies: (BOOL)flag // setter { _minimizedProjectReferenceProxies = flag; } - (NSString *) preferredProjectObjectVersion // getter { return _preferredProjectObjectVersion; } - (void) setPreferredProjectObjectVersion: (NSString *)object // setter { ASSIGN(_preferredProjectObjectVersion, object); } - (NSString *) developmentRegion // getter { return _developmentRegion; } - (void) setDevelopmentRegion: (NSString *)object // setter { ASSIGN(_developmentRegion,object); } - (NSMutableArray *) knownRegions // getter { return _knownRegions; } - (void) setKnownRegions: (NSMutableArray *)object // setter { ASSIGN(_knownRegions,object); } - (NSString *) compatibilityVersion // getter { return _compatibilityVersion; } - (void) setCompatibilityVersion: (NSString *)object // setter { ASSIGN(_compatibilityVersion,object); } - (NSMutableArray *) projectReferences // getter { return _projectReferences; } - (void) setProjectReferences: (NSMutableArray *)object // setter { ASSIGN(_projectReferences,object); } - (NSMutableArray *) targets // getter { return _targets; } - (void) setTargets: (NSMutableArray *)object // setter { ASSIGN(_targets,object); } - (NSString *) projectDirPath // getter { return _projectDirPath; } - (void) setProjectDirPath: (NSString *)object // setter { ASSIGN(_projectDirPath,object); } - (NSString *) projectRoot // getter { return _projectRoot; } - (void) setProjectRoot: (NSString *)object // setter { ASSIGN(_projectRoot,object); } - (XCConfigurationList *) buildConfigurationList // getter { return _buildConfigurationList; } - (void) setBuildConfigurationList: (XCConfigurationList *)object // setter { ASSIGN(_buildConfigurationList,object); } - (PBXGroup *) mainGroup // getter { return _mainGroup; } - (void) setMainGroup: (PBXGroup *)object // setter { ASSIGN(_mainGroup,object); } - (NSString *) hasScannedForEncodings // getter { return _hasScannedForEncodings; } - (void) setHasScannedForEncodings: (NSString *)object // setter { ASSIGN(_hasScannedForEncodings,object); } - (PBXGroup *) productRefGroup // getter { return _productRefGroup; } - (void) setProductRefGroup: (PBXGroup *)object // setter { ASSIGN(_productRefGroup,object); } - (PBXContainer *) container { return _container; } - (void) setContainer: (PBXContainer *)object { _container = object; // container retains us, do not retain it... } - (void) setContext: (NSDictionary *)context { ASSIGN(_ctx,context); } - (NSDictionary *) context { return _ctx; } - (void) setFilename: (NSString *)fn { ASSIGN(_filename, fn); } - (NSString *) filename { return _filename; } - (void) plan { xcprintf("=== Planning build -- Recursing dependencies..."); _arrangedTargets = [self arrangedTargets]; xcprintf("%ld targets - completed\n", (long)[_arrangedTargets count]); } - (void) _sourceRootFromMainGroup { NSString *sourceRoot = @"./"; // [[sourceGroup path] firstPathComponent]; // get first group, which is the source group. if(sourceRoot == nil || [sourceRoot isEqualToString: @""]) { sourceRoot = @"./"; } setenv("SOURCE_ROOT","./",1); setenv("SRCROOT","./",1); } - (NSString *) buildString { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *output = nil; // NSString *cmd = nil; // cmd = @"gnustep-config --debug-flags"; // Context... output = @"`gnustep-config --debug-flags`"; //[NSString stringForCommand: cmd]; [context setObject: output forKey: @"CONFIG_STRING"]; return output; } - (BOOL) build { NSString *fn = [[[self container] filename] stringByDeletingLastPathComponent]; xcprintf("=== Building Project %s%s%s%s\n", BOLD, GREEN, [fn cString], RESET); [_buildConfigurationList applyDefaultConfiguration]; [self _sourceRootFromMainGroup]; [self plan]; // Show list of targets... NSEnumerator *ten = [_arrangedTargets objectEnumerator]; id t = nil; NSUInteger c = 0; while ((t = [ten nextObject]) != nil) { c++; xcprintf("\t* Target #%ld: %s%s%s%s\n", c, BOLD, GREEN, [[t name] cString], RESET); } NSDebugLog(@"arrangedTargets = %@", _arrangedTargets); NSFileManager *fileManager = [NSFileManager defaultManager]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSEnumerator *en = [_arrangedTargets objectEnumerator]; id target = nil; BOOL result = YES; while((target = [en nextObject]) != nil && result) { [target setProject: self]; [context contextDictionaryForName: [target name]]; [self buildString]; if(YES == [fileManager fileExistsAtPath: [target name]]) { [context setObject: @"YES" forKey: @"TARGET_IN_SUBDIR"]; } [context setObject: _mainGroup forKey: @"MAIN_GROUP"]; [context setObject: _container forKey: @"CONTAINER"]; [context setObject: @"./" forKey: @"PROJECT_ROOT"]; [context setObject: @"./" forKey: @"PROJECT_DIR"]; [context setObject: @"./" forKey: @"SRCROOT"]; [context setObject: @"./" forKey: @"SOURCE_ROOT"]; [context addEntriesFromDictionary: _ctx]; result = [target build]; [context popCurrentContext]; if (result == NO) { break; } } xcprintf("=== Done Building Project %s%s%s%s\n", BOLD, GREEN, [fn cString], RESET); return result; } - (BOOL) clean { xcputs("=== Cleaning Project"); [_buildConfigurationList applyDefaultConfiguration]; NSFileManager *fileManager = [NSFileManager defaultManager]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSEnumerator *en = [_targets objectEnumerator]; id target = nil; BOOL result = YES; while((target = [en nextObject]) != nil && result) { [target setProject: self]; if(YES == [fileManager fileExistsAtPath:[target name]]) { [context setObject: @"YES" forKey: @"TARGET_IN_SUBDIR"]; } [context contextDictionaryForName: [target name]]; [context setObject: _mainGroup forKey: @"MAIN_GROUP"]; // [context setObject: _container // forKey: @"CONTAINER"]; [context setObject: @"./" forKey: @"PROJECT_ROOT"]; [context setObject: @"./" forKey: @"PROJECT_DIR"]; [context setObject: @"./" forKey: @"SRCROOT"]; [context setObject: @"./" forKey: @"SOURCE_ROOT"]; [context addEntriesFromDictionary: _ctx]; result = [target clean]; [context popCurrentContext]; } xcputs("=== Completed Cleaning Project"); return result; } - (BOOL) install { xcputs("=== Installing Project"); [_buildConfigurationList applyDefaultConfiguration]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSEnumerator *en = [_targets objectEnumerator]; id target = nil; BOOL result = YES; while((target = [en nextObject]) != nil && result) { [target setProject: self]; [context contextDictionaryForName: [target name]]; [context setObject: _mainGroup forKey: @"MAIN_GROUP"]; // [context setObject: _container // forKey: @"CONTAINER"]; [context setObject: @"./" forKey: @"PROJECT_ROOT"]; [context setObject: @"./" forKey: @"PROJECT_DIR"]; [context setObject: @"./" forKey: @"SRCROOT"]; [context setObject: @"./" forKey: @"SOURCE_ROOT"]; [context addEntriesFromDictionary: _ctx]; result = [target install]; [context popCurrentContext]; } xcputs("=== Completed Installing Project"); return result; } - (BOOL) generate { NSString *fn = [[[self container] filename] stringByDeletingLastPathComponent]; xcprintf("=== Generating %@ for Project %s%s%s%s\n", [_container parameter], BOLD, GREEN, [fn cString], RESET); [_buildConfigurationList applyDefaultConfiguration]; [self _sourceRootFromMainGroup]; [self plan]; NSFileManager *fileManager = [NSFileManager defaultManager]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSEnumerator *en = [_arrangedTargets objectEnumerator]; id target = nil; BOOL result = YES; while((target = [en nextObject]) != nil && result) { [target setProject: self]; [context contextDictionaryForName: [target name]]; [self buildString]; if(YES == [fileManager fileExistsAtPath:[target name]]) { [context setObject: @"YES" forKey: @"TARGET_IN_SUBDIR"]; } [context setObject: _mainGroup forKey: @"MAIN_GROUP"]; [context setObject: _container forKey: @"CONTAINER"]; [context setObject: @"./" forKey: @"PROJECT_ROOT"]; [context setObject: @"./" forKey: @"PROJECT_DIR"]; [context setObject: @"./" forKey: @"SRCROOT"]; [context setObject: @"./" forKey: @"SOURCE_ROOT"]; [context addEntriesFromDictionary: _ctx]; result = [target generate]; [context popCurrentContext]; if (result == NO) { break; } } xcputs("=== Completed Generating Project"); return result; } - (BOOL) link { NSString *fn = [[[self container] filename] stringByDeletingLastPathComponent]; xcprintf("=== Linking Project %s%s%s%s\n", BOLD, GREEN, [fn cString], RESET); [_buildConfigurationList applyDefaultConfiguration]; [self _sourceRootFromMainGroup]; // [self plan]; // NSLog(@"arrangedTargets = %@", _arrangedTargets); NSFileManager *fileManager = [NSFileManager defaultManager]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSEnumerator *en = [_targets objectEnumerator]; id target = nil; BOOL result = YES; while((target = [en nextObject]) != nil && result) { [target setProject: self]; [context contextDictionaryForName: [target name]]; [self buildString]; if(YES == [fileManager fileExistsAtPath: [target name]]) { [context setObject: @"YES" forKey: @"TARGET_IN_SUBDIR"]; } [context setObject: _mainGroup forKey: @"MAIN_GROUP"]; [context setObject: _container forKey: @"CONTAINER"]; [context setObject: @"./" forKey: @"PROJECT_ROOT"]; [context setObject: @"./" forKey: @"PROJECT_DIR"]; [context setObject: @"./" forKey: @"SRCROOT"]; [context setObject: @"./" forKey: @"SOURCE_ROOT"]; [context addEntriesFromDictionary: _ctx]; result = [target link]; [context popCurrentContext]; if (result == NO) { break; } } xcprintf("=== Done Linking Project %s%s%s%s\n", BOLD, GREEN, [fn cString], RESET); return result; } - (XCConfigurationList *) _defaultConfigList { XCConfigurationList *xcl = AUTORELEASE([[XCConfigurationList alloc] init]); XCBuildConfiguration *config = AUTORELEASE([[XCBuildConfiguration alloc] init]); NSMutableArray *configs = [NSMutableArray arrayWithObject: config]; [config setName: @"Debug"]; [config setBuildSettings: [NSMutableDictionary dictionaryWithObject: @"macosx" forKey: @"SDKROOT"]]; [xcl setDefaultConfigurationName: @"Debug"]; [xcl setBuildConfigurations: configs]; return xcl; } - (BOOL) save { NSEnumerator *en = [_arrangedTargets objectEnumerator]; id target = nil; // Set up the configuration list... [self setBuildConfigurationList: [self _defaultConfigList]]; id targetConfig = [self _defaultConfigList]; while((target = [en nextObject]) != nil) { [target setBuildConfigurationList: targetConfig]; // set up config list. } return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXReferenceProxy.h000066400000000000000000000030771475431643200214140ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXContainerItemProxy.h" @interface PBXReferenceProxy : NSObject { NSString *sourceTree; NSString *fileType; PBXContainerItemProxy *remoteRef; NSString *path; } // Methods.... - (NSString *) sourceTree; // getter - (void) setSourceTree: (NSString *)object; // setter - (NSString *) fileType; // getter - (void) setFileType: (NSString *)object; // setter - (PBXContainerItemProxy *) remoteRef; // getter - (void) setRemoteRef: (PBXContainerItemProxy *)object; // setter - (NSString *) path; // getter - (void) setPath: (NSString *)object; // setter @end libs-xcode-XCode-0_5_0/XCode/PBXReferenceProxy.m000066400000000000000000000033611475431643200214150ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXReferenceProxy.h" @implementation PBXReferenceProxy - (void) dealloc { RELEASE(sourceTree); RELEASE(fileType); RELEASE(remoteRef); RELEASE(path); [super dealloc]; } // Methods.... - (NSString *) sourceTree // getter { return sourceTree; } - (void) setSourceTree: (NSString *)object; // setter { ASSIGN(sourceTree,object); } - (NSString *) fileType // getter { return fileType; } - (void) setFileType: (NSString *)object; // setter { ASSIGN(fileType,object); } - (PBXContainerItemProxy *) remoteRef // getter { return remoteRef; } - (void) setRemoteRef: (PBXContainerItemProxy *)object; // setter { ASSIGN(remoteRef,object); } - (NSString *) path // getter { return path; } - (void) setPath: (NSString *)object; // setter { ASSIGN(path,object); } @end libs-xcode-XCode-0_5_0/XCode/PBXResourcesBuildPhase.h000066400000000000000000000021231475431643200223560ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @interface PBXResourcesBuildPhase : PBXBuildPhase @end libs-xcode-XCode-0_5_0/XCode/PBXResourcesBuildPhase.m000066400000000000000000000327741475431643200224020ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXGroup.h" #import "PBXResourcesBuildPhase.h" #import "PBXFileReference.h" #import "PBXBuildFile.h" #import "PBXVariantGroup.h" #import "NSString+PBXAdditions.h" #import "GSXCBuildContext.h" #import "XCBuildConfiguration.h" #import "XCConfigurationList.h" @implementation PBXResourcesBuildPhase - (instancetype) init { self = [super init]; if (self != nil) { NSArray *objs = nil; objs = [[[GSXCBuildContext sharedBuildContext] objectForKey: @"objects"] allValues]; [self setFiles: [objs mutableCopy]]; } return self; } - (NSString *) productName { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSDictionary *ctx = [context currentContext]; XCConfigurationList *xcl = [ctx objectForKey: @"buildConfig"]; XCBuildConfiguration *xbc = [xcl defaultConfiguration]; NSDictionary *bs = [xbc buildSettings]; NSString *productName = [bs objectForKey: @"PRODUCT_NAME"]; // NSProcessInfo *info = [NSProcessInfo processInfo]; // NSDictionary *env = [info environment]; NSDebugLog(@"bs = %@", bs); // This is kind of a kludge, but better than what was here before. // I believe that when the context has the variable name it means to use // the product name from the target. if ([productName isEqualToString: @"$(TARGET_NAME)"]) { productName = [_target productName]; NSDebugLog(@"* 2nd try %@", productName); if ([productName isEqualToString: @"$(TARGET_NAME)"]) { productName = [_target name]; NSDebugLog(@"* 3rd try %@", productName); } } return productName; } - (NSString *) processAssets { NSFileManager *mgr = [NSFileManager defaultManager]; NSString *filename = nil; NSString *productName = [_target name]; // [self productName]; NSString *assetsDir = [productName stringByAppendingPathComponent: @"Assets.xcassets"]; NSString *appIconDir = [assetsDir stringByAppendingPathComponent: @"AppIcon.appiconset"]; NSString *contentsJson = [appIconDir stringByAppendingPathComponent: @"Contents.json"]; NSData *data = [NSData dataWithContentsOfFile: contentsJson]; if (data != nil) { NSDictionary *dict = [NSJSONSerialization JSONObjectWithData: data options: 0L error: NULL]; NSArray *imagesArray = [dict objectForKey: @"images"]; NSDictionary *imageDict = nil; NSEnumerator *en = [imagesArray objectEnumerator]; while ((imageDict = [en nextObject]) != nil) { NSString *size = [imageDict objectForKey: @"size"]; NSString *scale = [imageDict objectForKey: @"scale"]; if ([size isEqualToString: @"32x32"] && [scale isEqualToString: @"1x"]) { filename = [imageDict objectForKey: @"filename"]; break; } } // Copy icons to resource dir... GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *productOutputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; NSString *resourcesDir = [productOutputDir stringByAppendingPathComponent: @"Resources"]; NSString *imagePath = [appIconDir stringByAppendingPathComponent: filename]; NSString *destPath = [resourcesDir stringByAppendingPathComponent: filename]; // Copy the item, remove it first to make sure there is no issue. //[mgr removeItemAtPath: destPath // error: NULL]; [mgr copyItemAtPath: imagePath toPath: destPath error: NULL]; } return filename; } - (BOOL) processInfoPlistInput: (NSString *)inputFileName output: (NSString *)outputFileName { if (inputFileName != nil) { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *settings = [context objectForKey: @"PRODUCT_SETTINGS_XML"]; if(settings == nil) { NSString *inputFileString = [NSString stringWithContentsOfFile: inputFileName]; NSString *outputFileString = [inputFileString stringByReplacingEnvironmentVariablesWithValues]; NSMutableDictionary *plistDict = [NSMutableDictionary dictionaryWithDictionary: [outputFileString propertyList]]; NSString *filename = [self processAssets]; if (filename != nil) { [plistDict setObject: filename forKey: @"NSIcon"]; } [plistDict writeToFile: outputFileName atomically: YES]; NSDebugLog(@"%@", plistDict); } else { [settings writeToFile: outputFileName atomically: YES encoding: NSUTF8StringEncoding error: NULL]; } } else { NSArray *keys = [NSArray arrayWithObjects: @"NSPrincipalClass", @"NSMainNibFile", nil]; NSArray *objs = [NSArray arrayWithObjects: @"NSApplication", @"MainMenu", nil]; NSDictionary *ipl = [NSDictionary dictionaryWithObjects: objs forKeys: keys]; [ipl writeToFile: outputFileName atomically: YES]; } return YES; } - (BOOL) copyResourceFrom: (NSString *)srcPath to: (NSString *)dstPath { BOOL result = NO; NSFileManager *mgr = [NSFileManager defaultManager]; NSError *error = nil; NSDebugLog(@"\t* Copy child %@ -> %@",srcPath,dstPath); // Copy the item result = [mgr copyItemAtPath: srcPath toPath: dstPath error: &error]; if (error != nil) { xcputs([[NSString stringWithFormat: @"\t* Updating resource \"%s%@%s\" --> \"%s%@%s\"", CYAN, srcPath, RESET, GREEN, dstPath, RESET] cString]); [mgr removeItemAtPath: dstPath error: NULL]; result = [mgr copyItemAtPath: srcPath toPath: dstPath error: &error]; } else { xcputs([[NSString stringWithFormat: @"\t* Copy resource \"%s%@%s\" --> \"%s%@%s\"", CYAN, srcPath, RESET, GREEN, dstPath, RESET] cString]); } return result; } - (BOOL) build { xcputs("=== Executing Resources Build Phase"); NSFileManager *mgr = [NSFileManager defaultManager]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *productOutputDir = [context objectForKey: @"PRODUCT_OUTPUT_DIR"]; // [NSString stringWithCString: getenv("PRODUCT_OUTPUT_DIR")]; NSString *resourcesDir = [productOutputDir stringByAppendingPathComponent: @"Resources"]; NSError *error = nil; NSString *productName = [self productName]; // @""; // [_target productName]; NSDebugLog(@"productName = %@", productName); // Pre create directory.... [mgr createDirectoryAtPath:resourcesDir withIntermediateDirectories:YES attributes:nil error:&error]; // Copy all resources... NSArray *synchronizedFiles = [_target synchronizedResources]; NSArray *files = [_files arrayByAddingObjectsFromArray: synchronizedFiles]; NSEnumerator *en = [files objectEnumerator]; BOOL result = YES; id file = nil; while((file = [en nextObject]) != nil && result) { id fileRef = [file fileRef]; if ([fileRef isKindOfClass: [PBXVariantGroup class]]) { NSArray *children = [fileRef children]; NSEnumerator *e = [children objectEnumerator]; id child = nil; while ((child = [e nextObject]) != nil) { NSString *filePath = [child path]; NSDebugLog(@"FILEPATH = %@", filePath); NSString *resourceFilePath = [filePath stringByDeletingLastPathComponent]; BOOL edited = NO; if ([mgr fileExistsAtPath: [child path]] == NO) { edited = YES; filePath = [productName stringByAppendingPathComponent: [child path]]; if ([mgr fileExistsAtPath: filePath] == NO) { filePath = [child buildPath]; } } NSString *fileDir = [resourcesDir stringByAppendingPathComponent: resourceFilePath]; NSString *fileName = [filePath lastPathComponent]; NSString *destPath = [resourcesDir stringByAppendingPathComponent: fileName]; NSError *error = nil; BOOL copyResult = NO; // If there is more than one path component... // then the intervening directories need to // be created. if([[filePath pathComponents] count] > 1) { NSString *dirs = [filePath stringByDeletingLastPathComponent]; if (edited) { dirs = [dirs stringByReplacingOccurrencesOfString: productName withString: @""]; } destPath = [resourcesDir stringByAppendingPathComponent: dirs]; destPath = [destPath stringByAppendingPathComponent: fileName]; } NSDebugLog(@"\tCreate %@",fileDir); copyResult = [mgr createDirectoryAtPath: fileDir withIntermediateDirectories: YES attributes: nil error: &error]; if (copyResult == NO) { NSLog(@"\tFILE CREATION ERROR: %@, %@", error, fileDir); } // kludge since Base/en etc is not supported yet. destPath = [destPath stringByReplacingOccurrencesOfString: @"Base.lproj/" withString: @""]; destPath = [destPath stringByReplacingOccurrencesOfString: @"en.lproj/" withString: @""]; copyResult = [self copyResourceFrom: filePath to: destPath]; if (copyResult == NO) { NSLog(@"\tFILE COPY ERROR: %@", destPath); } } continue; } NSString *filePath = [file path]; if ([mgr fileExistsAtPath: [file path]] == NO) { filePath = [file buildPath]; if ([mgr fileExistsAtPath: filePath] == NO) { filePath = [productName stringByAppendingPathComponent: [file path]]; } } NSString *fileName = [filePath lastPathComponent]; NSString *destPath = [resourcesDir stringByAppendingPathComponent: fileName]; BOOL copyResult = NO; NSDebugLog(@"\tXXXX Copy %@ -> %@",filePath,destPath); copyResult = [self copyResourceFrom: filePath to: destPath]; if (!copyResult) { NSLog(@"File not copied: %@ -> %@", filePath, destPath); } } // Handle Info.plist.... NSDictionary *ctx = [context currentContext]; XCConfigurationList *xcl = [ctx objectForKey: @"buildConfig"]; XCBuildConfiguration *xbc = [xcl defaultConfiguration]; NSDictionary *bs = [xbc buildSettings]; NSString *infoPlist = [bs objectForKey: @"INFOPLIST_FILE"]; if ([mgr fileExistsAtPath: infoPlist] == NO) { infoPlist = [infoPlist lastPathComponent]; } NSString *outputPlist = [resourcesDir stringByAppendingPathComponent: @"Info-gnustep.plist"]; [self processInfoPlistInput: infoPlist output: outputPlist]; xcputs("=== Resources Build Phase Completed"); fflush(stdout); return result; } - (BOOL) generate { GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSMutableArray *resources = [NSMutableArray arrayWithCapacity: [_files count]]; xcputs("=== Generating Resources Entries Build Phase"); NSFileManager *mgr = [NSFileManager defaultManager]; NSString *productName = [_target productName]; NSString *appName = [productName stringByDeletingPathExtension]; // Copy all resources... NSEnumerator *en = [_files objectEnumerator]; BOOL result = YES; id file = nil; while((file = [en nextObject]) != nil && result) { id fileRef = [file fileRef]; if ([fileRef isKindOfClass: [PBXVariantGroup class]]) { NSArray *children = [fileRef children]; NSEnumerator *e = [children objectEnumerator]; id child = nil; while ((child = [e nextObject]) != nil) { NSString *filePath = [child path]; if ([mgr fileExistsAtPath: [child path]] == NO) { filePath = [productName stringByAppendingPathComponent: [child path]]; } xcputs([[NSString stringWithFormat: @"\tAdd child resource entry %@", filePath] cString]); [resources addObject: filePath]; } continue; } NSString *filePath = [file path]; if ([mgr fileExistsAtPath: [file path]] == NO) { filePath = [productName stringByAppendingPathComponent: [file path]]; } xcputs([[NSString stringWithFormat: @"\tAdd resource entry %@",filePath] cString]); [resources addObject: filePath]; } // Handle Info.plist... NSDictionary *ctx = [context currentContext]; XCConfigurationList *xcl = [ctx objectForKey: @"buildConfig"]; XCBuildConfiguration *xbc = [xcl defaultConfiguration]; NSDictionary *bs = [xbc buildSettings]; NSString *inputPlist = [bs objectForKey: @"INFOPLIST_FILE"]; if ([mgr fileExistsAtPath: inputPlist] == NO) { inputPlist = [inputPlist lastPathComponent]; } NSString *outputPlist = [NSString stringWithFormat: @"%@Info.plist",appName] ; [self processInfoPlistInput: inputPlist output: outputPlist]; // Move Base.lproj to English.lproj until Base.lproj is supported.. // NSString *baseLproj = @"Base.lproj/*"; // NSString *engLproj = @"English.lproj"; // [resources addObject: engLproj]; [resources addObject: outputPlist]; [context setObject: resources forKey: @"RESOURCES"]; xcputs("=== Resources Build Phase Completed (generate)"); return result; } - (BOOL) link { return [self build]; } @end libs-xcode-XCode-0_5_0/XCode/PBXRezBuildPhase.h000066400000000000000000000021141475431643200211440ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @interface PBXRezBuildPhase : PBXBuildPhase @end libs-xcode-XCode-0_5_0/XCode/PBXRezBuildPhase.m000066400000000000000000000026201475431643200211530ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXRezBuildPhase.h" @implementation PBXRezBuildPhase -(BOOL) build { NSEnumerator *en = [_files objectEnumerator]; id file = nil; BOOL result = YES; xcputs("=== Executing Rez Build Phase"); while((file = [en nextObject]) != nil && result) { xcputs([[NSString stringWithFormat: @"\tFile = %@",file] cString]); } xcputs("=== Completed Rez Build Phase"); return result; } - (BOOL) link { return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXShellScriptBuildPhase.h000066400000000000000000000036741475431643200226540ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @interface PBXShellScriptBuildPhase : PBXBuildPhase { NSString *_shellPath; NSString *_shellScript; NSMutableArray *_inputPaths; NSMutableArray *_outputPaths; NSMutableArray *_inputFileListPaths; NSMutableArray *_outputFileListPaths; } // Methods.... - (NSString *) shellPath; // getter - (void) setShellPath: (NSString *)object; // setter - (NSString *) shellScript; // getter - (void) setShellScript: (NSString *)object; // setter - (NSMutableArray *) inputPaths; // getter - (void) setInputPaths: (NSMutableArray *)object; // setter - (NSMutableArray *) outputPaths; // getter - (void) setOutputPaths: (NSMutableArray *)object; // setter - (NSMutableArray *) inputFileListPaths; // getter - (void) setInputFileListPaths: (NSMutableArray *)object; // setter - (NSMutableArray *) outputFileListPaths; // getter - (void) setOutputFileListPaths: (NSMutableArray *)object; // setter // build... - (BOOL) build; @end libs-xcode-XCode-0_5_0/XCode/PBXShellScriptBuildPhase.m000066400000000000000000000200121475431643200226420ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXShellScriptBuildPhase.h" #import "NSString+PBXAdditions.h" #import "xcsystem.h" extern char **environ; @implementation PBXShellScriptBuildPhase - (void) dealloc { RELEASE(_shellPath); RELEASE(_shellScript); RELEASE(_inputPaths); RELEASE(_outputPaths); RELEASE(_inputFileListPaths); RELEASE(_outputFileListPaths); [super dealloc]; } // Methods.... - (NSMutableArray *) inputFileListPaths { return _inputFileListPaths; } - (void) setInputFileListPaths: (NSMutableArray *)object { ASSIGN(_inputFileListPaths, object); } - (NSMutableArray *) outputFileListPaths { return _outputFileListPaths; } - (void) setOutputFileListPaths: (NSMutableArray *)object { ASSIGN(_outputFileListPaths, object); } - (NSString *) shellPath // getter { return _shellPath; } - (void) setShellPath: (NSString *)object; // setter { ASSIGN(_shellPath,object); } - (NSString *) shellScript // getter { return _shellScript; } - (void) setShellScript: (NSString *)object; // setter { ASSIGN(_shellScript,object); } - (NSMutableArray *) inputPaths // getter { return _inputPaths; } - (void) setInputPaths: (NSMutableArray *)object; // setter { ASSIGN(_inputPaths,object); } - (NSMutableArray *) outputPaths // getter { return _outputPaths; } - (void) setOutputPaths: (NSMutableArray *)object; // setter { ASSIGN(_outputPaths,object); } - (NSString *) environmentVariableString { NSString *result = [NSString stringWithFormat: @"\n# Environment variables\n\n"]; char **env = NULL; for (env = environ; *env != 0; env++) { char *thisEnv = *env; NSString *envStr = [NSString stringWithCString: thisEnv encoding: NSUTF8StringEncoding]; NSArray *arr = [envStr componentsSeparatedByString: @"="]; if ([arr count] == 2) { NSString *var = [arr objectAtIndex: 0]; NSString *val = [arr objectAtIndex: 1]; if ([val containsString: @"%"] == NO) { if ([val containsString: @"\""] ) // val is already quoted { result = [result stringByAppendingString: [NSString stringWithFormat: @"export %@=%@\n", var, val]]; } else { result = [result stringByAppendingString: [NSString stringWithFormat: @"export %@=\"%@\"\n", var, val]]; } } } } result = [result stringByAppendingString: @"# Done with environment setup...\n\n"]; return result; } - (NSString *) contextString { NSString *result = [NSString stringWithFormat: @"#!%@\n# Context variables\n\n", _shellPath];; GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; NSDictionary *dict = [ctx currentContext]; NSArray *keys = [dict allKeys]; NSEnumerator *en = [keys objectEnumerator]; NSString *k = nil; result = [result stringByAppendingString: @"set -eo pipefail\n" @"shopt -s inherit_errexit\n\n"]; while ((k = [en nextObject]) != nil) { id v = [dict objectForKey: k]; if ([v isKindOfClass: [NSString class]]) { if ([v containsString: @"%"] == NO) { if ([v containsString: @"\""] ) // val is already quoted { result = [result stringByAppendingString: [NSString stringWithFormat: @"export %@=%@\n", k, v]]; } else { result = [result stringByAppendingString: [NSString stringWithFormat: @"export %@=\"%@\"\n", k, v]]; } } } } result = [result stringByAppendingString: @"# Done with context setup...\n\n"]; return result; } - (NSString *) preprocessScript { NSDictionary *plistFile = [NSDictionary dictionaryWithContentsOfFile: @"buildtool.plist"]; NSDictionary *searchReplace = [plistFile objectForKey: @"searchReplace"]; NSString *script = nil; NSString *result = nil; ASSIGNCOPY(script, _shellScript); // Search & replace as defined in the plist file.. if (searchReplace != nil) { #if GS_USE_ICU NSEnumerator *en = [searchReplace keyEnumerator]; NSString *key = nil; while ((key = [en nextObject]) != nil) { NSString *v = [searchReplace objectForKey: key]; NSError *error = NULL; BOOL done = NO; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern: key options: 0 error: &error]; // Iterate through all of the matches, but after each change start over because the ranges // will shift as a result of the substitution. When there are no matches left, exit. while (done == NO) { NSTextCheckingResult *match = [regex firstMatchInString: script options: 0 range: NSMakeRange(0, [key length])]; if (match != nil) { NSRange matchRange = [match range]; script = [script stringByReplacingCharactersInRange: matchRange withString: v]; } else { done = YES; } } } #else NSLog(@"WARNING: searchAndReplace is not available since GS was compiled without ICU support. ICU is needed for regular expressions."); #endif } // Replace any variables defined in the context result = [self contextString]; // result = [result stringByAppendingString: [self environmentVariableString]]; result = [result stringByAppendingString: @"\n# Script from project file...\n"]; result = [result stringByAppendingString: script]; result = [result stringByAppendingString: @"\n# Done with Xcode script\nexit $?\n"]; return result; } - (BOOL) build { NSError *error = nil; NSString *fileName = [NSString stringWithFormat: @"script_%@_%lu", [[self name] stringByEliminatingSpecialCharacters], [_shellScript hash]]; NSString *tmpFilename = [NSString stringWithFormat: @"build/%@", fileName]; NSString *command = [NSString stringWithFormat: @"%@ %@",_shellPath,tmpFilename]; BOOL result = NO; NSString *processedScript = [self preprocessScript]; // processedScript = [processedScript stringByReplacingEnvironmentVariablesWithValues]; xcprintf("=== Executing Script Build Phase... %s%s%s\n", GREEN, [_name cString], RESET); xcputs([[NSString stringWithFormat: @"=== Command: %s%@%s using shell %@", YELLOW, command, RESET, _shellPath] cString]); xcputs("*** script output"); [processedScript writeToFile: tmpFilename atomically: YES encoding: NSASCIIStringEncoding error: &error]; result = xcsystem(command); xcputs("*** script completed"); xcputs("=== Done Executing Script Build Phase..."); return (result == 0); } @end libs-xcode-XCode-0_5_0/XCode/PBXSourcesBuildPhase.h000066400000000000000000000022361475431643200220340ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXBuildPhase.h" @class NSOperationQueue; @interface PBXSourcesBuildPhase : PBXBuildPhase { NSOperationQueue *_queue; NSUInteger _cpus; } @end libs-xcode-XCode-0_5_0/XCode/PBXSourcesBuildPhase.m000066400000000000000000000136231475431643200220430ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXSourcesBuildPhase.h" #import "PBXFileReference.h" #import "PBXBuildFile.h" #import "GSXCBuildOperation.h" #import "GSXCBuildDatabase.h" @implementation PBXSourcesBuildPhase - (instancetype) init { if ((self = [super init]) != nil) { _cpus = [[NSProcessInfo processInfo] processorCount]; _queue = [[NSOperationQueue alloc] init]; [_queue setMaxConcurrentOperationCount: _cpus]; } return self; } - (void) dealloc { RELEASE(_queue); [super dealloc]; } - (BOOL) build { GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; NSDictionary *config = [ctx config]; GSXCBuildDatabase *db = [_target database]; NSArray *files = _files; id file = nil; BOOL result = YES; NSUInteger i = 1; NSMutableArray *ops = [NSMutableArray array]; NSEnumerator *en = nil; NSString *buildType = [config objectForKey: @"buildType"]; NSDebugLog(@"config = %@", config); if ([buildType isEqualToString: @"linear"] == YES || buildType == nil) // linear is the default { [_queue setMaxConcurrentOperationCount: 1]; } else if ([buildType isEqualToString: @"parallel"] == YES) { NSString *mct = [config objectForKey: @"maxConcurrentOperationCount"]; if (mct != nil) { NSUInteger t = [mct intValue]; if (t > 0) { _cpus = t; [_queue setMaxConcurrentOperationCount: _cpus]; } } xcprintf("\t* Parallel build using %ld CPUs...\n", _cpus); } NSArray *synchronizedFiles = [_target synchronizedSources]; files = [files arrayByAddingObjectsFromArray: synchronizedFiles]; // NSLog(@"files = %@", files); // if the database is present use it's list of files... if (db != nil && [synchronizedFiles count] == 0) { if ([db isEmpty]) { xcputs("\t++++ No files modified, nothing to build. ++++\n"); return YES; } files = [db files]; } else { xcputs([[NSString stringWithFormat: @"%s+++ Using synchronized group...%s", YELLOW, RESET] cString]); } en = [files objectEnumerator]; xcputs("=== Executing Sources Build Phase"); while((file = [en nextObject]) != nil && result) { NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init]; GSXCBuildOperation *op = [GSXCBuildOperation operationWithFile: file]; [file setTarget: _target]; [file setTotalFiles: [files count]]; [file setCurrentFile: i]; [ops addObject: op]; i++; RELEASE(p); } // Handle the error... NS_DURING { [_queue addOperations: ops waitUntilFinished: YES]; } NS_HANDLER { [_queue cancelAllOperations]; NSLog(@"Compilation halted."); } NS_ENDHANDLER; xcputs("=== Sources Build Phase Completed"); // if (db != nil) { [self link]; // generate the rest of the output file entries } return result; } - (BOOL) generate { xcputs("=== Generating using Sources Build Phase"); NSEnumerator *en = [_files objectEnumerator]; id file = nil; BOOL result = YES; while((file = [en nextObject]) != nil && result) { [file setTarget: _target]; result = [file generate]; } xcputs("=== Sources Build Phase generation completed"); return result; } - (BOOL) link { GSXCBuildDatabase *db = [_target database]; GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSString *of = (db != nil) ? nil : [context objectForKey: @"OUTPUT_FILES"]; NSString *outputFiles = (of == nil) ? @"" : of; PBXBuildFile *file = nil; BOOL result = YES; NSString *buildDir = @"./build"; NSEnumerator *en = nil; // [_files objectEnumerator]; NSFileManager *mgr = [NSFileManager defaultManager]; buildDir = [buildDir stringByAppendingPathComponent: [_target name]]; NSArray *synchronizedFiles = [_target synchronizedSources]; NSArray *files = [_files arrayByAddingObjectsFromArray: synchronizedFiles]; en = [files objectEnumerator]; xcputs("=== Executing Sources Build Phase (LINK)"); while((file = [en nextObject]) != nil && result) { PBXFileReference *fr = [file fileRef]; NSString *fileName = [[fr path] lastPathComponent]; NSString *outputPath = [buildDir stringByAppendingPathComponent: [fileName stringByAppendingString: @".o"]]; outputFiles = [[outputFiles stringByAppendingString: [NSString stringWithFormat: @"'%@'",outputPath]] stringByAppendingString: @" "]; // NSLog(@"name = %@", [fr path]); xcprintf("\t+ Collecting %s%s%s%s ... ", BOLD, MAGENTA, [outputPath cString], RESET); if ([mgr fileExistsAtPath: outputPath] == YES) { xcprintf("%s%sfound%s\n", BOLD, GREEN, RESET); } else { xcprintf("%s%smissing%s\n", BOLD, RED, RESET); result = NO; break; } } [context setObject: outputFiles forKey: @"OUTPUT_FILES"]; // NSLog(@"Output files %@", outputFiles); xcputs("=== Sources Build Phase Completed (LINK)"); return result; } @end libs-xcode-XCode-0_5_0/XCode/PBXTarget.h000066400000000000000000000054471475431643200177050ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "XCConfigurationList.h" #import "PBXFileReference.h" #import "GSXCBuildContext.h" #import "PBXBuildFile.h" #import "PBXFileSystemSynchronizedRootGroup.h" @class PBXProject, GSXCBuildDatabase; @interface PBXTarget : NSObject { NSMutableArray *_dependencies; XCConfigurationList *_buildConfigurationList; NSString *_productName; NSMutableArray *_buildPhases; NSString *_name; NSString *_productType; NSMutableArray *_fileSystemSynchronizedGroups; NSMutableArray *_packageProductDepedencies; PBXProject *_project; GSXCBuildDatabase *_database; } // Methods.... - (NSMutableArray *) fileSystemSynchronizedGroups; - (void) setFileSystemSynchronizedGroups: (NSMutableArray *)object; - (NSMutableArray *) packageProductDependencies; - (void) setPackageProductDependencies: (NSMutableArray *)object; - (NSMutableArray *) dependencies; // getter - (void) setDependencies: (NSMutableArray *)object; // setter - (XCConfigurationList *) buildConfigurationList; // getter - (void) setBuildConfigurationList: (XCConfigurationList *)object; // setter - (NSString *) productName; // getter - (void) setProductName: (NSString *)object; // setter - (NSMutableArray *) buildPhases; // getter - (void) setBuildPhases: (NSMutableArray *)object; // setter - (NSString *) name; // getter - (void) setName: (NSString *)object; // setter - (PBXProject *) project; - (void) setProject: (PBXProject *)project; - (GSXCBuildDatabase *) database; - (void) setDatabase: (GSXCBuildDatabase *)db; - (NSString *) productType; // getter - (void) setProductType: (NSString *)object; // setter // Utility methods... - (NSArray *) synchronizedSources; - (NSArray *) synchronizedHeaders; - (NSArray *) synchronizedResources; // build - (BOOL) build; - (BOOL) clean; - (BOOL) install; - (BOOL) generate; - (BOOL) link; @end libs-xcode-XCode-0_5_0/XCode/PBXTarget.m000066400000000000000000000140011475431643200176740ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "PBXCommon.h" #import "PBXTarget.h" #import "NSString+PBXAdditions.h" #import "PBXProject.h" #import "GSXCBuildDatabase.h" @implementation PBXTarget - (void) dealloc { RELEASE(_dependencies); RELEASE(_buildConfigurationList); RELEASE(_productName); RELEASE(_buildPhases); RELEASE(_name); RELEASE(_project); RELEASE(_productType); RELEASE(_fileSystemSynchronizedGroups); RELEASE(_packageProductDepedencies); [super dealloc]; } // Methods.... - (NSMutableArray *) fileSystemSynchronizedGroups { return _fileSystemSynchronizedGroups; } - (void) setFileSystemSynchronizedGroups: (NSMutableArray *)object { ASSIGN(_fileSystemSynchronizedGroups, object); } - (NSMutableArray *) packageProductDependencies { return _packageProductDepedencies; } - (void) setPackageProductDependencies: (NSMutableArray *)object { ASSIGN(_packageProductDepedencies, object); } - (PBXProject *) project { return _project; } - (void) setProject: (PBXProject *)project { ASSIGN(_project, project); } - (NSMutableArray *) dependencies // getter { return _dependencies; } - (void) setDependencies: (NSMutableArray *)object; // setter { ASSIGN(_dependencies,object); } - (XCConfigurationList *) buildConfigurationList // getter { return _buildConfigurationList; } - (void) setBuildConfigurationList: (XCConfigurationList *)object; // setter { ASSIGN(_buildConfigurationList,object); } - (NSString *) productName // getter { return _productName; } - (void) setProductName: (NSString *)object; // setter { NSString *newName = [object stringByEliminatingSpecialCharacters]; ASSIGN(_productName,newName); } - (NSString *) name // getter { return _name; } - (void) setName: (NSString *)object; // setter { NSString *newName = [object stringByEliminatingSpecialCharacters]; ASSIGN(_name, newName); } - (NSMutableArray *) buildPhases // getter { return _buildPhases; } - (void) setBuildPhases: (NSMutableArray *)object; // setter { ASSIGN(_buildPhases,object); } - (void) setDatabase: (GSXCBuildDatabase *)db { ASSIGN(_database, db); } - (GSXCBuildDatabase *) database { return _database; } - (NSString *) productType // getter { return _productType; } - (void) setProductType: (NSString *)object; // setter { ASSIGN(_productType,object); } - (NSArray *) synchronizedSources { NSMutableArray *result = [NSMutableArray array]; NSEnumerator *gen = [_fileSystemSynchronizedGroups objectEnumerator]; PBXFileSystemSynchronizedRootGroup *group = nil; while ((group = [gen nextObject]) != nil) { NSArray *children = [group children]; NSEnumerator *cen = [children objectEnumerator]; PBXBuildFile *buildFile = nil; while ((buildFile = [cen nextObject]) != nil) { PBXFileReference *fr = [buildFile fileRef]; NSString *name = [fr path]; // NSLog(@"path = %@", name); if ([[name pathExtension] isEqualToString: @"m"] || [[name pathExtension] isEqualToString: @"mm"] || [[name pathExtension] isEqualToString: @"M"] || [[name pathExtension] isEqualToString: @"c"] || [[name pathExtension] isEqualToString: @"cc"] || [[name pathExtension] isEqualToString: @"C"] || [[name pathExtension] isEqualToString: @"swift"]) { [result addObject: buildFile]; } } } return result; } - (NSArray *) synchronizedHeaders { NSMutableArray *result = [NSMutableArray array]; NSEnumerator *gen = [_fileSystemSynchronizedGroups objectEnumerator]; PBXFileSystemSynchronizedRootGroup *group = nil; while ((group = [gen nextObject]) != nil) { NSArray *children = [group children]; NSEnumerator *cen = [children objectEnumerator]; PBXBuildFile *buildFile = nil; while ((buildFile = [cen nextObject]) != nil) { PBXFileReference *fr = [buildFile fileRef]; NSString *name = [fr path]; if ([[name pathExtension] isEqualToString: @"h"]) { [result addObject: buildFile]; } } } return result; } - (NSArray *) synchronizedResources { NSMutableArray *result = [NSMutableArray array]; NSEnumerator *gen = [_fileSystemSynchronizedGroups objectEnumerator]; PBXFileSystemSynchronizedRootGroup *group = nil; while ((group = [gen nextObject]) != nil) { NSArray *children = [group children]; NSEnumerator *cen = [children objectEnumerator]; PBXBuildFile *buildFile = nil; while ((buildFile = [cen nextObject]) != nil) { PBXFileReference *fr = [buildFile fileRef]; NSString *name = [fr path]; if ([[name pathExtension] isEqualToString: @"xcassets"] || [[name pathExtension] isEqualToString: @"xib"]) { [result addObject: buildFile]; } } } return result; } - (BOOL) build { GSXCBuildDatabase *db = [GSXCBuildDatabase buildDatabaseWithTarget: self]; [self setDatabase: db]; return YES; } - (BOOL) clean { xcputs([[NSString stringWithFormat: @"Cleaning %@",self] cString]); return YES; } - (BOOL) install { xcputs([[NSString stringWithFormat: @"Installing %@",self] cString]); return YES; } - (BOOL) generate { return YES; } - (BOOL) link { return YES; } @end libs-xcode-XCode-0_5_0/XCode/PBXTargetDependency.h000066400000000000000000000030511475431643200216710ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXContainerItemProxy.h" #import "PBXNativeTarget.h" @interface PBXTargetDependency : NSObject { PBXContainerItemProxy *_targetProxy; NSString *_name; PBXNativeTarget *_target; } // Methods.... - (PBXContainerItemProxy *) targetProxy; // getter - (void) setTargetProxy: (PBXContainerItemProxy *)object; // setter - (NSString *) name; // getter - (void) setName: (NSString *)object; // setter - (PBXNativeTarget *) target; - (void) setTarget: (PBXNativeTarget *)object; // build - (BOOL) build; - (BOOL) generate; - (BOOL) clean; @end libs-xcode-XCode-0_5_0/XCode/PBXTargetDependency.m000066400000000000000000000034751475431643200217100ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXTargetDependency.h" @implementation PBXTargetDependency - (void) dealloc { RELEASE(_targetProxy); RELEASE(_name); RELEASE(_target); [super dealloc]; } // Methods.... - (PBXContainerItemProxy *) targetProxy // getter { return _targetProxy; } - (void) setTargetProxy: (PBXContainerItemProxy *)object; // setter { ASSIGN(_targetProxy,object); } - (NSString *) name // getter { return _name; } - (void) setName: (NSString *)object; // setter { ASSIGN(_name,object); } - (PBXNativeTarget *)target { return _target; } - (void) setTarget: (PBXNativeTarget *)object { _target = object; } - (BOOL) build { return [_targetProxy build]; } - (BOOL) generate { return [_targetProxy generate]; } - (BOOL) clean { return YES; } - (NSString *) description { return [NSString stringWithFormat: @"<%@> - %@", [super description], _name]; } @end libs-xcode-XCode-0_5_0/XCode/PBXVariantGroup.h000066400000000000000000000030351475431643200210670ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" @interface PBXVariantGroup : NSObject { NSString *sourceTree; NSString *path; NSMutableArray *children; NSString *name; } // Methods.... - (NSString *) sourceTree; // getter - (void) setSourceTree: (NSString *)object; // setter - (NSString *) path; // getter - (void) setPath: (NSString *)object; // setter - (NSMutableArray *) children; // getter - (void) setChildren: (NSMutableArray *)object; // setter - (NSString *) name; // getter - (void) setName: (NSString *)object; // setter // build... - (NSString *) buildPath; @end libs-xcode-XCode-0_5_0/XCode/PBXVariantGroup.m000066400000000000000000000060111475431643200210710ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "PBXVariantGroup.h" #import "PBXGroup.h" #import "PBXFileReference.h" #import "GSXCBuildContext.h" @implementation PBXVariantGroup // Methods.... - (NSString *) sourceTree // getter { return sourceTree; } - (void) setSourceTree: (NSString *)object; // setter { ASSIGN(sourceTree,object); } - (NSString *) path // getter { return path; } - (void) setPath: (NSString *)object; // setter { ASSIGN(path,object); } - (NSMutableArray *) children // getter { return children; } - (void) setChildren: (NSMutableArray *)object; // setter { ASSIGN(children,object); } - (NSString *) name // getter { return name; } - (void) setName: (NSString *)object; // setter { ASSIGN(name,object); } - (NSString *) resolvePathFor: (id)object withGroup: (PBXGroup *)group found: (BOOL *)found { NSString *result = @""; NSArray *chldren = [group children]; NSEnumerator *en = [chldren objectEnumerator]; id file = nil; while((file = [en nextObject]) != nil && *found == NO) { if(file == self) // have we found ourselves?? { PBXFileReference *fileRef = [[file children] objectAtIndex: 0]; // FIXME: Assume english for now... NSString *filePath = ([fileRef path] == nil)?@"":[[fileRef path] lastPathComponent]; result = filePath; *found = YES; break; } else if([file isKindOfClass: [PBXGroup class]]) { NSString *filePath = ([file path] == nil)?@"":[file path]; // lastPathComponent]; result = [filePath stringByAppendingPathComponent: [self resolvePathFor: object withGroup: file found: found]]; } } return result; } - (NSString *) buildPath { PBXGroup *mainGroup = [[GSXCBuildContext sharedBuildContext] objectForKey: @"MAIN_GROUP"]; BOOL found = NO; NSString *result = nil; // Resolve path for the current file reference... result = [self resolvePathFor: self withGroup: mainGroup found: &found]; return result; } - (NSString *) description { return [NSString stringWithFormat: @"%@ - %@, %@, %@, %@", [super description], name, path, sourceTree, children]; } @end libs-xcode-XCode-0_5_0/XCode/Resources/000077500000000000000000000000001475431643200176745ustar00rootroot00000000000000libs-xcode-XCode-0_5_0/XCode/Resources/Framework-mapping.plist000066400000000000000000000014321475431643200243370ustar00rootroot00000000000000{ "## Comment" = "This file defines frameworks which are mapped or ignored"; Mapped = { Cocoa = "`gnustep-config --gui-libs`"; Foundation = "`gnustep-config --base-libs`"; AppKit = "`gnustep-config --gui-libs`"; CoreFoundation = "-lgnustep-corebase"; CoreGraphics = "-lopal"; Carbon = "-lgnustep-boron -lgnustep-corebase -lopal -licui18n"; OpenGL = "-lGL -lGLU"; libobjc.A = "-lobjc"; libiconv.2 = ""; }; Ignored = ("IOKit", "Quartz", "QuartzCore", "QuickTime", "ApplicationServices", "SystemConfiguration", "Security", "libiconv.2","liby"); }libs-xcode-XCode-0_5_0/XCode/Resources/create-dummy-class.sh000066400000000000000000000036741475431643200237410ustar00rootroot00000000000000#!/bin/bash # # This script is meant to build the dummy framework class needed to get the class list from the framework bundle. # FILES=$1 NAME=$2 classes=""; for object_file in ${FILES} __dummy__; do if [ "$object_file" != "__dummy__" ]; then sym=`nm -Pg $object_file | sed -n -e '/^._OBJC_CLASS_[A-Za-z0-9_.]* [^U]/ {s/^._OBJC_CLASS_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}' -e '/^__objc_class_name_[A-Za-z0-9_.]* [^U]/ {s/^__objc_class_name_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}'`; classes="$classes $sym"; fi; done; classlist=""; classarray=""; for f in $classes __dummy__ ; do if [ "$f" != "__dummy__" ]; then if [ "$classlist" = "" ]; then classlist="@\"$f\""; classarray="(\"$f\""; else classlist="$classlist, @\"$f\""; classarray="$classarray, \"$f\""; fi; fi; done; if [ "$classlist" = "" ]; then classlist="NULL"; classarray="()"; else classlist="$classlist, NULL"; classarray="$classarray)"; fi; rm -rf ./derived_src mkdir ./derived_src echo "$classarray" > ./derived_src/${NAME}-class-list; echo "#include " > derived_src/NSFramework_${NAME}.m; echo "#include " >> derived_src/NSFramework_${NAME}.m; echo "@interface NSFramework_${NAME} : NSObject" >> derived_src/NSFramework_${NAME}.m; echo "+ (NSString *)frameworkVersion;" >> derived_src/NSFramework_${NAME}.m; echo "+ (NSString *const*)frameworkClasses;" >> derived_src/NSFramework_${NAME}.m; echo "@end" >> derived_src/NSFramework_${NAME}.m; echo "@implementation NSFramework_${NAME}" >> derived_src/NSFramework_${NAME}.m; echo "+ (NSString *)frameworkVersion { return @\"0\"; }" >> derived_src/NSFramework_${NAME}.m; echo "static NSString *allClasses[] = {$classlist};" >> derived_src/NSFramework_${NAME}.m; echo "+ (NSString *const*)frameworkClasses { return allClasses; }" >> derived_src/NSFramework_${NAME}.m; echo "@end" >> derived_src/NSFramework_${NAME}.m libs-xcode-XCode-0_5_0/XCode/Resources/language-codes.plist000066400000000000000000000053541475431643200236360ustar00rootroot00000000000000{ alpha2 = English; aa = Afar; ab = Abkhazian; ae = Avestan; af = Afrikaans; ak = Akan; am = Amharic; an = Aragonese; ar = Arabic; as = Assamese; av = Avaric; ay = Aymara; az = Azerbaijani; ba = Bashkir; be = Belarusian; bg = Bulgarian; bh = Bihari; bi = Bislama; bm = Bambara; bn = Bengali; bo = Tibetan; br = Breton; bs = Bosnian; ca = Catalan; ce = Chechen; ch = Chamorro; co = Corsican; cr = Cree; cs = Czech; cu = ChurchSlavic; cv = Chuvash; cy = Welsh; da = Danish; de = German; dv = Divehi; dz = Dzongkha; ee = Ewe; el = Greek; en = English; eo = Esperanto; es = Spanish; et = Estonian; eu = Basque; fa = Persian; ff = Fulah; fi = Finnish; fj = Fijian; fo = Faroese; fr = French; fy = WesternFrisian; ga = Irish; gd = Gaelic; gl = Galician; gn = Guarani; gu = Gujarati; gv = Manx; ha = Hausa; he = Hebrew; hi = Hindi; ho = HiriMotu; hr = Croatian; ht = Haitian; hu = Hungarian; hy = Armenian; hz = Herero; ia = Interlingua; id = Indonesian; ie = Interlingue; ig = Igbo; ii = Nuosu; ik = Inupiaq; io = Ido; is = Icelandic; it = Italian; iu = Inuktitut; ja = Japanese; jv = Javanese; ka = Georgian; kg = Kongo; ki = Kikuyu; kj = Kuanyama; kk = Kazakh; kl = Kalaallisut; km = CentralKhmer; kn = Kannada; ko = Korean; kr = Kanuri; ks = Kashmiri; ku = Kurdish; kv = Komi; kw = Cornish; ky = Kirghiz; la = Latin; lb = Luxembourgish; lg = Ganda; li = Limburgan; ln = Lingala; lo = Lao; lt = Lithuanian; lu = "Luba-Katanga"; lv = Latvian; mg = Malagasy; mh = Marshallese; mi = Maori; mk = Macedonian; ml = Malayalam; mn = Mongolian; mr = Marathi; ms = Malay; mt = Maltese; my = Burmese; na = Nauru; nb = Bokmal; nd = NdebeleNorth; ne = Nepali; ng = Ndonga; nl = Dutch; nn = Norsk; no = Norwegian; nr = Ndebele; nv = Navajo; ny = Chichewa; oc = Occitan; oj = Ojibwa; om = Oromo; or = Oriya; os = Ossetian; pa = Panjabi; Punjabi = Punjabi; pi = Pali; pl = Polish; ps = Pushto; pt = Portuguese; qu = Quechua; rm = Romansh; rn = Rundi; ro = Romanian; ru = Russian; rw = Kinyarwanda; sa = Sanskrit; sc = Sardinian; sd = Sindhi; se = NorthernSami; sg = Sango; si = Sinhala; sk = Slovak; sl = Slovenian; sm = Samoan; sn = Shona; so = Somali; sq = Albanian; sr = Serbian; ss = Swati; st = Sotho; su = Sundanese; sv = Swedish; sw = Swahili; ta = Tamil; te = Telugu; tg = Tajik; th = Thai; ti = Tigrinya; tk = Turkmen; tl = Tagalog; tn = Tswana; to = Tonga; tr = Turkish; ts = Tsonga; tt = Tatar; tw = Twi; ty = Tahitian; ug = Uighur; uk = Ukrainian; ur = Urdu; uz = Uzbek; ve = Venda; vi = Vietnamese; vo = Volapuk; wa = Walloon; wo = Wolof; xh = Xhosa; yi = Yiddish; yo = Yoruba; za = Zhuang; zh = Chinese; zu = Zulu; }libs-xcode-XCode-0_5_0/XCode/Version000066400000000000000000000005651475431643200173000ustar00rootroot00000000000000# This file is included in various Makefile's to get version information. # Compatible with Bourne shell syntax, so it can included there too. # The minimum gcc version required to compile the library. GNUSTEP_GCC=4.3.0 # The version number of this release. MAJOR_VERSION=0 MINOR_VERSION=5 SUBMINOR_VERSION=0 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} libs-xcode-XCode-0_5_0/XCode/XCAbstractDelegate.h000066400000000000000000000020261475431643200215240ustar00rootroot00000000000000/* XCAbstractDelegate.h * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import @interface XCAbstractDelegate : NSObject - (void) postMessage: (NSString *)format, ...; @end libs-xcode-XCode-0_5_0/XCode/XCAbstractDelegate.m000066400000000000000000000024401475431643200215310ustar00rootroot00000000000000/* XCAbstractDelegate.h * * Copyright (C) 2023 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2023 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import #import "XCAbstractDelegate.h" #import "xcsystem.h" @implementation XCAbstractDelegate - (void) postMessage: (NSString *)format, ... { va_list args; va_start(args, format); NSString *formattedString = [[NSString alloc] initWithFormat: format arguments: args]; AUTORELEASE(formattedString); va_end(args); xcput_string(formattedString); } @end libs-xcode-XCode-0_5_0/XCode/XCBuildConfiguration.h000066400000000000000000000033121475431643200221140ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __XCBuildConfiguration_h_GNUSTEP_INCLUDE #define __XCBuildConfiguration_h_GNUSTEP_INCLUDE #import // Local includes #import "PBXCoder.h" #import "PBXFileReference.h" @interface XCBuildConfiguration : NSObject { NSMutableDictionary *buildSettings; NSString *name; PBXFileReference *baseConfigurationReference; } // Initialization... - (instancetype) initWithName: (NSString *)theName buildSettings: (NSMutableDictionary *)settings; - (instancetype) initWithName: (NSString *)theName; // Methods.... - (NSMutableDictionary *) buildSettings; // getter - (void) setBuildSettings: (NSMutableDictionary *)object; // setter - (NSString *) name; // getter - (void) setName: (NSString *)object; // setter - (void) apply; @end #endif libs-xcode-XCode-0_5_0/XCode/XCBuildConfiguration.m000066400000000000000000000070251475431643200221260ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "XCBuildConfiguration.h" #import "GSXCBuildContext.h" #import #ifdef _WIN32 #import "setenv.h" #endif @implementation XCBuildConfiguration - (instancetype) initWithName: (NSString *)theName buildSettings: (NSMutableDictionary *)settings { self = [super init]; if (self != nil) { [self setBuildSettings: settings]; [self setName: theName]; } return self; } - (instancetype) initWithName: (NSString *)theName { NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithObject: @"macosx" forKey: @"SDKROOT"]; return [self initWithName: theName buildSettings: settings]; } - (instancetype) init { self = [super init]; if (self != nil) { // nothing now... } return self; } - (NSString *) description { return [NSString stringWithFormat: @"%@ -- buildSettings = %@, name = %@", [super description], buildSettings, name]; } // Methods.... - (NSMutableDictionary *) buildSettings // getter { return buildSettings; } - (void) setBuildSettings: (NSMutableDictionary *)object; // setter { ASSIGN(buildSettings,object); } - (NSString *) name // getter { return name; } - (void) setName: (NSString *)object; // setter { ASSIGN(name,object); } - (void) apply { xcputs([[NSString stringWithFormat: @"=== Applying Build Configuration %s%@%s",GREEN, name, RESET] cString]); GSXCBuildContext *context = [GSXCBuildContext sharedBuildContext]; NSEnumerator *en = [buildSettings keyEnumerator]; NSString *key = nil; while ((key = [en nextObject]) != nil) { id value = [buildSettings objectForKey: key]; if ([value isKindOfClass: [NSString class]]) { setenv([key cString],[value cString],1); } else if([value isKindOfClass: [NSArray class]]) { [context setObject: value forKey: key]; NSDebugLog(@"\tContext: %@ = %@",key,value); } else { NSDebugLog(@"\tWARNING: Can't interpret value %@, for environment variable %@", value, key); } } if ([buildSettings objectForKey: @"TARGET_BUILD_DIR"] == nil) { NSDebugLog(@"\tEnvironment: TARGET_BUILD_DIR = build (built-in)"); setenv("TARGET_BUILD_DIR","build",1); [context setObject: @"build" forKey: @"TARGET_BUILD_DIR"]; } if ([buildSettings objectForKey: @"BUILT_PRODUCTS_DIR"] == nil) { NSDebugLog(@"\tEnvironment: BUILT_PRODUCTS_DIR = build (built-in)"); setenv("BUILT_PRODUCTS_DIR","build",1); [context setObject: @"build" forKey: @"BUILD_PRODUCTS_DIR"]; } xcputs([[NSString stringWithFormat: @"=== Done Applying Build Configuration for %@",name] cString]); } @end libs-xcode-XCode-0_5_0/XCode/XCConfigurationList.h000066400000000000000000000034751475431643200220020ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __XCConfigurationList_h_GNUSTEP_INCLUDE #define __XCConfigurationList_h_GNUSTEP_INCLUDE #import #import "PBXCoder.h" @class XCBuildConfiguration; @interface XCConfigurationList : NSObject { NSString *defaultConfigurationIsVisible; NSMutableArray *buildConfigurations; NSString *defaultConfigurationName; } - (instancetype) initWithConfigurations: (NSMutableArray *)configs; // Methods.... - (NSString *) defaultConfigurationIsVisible; // getter - (void) setDefaultConfigurationIsVisible: (NSString *)object; // setter - (NSMutableArray *) buildConfigurations; // getter - (void) setBuildConfigurations: (NSMutableArray *)object; // setter - (NSString *) defaultConfigurationName; // getter - (void) setDefaultConfigurationName: (NSString *)object; // setter - (XCBuildConfiguration *) defaultConfiguration; - (void) applyDefaultConfiguration; @end #endif libs-xcode-XCode-0_5_0/XCode/XCConfigurationList.m000066400000000000000000000053041475431643200220000ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "XCConfigurationList.h" #import "XCBuildConfiguration.h" @implementation XCConfigurationList - (instancetype) initWithConfigurations: (NSMutableArray *)configs { self = [super init]; if (self != nil) { [self setBuildConfigurations: configs]; } return self; } /* - (instancetype) init { return [self initWithConfigurations: [NSMutableArray array]]; } */ // Methods.... - (NSString *) defaultConfigurationIsVisible // getter { return defaultConfigurationIsVisible; } - (void) setDefaultConfigurationIsVisible: (NSString *)object; // setter { ASSIGN(defaultConfigurationIsVisible,object); } - (NSMutableArray *) buildConfigurations // getter { return buildConfigurations; } - (void) setBuildConfigurations: (NSMutableArray *)object; // setter { ASSIGN(buildConfigurations,object); } - (NSString *) defaultConfigurationName // getter { return defaultConfigurationName; } - (void) setDefaultConfigurationName: (NSString *)object; // setter { ASSIGN(defaultConfigurationName,object); } - (XCBuildConfiguration *) defaultConfiguration { NSEnumerator *en = [buildConfigurations objectEnumerator]; NSString *defaultConfig = (defaultConfigurationName == nil)? @"Release":defaultConfigurationName; XCBuildConfiguration *config = nil; NSDebugLog(@"Number of build configurations = %ld\n%@", [buildConfigurations count], buildConfigurations); while((config = [en nextObject]) != nil) { if([[config name] isEqualToString: defaultConfig]) { break; } } return config; } - (void) applyDefaultConfiguration { [[self defaultConfiguration] apply]; } - (NSString *) description { return [NSString stringWithFormat: @"%@ -- %@", [super description], buildConfigurations]; } @end libs-xcode-XCode-0_5_0/XCode/XCFileRef.h000066400000000000000000000030461475431643200176450ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @class NSString; @interface XCFileRef : NSObject { NSString *_location; NSString *_workspaceLink; NSString *_workspaceIncludes; NSString *_workspaceLibs; } + (instancetype) fileRef; - (NSString *) workspaceIncludes; - (void) setWorkspaceIncludes: (NSString *)wsInc; - (NSString *) workspaceLink; - (void) setWorkspaceLink: (NSString *)wsLink; - (NSString *) workspaceLibs; - (void) setWorkspaceLibs: (NSString *)wsLibs; - (NSString *) location; - (void) setLocation: (NSString *)loc; - (NSArray *) targets; - (BOOL) build; - (BOOL) clean; - (BOOL) install; - (BOOL) link; @end libs-xcode-XCode-0_5_0/XCode/XCFileRef.m000066400000000000000000000115241475431643200176520ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "XCFileRef.h" #import "PBXCoder.h" #import "PBXContainer.h" #import "PBXProject.h" #import "NSString+PBXAdditions.h" #import "GSXCBuildContext.h" #import #import @implementation XCFileRef + (instancetype) fileRef { return AUTORELEASE([[self alloc] init]); } - (instancetype) init { self = [super init]; if (self) { [self setLocation: nil]; [self setWorkspaceLink: nil]; } return self; } - (void) dealloc { RELEASE(_location); RELEASE(_workspaceLink); [super dealloc]; } - (NSString *) location { return _location; } - (void) setLocation: (NSString *)loc { ASSIGN(_location, loc); } - (NSString *) workspaceLink { return _workspaceLink; } - (void) setWorkspaceLink: (NSString *)link { ASSIGN(_workspaceLink, link); } - (NSString *) workspaceLibs { return _workspaceLibs; } - (void) setWorkspaceLibs: (NSString *)libs { ASSIGN(_workspaceLibs, libs); } - (NSString *) workspaceIncludes { return _workspaceIncludes; } - (void) setWorkspaceIncludes: (NSString *)inc { ASSIGN(_workspaceIncludes, inc); } - (NSArray *) targets { NSString *loc = [[self location] stringByReplacingOccurrencesOfString: @"group:" withString: @""]; NSString *p = [loc stringByDeletingLastPathComponent]; NSArray *result = nil; if (p != nil) { PBXCoder *coder = nil; NSFileManager *mgr = [NSFileManager defaultManager]; NSString *cwd = [mgr currentDirectoryPath]; // If the project is in a subdir, go to the subdir... if ([[p pathExtension] isEqualToString: @"xcodeproj"] == NO) { NSString *nwd = [cwd stringByAppendingPathComponent: p]; [mgr changeCurrentDirectoryPath: nwd]; } coder = [[PBXCoder alloc] initWithProjectFile: [loc lastPathComponent]]; if (coder != nil) { PBXContainer *pc = [coder unarchive]; PBXProject *prj = [pc rootObject]; result = [[prj targets] copy]; } // Go back to the original working dir... if ([[p pathExtension] isEqualToString: @"xcodeproj"] == NO) { [mgr changeCurrentDirectoryPath: cwd]; } } return result; } - (BOOL) performLegacyOperation: (SEL)sel { NSString *loc = [[self location] stringByReplacingOccurrencesOfString: @"group:" withString: @""]; NSString *p = [loc stringByDeletingLastPathComponent]; NSString *function = NSStringFromSelector(sel); NSString *display = [function stringByCapitalizingFirstCharacter]; if (p != nil) { PBXCoder *coder = nil; NSFileManager *mgr = [NSFileManager defaultManager]; NSString *cwd = [mgr currentDirectoryPath]; // If the project is in a subdir, go to the subdir... if ([[p pathExtension] isEqualToString: @"xcodeproj"] == NO) { NSString *nwd = [cwd stringByAppendingPathComponent: p]; printf("++ %s project in dir... %s\n", [display cString], [nwd cString]); [mgr changeCurrentDirectoryPath: nwd]; } coder = [[PBXCoder alloc] initWithProjectFile: [loc lastPathComponent]]; if (coder != nil) { PBXContainer *pc = [coder unarchive]; [pc setWorkspaceLink: _workspaceLink]; [pc setWorkspaceIncludes: _workspaceIncludes]; [pc setWorkspaceLibs: _workspaceLibs]; [pc performSelector: sel]; } // If the project is in a subdir, return to the previous dir... if ([[p pathExtension] isEqualToString: @"xcodeproj"] == NO) { printf("++ %s completed\n", [display cString]); [mgr changeCurrentDirectoryPath: cwd]; } AUTORELEASE(coder); } return YES; } - (BOOL) build { return [self performLegacyOperation: _cmd]; } - (BOOL) clean { return [self performLegacyOperation: _cmd]; } - (BOOL) install { return [self performLegacyOperation: _cmd]; } - (BOOL) link { return [self performLegacyOperation: _cmd]; } @end libs-xcode-XCode-0_5_0/XCode/XCVersionGroup.h000066400000000000000000000034621475431643200207750ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import // Local includes #import "PBXCoder.h" #import "PBXFileReference.h" @interface XCVersionGroup : NSObject { NSString *sourceTree; PBXFileReference *currentVersion; NSString *versionGroupType; NSString *path; NSMutableArray *children; NSUInteger _totalFiles; } // Methods.... - (NSString *) sourceTree; // getter - (void) setSourceTree: (NSString *)object; // setter - (PBXFileReference *) currentVersion; // getter - (void) setCurrentVersion: (PBXFileReference *)object; // setter - (NSString *) versionGroupType; // getter - (void) setVersionGroupType: (NSString *)object; // setter - (NSString *) path; // getter - (void) setPath: (NSString *)object; // setter - (NSMutableArray *) children; // getter - (void) setChildren: (NSMutableArray *)object; // setter - (void) setTotalFiles: (NSUInteger)total; - (NSUInteger) totalFiles; @end libs-xcode-XCode-0_5_0/XCode/XCVersionGroup.m000066400000000000000000000044231475431643200210000ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "PBXCommon.h" #import "XCVersionGroup.h" @implementation XCVersionGroup // Methods.... - (NSString *) sourceTree // getter { return sourceTree; } - (void) setSourceTree: (NSString *)object; // setter { ASSIGN(sourceTree,object); } - (PBXFileReference *) currentVersion // getter { return currentVersion; } - (void) setCurrentVersion: (PBXFileReference *)object; // setter { ASSIGN(currentVersion,object); } - (NSString *) versionGroupType // getter { return versionGroupType; } - (void) setVersionGroupType: (NSString *)object; // setter { ASSIGN(versionGroupType,object); } - (NSString *) path // getter { return path; } - (void) setPath: (NSString *)object; // setter { ASSIGN(path,object); } - (NSString *) buildPath { return [self path]; } - (NSMutableArray *) children // getter { return children; } - (void) setChildren: (NSMutableArray *)object; // setter { ASSIGN(children,object); } - (void) setTarget: (NSString *)target { } - (void) setTotalFiles: (NSUInteger)total { _totalFiles = total; } - (NSUInteger) totalFiles { return _totalFiles; } - (BOOL) build { NSEnumerator *en = [children objectEnumerator]; id o = nil; BOOL result = YES; while((o = [en nextObject]) != nil && result) { xcputs([[NSString stringWithFormat: @"\tProcessing %@",[o path]] cString]); } return result; } @end libs-xcode-XCode-0_5_0/XCode/XCWorkspace.h000066400000000000000000000026161475431643200202710ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import @class NSString; @class NSArray; @interface XCWorkspace : NSObject { NSString *_version; NSArray *_fileRefs; NSString *_filename; } + (instancetype) workspace; - (NSString *) version; - (void) setVersion: (NSString *)v; - (NSArray *) fileRefs; - (void) setFileRefs: (NSArray *)refs; - (NSString *) filename; - (void) setFilename: (NSString *)filename; - (BOOL) build; - (BOOL) clean; - (BOOL) install; - (BOOL) link; @end libs-xcode-XCode-0_5_0/XCode/XCWorkspace.m000066400000000000000000000156041475431643200202770ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "XCWorkspace.h" #import "XCFileRef.h" #import "PBXNativeTarget.h" #import "GSXCCommon.h" #import #import #import #import #import #import @implementation XCWorkspace + (instancetype) workspace { return AUTORELEASE([[self alloc] init]); } - (instancetype) init { self = [super init]; if (self != nil) { [self setFileRefs: [NSArray array]]; [self setVersion: nil]; } return self; } - (NSString *) version { return _version; } - (void) setVersion: (NSString *)v { ASSIGN(_version, v); } - (NSArray *) fileRefs { return _fileRefs; } - (void) setFileRefs: (NSArray *)refs { ASSIGN(_fileRefs, refs); } - (NSString *) filename { return _filename; } - (void) setFilename: (NSString *)filename { ASSIGN(_filename, filename); } - (NSString *) _collectWorkspaceLinkDirs { NSString *result = @""; NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; while ((ref = [en nextObject]) != nil) { NSString *loc = [ref location]; NSString *projRoot = [loc stringByDeletingLastPathComponent]; NSString *buildDir = [projRoot stringByAppendingPathComponent: @"build"]; NSArray *targets = [ref targets]; NSEnumerator *ten = [targets objectEnumerator]; PBXNativeTarget *t = nil; while ((t = [ten nextObject]) != nil) { NSString *name = [t productName]; NSString *targetDir = [[buildDir stringByAppendingPathComponent: name] stringByReplacingOccurrencesOfString: @"group:" withString: @""]; NSString *prodDir = [targetDir stringByAppendingPathComponent: @"Products"]; result = [result stringByAppendingFormat: @" -L./%@ ", prodDir]; } } return result; } - (NSString *) _collectWorkspaceLinkLibs { NSString *result = @""; NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; while ((ref = [en nextObject]) != nil) { NSArray *targets = [ref targets]; NSEnumerator *ten = [targets objectEnumerator]; PBXNativeTarget *t = nil; while ((t = [ten nextObject]) != nil) { NSString *type = [t productType]; if ([type isEqualToString: LIBRARY_TYPE] || [type isEqualToString: DYNAMIC_LIBRARY_TYPE] || [type isEqualToString: FRAMEWORK_TYPE]) { NSString *name = [t productName]; NSString *libName = [name stringByReplacingOccurrencesOfString: @"group:" withString: @""]; result = [result stringByAppendingFormat: @" -l%@ ", libName]; } } } return result; } - (NSString *) _collectWorkspaceIncludeDirs { NSString *result = @""; NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; while ((ref = [en nextObject]) != nil) { NSString *loc = [ref location]; NSString *projRoot = [loc stringByDeletingLastPathComponent]; NSArray *targets = [ref targets]; NSEnumerator *ten = [targets objectEnumerator]; PBXNativeTarget *t = nil; while ((t = [ten nextObject]) != nil) { NSString *targetDir = [projRoot stringByReplacingOccurrencesOfString: @"group:" withString: @""]; result = [result stringByAppendingFormat: @" -I./%@ ", targetDir]; } } return result; } - (BOOL) build { NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init]; // start pool for workspace NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; NSString *display = [[self filename] stringByDeletingLastPathComponent]; NSString *workspaceLinkDirs = [self _collectWorkspaceLinkDirs]; NSString *workspaceIncDirs = [self _collectWorkspaceIncludeDirs]; NSString *workspaceLinkLibs = [self _collectWorkspaceLinkLibs]; NSDebugLog(@"\n\n\nWorkspace Include Dirs = %@\n\n\n", workspaceIncDirs); NSDebugLog(@"\n\n\nWorkspace Link Libs = %@\n\n\n", workspaceLinkLibs); printf("+++ Building projects workspace.. %s\n", [display cString]); while ((ref = [en nextObject]) != nil) { [ref setWorkspaceIncludes: workspaceIncDirs]; [ref setWorkspaceLink: workspaceLinkDirs]; [ref setWorkspaceLibs: workspaceLinkLibs]; BOOL s = [ref build]; if (s == NO) { printf("+++ Workspace build FAILED %s\n", [display cString]); return NO; } } printf("+++ Workspace build completed... %s\n", [display cString]); RELEASE(p); return YES; } - (BOOL) clean { NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; printf("+++ Cleaning projects in workspace.. %s\n", [[[self filename] stringByDeletingLastPathComponent] cString]); while ((ref = [en nextObject]) != nil) { BOOL s = [ref clean]; if (s == NO) { return NO; } } printf("+++ Workspace clean complete\n"); return YES; } - (BOOL) install { NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; printf("+++ Installing projects in workspace.. %s\n", [[[self filename] stringByDeletingLastPathComponent] cString]); while ((ref = [en nextObject]) != nil) { BOOL s = [ref install]; if (s == NO) { return NO; } } printf("+++ Workspace install complete\n"); return YES; } - (BOOL) link { NSEnumerator *en = [_fileRefs reverseObjectEnumerator]; XCFileRef *ref = nil; NSString *display = [[self filename] stringByDeletingLastPathComponent]; printf("+++ Building projects workspace.. %s\n", [display cString]); while ((ref = [en nextObject]) != nil) { NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init]; BOOL s = [ref link]; if (s == NO) { printf("+++ Workspace build FAILED %s\n", [display cString]); return NO; } RELEASE(p); } printf("+++ Workspace build completed... %s\n", [display cString]); return YES; } @end libs-xcode-XCode-0_5_0/XCode/XCWorkspaceParser.h000066400000000000000000000025461475431643200214500ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import @class NSString; @class XCWorkspace; @interface XCWorkspaceParser : NSObject { XCWorkspace *_workspace; NSString *_filename; } + (instancetype) parseWorkspaceFile: (NSString *)file; + (instancetype) parseWorkspaceDirectory: (NSString *)dir; - (instancetype) initWithContentsOfFile: (NSString *)file; - (XCWorkspace *) workspace; @end libs-xcode-XCode-0_5_0/XCode/XCWorkspaceParser.m000066400000000000000000000072001475431643200214450ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "XCWorkspaceParser.h" #import "XCWorkspace.h" #import "XCFileRef.h" #import #import #import #import #import @implementation XCWorkspaceParser - (instancetype) initWithContentsOfFile: (NSString *)file { ASSIGN(_filename, file); if ((self = [super init]) != nil) { NSData *data = [NSData dataWithContentsOfFile: file]; if (data != nil) { NSError *error = nil; NSXMLParser *parser = [[NSXMLParser alloc] initWithData: data]; [parser setDelegate: self]; [parser parse]; error = [parser parserError]; if (error != nil) { NSLog(@"Error: %@", error); return nil; } RELEASE(parser); } else { NSLog(@"Unable to read data"); } } return self; } + (instancetype) parseWorkspaceFile: (NSString *)file { return AUTORELEASE([[self alloc] initWithContentsOfFile: file]); } + (instancetype) parseWorkspaceDirectory: (NSString *)dir { NSString *datafile = [dir stringByAppendingPathComponent: @"contents.xcworkspacedata"]; return [self parseWorkspaceFile: datafile]; } - (XCWorkspace *) workspace { [_workspace setFilename: _filename]; return _workspace; } - (void) dealloc { RELEASE(_filename); RELEASE(_workspace); [super dealloc]; } /** Parser delegate **/ - (void) parserDidStartDocument: (NSXMLParser *)parser { // not needed for this type of file... } - (void) parser: (NSXMLParser *)parser didStartElement: (NSString *)elementName namespaceURI: (NSString *)namespaceURI qualifiedName: (NSString *)qName attributes: (NSDictionary *)attributeDict { if ([elementName isEqualToString: @"Workspace"]) { NSString *v = [attributeDict objectForKey: @"version"]; ASSIGN(_workspace, [XCWorkspace workspace]); [_workspace setVersion: v]; } else if ([elementName isEqualToString: @"FileRef"]) { XCFileRef *fr = [XCFileRef fileRef]; NSString *l = [attributeDict objectForKey: @"location"]; NSArray *a = [_workspace fileRefs]; [fr setLocation: l]; a = [a arrayByAddingObject: fr]; [_workspace setFileRefs: a]; } } -(void) parser: (NSXMLParser *)parser foundCharacters: (NSString *)string { // not needed for this type of file... } - (void) parser: (NSXMLParser *)parser didEndElement: (NSString *)elementName namespaceURI: (NSString *)namespaceURI qualifiedName: (NSString *)qName { } - (void) parserDidEndDocument: (NSXMLParser *)parser { // not needed for this type of file... } @end libs-xcode-XCode-0_5_0/XCode/XCode.h000066400000000000000000000051511475431643200170770ustar00rootroot00000000000000/* Global include file for the GNUstep XCode Library. Copyright (C) 2024 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: Sep 2024 This file is part of the GNUstep XCode Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef __XCode_h_GNUSTEP_INCLUDE #define __XCode_h_GNUSTEP_INCLUDE #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #endif // __XCode_h_GNUSTEP_INCLUDE libs-xcode-XCode-0_5_0/XCode/setenv.h000066400000000000000000000022041475431643200173750ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #include #ifndef _MSC_VER #include #endif #include int setenv(const char *key, const char *value, int overwrite); // char *getenv(const char *key); libs-xcode-XCode-0_5_0/XCode/setenv.m000066400000000000000000000035171475431643200174120ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import "setenv.h" #import "GSXCBuildContext.h" int setenv(const char *key, const char *value, int overwrite) { GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; int result = 255; // failure... char *current = getenv(key); if(overwrite && current) { int key_len = strlen(key); int val_len = strlen(value); int len = key_len + 1 + val_len + 1; // key + "=" + value + '\0' char *buffer = malloc(len); memset(buffer, 0, len); sprintf(buffer,"%s=%s",key,value); result = putenv(buffer); [ctx setObject: [NSString stringWithCString: value] forKey: [NSString stringWithCString: key]]; free(buffer); } return result; } /* char *getenv(const char *key) { GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; char *result = [[ctx objectForKey: [NSString stringWithCString: key]] cString]; return result; } */ libs-xcode-XCode-0_5_0/XCode/xcsystem.h000066400000000000000000000024741475431643200177610ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #ifndef _XCSystem_h_INCLUDE #define _XCSystem_h_INCLUDE #import #if defined(__cplusplus) extern "C" { #endif NSInteger xcsystem(NSString *cmd); void xcputs(const char *str); void xcput_string(NSString *str); int xcprintf(const char *format, ...); #if defined(__cplusplus) } #endif #endif /* _XCSystem_h_INCLUDE */ libs-xcode-XCode-0_5_0/XCode/xcsystem.m000066400000000000000000000103701475431643200177600ustar00rootroot00000000000000/* Copyright (C) 2018, 2019, 2020, 2021 Free Software Foundation, Inc. Written by: Gregory John Casamento Date: 2022 This file is part of the GNUstep XCode Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 USA. */ #import #import "GSXCBuildContext.h" #import "NSString+PBXAdditions.h" #import "xcsystem.h" #import #ifndef _MSC_VER #import #endif NSString *contextString() { NSString *result = @"\n# Context variables\n\n"; GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; NSDictionary *dict = [ctx currentContext]; NSArray *keys = [dict allKeys]; NSEnumerator *en = [keys objectEnumerator]; NSString *k = nil; while ((k = [en nextObject]) != nil) { if (![k isEqualToString: @"OUTPUT_FILES"]) // exclude some vars { id v = [dict objectForKey: k]; if ([v isKindOfClass: [NSString class]]) { if ([v containsString: @"%"] == NO) { if ([v containsString: @"\""] ) // val is already quoted { result = [result stringByAppendingString: [NSString stringWithFormat: @"export %@=%@\n", k, v]]; } else { result = [result stringByAppendingString: [NSString stringWithFormat: @"export %@=\"%@\"\n", k, v]]; } } } } } result = [result stringByAppendingString: @"# Done with context setup...\n\n"]; return result; } NSInteger xcsystem(NSString *cmd) { GSXCBuildContext *ctx = [GSXCBuildContext sharedBuildContext]; NSDictionary *dict = [ctx config]; NSString *setupScript = [dict objectForKey: @"setupScript"]; NSInteger r = 0; if(setupScript == nil) { #ifdef _WIN32 NSString *win_cmd = [cmd execPathForString]; NSDebugLog(@"win_cmd = %@", win_cmd); r = system([win_cmd cString]); #else r = system([cmd cString]); #endif } else { NSString *scriptFormat = @"#!/bin/bash\n" @"set -eo pipefail\n" @"shopt -s inherit_errexit\n\n" @"%@\n\n" @"exit $?\n"; NSString *body = @""; NSString *script = nil; NSString *c = [cmd stringByReplacingOccurrencesOfString: @"$(SRCROOT)" withString: @"."]; NSUUID *uuid = [NSUUID UUID]; body = [body stringByAppendingString: [NSString stringWithFormat: @". %@ > /dev/null\n", setupScript]]; body = [body stringByAppendingString: contextString()]; body = [body stringByAppendingString: [NSString stringWithFormat: @"%@\n", c]]; script = [NSString stringWithFormat: scriptFormat, body]; NSString *filename = [NSString stringWithFormat: @"bt_%@.sh", [uuid UUIDString]]; // [script hash]]; NSString *scriptCmd = [NSString stringWithFormat: @"./build/%@", filename]; BOOL f = [script writeToFile: scriptCmd atomically: YES encoding: NSUTF8StringEncoding error: NULL]; if (f) { #ifdef _WIN32 NSString *win_cmd = [scriptCmd execPathForString]; NSDebugLog(@"win_cmd = %@", win_cmd); r = system([win_cmd cString]); #else r = system([scriptCmd cString]); #endif } else { NSLog(@"Failed to write out temporary script %@", scriptCmd); } } return r; } void xcputs(const char *str) { puts(str); fflush(stdout); } void xcput_string(NSString *str) { xcputs([str cString]); } int xcprintf(const char *format, ...) { int result; va_list args; va_start(args, format); result = vprintf(format, args); va_end(args); fflush(stdout); return result; }