Skip to content

Commit c8b8ec1

Browse files
authored
Merge pull request #5 from Unity-Technologies/fixes/environment
Add Unity application contents path to the default Environment initialization
2 parents f994b1d + d6b51e3 commit c8b8ec1

26 files changed

+308
-146
lines changed

.yamato/build.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
build:
44
name: Build
55
agent:
6-
type: Unity::VM
7-
image: core-kaunas/win10-vs2017-dotnetcore:latest
8-
flavor: m1.large
6+
type: {{ build_agent_type }}
7+
image: {{ build_agent_image }}
8+
flavor: {{ build_agent_flavor }}
99
variables:
1010
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1111

@@ -15,7 +15,15 @@ build:
1515
- |
1616
set RELEASE=0
1717
if "x%GIT_TAG%"!==!"x" set RELEASE=1
18-
if "%RELEASE%"=="1" (pack -r -b -p -u) else (pack -r -b -u)
18+
if "%RELEASE%"=="1" (build -r -p) else (build -r)
19+
- |
20+
set RELEASE=0
21+
if "x%GIT_TAG%"!==!"x" set RELEASE=1
22+
if "%RELEASE%"=="1" (test -r -p) else (test -r)
23+
- |
24+
set RELEASE=0
25+
if "x%GIT_TAG%"!==!"x" set RELEASE=1
26+
if "%RELEASE%"=="1" (pack -r -p -u) else (pack -r -u)
1927
2028
artifacts:
2129
nuget:
@@ -31,6 +39,7 @@ build:
3139
tests:
3240
paths:
3341
- "build/tests/bin/**/*"
42+
- "tests/**/TestResults/*"
3443
sources:
3544
paths:
3645
- "build/upm/**/*"

.yamato/publish.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
publish_nuget:
44
name: Publish Nuget
55
agent:
6-
type: Unity::VM
7-
image: core-kaunas/win10-vs2017-dotnetcore:latest
8-
flavor: m1.large
6+
type: {{ build_agent_type }}
7+
image: {{ build_agent_image }}
8+
flavor: {{ build_agent_flavor }}
99
interpreter: powershell
1010
skip_checkout: true
1111
variables:
12-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1312
PUBLISH_URL: https://artifactory.internal.unity3d.com/api/nuget/core-utilities
1413

1514
commands:
@@ -24,16 +23,16 @@ publish_nuget:
2423
publish_npm:
2524
name: Publish Npm
2625
agent:
27-
type: Unity::VM
28-
image: core-kaunas/win10-vs2017-dotnetcore:latest
29-
flavor: m1.large
26+
type: {{ upm_agent_type }}
27+
image: {{ upm_agent_image }}
28+
flavor: {{ upm_agent_flavor }}
3029
skip_checkout: true
3130
variables:
32-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
3331
PUBLISH_URL: https://artifactory.internal.unity3d.com/api/npm/core-npm
32+
AUTH_URL: https://artifactory.internal.unity3d.com/api/npm/auth
3433

3534
commands:
36-
- curl -u%ARTIFACTORY% %PUBLISH_URL%/auth/artifactory > %USERPROFILE%\.npmrc
35+
- curl -u%ARTIFACTORY% %AUTH_URL%/auth > %USERPROFILE%\.npmrc
3736
- for /f "delims=" %%d in ('dir /b "upm-ci~\packages\*.tgz"') do (call npm publish "upm-ci~\packages\%%d" --quiet --registry %PUBLISH_URL%)
3837

3938
dependencies:
@@ -43,12 +42,10 @@ publish_npm:
4342
publish_packman:
4443
name: Publish to Candidates
4544
agent:
46-
type: Unity::VM
47-
image: core-kaunas/win10-vs2017-dotnetcore:latest
48-
flavor: m1.large
45+
type: {{ upm_agent_type }}
46+
image: {{ upm_agent_image }}
47+
flavor: {{ upm_agent_flavor }}
4948
skip_checkout: true
50-
variables:
51-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
5249

5350
commands:
5451
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm

.yamato/test.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{% metadata_file .yamato_config/config.yml %}
22
---
3-
{% for package in packages %}
4-
{% for editor in editors %}
5-
{% for platform in platforms %}
6-
test_{{ package.safename }}_{{ platform.name }}_{{ editor.version }}:
7-
name : Test {{ package.name }} {{ editor.version }} on {{ platform.name }}
3+
{% for editor in test_editors %}
4+
{% for platform in test_platforms %}
5+
test_{{ platform.name }}_{{ editor.version }}:
6+
name : Test {{ editor.version }} on {{ platform.name }}
87
agent:
98
type: {{ platform.type }}
109
image: {{ platform.image }}
@@ -13,9 +12,10 @@ test_{{ package.safename }}_{{ platform.name }}_{{ editor.version }}:
1312
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1413

