├── .gitignore ├── Makefile ├── README.md ├── main.xcodeproj └── project.pbxproj └── main ├── Images.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Info.plist ├── assets └── test.jpg └── main /.gitignore: -------------------------------------------------------------------------------- 1 | build/* -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | CGO_ENABLED=1 GOARCH=arm go build -o arm golang.org/x/mobile/example/basic 3 | CGO_ENABLED=1 GOARCH=arm64 go build -o arm64 golang.org/x/mobile/example/basic 4 | lipo -create arm arm64 -o main/main && rm arm arm64 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # go-xcode 2 | 3 | This project requires Go 1.5 darwin/arm and darwin/arm64 cross compilers. 4 | 5 | ``` 6 | make && xcodebuild 7 | ``` 8 | -------------------------------------------------------------------------------- /main.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 254BB84F1B1FD08900C56DE9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 254BB84E1B1FD08900C56DE9 /* Images.xcassets */; }; 11 | 254BB8681B1FD16500C56DE9 /* main in Resources */ = {isa = PBXBuildFile; fileRef = 254BB8671B1FD16500C56DE9 /* main */; }; 12 | 25FB30331B30FDEE0005924C /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 25FB30321B30FDEE0005924C /* assets */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | 254BB83E1B1FD08900C56DE9 /* main.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = main.app; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | 254BB8421B1FD08900C56DE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | 254BB84E1B1FD08900C56DE9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 19 | 254BB8671B1FD16500C56DE9 /* main */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = main; sourceTree = ""; }; 20 | 25FB30321B30FDEE0005924C /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = main/assets; sourceTree = ""; }; 21 | /* End PBXFileReference section */ 22 | 23 | /* Begin PBXGroup section */ 24 | 254BB8351B1FD08900C56DE9 = { 25 | isa = PBXGroup; 26 | children = ( 27 | 25FB30321B30FDEE0005924C /* assets */, 28 | 254BB8401B1FD08900C56DE9 /* main */, 29 | 254BB83F1B1FD08900C56DE9 /* Products */, 30 | ); 31 | sourceTree = ""; 32 | usesTabs = 0; 33 | }; 34 | 254BB83F1B1FD08900C56DE9 /* Products */ = { 35 | isa = PBXGroup; 36 | children = ( 37 | 254BB83E1B1FD08900C56DE9 /* main.app */, 38 | ); 39 | name = Products; 40 | sourceTree = ""; 41 | }; 42 | 254BB8401B1FD08900C56DE9 /* main */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 254BB8671B1FD16500C56DE9 /* main */, 46 | 254BB84E1B1FD08900C56DE9 /* Images.xcassets */, 47 | 254BB8411B1FD08900C56DE9 /* Supporting Files */, 48 | ); 49 | path = main; 50 | sourceTree = ""; 51 | }; 52 | 254BB8411B1FD08900C56DE9 /* Supporting Files */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 254BB8421B1FD08900C56DE9 /* Info.plist */, 56 | ); 57 | name = "Supporting Files"; 58 | sourceTree = ""; 59 | }; 60 | /* End PBXGroup section */ 61 | 62 | /* Begin PBXNativeTarget section */ 63 | 254BB83D1B1FD08900C56DE9 /* main */ = { 64 | isa = PBXNativeTarget; 65 | buildConfigurationList = 254BB8611B1FD08900C56DE9 /* Build configuration list for PBXNativeTarget "main" */; 66 | buildPhases = ( 67 | 254BB83C1B1FD08900C56DE9 /* Resources */, 68 | ); 69 | buildRules = ( 70 | ); 71 | dependencies = ( 72 | ); 73 | name = main; 74 | productName = main; 75 | productReference = 254BB83E1B1FD08900C56DE9 /* main.app */; 76 | productType = "com.apple.product-type.application"; 77 | }; 78 | /* End PBXNativeTarget section */ 79 | 80 | /* Begin PBXProject section */ 81 | 254BB8361B1FD08900C56DE9 /* Project object */ = { 82 | isa = PBXProject; 83 | attributes = { 84 | LastUpgradeCheck = 0630; 85 | ORGANIZATIONNAME = Developer; 86 | TargetAttributes = { 87 | 254BB83D1B1FD08900C56DE9 = { 88 | CreatedOnToolsVersion = 6.3.1; 89 | }; 90 | }; 91 | }; 92 | buildConfigurationList = 254BB8391B1FD08900C56DE9 /* Build configuration list for PBXProject "main" */; 93 | compatibilityVersion = "Xcode 3.2"; 94 | developmentRegion = English; 95 | hasScannedForEncodings = 0; 96 | knownRegions = ( 97 | en, 98 | Base, 99 | ); 100 | mainGroup = 254BB8351B1FD08900C56DE9; 101 | productRefGroup = 254BB83F1B1FD08900C56DE9 /* Products */; 102 | projectDirPath = ""; 103 | projectRoot = ""; 104 | targets = ( 105 | 254BB83D1B1FD08900C56DE9 /* main */, 106 | ); 107 | }; 108 | /* End PBXProject section */ 109 | 110 | /* Begin PBXResourcesBuildPhase section */ 111 | 254BB83C1B1FD08900C56DE9 /* Resources */ = { 112 | isa = PBXResourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | 25FB30331B30FDEE0005924C /* assets in Resources */, 116 | 254BB8681B1FD16500C56DE9 /* main in Resources */, 117 | 254BB84F1B1FD08900C56DE9 /* Images.xcassets in Resources */, 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | /* End PBXResourcesBuildPhase section */ 122 | 123 | /* Begin XCBuildConfiguration section */ 124 | 254BB85F1B1FD08900C56DE9 /* Debug */ = { 125 | isa = XCBuildConfiguration; 126 | buildSettings = { 127 | ALWAYS_SEARCH_USER_PATHS = NO; 128 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 129 | CLANG_CXX_LIBRARY = "libc++"; 130 | CLANG_ENABLE_MODULES = YES; 131 | CLANG_ENABLE_OBJC_ARC = YES; 132 | CLANG_WARN_BOOL_CONVERSION = YES; 133 | CLANG_WARN_CONSTANT_CONVERSION = YES; 134 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 135 | CLANG_WARN_EMPTY_BODY = YES; 136 | CLANG_WARN_ENUM_CONVERSION = YES; 137 | CLANG_WARN_INT_CONVERSION = YES; 138 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 139 | CLANG_WARN_UNREACHABLE_CODE = YES; 140 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 141 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 142 | COPY_PHASE_STRIP = NO; 143 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 144 | ENABLE_STRICT_OBJC_MSGSEND = YES; 145 | GCC_C_LANGUAGE_STANDARD = gnu99; 146 | GCC_DYNAMIC_NO_PIC = NO; 147 | GCC_NO_COMMON_BLOCKS = YES; 148 | GCC_OPTIMIZATION_LEVEL = 0; 149 | GCC_PREPROCESSOR_DEFINITIONS = ( 150 | "DEBUG=1", 151 | "$(inherited)", 152 | ); 153 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 154 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 155 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 156 | GCC_WARN_UNDECLARED_SELECTOR = YES; 157 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 158 | GCC_WARN_UNUSED_FUNCTION = YES; 159 | GCC_WARN_UNUSED_VARIABLE = YES; 160 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 161 | MTL_ENABLE_DEBUG_INFO = YES; 162 | ONLY_ACTIVE_ARCH = YES; 163 | SDKROOT = iphoneos; 164 | TARGETED_DEVICE_FAMILY = "1,2"; 165 | }; 166 | name = Debug; 167 | }; 168 | 254BB8601B1FD08900C56DE9 /* Release */ = { 169 | isa = XCBuildConfiguration; 170 | buildSettings = { 171 | ALWAYS_SEARCH_USER_PATHS = NO; 172 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 173 | CLANG_CXX_LIBRARY = "libc++"; 174 | CLANG_ENABLE_MODULES = YES; 175 | CLANG_ENABLE_OBJC_ARC = YES; 176 | CLANG_WARN_BOOL_CONVERSION = YES; 177 | CLANG_WARN_CONSTANT_CONVERSION = YES; 178 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 179 | CLANG_WARN_EMPTY_BODY = YES; 180 | CLANG_WARN_ENUM_CONVERSION = YES; 181 | CLANG_WARN_INT_CONVERSION = YES; 182 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 183 | CLANG_WARN_UNREACHABLE_CODE = YES; 184 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 185 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 186 | COPY_PHASE_STRIP = NO; 187 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 188 | ENABLE_NS_ASSERTIONS = NO; 189 | ENABLE_STRICT_OBJC_MSGSEND = YES; 190 | GCC_C_LANGUAGE_STANDARD = gnu99; 191 | GCC_NO_COMMON_BLOCKS = YES; 192 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 193 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 194 | GCC_WARN_UNDECLARED_SELECTOR = YES; 195 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 196 | GCC_WARN_UNUSED_FUNCTION = YES; 197 | GCC_WARN_UNUSED_VARIABLE = YES; 198 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 199 | MTL_ENABLE_DEBUG_INFO = NO; 200 | SDKROOT = iphoneos; 201 | TARGETED_DEVICE_FAMILY = "1,2"; 202 | VALIDATE_PRODUCT = YES; 203 | }; 204 | name = Release; 205 | }; 206 | 254BB8621B1FD08900C56DE9 /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 210 | INFOPLIST_FILE = main/Info.plist; 211 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 212 | PRODUCT_NAME = "$(TARGET_NAME)"; 213 | }; 214 | name = Debug; 215 | }; 216 | 254BB8631B1FD08900C56DE9 /* Release */ = { 217 | isa = XCBuildConfiguration; 218 | buildSettings = { 219 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 220 | INFOPLIST_FILE = main/Info.plist; 221 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 222 | PRODUCT_NAME = "$(TARGET_NAME)"; 223 | }; 224 | name = Release; 225 | }; 226 | /* End XCBuildConfiguration section */ 227 | 228 | /* Begin XCConfigurationList section */ 229 | 254BB8391B1FD08900C56DE9 /* Build configuration list for PBXProject "main" */ = { 230 | isa = XCConfigurationList; 231 | buildConfigurations = ( 232 | 254BB85F1B1FD08900C56DE9 /* Debug */, 233 | 254BB8601B1FD08900C56DE9 /* Release */, 234 | ); 235 | defaultConfigurationIsVisible = 0; 236 | defaultConfigurationName = Release; 237 | }; 238 | 254BB8611B1FD08900C56DE9 /* Build configuration list for PBXNativeTarget "main" */ = { 239 | isa = XCConfigurationList; 240 | buildConfigurations = ( 241 | 254BB8621B1FD08900C56DE9 /* Debug */, 242 | 254BB8631B1FD08900C56DE9 /* Release */, 243 | ); 244 | defaultConfigurationIsVisible = 0; 245 | defaultConfigurationName = Release; 246 | }; 247 | /* End XCConfigurationList section */ 248 | }; 249 | rootObject = 254BB8361B1FD08900C56DE9 /* Project object */; 250 | } 251 | -------------------------------------------------------------------------------- /main/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /main/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | main 9 | CFBundleIdentifier 10 | org.golang.test.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /main/assets/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakyll/go-xcode/71f9d4a7af94167b2e8be9a1dd1cb5bd23ac223f/main/assets/test.jpg -------------------------------------------------------------------------------- /main/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakyll/go-xcode/71f9d4a7af94167b2e8be9a1dd1cb5bd23ac223f/main/main --------------------------------------------------------------------------------