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

Commit 4e97647

Browse files
author
Paul Balaji
authored
Split build target from build environment (#1012)
1 parent 1bd423d commit 4e97647

File tree

10 files changed

+142
-84
lines changed

10 files changed

+142
-84
lines changed

.buildkite/premerge.steps.yaml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,29 @@ steps:
4949
artifact_paths:
5050
- logs/**/*
5151

52-
- label: "build :android: and iOS"
52+
- label: "build :android:"
5353
command: bash -c .shared-ci/scripts/build-worker.sh
5454
<<: *common
5555
artifact_paths:
5656
- logs/**/*
5757
- workers/unity/build/worker/**/*
5858
env:
5959
WORKER_TYPE: "MobileClient"
60-
BUILD_TARGET: "local"
61-
SCRIPTING_TYPE: "mono"
60+
BUILD_ENVIRONMENT: "local"
61+
BUILD_TARGET_FILTER: "android"
62+
SCRIPTING_BACKEND: "mono"
63+
64+
- label: "build iOS"
65+
command: bash -c .shared-ci/scripts/build-worker.sh
66+
<<: *common
67+
artifact_paths:
68+
- logs/**/*
69+
- workers/unity/build/worker/**/*
70+
env:
71+
WORKER_TYPE: "MobileClient"
72+
BUILD_ENVIRONMENT: "local"
73+
BUILD_TARGET_FILTER: "ios"
74+
SCRIPTING_BACKEND: "il2cpp"
6275

6376
- label: "build UnityClient mono"
6477
command: bash -c .shared-ci/scripts/build-worker.sh
@@ -67,8 +80,8 @@ steps:
6780
- logs/**/*
6881
env:
6982
WORKER_TYPE: "UnityClient"
70-
BUILD_TARGET: "cloud"
71-
SCRIPTING_TYPE: "mono"
83+
BUILD_ENVIRONMENT: "cloud"
84+
SCRIPTING_BACKEND: "mono"
7285

7386
- label: "build UnityClient il2cpp"
7487
command: bash -c .shared-ci/scripts/build-worker.sh
@@ -77,8 +90,8 @@ steps:
7790
- logs/**/*
7891
env:
7992
WORKER_TYPE: "UnityClient"
80-
BUILD_TARGET: "local"
81-
SCRIPTING_TYPE: "il2cpp"
93+
BUILD_ENVIRONMENT: "local"
94+
SCRIPTING_BACKEND: "il2cpp"
8295

8396
- label: "build UnityGameLogic mono"
8497
command: bash -c .shared-ci/scripts/build-worker.sh
@@ -87,5 +100,5 @@ steps:
87100
- logs/**/*
88101
env:
89102
WORKER_TYPE: "UnityGameLogic"
90-
BUILD_TARGET: "cloud"
91-
SCRIPTING_TYPE: "mono"
103+
BUILD_ENVIRONMENT: "cloud"
104+
SCRIPTING_BACKEND: "mono"

.buildkite/release-qa.steps.yaml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,29 @@ common: &common
3535
# These are then relied on to have stable names by other things, so once named, please beware renaming has consequences.
3636

3737
steps:
38-
- label: "build :android: and iOS"
38+
- label: "build :android:"
3939
command: bash -c .shared-ci/scripts/build-worker.sh
4040
<<: *common
4141
artifact_paths:
4242
- logs/**/*
4343
- build/assembly/**/*
4444
env:
4545
WORKER_TYPE: "MobileClient"
46-
BUILD_TARGET: "local"
47-
SCRIPTING_TYPE: "mono"
46+
BUILD_ENVIRONMENT: "cloud"
47+
BUILD_TARGET_FILTER: "android"
48+
SCRIPTING_BACKEND: "mono"
49+
50+
- label: "build iOS"
51+
command: bash -c .shared-ci/scripts/build-worker.sh
52+
<<: *common
53+
artifact_paths:
54+
- logs/**/*
55+
- build/assembly/**/*
56+
env:
57+
WORKER_TYPE: "MobileClient"
58+
BUILD_ENVIRONMENT: "cloud"
59+
BUILD_TARGET_FILTER: "ios"
60+
SCRIPTING_BACKEND: "il2cpp"
4861

4962
- label: "build UnityClient mono"
5063
command: bash -c .shared-ci/scripts/build-worker.sh
@@ -54,8 +67,8 @@ steps:
5467
- build/assembly/**/*
5568
env:
5669
WORKER_TYPE: "UnityClient"
57-
BUILD_TARGET: "cloud"
58-
SCRIPTING_TYPE: "mono"
70+
BUILD_ENVIRONMENT: "cloud"
71+
SCRIPTING_BACKEND: "mono"
5972

6073
- label: "build UnityGameLogic mono"
6174
command: bash -c .shared-ci/scripts/build-worker.sh
@@ -65,8 +78,8 @@ steps:
6578
- build/assembly/**/*
6679
env:
6780
WORKER_TYPE: "UnityGameLogic"
68-
BUILD_TARGET: "cloud"
69-
SCRIPTING_TYPE: "mono"
81+
BUILD_ENVIRONMENT: "cloud"
82+
SCRIPTING_BACKEND: "mono"
7083
- wait
7184
- label: Launch deployments
7285
command: bash -c ci/launch.sh

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
## Unreleased
44

5+
### Breaking Changes
6+
7+
- Renamed the `buildTarget` command line argument to `buildEnvironment`. [#1012](https://github.com/spatialos/gdk-for-unity/pull/1012)
8+
59
### Added
610

711
- Added the `LinkedGameObjectMap` class for finding the `GameObject`(s) linked with a specified `EntityId`. [#1013](https://github.com/spatialos/gdk-for-unity/pull/1013)
812
- 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;`
13+
- 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)
14+
- Use the `buildTargetFilter` command line argument to pass in a comma delimited list of build targets to filter for. For example, `+buildTargetFilter win,macos`.
915

1016
### Internal
1117

@@ -39,7 +45,7 @@
3945
- `List<LoginTokenDetails> GetDevelopmentLoginTokens(string workerType, string playerIdentityToken)`
4046
- The `WorkerConnector` has also had the following changes:
4147
- The `public Worker Worker;` field is now the `public WorkerInWorld Worker;` field.
42-
- The `public async Task Connect(string workerType, ILogDispatcher logger)` method is now `protected async Task Connect(IConnectionHandlerBuilder builder, ILogDispatcher logger)`.
48+
- The `public async Task Connect(string workerType, ILogDispatcher logger)` method is now `protected async Task Connect(IConnectionHandlerBuilder builder, ILogDispatcher logger)`.
4349
- The `Worker` class has had the following changes:
4450
- The `public Connection Connection { get; private set; }` property has been removed.
4551
- The `public World World { get; private set; }` property has been moved to the `WorkerInWorld` class.

UPGRADE_GUIDE.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Upgrade Guide
22

3+
## From `0.2.4` to `0.2.5`
4+
5+
### Build system changes
6+
7+
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:
8+
9+
```bash
10+
Unity.exe <arguments> \
11+
-executeMethod "Improbable.Gdk.BuildSystem.WorkerBuilder.Build" \
12+
+buildWorkerTypes "UnityGameLogic" \
13+
+buildTarget "cloud" \
14+
+scriptingBackend "mono"
15+
```
16+
17+
You must change this to:
18+
19+
```bash
20+
Unity.exe <arguments> \
21+
-executeMethod "Improbable.Gdk.BuildSystem.WorkerBuilder.Build" \
22+
+buildWorkerTypes "UnityGameLogic" \
23+
+buildEnvironment "cloud" \
24+
+scriptingBackend "mono"
25+
```
26+
327
## From `0.2.3` to `0.2.4`
428

529
### General changes
@@ -129,15 +153,15 @@ Previously, there were a set of virtual methods on the `WorkerConnector` class t
129153
| Method | Class |
130154
| --- | --- |
131155
| `SelectDeploymentName(DeploymentList deployments)` | `LocatorFlow` |
132-
| `GetPlayerId()` | `AlphaLocatorFlow` |
133-
| `GetDisplayName()` | `AlphaLocatorFlow` |
156+
| `GetPlayerId()` | `AlphaLocatorFlow` |
157+
| `GetDisplayName()` | `AlphaLocatorFlow` |
134158
| `string SelectLoginToken(List<LoginTokenDetails> loginTokens)` | `AlphaLocatorFlow` |
135159
| `string GetDevelopmentPlayerIdentityToken(string authToken, string playerId, string displayName)` | `AlphaLocatorFlow` |
136160
| `List<LoginTokenDetails> GetDevelopmentLoginTokens(string workerType, string playerIdentityToken)` | `AlphaLocatorFlow` |
137161

138162
#### Mobile setup
139163

140-
The mobile setup is a little bit special. There are built-in initializers for the connection flows and connection parameters in the mobile package. These replicate the behaviour of the `DefaultMobileWorkerConnector`.
164+
The mobile setup is a little bit special. There are built-in initializers for the connection flows and connection parameters in the mobile package. These replicate the behaviour of the `DefaultMobileWorkerConnector`.
141165

142166
The `MobileConnectionFlowInitializer` constructor takes any number of `IMobileSettingsProvider` objects and will use these to get mobile specific settings (such as the host IP address for the receptionist). The order in which you provide these objects _does matter_ as the first one to return a valid setting for each setting will be used. We provide two implementations of this interface in the mobile package, one for command line arguments and one for player prefs.
143167

ci/build-test.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

ci/docs-lint.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ cd "$(dirname "$0")/../"
66
ci/bootstrap.sh
77

88
source .shared-ci/scripts/pinned-tools.sh
9-
source .shared-ci/scripts/profiling.sh
109

11-
markStartOfBlock "Running Docs Linter"
12-
dotnet run -p .shared-ci/tools/DocsLinter/DocsLinter.csproj
13-
markEndOfBlock "Running Docs Linter"
10+
echo "Running Docs Linter"
11+
dotnet run -p .shared-ci/tools/DocsLinter/DocsLinter.csproj

ci/launch.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e -u -x -o pipefail
44

55
cd "$(dirname "$0")/../"
66

7-
source ".shared-ci/scripts/profiling.sh"
87
source ".shared-ci/scripts/pinned-tools.sh"
98

109
if [[ -n "${BUILDKITE-}" ]]; then
@@ -17,7 +16,7 @@ fi
1716

1817
uploadAssembly "${ASSEMBLY_PREFIX}" "${PROJECT_NAME}"
1918

20-
markStartOfBlock "Launching deployment"
19+
echo "Launching deployment"
2120

2221
spatial cloud launch "${ASSEMBLY_NAME}" cloud_launch.json "${ASSEMBLY_NAME}" --snapshot=snapshots/default.snapshot | tee -a ./launch.log
2322

@@ -31,5 +30,3 @@ if [[ -n "${BUILDKITE-}" ]]; then
3130
buildkite-agent annotate --style "warning" "Could not parse deployment URL from launch log."
3231
fi
3332
fi
34-
35-
markEndOfBlock "Launching deployment"

ci/shared-ci.pinned

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
02385564bd29e3cc566951f7e38a1e9530846b7e
1+
e056fe31826b64dbdf51b6974ba36d9908e32f9e

ci/test.sh

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ cd "$(dirname "$0")/../"
66
ci/bootstrap.sh
77

88
source .shared-ci/scripts/pinned-tools.sh
9-
source .shared-ci/scripts/profiling.sh
109

1110
if isDocsBranch; then
1211
exit 0
1312
fi
1413

15-
markStartOfBlock "$0"
14+
echo "$0"
1615

1716
#####
1817
# Setup variables
1918
#####
20-
markStartOfBlock "Setup variables"
19+
echo "Setup variables"
2120
PROJECT_DIR="$(pwd)"
2221
mkdir -p "${PROJECT_DIR}/logs/"
2322

@@ -31,22 +30,18 @@ rm "${CODE_GENERATOR_TEST_RESULTS_FILE}" \
3130
"${EDITMODE_TEST_RESULTS_FILE}" \
3231
"${PLAYMODE_TEST_RESULTS_FILE}"
3332

34-
markEndOfBlock "Setup variables"
35-
3633
cleanUnity "$(pwd)/workers/unity"
3734
cleanUnity "$(pwd)/test-project"
3835

39-
markStartOfBlock "Code Generator Testing"
36+
echo "Code Generator Testing"
4037

4138
dotnet test --logger:"nunit;LogFilePath=${CODE_GEN_LIB_TEST_RESULTS_FILE}" workers/unity/Packages/com.improbable.gdk.tools/.CodeGenerator/CodeGeneration/CodeGeneration.csproj
4239
CODE_GEN_LIB_TEST_RESULT=$?
4340

4441
dotnet test --logger:"nunit;LogFilePath=${CODE_GENERATOR_TEST_RESULTS_FILE}" workers/unity/Packages/com.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/GdkCodeGenerator.csproj
4542
CODE_GENERATOR_TEST_RESULT=$?
4643

47-
markEndOfBlock "Code Generator Testing"
48-
49-
markStartOfBlock "Editmode Testing"
44+
echo "Editmode Testing"
5045

5146
pushd "workers/unity"
5247
dotnet run -p "${PROJECT_DIR}/.shared-ci/tools/RunUnity/RunUnity.csproj" -- \
@@ -60,11 +55,9 @@ pushd "workers/unity"
6055
EDITMODE_TEST_RESULT=$?
6156
popd
6257

63-
markEndOfBlock "Editmode Testing"
64-
6558
cleanUnity "$(pwd)/workers/unity"
6659

67-
markStartOfBlock "Playmode Testing"
60+
echo "Playmode Testing"
6861

6962
pushd "workers/unity"
7063
dotnet run -p "${PROJECT_DIR}/.shared-ci/tools/RunUnity/RunUnity.csproj" -- \
@@ -78,10 +71,9 @@ pushd "workers/unity"
7871
PLAYMODE_TEST_RESULT=$?
7972
popd
8073

81-
markEndOfBlock "Playmode Testing"
74+
echo "Generated Code Testing"
8275

8376
pushd "test-project"
84-
markStartOfBlock "Generated Code Testing"
8577
dotnet run -p "${PROJECT_DIR}/.shared-ci/tools/RunUnity/RunUnity.csproj" -- \
8678
-batchmode \
8779
-projectPath "${PROJECT_DIR}/test-project" \
@@ -93,8 +85,6 @@ markStartOfBlock "Generated Code Testing"
9385
TEST_PROJECT_EDITMODE_TEST_RESULT=$?
9486
popd
9587

96-
markEndOfBlock "Generated Code Testing"
97-
9888
if [ $CODE_GEN_LIB_TEST_RESULT -ne 0 ]; then
9989
>&2 echo "Code Generator Tests failed. Please check the file ${CODE_GEN_LIB_TEST_RESULTS_FILE} for more information."
10090
fi
@@ -115,8 +105,6 @@ if [ $TEST_PROJECT_EDITMODE_TEST_RESULT -ne 0 ]; then
115105
>&2 echo "Test Project Editmode Tests failed. Please check the file ${TEST_PROJECT_EDITMODE_TEST_RESULTS_FILE} for more information."
116106
fi
117107

118-
markEndOfBlock "$0"
119-
120108
cleanUnity "$(pwd)/workers/unity"
121109
cleanUnity "$(pwd)/test-project"
122110

0 commit comments

Comments
 (0)