1514
commands:
16-
- |
17-
npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
18-
upm-ci package test --package-path build\upm\{{ package.name }} -u {{editor.version}}
15+
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
16+
{% for package in packages %}
17+
- upm-ci package test --package-path build\upm\{{ package.name }} -u {{editor.version}}
18+
{% endfor %}
1919

2020
dependencies:
2121
- .yamato/build.yml#build
@@ -26,16 +26,13 @@ test_{{ package.safename }}_{{ platform.name }}_{{ editor.version }}:
2626
- "upm-ci~/test-results/**/*"
2727
{% endfor %}
2828
{% endfor %}
29-
{% endfor %}
3029

3130
test_trigger:
3231
name: Build and Test All
3332
dependencies:
34-
{% for package in packages %}
35-
{% for editor in editors %}
36-
{% for platform in platforms %}
37-
- .yamato/test.yml#test_{{ package.safename }}_{{platform.name}}_{{editor.version}}
38-
{% endfor %}
33+
{% for editor in test_editors %}
34+
{% for platform in test_platforms %}
35+
- .yamato/test.yml#test_{{platform.name}}_{{editor.version}}
3936
{% endfor %}
4037
{% endfor %}
4138
triggers:

.yamato_config/config.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
platforms:
1+
build_agent_type: Unity::VM
2+
build_agent_image: core-kaunas/win10-vs2017-dotnetcore:latest
3+
build_agent_flavor: m1.large
4+
5+
upm_agent_type: Unity::VM
6+
upm_agent_image: package-ci/win10:stable
7+
upm_agent_flavor: b1.large
8+
9+
test_platforms:
210
- name: win
311
type: Unity::VM
4-
image: core-kaunas/win10-vs2017-dotnetcore:latest
5-
flavor: m1.large
12+
image: package-ci/win10:stable
13+
flavor: b1.large
614
# - name: mac
715
# type: Unity::VM::osx
816
# image: buildfarm/mac:stable
@@ -12,9 +20,9 @@ platforms:
1220
# image: yamato/ubuntu-18.04-dotnet:latest
1321
# flavor: b1.small
1422

15-
editors:
23+
test_editors:
1624
- version: 2019.2
1725

1826
packages:
1927
- name: com.unity.editor.tasks
20-
safename: com_unity_editor_tasks
28+
safename: com_unity_editor_tasks

Directory.Build.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
43
<LangVersion>7.3</LangVersion>
54
<GenerateDocumentationFile>false</GenerateDocumentationFile>
6-
<RepoRoot Condition=" '$(RepoRoot)' == '' ">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</RepoRoot>
75
</PropertyGroup>
86
</Project>

build.cmd

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,43 @@
11
@echo off
22
setlocal
33

4-
SET CONFIGURATION=Debug
4+
SET CONFIGURATION=Release
55
SET PUBLIC=""
6+
SET BUILD=0
7+
set UPM=0
68

79
:loop
810
IF NOT "%1"=="" (
911
IF "%1"=="-p" (
1012
SET PUBLIC=/p:PublicRelease=true
1113
)
14+
IF "%1"=="--public" (
15+
SET PUBLIC=/p:PublicRelease=true
16+
)
17+
IF "%1"=="-b" (
18+
SET BUILD=1
19+
)
20+
IF "%1"=="--build" (
21+
SET BUILD=1
22+
)
23+
IF "%1"=="-d" (
24+
SET CONFIGURATION=Debug
25+
)
26+
IF "%1"=="--debug" (
27+
SET CONFIGURATION=Debug
28+
)
1229
IF "%1"=="-r" (
1330
SET CONFIGURATION=Release
1431
)
32+
IF "%1"=="--release" (
33+
SET CONFIGURATION=Release
34+
)
35+
IF "%1"=="-u" (
36+
SET UPM=1
37+
)
38+
IF "%1"=="--upm" (
39+
SET UPM=1
40+
)
1541
SHIFT
1642
GOTO :loop
1743
)

build.sh

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ if [[ -e "/c/" ]]; then
88
OS="Windows"
99
fi
1010

