Skip to content

Commit a935124

Browse files
committed
Readme general information & package.json
1 parent 47f83b3 commit a935124

File tree

2 files changed

+69
-25
lines changed

2 files changed

+69
-25
lines changed

README.md

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
# UnityOSXBuild
22

3-
Short description of the package.
3+
A Unity package for zipping builds automatically, and on Windows, fix OSX builds by adding the executable bits in the process.
44

55
## Usage
66

7-
Install the package according to the installation instructions
7+
Install the package according to the [installation instructions](#installation). Once installed, every OSX build you create, the post processing script will run, zip your build, and if necessary, fixes said build to be able to run on OSX devices.
88

9-
...
9+
### Project settings
10+
11+
This package comes with project specific settings, found at `Edit > Project Settings... > OSX Zip Options`.
12+
13+
|Setting|Description
14+
|---|---
15+
|[Zip Creation Method](#zip-creation-method)|Which method to use for creating the build zip file. (Windows Editor only).
16+
|[Zip Compression Level](#zip-compression-level)|The compression level to apply when generating the zip file.
17+
|Original Build Option|Determines what happens to the original build directory that was used to create the zip file.
18+
|WSL Process Timeout|The time (in seconds) until the wsl process times out.
19+
|Verbose Logging|If checked, prints additional debugging information about the build process.
20+
21+
#### Zip Creation Method
22+
23+
##### WSL
24+
25+
> [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/) (WSL) lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup.
26+
27+
To use this option, WSL has to be installed (preferably an Ubuntu distribution, it's currently the only one we've tested), including the `zip` package on the standard Distribution of WSL on your device.
28+
29+
- For more information on how to install WSL: https://learn.microsoft.com/en-us/windows/wsl/install/
30+
- For more information on how to install the `zip` package on Linux (in this case, WSL): https://www.tecmint.com/install-zip-and-unzip-in-linux/#zipubuntu
31+
32+
##### Zip Manipulation
33+
34+
A Windows-only solution, that zips the build, then edits very specifc bytes of the newly created zip, in order to make it compatible with OSX.
35+
36+
#### Zip Compression Level
37+
38+
|Compression Level|[WSL](#wsl)|[Zip Manipulation](#zip-manipulation)
39+
|---|---|---
40+
|None|No compression (`0` in the zip command)|No compression
41+
|Fastest|Fast compression (`1` out of 9 in the zip command)|Fast compression
42+
|Optimal|Best compression (`9` out of 9 in the zip command)|Best compression
1043

1144
## Installation
1245

@@ -31,33 +64,38 @@ You can also download this repository and extract the `Editor` directory file an
3164

3265
## The Problem
3366

34-
What the problem is
67+
Any build for OSX (otherwise known as MacOS) built on Windows devices, do in general *not* work. Instead, you get presented with an error, saying `The application "game-name" can't be opened`, with no more information.
68+
69+
The reason why OSX builds built on Windows do not work on OSX, is the fact that Windows does not get the concept of file attributes, or at least does not know executable flags, which are needed for OSX to know a file is executable. This executable generally can only be added on Unix devices, which both Linux and OSX devices are. The only current solutions for creating an OSX build, are building on either Linux or OSX itself.
3570

3671
## The Solution
3772

38-
How this package solves the problem (zip)
73+
This package adds or preservers the executable bits, which get lost because of Windows.
74+
75+
If you use the [WSL Zip Creation Method](#wsl), it utilises the Windows Subsystem for Linux to zip the build, so OSX knows how to read, unpack, and fix all files, hence adding the executable bit. It's possible to manually add the executable bit to a file on Linux too, with the `chmod` command.
3976

77+
The [Zip Manipulation](#zip-manipulation) method, instead, is a Windows-only solution. Instead of relying on a Unix system, it zips the build first, then edits the zip itself and its entries (the files inside), to accomodate the necessary file attributes getting lost. To make sure everything works as expected on OSX when unzipping this zip, it changes the zip OS to Linux too, to fake it being made on Linux.
4078

4179
### TODO
4280

4381
The following files will need to be edited:
4482

45-
- package.json
46-
- Package Name
47-
- Description
48-
- Package version
49-
- Minimum Unity version
50-
- Author information
51-
- Package samples
83+
- [ ] package.json
84+
- [x] Package Name
85+
- [x] Description
86+
- [x] Package version
87+
- [x] Minimum Unity version
88+
- [ ] Author information
89+
- [ ] Package samples
5290
- More information about package manifest files: https://docs.unity3d.com/Manual/upm-manifestPkg.html
53-
- Runtime .asmdef
54-
- File name must be [company-name].[package-name].asmdef
55-
- Assembly name must be [company-name].[package-name]
56-
- Editor .asmdef
57-
- File name must be "[company-name].[package-name].Editor.asmdef"
58-
- Assembly name must be "[company-name].[package-name].Editor"
59-
- Optional: Reference runtime assembly
60-
- LICENSE.md
61-
- This README.md
91+
- [ ] Runtime .asmdef
92+
- [ ] File name must be [company-name].[package-name].asmdef
93+
- [ ] Assembly name must be [company-name].[package-name]
94+
- [ ] Editor .asmdef
95+
- [ ] File name must be "[company-name].[package-name].Editor.asmdef"
96+
- [ ] Assembly name must be "[company-name].[package-name].Editor"
97+
- [ ] Optional: Reference runtime assembly
98+
- [ ] LICENSE.md
99+
- [x] This README.md
62100

63101
See https://docs.unity3d.com/Manual/cus-layout.html for more info.

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
"name": "com.github.d3tonat0r.unityosxbuild",
33
"version": "0.1.0",
44
"displayName": "OSX Build",
5-
"description": "A brief description of the package. This is the text that appears in the details view of the Package Manager window. This field supports UTF–8 character codes. This means that you can use special formatting character codes, such as line breaks (\n) and bullets (\u25AA).",
6-
"unity": "2022.1",
7-
"category": "",
8-
"hideInEditor": true
5+
"description": "A Unity package for zipping builds automatically, and on Windows, fix OSX builds by adding the executable bits in the process.",
6+
"unity": "2022.3",
7+
"keywords": [
8+
"zip",
9+
"osx",
10+
"macos",
11+
"executable bit"
12+
],
13+
"hideInEditor": true,
14+
"documentationUrl": "https://github.com/D3TONAT0R/UnityOSXBuild/blob/main/README.md"
915
}

0 commit comments

Comments
 (0)