Skip to content

Commit

Permalink
metadata and script directories (fixes exokitxr#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Sep 9, 2018
1 parent ace8864 commit 14d295d
Show file tree
Hide file tree
Showing 36 changed files with 87,057 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -63,11 +63,11 @@ matrix:
build/Release/exokit.node
- mkdir -p /tmp/Exokit.app/Contents/MacOS
- cp -R * /tmp/Exokit.app/Contents/MacOS
- cp Info.plist /tmp/Exokit.app/Contents
- cp metadata/Info.plist /tmp/Exokit.app/Contents
- tar -czf exokit-macos-full.tar.gz --exclude=".*" --exclude="*.tar.gz" *
- rm -R node
- tar -czf exokit-macos.tar.gz --exclude=".*" --exclude="*.tar.gz" *
- ./exokit-codesign-macos.sh
- ./scripts/exokit-codesign-macos.sh
deploy:
- provider: releases
api_key:
Expand Down
6 changes: 3 additions & 3 deletions BUILDING.md
Expand Up @@ -15,7 +15,7 @@ Exokit is a node module. The core is written in Javascript, with native bindings

## MacOS

**Requirements**: Node.js 10, XCode
**Requirements**: Node.js 10, XCode

### Procedure
1. open **Terminal.app**
Expand Down Expand Up @@ -43,11 +43,11 @@ Exokit is a node module. The core is written in Javascript, with native bindings
1. place certificate/private key in `cert/{app.cert,app.privkey}`
1. open **Ubuntu Bash on Windows**
1. `export MLSDK=/mnt/c/your_mlsdk_path_goes_here # fill this in`
1. run `build-ml.sh --signed`
1. run `scripts/build-ml.sh --signed`

### Procedure (unsigned)
1. download Magic Leap Package Manager from https://creator.magicleap.com
1. install Magic Leap Lumin SDK
1. open **Ubuntu Bash on Windows**
1. `export MLSDK=/mnt/c/your_mlsdk_path_goes_here # fill this in`
1. `build-ml.sh --unsigned`
1. `scripts/build-ml.sh --unsigned`
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -19,7 +19,7 @@ RUN \
RUN \
mkdir -p /tmp/exokit-bin/bin /tmp/exokit-bin/lib/exokit && \
cp -R . /tmp/exokit-bin/lib/exokit && \
cp exokit-bin.sh /tmp/exokit-bin/bin/exokit && \
cp scripts/exokit-bin.sh /tmp/exokit-bin/bin/exokit && \
cd /tmp/exokit-bin && \
tar -czf /app/exokit-linux-bin.tar.gz --exclude=".*" --exclude="*.tar.gz" * && \
cd /app && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@

## Native VR and AR engine for JavaScript πŸ¦–

<img src="https://github.com/webmixedreality/exokit/blob/master/icon.png" width=100/>
<img src="https://github.com/webmixedreality/exokit/blob/master/assets/icon.png" width=100/>

[![Slack](https://exoslack.now.sh/badge.svg)](https://join.slack.com/t/exokit/shared_invite/enQtNDI3NjcxNzYwMDIxLWU2NmFmOTEzMzk4NWNiYjRhMjVkYzcyNjg5YjUyMzZkYWM1ZGI4M2IwYWZiMjNlMTJjMDlkM2U3Y2JiNTc2M2Q)
[![Github releases](https://img.shields.io/github/downloads/webmixedreality/exokit/total.svg)](https://github.com/webmixedreality/exokit/releases )
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions appveyor.yml β†’ metadata/appveyor.yml
Expand Up @@ -28,14 +28,14 @@ after_test:
$env:Path = "$pwd\node;$env:Path";
.\node\npm install
.\node\npm run test:ci
bash testRun.sh
bash scripts/testRun.sh
set version "$env:APPVEYOR_REPO_TAG_NAME"
if ([string]::IsNullOrEmpty("$version")) { set version "$env:APPVEYOR_REPO_COMMIT".Substring(0, 8) }
mkdir dist
.\buildtools\iscc "$pwd\exokit.iss" "/dMyAppVersion=$version" /odist /qp
.\buildtools\iscc "$pwd\metadata\exokit.iss" "/dMyAppVersion=$version" /odist /qp
mv dist\*.exe exokit-win-x64.exe
rm -R -fo dist
& "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Bin/SignTool.exe" sign /f .\codesign-windows.pfx /t http://timestamp.comodoca.com/authenticode /p "$env:PFX_KEY" exokit-win-x64.exe
& "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Bin/SignTool.exe" sign /f .\metadata\codesign-windows.pfx /t http://timestamp.comodoca.com/authenticode /p "$env:PFX_KEY" exokit-win-x64.exe
7z a exokit-windows-full.zip * -xr'!.git' -xr'!buildtools' -xr'!exokit-win-x64.exe'
rm -r -fo node
7z a exokit-windows.zip * -xr'!.git' -xr'!buildtools' -xr'!exokit-win-x64.exe' -xr'!exokit-windows-full.zip'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 19 additions & 19 deletions exokit.iss β†’ metadata/exokit.iss
Expand Up @@ -27,15 +27,15 @@ AllowNoIcons=yes
LicenseFile={#ProjectRoot}\LICENSE.md
OutputDir={#ProjectRoot}\dist\{#MyAppVersion}
OutputBaseFilename={#MyAppLCShortName}-v{#MyAppVersion}-win-x64
SetupIconFile={#ProjectRoot}\{#MyIcon}
SetupIconFile={#ProjectRoot}\metadata\{#MyIcon}
Compression=lzma
; Much faster
; Compression=none
SolidCompression=yes
ChangesEnvironment=yes
DisableProgramGroupPage=yes
ArchitecturesInstallIn64BitMode=x64 ia64
UninstallDisplayIcon={app}\{#MyIcon}
UninstallDisplayIcon={app}\metadata\{#MyIcon}
AppCopyright=Copyright (c) 2018 WebMR

[Languages]
Expand All @@ -50,12 +50,12 @@ Source: "{#ProjectRoot}\*"; DestDir: "{app}"; BeforeInstall: PreInstall; Flags:
[Registry]
Root: HKCR; Subkey: "Exokit"; ValueType: "string"; ValueData: "URL:Exokit Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Exokit"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "Exokit\DefaultIcon"; ValueType: "string"; ValueData: "{app}\{#MyAppExeName},0"
Root: HKCR; Subkey: "Exokit\shell\open\command"; ValueType: "string"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKCR; Subkey: "Exokit\DefaultIcon"; ValueType: "string"; ValueData: "{app}\scripts\{#MyAppExeName},0"
Root: HKCR; Subkey: "Exokit\shell\open\command"; ValueType: "string"; ValueData: """{app}\scripts\{#MyAppExeName}"" ""%1"""

[Icons]
Name: "{group}\{#MyAppName}"; WorkingDir: "{%userprofile}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "-h -l"; IconFilename: "{app}\{#MyIcon}"
Name: "{group}\{#MyAppShortName} Engine CLI"; WorkingDir: "{%userprofile}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "-l"; IconFilename: "{app}\{#MyIcon}"
Name: "{group}\{#MyAppName}"; WorkingDir: "{%userprofile}"; Filename: "{app}\scripts\{#MyAppExeName}"; Parameters: "-h -l"; IconFilename: "{app}\metadata\{#MyIcon}"
Name: "{group}\{#MyAppShortName} Engine CLI"; WorkingDir: "{%userprofile}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "-l"; IconFilename: "{app}\metadata\{#MyIcon}"
Name: "{group}\Uninstall {#MyAppShortName}"; Filename: "{uninstallexe}"

[Code]
Expand Down Expand Up @@ -142,12 +142,12 @@ begin
// // Create a file to check for Node.JS
// TmpJS := ExpandConstant('{tmp}') + '\nvm_check.js';
// SaveStringToFile(TmpJS, 'console.log(require("path").dirname(process.execPath));', False);
//
//
// // Execute the node file and save the output temporarily
// TmpResultFile := ExpandConstant('{tmp}') + '\nvm_node_check.txt';
// Exec(ExpandConstant('{cmd}'), '/C node "'+TmpJS+'" > "' + TmpResultFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
// DeleteFile(TmpJS)
//
//
// // Process the results
// LoadStringFromFile(TmpResultFile,stdout);
// NodePath := Trim(Ansi2String(stdout));
Expand All @@ -171,7 +171,7 @@ begin
// TakeControl(NodePath, NodeVersion);
// end;
// end;
//
//
// // Make sure the symlink directory doesn't exist
// if DirExists(SymlinkPage.Values[0]) then begin
// // If the directory is empty, just delete it since it will be recreated anyway.
Expand Down Expand Up @@ -208,13 +208,13 @@ var
nvm_symlink: string;
begin
// MsgBox('Removing NVM for Windows will remove the nvm command and all versions of node.js, including global npm modules.', mbInformation, MB_OK);
//
//
// // Remove the symlink
// RegQueryStringValue(HKEY_LOCAL_MACHINE,
// 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
// 'NVM_SYMLINK', nvm_symlink);
// RemoveDir(nvm_symlink);
//
//
// // Clean the registry
// RegDeleteValue(HKEY_LOCAL_MACHINE,
// 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
Expand All @@ -228,25 +228,25 @@ begin
// RegDeleteValue(HKEY_CURRENT_USER,
// 'Environment',
// 'NVM_SYMLINK')
//
//
// RegQueryStringValue(HKEY_LOCAL_MACHINE,
// 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
// 'Path', path);
//
//
// StringChangeEx(path,'%NVM_HOME%','',True);
// StringChangeEx(path,'%NVM_SYMLINK%','',True);
// StringChangeEx(path,';;',';',True);
//
//
// RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', path);
//
//
// RegQueryStringValue(HKEY_CURRENT_USER,
// 'Environment',
// 'Path', path);
//
//
// StringChangeEx(path,'%NVM_HOME%','',True);
// StringChangeEx(path,'%NVM_SYMLINK%','',True);
// StringChangeEx(path,';;',';',True);
//
//
// RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', path);
Result := True;
Expand All @@ -260,13 +260,13 @@ begin
if CurStep = ssPostInstall then
begin
// SaveStringToFile(ExpandConstant('{app}\settings.txt'), 'root: ' + ExpandConstant('{app}') + #13#10 + 'path: ' + SymlinkPage.Values[0] + #13#10, False);
//
//
// // Add Registry settings
// RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'NVM_HOME', ExpandConstant('{app}'));
// RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'NVM_SYMLINK', SymlinkPage.Values[0]);
// RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'NVM_HOME', ExpandConstant('{app}'));
// RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'NVM_SYMLINK', SymlinkPage.Values[0]);
//
//
// // Update system and user PATH if needed
// RegQueryStringValue(HKEY_LOCAL_MACHINE,
// 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"build": "node-gyp build",
"debug": "ndb",
"install": "node ./preinstall.js && node-gyp rebuild",
"install": "node ./scripts/preinstall.js && node-gyp rebuild",
"lint": "eslint src tests",
"rebuild": "shx rm -rf node_modules && npm cache clean --force && npm install",
"serve": "serve examples",
Expand Down
10 changes: 5 additions & 5 deletions build-ml.sh β†’ scripts/build-ml.sh
Expand Up @@ -43,18 +43,18 @@ find -name '\.bin' | xargs rm -Rf
rm -Rf build/libexokit
mkdir -p build/libexokit
find build/Release/obj.target node_modules -name '*.o' | xargs "$AR" crs build/libexokit/libexokit.a
./gen-dlibs-h.js >build/libexokit/dlibs.h
./scripts/gen-dlibs-h.js >build/libexokit/dlibs.h

# build mpk

./magicleap-js/hack-toolchain.js -u

cmd.exe /c "$MLSDK_WIN/mabu.cmd" "MLSDK=$MLSDK_WIN" -v -t release_lumin program-device.mabu
cmd.exe /c "$MLSDK_WIN/mabu.cmd" "MLSDK=$MLSDK_WIN" -v -t release_lumin metadata/program-device.mabu
if [ "$ARG1" = "--signed" ] || [ "$ARG1" = "--all" ]; then
cmd.exe /c "$MLSDK_WIN/mabu.cmd" "MLSDK=$MLSDK_WIN" -v -t release_lumin -m manifest-device.xml -p --create-package -s cert/app.cert app-device.package
cmd.exe /c "$MLSDK_WIN/mabu.cmd" "MLSDK=$MLSDK_WIN" -v -t release_lumin -m metadata/metadata/manifest-device.xml -p --create-package -s cert/app.cert metadata/app-device.package
cp build/magicleap/app-device/app-device.mpk build/magicleap/exokit.mpk
fi
if [ "$ARG1" = "--unsigned" ] || [ "$ARG1" = "--all" ]; then
cmd.exe /c "$MLSDK_WIN/mabu.cmd" "MLSDK=$MLSDK_WIN" -v -t release_lumin -m manifest-device.xml -p --create-package --allow-unsigned app-device.package
cmd.exe /c "$MLSDK_WIN/mabu.cmd" "MLSDK=$MLSDK_WIN" -v -t release_lumin -m metadata/manifest-device.xml -p --create-package --allow-unsigned metadata/app-device.package
cp build/magicleap/app-device/app-device.mpk build/magicleap/exokit-unsigned.mpk
fi
fi
File renamed without changes.
File renamed without changes.
Expand Up @@ -3,17 +3,17 @@
# TODO https://github.com/webmixedreality/exokit/issues/169
if true || [ -z "${PFX_KEY}" ]
then
cp appdmg.json /tmp
cp metadata/appdmg.json /tmp
appdmg /tmp/appdmg.json exokit-macos-x64.dmg
else
security create-keychain -p nopassword build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p nopassword build.keychain
security set-keychain-settings -t 3600 -u build.keychain
security import codesign-macos.pfx -k build.keychain -P "${PFX_KEY}" -A
security import metadata/codesign-macos.pfx -k build.keychain -P "${PFX_KEY}" -A
security set-key-partition-list -S apple-tool:,apple: -s -k nopassword build.keychain
find /tmp/Exokit.app -type f | xargs -n 1 codesign --force --verify --verbose --sign "7C22D41BA5AB743D3E47D543F6B27FE2FC720412"
codesign --force --verify --verbose --sign "7C22D41BA5AB743D3E47D543F6B27FE2FC720412" /tmp/Exokit.app
cp appdmg-codesign.json /tmp
cp metadata/appdmg-codesign.json /tmp
appdmg /tmp/appdmg-codesign.json exokit-macos-x64.dmg
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion preinstall.js β†’ scripts/preinstall.js
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs');
const childProcess = require('child_process');

const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json')));
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../', 'package.json')));
const dependencies = Object.keys(packageJson.dependencies);
const nativeDependencies = [...dependencies.filter(dependency => /^native-/.test(dependency))]

Expand Down
2 changes: 1 addition & 1 deletion rebuild-ml.sh β†’ scripts/rebuild-ml.sh
Expand Up @@ -6,4 +6,4 @@ rm -Rf node_modules
npm cache clean --force
rm -Rf build/magicleap

./build-ml.sh "$@"
./scripts/build-ml.sh "$@"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 14d295d

Please sign in to comment.