11-
CONFIGURATION=""
11+
CONFIGURATION=Release
1212
PUBLIC=""
13+
BUILD=0
14+
UPM=0
1315

1416
while (( "$#" )); do
1517
case "$1" in
@@ -25,30 +27,27 @@ while (( "$#" )); do
2527
PUBLIC="/p:PublicRelease=true"
2628
shift
2729
;;
30+
-b|--build)
31+
BUILD=1
32+
shift
33+
;;
34+
-u|--upm)
35+
UPM=1
36+
shift
37+
;;
2838
-*|--*=) # unsupported flags
2939
echo "Error: Unsupported flag $1" >&2
3040
exit 1
3141
;;
32-
*) # preserve positional arguments
33-
if [[ x"$CONFIGURATION" != x"" ]]; then
34-
echo "Invalid argument $1"
35-
exit -1
36-
fi
37-
CONFIGURATION="$1"
38-
shift
39-
;;
4042
esac
4143
done
4244

43-
if [[ x"$CONFIGURATION" == x"" ]]; then
44-
CONFIGURATION="Debug"
45-
fi
46-
4745
if [[ x"$OS" == x"Windows" && x"$PUBLIC" != x"" ]]; then
4846
PUBLIC="/$PUBLIC"
4947
fi
5048

5149
pushd $DIR >/dev/null 2>&1
50+
dotnet build-server shutdown >/dev/null 2>&1 || true
5251
dotnet restore
5352
dotnet build --no-restore -c $CONFIGURATION $PUBLIC
5453
popd >/dev/null 2>&1

common/packageversionfiles.targets

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- Prevent this from being imported multiple times -->
4+
<Import Condition="'$(PropsIncluded)' == ''" Project="packaging.props" />
5+
6+
<ItemGroup>
7+
<VersionFiles Include="$(IntermediateOutputPath)\$(AssemblyName).Version$(DefaultLanguageSourceExtension)" />
8+
</ItemGroup>
9+
10+
<Target Name="CopyVersionFilesToPackage"
11+
AfterTargets="AfterBuild"
12+
Inputs="@(VersionFiles)"
13+
Outputs="@(VersionFiles->'$(PublishTo)$(PackageName)$(PackageSubFolder)Version%(Extension)')"
14+
>
15+
<MakeDir Directories="$(PublishTo)$(PackageName)$(PackageSubFolder)" />
16+
<Copy SkipUnchangedFiles="true"
17+
SourceFiles="@(VersionFiles)"
18+
DestinationFiles="@(VersionFiles->'$(PublishTo)$(PackageName)$(PackageSubFolder)Version%(Extension)')"
19+
/>
20+
</Target>
21+
22+
</Project>

common/packaging.props

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4+
<PropsIncluded>true</PropsIncluded>
45
<PublishTo Condition="'$(PublishTo)' == '' ">$(RepoRoot)build\packages\</PublishTo>
5-
<CurrentFullPath>$(MSBuildProjectDirectory)</CurrentFullPath>
6-
<PackageSourceRoot Condition="'$(PackageSourceRoot)' == ''">$(MSBuildProjectDirectory)\..\</PackageSourceRoot>
6+
<PackageSourceRoot Condition="'$(PackageSourceRoot)' == ''">$(MSBuildProjectDirectory)\..\..\</PackageSourceRoot>
77
<PackageSourceRootFull>$([System.IO.Path]::GetFullPath($(PackageSourceRoot)))</PackageSourceRootFull>
88

99
<TmpPackageName>$([System.IO.Path]::GetDirectoryName($(PackageSourceRootFull)))</TmpPackageName>
1010
<PackageName Condition="'$(PackageName)' == '' ">$([System.IO.Path]::GetFileName($(TmpPackageName)))</PackageName>
11+
<PackageTestName>$(PackageName).tests</PackageTestName>
1112

13+
<CurrentFullPath>$(MSBuildProjectDirectory)</CurrentFullPath>
1214
<PackageSubFolder>\$(CurrentFullPath.Substring($(PackageSourceRootFull.Length)))\</PackageSubFolder>
13-
<PackageTestName>$(PackageName).tests</PackageTestName>
1415

1516
<NpmVersionSuffix>-preview</NpmVersionSuffix>
1617
</PropertyGroup>
17-
18-
<ItemGroup>
19-
<None Include="$(RepoRoot)icon.png" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="icon.png" />
20-
</ItemGroup>
21-
2218
</Project>

0 commit comments

Comments
 (0)