Skip to content

Commit 1d55992

Browse files
authored
Merge pull request #15 from handsomecode/develop
Develop
2 parents 6fe9ee5 + 75ad283 commit 1d55992

File tree

9 files changed

+1033
-1028
lines changed

9 files changed

+1033
-1028
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TOOL_NAME = UnityBuildKit
2-
VERSION = 1.1.3
2+
VERSION = 1.1.4
33

44
PREFIX = /usr/local
55
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)

Package.resolved

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let package = Package(
1010
.library(name: "UBKit", targets: ["UBKit"]),
1111
],
1212
dependencies: [
13-
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "1.4.0")
13+
.package(url: "https://github.com/yonaskolb/XcodeGen.git", .upToNextMinor(from: "1.6.0"))
1414
],
1515
targets: [
1616
.target(

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src="Assets/ubk_logo.png">
33
</p>
44
<p align="center">
5-
<img src="https://img.shields.io/badge/version-1.1.3-blue.svg?style=flat-square" />
5+
<img src="https://img.shields.io/badge/version-1.1.4-blue.svg?style=flat-square" />
66
<a href="https://github.com/handsomecode/UnityBuildKit/blob/master/LICENSE">
77
<img src="https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square"/>
88
</a>

Sources/UBKit/Files/Xcode/SpecFile.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ extension File {
3030
It is specifically indented and formatted in order
3131
to work once the data is written to the spec file.
3232
*/
33-
class func specFile(projectName: String, bundleIdentifier: String, unityVersion: String) -> Data? {
33+
class func specFile(iOSProjectName: String, bundleIdentifier: String, unityProjectName: String, unityVersion: String) -> Data? {
3434
let file = """
35-
name: \(projectName)
35+
name: \(iOSProjectName)
3636
configs:
3737
Debug: debug
3838
Release: release
3939
targets:
40-
\(projectName):
40+
\(iOSProjectName):
4141
type: application
4242
platform: iOS
4343
sources:
44-
- \(projectName)
44+
- \(iOSProjectName)
4545
- Vendor
4646
settings:
4747
PRODUCT_BUNDLE_IDENTIFIER: \(bundleIdentifier)
4848
IOS_DEPLOYMENT_TARGET: 11.0
4949
IPHONEOS_DEPLOYMENT_TARGET: 11.0
5050
UNITY_RUNTIME_VERSION: \(unityVersion)
5151
UNITY_SCRIPTING_BACKEND: il2cpp
52-
UNITY_IOS_EXPORT_PATH: ${SRCROOT}/../Unity/\(projectName)/ios_build
52+
UNITY_IOS_EXPORT_PATH: ${SRCROOT}/../Unity/\(unityProjectName)/ios_build
5353
GCC_PREFIX_HEADER: $(UNITY_IOS_EXPORT_PATH)/Classes/Prefix.pch
5454
OTHER_LDFLAGS: -weak-lSystem -liconv.2 -liPhone-lib -weak_framework CoreMotion -weak_framework iAd -framework OpenGLES
5555
HEADER_SEARCH_PATHS: $(UNITY_IOS_EXPORT_PATH)/Classes $(UNITY_IOS_EXPORT_PATH)/Classes/Native $(UNITY_IOS_EXPORT_PATH)/Libraries/libil2cpp/include
@@ -58,7 +58,7 @@ extension File {
5858
OTHER_CFLAGS: $(inherited) -DINIT_SCRIPTING_BACKEND=1 -fno-strict-overflow -DRUNTIME_IL2CPP=1
5959
CLANG_CXX_LANGUAGE_STANDARD: c++11
6060
CLANG_CXX_LIBRARY: libc++
61-
SWIFT_OBJC_BRIDGING_HEADER: \(projectName)/UnityBridge/UnityBridge.h
61+
SWIFT_OBJC_BRIDGING_HEADER: \(iOSProjectName)/UnityBridge/UnityBridge.h
6262
CLANG_ENABLE_MODULES: NO
6363
CLANG_WARN_BOOL_CONVERSION: NO
6464
CLANG_WARN_CONSTANT_CONVERSION: NO

Sources/UBKit/Workers/FileCopier.swift

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ private extension FileCopier {
106106
return .failure(UBKitError.invalidXcodeProject("Missing main target"))
107107
}
108108

109-
let frameworksBuildPhase = PBXFrameworksBuildPhase(reference: generateUUID(PBXFrameworksBuildPhase.self,
110-
"frameworks".appending(nameSalt)))
111-
mainTarget.value.buildPhases.append(frameworksBuildPhase.reference)
112-
project.pbxproj.objects.addObject(frameworksBuildPhase)
109+
let frameworksBuildPhase = PBXFrameworksBuildPhase()
110+
let frameworksBuildPhaseReference = project.pbxproj.objects.generateReference(frameworksBuildPhase, "frameworks".appending(nameSalt))
111+
mainTarget.value.buildPhases.append(frameworksBuildPhaseReference)
112+
project.pbxproj.objects.addObject(frameworksBuildPhase, reference: frameworksBuildPhaseReference)
113113

114114
return .success
115115
}
@@ -275,24 +275,3 @@ private extension FileCopier {
275275
return .success
276276
}
277277
}
278-
279-
/**
280-
The following private methods are credited to XcodeGenKit and
281-
are used with little to no modifications.
282-
*/
283-
private extension FileCopier {
284-
285-
func generateUUID<T: PBXObject>(_ element: T.Type, _ id: String) -> String {
286-
var uuid: String = ""
287-
var counter: UInt = 0
288-
let className: String = String(describing: T.self).replacingOccurrences(of: "PBX", with: "")
289-
let classAcronym = className.filter({ String($0).lowercased() != String($0) })
290-
let stringID = String(abs(id.hashValue).description.prefix(10 - classAcronym.utf8.count))
291-
repeat {
292-
counter += 1
293-
uuid = "\(classAcronym)\(stringID)\(String(format: "%02d", counter))"
294-
} while (uuids.contains(uuid))
295-
uuids.insert(uuid)
296-
return uuid
297-
}
298-
}

Sources/UBKit/Workers/XcodeProject.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ private extension XcodeProject {
114114
}
115115

116116
let contents = File.specFile(
117-
projectName: config.iOS.projectName,
117+
iOSProjectName: config.iOS.projectName,
118118
bundleIdentifier: config.iOS.bundleId,
119+
unityProjectName: config.unity.projectName,
119120
unityVersion: config.unity.version
120121
)
121122

UnityBuildKit.xcodeproj/UBKit_Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.1.1</string>
18+
<string>1.1.4</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)