Skip to content

Commit 48a6f0f

Browse files
authored
Merge pull request #1 from handsomecode/develop
Develop
2 parents 15b2379 + 55b1f7e commit 48a6f0f

27 files changed

+847
-130
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ xcuserdata/
1919
.DS_Store
2020
iOS/
2121
Unity/
22+
ubconfig.json
23+
refreshprojects.swift
2224

2325
## Other
2426
*.moved-aside

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
TOOL_NAME = UnityBuildKit
2+
VERSION = 0.7.0
3+
4+
PREFIX = /usr/local
5+
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
6+
SHARE_PATH = $(PREFIX)/share/$(TOOL_NAME)
7+
BUILD_PATH = .build/release/$(TOOL_NAME)
8+
CURRENT_PATH = $(PWD)
9+
TAR_FILENAME = $(TOOL_NAME)-$(VERSION).tar.gz
10+
11+
install: build
12+
mkdir -p $(PREFIX)/bin
13+
cp -f $(BUILD_PATH) $(INSTALL_PATH)
14+
mkdir -p $(SHARE_PATH)
15+
16+
build:
17+
swift build --disable-sandbox -c release -Xswiftc -static-stdlib
18+
19+
uninstall:
20+
rm -f $(INSTALL_PATH)
21+
rm -rf $(SHARE_PATH)
22+
23+
get_sha:
24+
wget https://github.com/handsomecode/$(TOOL_NAME)/archive/$(VERSION).tar.gz -O $(TAR_FILENAME)
25+
shasum -a 256 $(TAR_FILENAME)
26+
rm $(TAR_FILENAME)

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
<p>
2+
<img src="https://img.shields.io/badge/version-0.7.0-blue.svg?style=flat-square" />
3+
<a href="https://github.com/handsomecode/UnityBuildKit/blob/master/LICENSE">
4+
<img src="https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square"/>
5+
</a>
6+
</p>
7+
18
# UnityBuildKit
29

3-
A description of this package.
10+
UnityBuildKit is a command line tool that generates an iOS application with an embedded Unity scene.
11+
12+
## Installation
13+
`UnityBuildKit` requires Xcode 9 and Swift 4
14+
15+
### Make
16+
```
17+
git clone https://github.com/handsomecode/UnityBuildKit
18+
cd UnityBuildKit
19+
make
20+
```
21+
22+
### Swift Package Manager
23+
#### Use as a dependency
24+
```
25+
.package(url: "https://github.com/handsomecode/UnityBuildKit", from: "1.0.0"),
26+
```
27+
28+
## Usage
29+
### To generate a new project
30+
1. Create a top-level folder and navigate to it. This folder will contain all information about the Xcode and Unity projects. (_Note: By default, the name of this folder will be the name of the Xcode and Unity projects._)
31+
```
32+
mkdir ExampleProject
33+
cd ExampleProject
34+
```
35+
36+
2. Create a configuration file named `ubconfig.json`
37+
38+
```
39+
{
40+
"project_name": "", // Leaving this empty uses folder name by default
41+
"bundle_id": "is.handsome.UnityBuildKit",
42+
"unity_path": "<path_to_unity_app>", // "/Applications/Unity/Unity.app/Contents/MacOS/Unity"
43+
"unity_version": "2017.1.1f1",
44+
"unity_scene_name": "" // Leaving this empty uses folder name by default
45+
}
46+
```
47+
48+
3. Run
49+
```
50+
$ UnityBuildKit generate
51+
```
52+
53+
## Known Unity Version Compatibility
54+
- 2107.1.f1
55+
56+
## Attributions
57+
This tool is built using:
58+
- [XcodeGen](https://github.com/yonaskolb/XcodeGen)
59+
- [xcproj](https://github.com/xcodeswift/xcproj)
60+
61+
and the wonderful dependencies they bring with them.
62+
63+
Inspiration for building `UnityBuildKit` came after running into several problems while trying to [manually do this process](https://the-nerd.be/2015/11/13/integrate-unity-5-in-a-native-ios-app-with-xcode-7/) and reading over a [github issue](https://github.com/blitzagency/ios-unity5/issues/52) trying to resolve those problems.
64+
65+
## License
66+
67+
UnityBuildKit is licensed under the MIT license. See LICENSE for more info.

Sources/UBKit/Files/File.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// File.swift
3-
// UEKit
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

Sources/UBKit/Files/UnityBridge/BridgeHeaderFile.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// BridgeHeaderFile.swift
3-
// unity.embedPackageDescription
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

Sources/UBKit/Files/UnityBridge/MessageBridge.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// MessageBridge.swift
3-
// UEKit
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

Sources/UBKit/Files/UnityBridge/UnityUtilsFile.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// UnityUtilsFile.swift
3-
// unity.embedPackageDescription
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

Sources/UBKit/Files/Xcode/AppDelegateFile.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// appDelegateFile.swift
3-
// UEKit
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

Sources/UBKit/Files/Xcode/AppIconContentsFile.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// appIconContentsFile.swift
3-
// UEKit
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

Sources/UBKit/Files/Xcode/InfoPlistFile.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
//
22
// infoPlistFile.swift
3-
// UEKit
43
//
5-
// Created by Eric Miller on 10/11/17.
4+
// Copyright (c) 2017 Handsome
65
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
723

824
import Foundation
925

0 commit comments

Comments
 (0)