Skip to content

Commit cedef20

Browse files
authored
Merge pull request #1092 from Unity-Technologies/stevedore-repo-name
Add stevedore repo name to config file
2 parents 80dbc48 + 3d962d3 commit cedef20

File tree

2 files changed

+41
-14
lines changed

2 files changed

+41
-14
lines changed

external/buildscripts/Build.bee.cs

+22-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Unity.BuildTools;
77
using System.Collections.Generic;
88
using System.Text;
9+
using Bee.Stevedore.Program;
910

1011
namespace BuildProgram
1112
{
@@ -43,10 +44,11 @@ internal static void Main()
4344

4445
foreach (var item in artifactNameIdFilesDictionary)
4546
{
46-
var artifactName = item.Key.Key;
47-
var artifactId = item.Key.Value;
47+
var artifactName = item.Key.Item1;
48+
var artifactId = item.Key.Item2;
49+
var repoName = item.Key.Item3;
4850
var artifactFiles = item.Value;
49-
DownloadAndCopyArtifact(artifactId, artifactName, artifactFiles, monoBuildDeps, stevedoreArtifactsDir);
51+
DownloadAndCopyArtifact(artifactId, artifactName, repoName, artifactFiles, monoBuildDeps, stevedoreArtifactsDir);
5052
}
5153
}
5254
else
@@ -55,9 +57,9 @@ internal static void Main()
5557
}
5658
}
5759

58-
private static void DownloadAndCopyArtifact(string artifactId, string artifactName, IEnumerable<NPath> artifacts, NPath monoBuildDeps, NPath stevedoreArtifactsDir)
60+
private static void DownloadAndCopyArtifact(string artifactId, string artifactName, string repoName, IEnumerable<NPath> artifacts, NPath monoBuildDeps, NPath stevedoreArtifactsDir)
5961
{
60-
var artifact = StevedoreArtifact.Testing(artifactId);
62+
var artifact = new StevedoreArtifact(repoName, new ArtifactId(artifactId));
6163
Backend.Current.Register(artifact);
6264

6365
var inputs = new List<NPath>();
@@ -125,19 +127,22 @@ private static bool IsRunningOnBuildMachine()
125127
# Dependencoes to pull down from Stevedore. Please follow the following format:
126128
# name : <stevedore artifact name>
127129
# id : <stevedore artifact id>
130+
# repo : <stevedore repo name (can be testing/public/unityinternal)>
128131
# files : <folder and/or comma-separated list of files downloaded and unpacked>
129132
130133
name: 7z
131134
id: 7z/9df1e3b3b120_12ed325f6a47f0e5cebc247dbe9282a5da280d392cce4e6c9ed227d57ff1e2ff.7z
135+
repo: testing
132136
files : 7z
133137
134138
name: libgdiplus
135139
id : libgdiplus/9df1e3b3b120_4cf7c08770db93922f54f38d2461b9122cddc898db58585864446e70c5ad3057.7z
140+
repo: public
136141
files : libgdiplus,lib2
137142
*/
138-
private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildDependenciesConfigFile(string buildDependenciesConfigFile)
143+
private static Dictionary<Tuple<string, string, string>, List<NPath>> ParseBuildDependenciesConfigFile(string buildDependenciesConfigFile)
139144
{
140-
var artifactNameIdFilesDictionary = new Dictionary<KeyValuePair<string, string>, List<NPath>>();
145+
var artifactNameIdFilesDictionary = new Dictionary<Tuple<string, string, string>, List<NPath>>();
141146

142147
var fileStream = new FileStream(buildDependenciesConfigFile, FileMode.Open, FileAccess.Read);
143148
using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
@@ -152,6 +157,7 @@ private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildD
152157
{
153158
var name = "";
154159
var id = "";
160+
var repoName = "";
155161
var files = "";
156162

157163
//read name
@@ -161,13 +167,19 @@ private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildD
161167
if ((line = streamReader.ReadLine()) != null)
162168
id = line.Split(':')[1].Trim();
163169
else
164-
throw new Exception($">>> Invalid {buildDependenciesConfigFile}");
170+
throw new Exception($">>> Invalid {buildDependenciesConfigFile}, id name does not exist");
171+
172+
//read repo name
173+
if ((line = streamReader.ReadLine()) != null)
174+
repoName = line.Split(':')[1].Trim();
175+
else
176+
throw new Exception($">>> Invalid {buildDependenciesConfigFile}, repo name does not exist");
165177

166178
//read comma separated folder/files list
167179
if ((line = streamReader.ReadLine()) != null)
168180
files = line.Split(':')[1].Trim();
169181
else
170-
throw new Exception($">>> Invalid {buildDependenciesConfigFile}");
182+
throw new Exception($">>> Invalid {buildDependenciesConfigFile}, files do not exist");
171183

172184
var filesList = new List<NPath>();
173185
if (!string.IsNullOrEmpty(files))
@@ -181,7 +193,7 @@ private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildD
181193
{
182194
throw new Exception($">>> Invalid {buildDependenciesConfigFile}");
183195
}
184-
artifactNameIdFilesDictionary.Add(new KeyValuePair<string, string>(name, id), filesList);
196+
artifactNameIdFilesDictionary.Add(new Tuple<string, string, string>(name, id, repoName), filesList);
185197
}
186198
}
187199
}
+19-4
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,75 @@
11
# Dependencoes to pull down from Stevedore. Please follow the following format:
22
# name : <stevedore artifact name>
33
# id : <stevedore artifact id>
4-
# files : <folder and/or comma-separated list of files downloaded and unpacked>
4+
# repo : <stevedore repo name (can be testing/public/unityinternal)>
5+
# files : <folder and/or comma-separated list of files downloaded and unpacked>
56

