Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TOOL_NAME = UnityBuildKit
VERSION = 1.1.3
VERSION = 1.1.4

PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
Expand Down
12 changes: 6 additions & 6 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
.library(name: "UBKit", targets: ["UBKit"]),
],
dependencies: [
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "1.4.0")
.package(url: "https://github.com/yonaskolb/XcodeGen.git", .upToNextMinor(from: "1.6.0"))
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="Assets/ubk_logo.png">
</p>
<p align="center">
<img src="https://img.shields.io/badge/version-1.1.3-blue.svg?style=flat-square" />
<img src="https://img.shields.io/badge/version-1.1.4-blue.svg?style=flat-square" />
<a href="https://github.com/handsomecode/UnityBuildKit/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square"/>
</a>
Expand Down
12 changes: 6 additions & 6 deletions Sources/UBKit/Files/Xcode/SpecFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ extension File {
It is specifically indented and formatted in order
to work once the data is written to the spec file.
*/
class func specFile(projectName: String, bundleIdentifier: String, unityVersion: String) -> Data? {
class func specFile(iOSProjectName: String, bundleIdentifier: String, unityProjectName: String, unityVersion: String) -> Data? {
let file = """
name: \(projectName)
name: \(iOSProjectName)
configs:
Debug: debug
Release: release
targets:
\(projectName):
\(iOSProjectName):
type: application
platform: iOS
sources:
- \(projectName)
- \(iOSProjectName)
- Vendor
settings:
PRODUCT_BUNDLE_IDENTIFIER: \(bundleIdentifier)
IOS_DEPLOYMENT_TARGET: 11.0
IPHONEOS_DEPLOYMENT_TARGET: 11.0
UNITY_RUNTIME_VERSION: \(unityVersion)
UNITY_SCRIPTING_BACKEND: il2cpp
UNITY_IOS_EXPORT_PATH: ${SRCROOT}/../Unity/\(projectName)/ios_build
UNITY_IOS_EXPORT_PATH: ${SRCROOT}/../Unity/\(unityProjectName)/ios_build
GCC_PREFIX_HEADER: $(UNITY_IOS_EXPORT_PATH)/Classes/Prefix.pch
OTHER_LDFLAGS: -weak-lSystem -liconv.2 -liPhone-lib -weak_framework CoreMotion -weak_framework iAd -framework OpenGLES
HEADER_SEARCH_PATHS: $(UNITY_IOS_EXPORT_PATH)/Classes $(UNITY_IOS_EXPORT_PATH)/Classes/Native $(UNITY_IOS_EXPORT_PATH)/Libraries/libil2cpp/include
Expand All @@ -58,7 +58,7 @@ extension File {
OTHER_CFLAGS: $(inherited) -DINIT_SCRIPTING_BACKEND=1 -fno-strict-overflow -DRUNTIME_IL2CPP=1
CLANG_CXX_LANGUAGE_STANDARD: c++11
CLANG_CXX_LIBRARY: libc++
SWIFT_OBJC_BRIDGING_HEADER: \(projectName)/UnityBridge/UnityBridge.h
SWIFT_OBJC_BRIDGING_HEADER: \(iOSProjectName)/UnityBridge/UnityBridge.h
CLANG_ENABLE_MODULES: NO
CLANG_WARN_BOOL_CONVERSION: NO
CLANG_WARN_CONSTANT_CONVERSION: NO
Expand Down
29 changes: 4 additions & 25 deletions Sources/UBKit/Workers/FileCopier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ private extension FileCopier {
return .failure(UBKitError.invalidXcodeProject("Missing main target"))
}

let frameworksBuildPhase = PBXFrameworksBuildPhase(reference: generateUUID(PBXFrameworksBuildPhase.self,
"frameworks".appending(nameSalt)))
mainTarget.value.buildPhases.append(frameworksBuildPhase.reference)
project.pbxproj.objects.addObject(frameworksBuildPhase)
let frameworksBuildPhase = PBXFrameworksBuildPhase()
let frameworksBuildPhaseReference = project.pbxproj.objects.generateReference(frameworksBuildPhase, "frameworks".appending(nameSalt))
mainTarget.value.buildPhases.append(frameworksBuildPhaseReference)
project.pbxproj.objects.addObject(frameworksBuildPhase, reference: frameworksBuildPhaseReference)

return .success
}
Expand Down Expand Up @@ -275,24 +275,3 @@ private extension FileCopier {
return .success
}
}

/**
The following private methods are credited to XcodeGenKit and
are used with little to no modifications.
*/
private extension FileCopier {

func generateUUID<T: PBXObject>(_ element: T.Type, _ id: String) -> String {
var uuid: String = ""
var counter: UInt = 0
let className: String = String(describing: T.self).replacingOccurrences(of: "PBX", with: "")
let classAcronym = className.filter({ String($0).lowercased() != String($0) })
let stringID = String(abs(id.hashValue).description.prefix(10 - classAcronym.utf8.count))
repeat {
counter += 1
uuid = "\(classAcronym)\(stringID)\(String(format: "%02d", counter))"
} while (uuids.contains(uuid))
uuids.insert(uuid)
return uuid
}
}
3 changes: 2 additions & 1 deletion Sources/UBKit/Workers/XcodeProject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ private extension XcodeProject {
}

let contents = File.specFile(
projectName: config.iOS.projectName,
iOSProjectName: config.iOS.projectName,
bundleIdentifier: config.iOS.bundleId,
unityProjectName: config.unity.projectName,
unityVersion: config.unity.version
)

Expand Down
2 changes: 1 addition & 1 deletion UnityBuildKit.xcodeproj/UBKit_Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Loading