Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 25fc8cc

Browse files
authored
Refactor to NPM Packages (#894)
* Update schema to right folders and namespaces Move SDK to package. TODO Create script to upgrade package to new SpatialOS version Delete CoreSDK downloader Add some temporary helper scripts * Fix code generation for packages that are dependencies only * Generate schema descriptor Fix local deployment launcher * Checkout sdk packages Initial version of sdk package update scripts. Still need to move and improve Move packaged schema from `Schema` to `.schema` to avoid needless meta files. * Update scripts to download into the right folders * Move SDK Update scripts and combine Update SDK Script to clean unneeded binaries * Fix update sdk script when run from outside scripts folder move republish script * Have npm ignore the gitignore files Add missing .gitignore file * Add Schema Descriptor path to GdkToolsConfiguration Fix window drawing to not be a hack * Fix code generation for test-project * Fixed error in download for mobile SDK * Fixed metafile names * add CoreSDK OSX meta files * Set repo to cloudsmith.io Split scripts into multiple * update sdk downloading scripts for 13.7.1 * update update script * add empty plugins dir * Rename all packages to io.improbable.* * Remove package specific git ignore from root * rename package dependencies to new naming style * Update application identifiers * Fix NPM CI (#1015) * upgrade guide * Update package definition descriptions * Update NPM Registry url in publish script * Update gitignore for code generator * Remove old gitignore entry for test-project schema from gdk packages
1 parent 3f4d4c9 commit 25fc8cc

File tree

956 files changed

+874
-897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

956 files changed

+874
-897
lines changed

.buildkite/premerge.steps.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ common: &common
1313
- "environment=production"
1414
- "permission_set=builder"
1515
- "platform=windows"
16-
- "queue=v3-1558109315-a75758857a3cdfbe-------z"
16+
- "queue=v3-1562257704-92dadf3bbbe69f0b-------z"
1717
- "scaler_version=2"
1818
- "minimum_instances=1"
1919
- "agent_count=1"

.buildkite/release-qa.steps.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ common: &common
1313
- "environment=production"
1414
- "permission_set=builder"
1515
- "platform=windows"
16-
- "queue=v3-1558109315-a75758857a3cdfbe-------z"
16+
- "queue=v3-1562257704-92dadf3bbbe69f0b-------z"
1717
- "scaler_version=2"
1818
- "minimum_instances=1"
1919
- "agent_count=1"

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ workers/unity/Assets/Plugins/Improbable.meta
4747

4848
_ReSharper.Caches
4949

50-
workers/unity/Packages/com.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Generated
51-
5250
# Jetbrains
5351
workers/unity/Assets/Plugins/Editor/Jetbrains
5452
workers/unity/Assets/Plugins/Editor/Jetbrains.meta
@@ -65,7 +63,6 @@ test-project/Assets/Plugins/Improbable.meta
6563
test-project/ProjectSettings/UnityConnectSettings.asset
6664
test-project/Assets/Generated/Source.meta
6765
test-project/Assets/Generated/Source/**/*.*
68-
test-project/Assets/.Schema/from_gdk_packages
6966
!test-project/Assets/Generated/Source/improbable/gdk/tests/**/*.cs
7067

7168
.shared-ci/

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@
55
### Breaking Changes
66

77
- Renamed the `buildTarget` command line argument to `buildEnvironment`. [#1012](https://github.com/spatialos/gdk-for-unity/pull/1012)
8+
- All GDK packages now have an `io.improbable` prefix instead of `com.improbable`.
89

910
### Added
1011

1112
- Added the `LinkedGameObjectMap` class for finding the `GameObject`(s) linked with a specified `EntityId`. [#1013](https://github.com/spatialos/gdk-for-unity/pull/1013)
1213
- This can be used with the `[Require]` annotation to inject it into your `MonoBehaviours` provided you are using the `GameObjectCreation` feature module. For example: `[Require] private LinkedGameObjectMap gameObjectMap;`
1314
- Added the ability for the build system to build specific targets of a given build environment. [#1012](https://github.com/spatialos/gdk-for-unity/pull/1012)
1415
- Use the `buildTargetFilter` command line argument to pass in a comma delimited list of build targets to filter for. For example, `+buildTargetFilter win,macos`.
16+
- Added two new GDK packages: `io.improbable.worker.sdk` and `io.improbable.worker.sdk.mobile` which contain the underlying Worker SDK packages for Windows/MacOS/Linux and Android/iOS respectively.
1517

1618
### Internal
1719

1820
- Stopped throwing a `Test Exception` in playground.
21+
- The embedded `DownloadCoreSdk` `dotnet` project has been removed from `Improbable.Gdk.Tools`.
22+
- The `PluginPostprocessor` tool has been removed from `Improbable.Gdk.Tools`.
1923

2024
## `0.2.4` - 2019-06-28
2125

UPGRADE_GUIDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
## From `0.2.4` to `0.2.5`
44

5+
### NPM Packages
6+
7+
From release `0.2.5` onward, all GDK packages and feature modules will be delivered through the Unity Package Manager. To upgrade your project to use these packages do the following:
8+
9+
1. Open the `Packages/manifest.json` file inside your Unity project.
10+
2. Add the following JSON snippet to the this file, under the `"registry: "https://packages.unity.com"` line:
11+
```json
12+
"scopedRegistries": [
13+
{
14+
"name": "Improbable",
15+
"url": "https://npm.improbable.io/gdk-for-unity/",
16+
"scopes": [
17+
"io.improbable"
18+
]
19+
}
20+
]
21+
```
22+
3. Under the `dependencies` field, find all `com.improbable.*` packages and change the names to `io.improbable.*`.
23+
4. For all these packages, change the value from `file:<something>` to `0.2.5`.
24+
25+
> **Note:** You no longer need to checkout the `gdk-for-unity` repository side-by-side your project to sideload these packages.
26+
527
### Build system changes
628

729
When calling the build system from the command line, you must change the `buildTarget` argument to `buildEnvironment`. Previously you may have called the build system like so:

ci/bootstrap.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ pushd "${SHARED_CI_DIR}"
2222
git fetch --depth 20 origin master
2323
git checkout "${PINNED_SHARED_CI_VERSION}"
2424
popd
25+
26+
# Download local copy of the SDK packages.
27+
./init.sh

ci/publish_packages.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -u -o pipefail
4+
5+
cd "$(dirname "$0")/../"
6+
7+
PKG_ROOT="workers/unity/Packages"
8+
REGISTRY="https://npm.improbable.io/gdk-for-unity/"
9+
10+
# Re-publish all packages
11+
pushd $PKG_ROOT
12+
for dir in */;
13+
do
14+
echo $dir
15+
pushd $dir
16+
npm publish --registry="${REGISTRY}"
17+
popd
18+
done
19+
popd

ci/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ cleanUnity "$(pwd)/test-project"
3535

3636
echo "Code Generator Testing"
3737

38-
dotnet test --logger:"nunit;LogFilePath=${CODE_GEN_LIB_TEST_RESULTS_FILE}" workers/unity/Packages/com.improbable.gdk.tools/.CodeGenerator/CodeGeneration/CodeGeneration.csproj
38+
dotnet test --logger:"nunit;LogFilePath=${CODE_GEN_LIB_TEST_RESULTS_FILE}" workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/CodeGeneration/CodeGeneration.csproj
3939
CODE_GEN_LIB_TEST_RESULT=$?
4040

41-
dotnet test --logger:"nunit;LogFilePath=${CODE_GENERATOR_TEST_RESULTS_FILE}" workers/unity/Packages/com.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/GdkCodeGenerator.csproj
41+
dotnet test --logger:"nunit;LogFilePath=${CODE_GENERATOR_TEST_RESULTS_FILE}" workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/GdkCodeGenerator.csproj
4242
CODE_GENERATOR_TEST_RESULT=$?
4343

4444
echo "Editmode Testing"

init.ps1

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
cd $PSScriptRoot
2+
3+
$PkgRoot = $PSScriptRoot + "/workers/unity/Packages"
4+
$SdkPath = $PkgRoot + "/io.improbable.worker.sdk"
5+
$SdkMobilePath = $PkgRoot + "/io.improbable.worker.sdk.mobile"
6+
7+
$SdkVersion = Get-Content ($SdkPath + "/package.json") | jq -r '.version'
8+
9+
function UpdatePackage($type, $identifier, $path, $removes)
10+
{
11+
spatial package get $type $identifier $SdkVersion "$path" --unzip --force --json_output
12+
13+
if ($removes -ne $null)
14+
{
15+
$removes.Split(";") | ForEach {
16+
rm "$path/$_"
17+
}
18+
}
19+
}
20+
21+
UpdatePackage worker_sdk core-dynamic-x86_64-linux "$SdkPath/Plugins/Improbable/Core/Linux/x86_64"
22+
UpdatePackage worker_sdk core-bundle-x86_64-macos "$SdkPath/Plugins/Improbable/Core/OSX"
23+
UpdatePackage worker_sdk core-dynamic-x86_64-win32 "$SdkPath/Plugins/Improbable/Core/Windows/x86_64" "CoreSdkDll.lib"
24+
25+
UpdatePackage worker_sdk csharp-c-interop "$SdkPath/Plugins/Improbable/Sdk/Common" "Improbable.Worker.CInterop.pdb"
26+
27+
UpdatePackage schema standard_library "$SdkPath/.schema"
28+
29+
UpdatePackage tools schema_compiler-x86_64-win32 "$SdkPath/.schema_compiler"
30+
UpdatePackage tools schema_compiler-x86_64-macos "$SdkPath/.schema_compiler"
31+
UpdatePackage tools schema_compiler-x86_64-linux "$SdkPath/.schema_compiler"
32+
33+
#Update Mobile SDK
34+
UpdatePackage worker_sdk core-static-fullylinked-arm-ios "$SdkMobilePath/Plugins/Improbable/Core/iOS/arm" "CoreSdkStatic.lib;libCoreSdkStatic.a.pic"
35+
UpdatePackage worker_sdk core-static-fullylinked-x86_64-ios "$SdkMobilePath/Plugins/Improbable/Core/iOS/x86_64" "CoreSdkStatic.lib;libCoreSdkStatic.a.pic"
36+
37+
UpdatePackage worker_sdk core-dynamic-arm64v8a-android "$SdkMobilePath/Plugins/Improbable/Core/Android/arm64"
38+
UpdatePackage worker_sdk core-dynamic-armv7a-android "$SdkMobilePath/Plugins/Improbable/Core/Android/armv7"
39+
UpdatePackage worker_sdk core-dynamic-x86-android "$SdkMobilePath/Plugins/Improbable/Core/Android/x86"
40+
41+
UpdatePackage worker_sdk csharp-c-interop-static "$SdkMobilePath/Plugins/Improbable/Sdk/iOS" "Improbable.Worker.CInteropStatic.pdb"

init.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
set -e -u -o pipefail
3+
4+
cd "$(dirname "$0")"
5+
6+
PKG_ROOT="workers/unity/Packages"
7+
SDK_PATH="${PKG_ROOT}/io.improbable.worker.sdk"
8+
SDK_MOBILE_PATH="${PKG_ROOT}/io.improbable.worker.sdk.mobile"
9+
10+
SDK_VERSION="$(cat "${SDK_PATH}"/package.json | jq -r '.version')"
11+
12+
update_package() {
13+
local type=$1
14+
local identifier=$2
15+
local path=$3
16+
17+
spatial package get $type $identifier $SDK_VERSION "${path}" --unzip --force --json_output
18+
19+
local files=${4:-""}
20+
for file in $(echo $files | tr ";" "\n"); do
21+
rm "${path}/${file}"
22+
done
23+
}
24+
25+
# Update Core SDK
26+
update_package worker_sdk core-dynamic-x86_64-linux "${SDK_PATH}/Plugins/Improbable/Core/Linux/x86_64"
27+
update_package worker_sdk core-bundle-x86_64-macos "${SDK_PATH}/Plugins/Improbable/Core/OSX"
28+
update_package worker_sdk core-dynamic-x86_64-win32 "${SDK_PATH}/Plugins/Improbable/Core/Windows/x86_64" "CoreSdkDll.lib"
29+
30+
update_package worker_sdk csharp-c-interop "${SDK_PATH}/Plugins/Improbable/Sdk/Common" "Improbable.Worker.CInterop.pdb"
31+
32+
update_package schema standard_library "${SDK_PATH}/.schema"
33+
34+
update_package tools schema_compiler-x86_64-win32 "${SDK_PATH}/.schema_compiler"
35+
update_package tools schema_compiler-x86_64-macos "${SDK_PATH}/.schema_compiler"
36+
update_package tools schema_compiler-x86_64-linux "${SDK_PATH}/.schema_compiler"
37+
38+
#Update Mobile SDK
39+
update_package worker_sdk core-static-fullylinked-arm-ios "${SDK_MOBILE_PATH}/Plugins/Improbable/Core/iOS/arm" "CoreSdkStatic.lib;libCoreSdkStatic.a.pic"
40+
update_package worker_sdk core-static-fullylinked-x86_64-ios "${SDK_MOBILE_PATH}/Plugins/Improbable/Core/iOS/x86_64" "CoreSdkStatic.lib;libCoreSdkStatic.a.pic"
41+
42+
update_package worker_sdk core-dynamic-arm64v8a-android "${SDK_MOBILE_PATH}/Plugins/Improbable/Core/Android/arm64"
43+
update_package worker_sdk core-dynamic-armv7a-android "${SDK_MOBILE_PATH}/Plugins/Improbable/Core/Android/armv7"
44+
update_package worker_sdk core-dynamic-x86-android "${SDK_MOBILE_PATH}/Plugins/Improbable/Core/Android/x86"
45+
46+
update_package worker_sdk csharp-c-interop-static "${SDK_MOBILE_PATH}/Plugins/Improbable/Sdk/iOS" "Improbable.Worker.CInteropStatic.pdb"

0 commit comments

Comments
 (0)