67
name : 7z
78
id: 7z/9df1e3b3b120_12ed325f6a47f0e5cebc247dbe9282a5da280d392cce4e6c9ed227d57ff1e2ff.7z
9+
repo: testing
810
files : 7z
911

1012
name : libgdiplus
1113
id : libgdiplus/9df1e3b3b120_4cf7c08770db93922f54f38d2461b9122cddc898db58585864446e70c5ad3057.7z
14+
repo: testing
1215
files : libgdiplus
1316

1417
name : MacBuildEnvironment
1518
id : MacBuildEnvironment/9df1e3b3b120_2fc8e616a2e5dfb7907fc42d9576b427e692223c266dc3bc305de4bf03714e30.7z
19+
repo: testing
1620
files : MacBuildEnvironment
1721

1822
name : mono
1923
id : mono/9df1e3b3b120_f81c172b91f45b2e045f4ba52d5f65cc54041da1527f2c854bf9db3a99495007.7z
20-
files : MacBuildEnvironment
24+
repo: testing
25+
files : mono
2126

2227
name : MonoBleedingEdge
2328
id : MonoBleedingEdge/9df1e3b3b120_ab6d2f131e6bd4fe2aacafb0f683e8fa4e1ccba35552b6fe89bf359b6ee16215.7z
29+
repo: testing
2430
files : MonoBleedingEdge
2531

2632
name : reference-assemblies
2733
id : reference-assemblies/9df1e3b3b120_bbb4750c6bf0a1784bec7d7c04b8ef5881f31f6212136e014694f3864a388886.7z
34+
repo: testing
2835
files : reference-assemblies
2936

3037
name : linux-sdk-20170609
3138
id : linux-sdk-20170609/9df1e3b3b120_9a3a0847d5b3767579e908b5a9ce050936617b1b9275a79a8b71bb3229998957.7z
39+
repo: testing
3240
files : linux-sdk-20170609
3341

3442
name : libtool-2-4-6
3543
id : libtool-2-4-6/9df1e3b3b120_50f88211570edd89e1bf344d33e416a2eb04519f54940ae72d954a5ee0b8a69c.7z
36-
files : libtool-2-4-6
44+
repo: testing
45+
files : libtool-2-4-6
3746

3847
name : texinfo-4-8
3948
id : texinfo-4-8/9df1e3b3b120_f0f8445fc0e8b8d6f52b8be4c3ff09fa59c30ff4424fe8c9bea951b9893540c9.7z
40-
files : texinfo-4-8
49+
repo: testing
50+
files : texinfo-4-8
4151

4252
name : automake-1-15
4353
id : automake-1-15/9df1e3b3b120_815e3ebf8d8bd08aa7f6ac1bbdff50d0379febba2049a5520247f7f4a1a6b3a3.7z
54+
repo: testing
4455
files : automake-1-15
4556

4657
name : autoconf-2-69
4758
id : autoconf-2-69/9df1e3b3b120_08915db7451aeafc86abedc46ef88243a1179ebaef4829ac75e5de8bfc80d0d2.7z
59+
repo: testing
4860
files : autoconf-2-69
4961

5062
name : android-ndk-r16b-darwin
5163
id : android-ndk-r16b-darwin/9df1e3b3b120_c7cda5a221dd72799b7e618597b3f8766df7183d386becb2785631c2d3ac0d75.7z
64+
repo: testing
5265
files : android-ndk-r16b-darwin
5366

5467
name : android-ndk-r16b-linux
5568
id : android-ndk-r16b-linux/9df1e3b3b120_fbabd18208d82cbc810266e8b566bb0ea4e1e438de38d450a92deaa3e23757b6.7z
69+
repo: testing
5670
files : android-ndk-r16b-linux
5771

5872
name : android-ndk-r16b-windows
5973
id : android-ndk-r16b-windows/9df1e3b3b120_403e0d58eabae03f0d9e8d1d2cea2dbf1d14c380c3d1c7eeb6e8c60ffc15e1b8.7z
74+
repo: testing
6075
files : android-ndk-r16b-windows

0 commit comments

Comments
 (0)