6
6
using Unity . BuildTools ;
7
7
using System . Collections . Generic ;
8
8
using System . Text ;
9
+ using Bee . Stevedore . Program ;
9
10
10
11
namespace BuildProgram
11
12
{
@@ -43,10 +44,11 @@ internal static void Main()
43
44
44
45
foreach ( var item in artifactNameIdFilesDictionary )
45
46
{
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 ;
48
50
var artifactFiles = item . Value ;
49
- DownloadAndCopyArtifact ( artifactId , artifactName , artifactFiles , monoBuildDeps , stevedoreArtifactsDir ) ;
51
+ DownloadAndCopyArtifact ( artifactId , artifactName , repoName , artifactFiles , monoBuildDeps , stevedoreArtifactsDir ) ;
50
52
}
51
53
}
52
54
else
@@ -55,9 +57,9 @@ internal static void Main()
55
57
}
56
58
}
57
59
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 )
59
61
{
60
- var artifact = StevedoreArtifact . Testing ( artifactId ) ;
62
+ var artifact = new StevedoreArtifact ( repoName , new ArtifactId ( artifactId ) ) ;
61
63
Backend . Current . Register ( artifact ) ;
62
64
63
65
var inputs = new List < NPath > ( ) ;
@@ -125,19 +127,22 @@ private static bool IsRunningOnBuildMachine()
125
127
# Dependencoes to pull down from Stevedore. Please follow the following format:
126
128
# name : <stevedore artifact name>
127
129
# id : <stevedore artifact id>
130
+ # repo : <stevedore repo name (can be testing/public/unityinternal)>
128
131
# files : <folder and/or comma-separated list of files downloaded and unpacked>
129
132
130
133
name: 7z
131
134
id: 7z/9df1e3b3b120_12ed325f6a47f0e5cebc247dbe9282a5da280d392cce4e6c9ed227d57ff1e2ff.7z
135
+ repo: testing
132
136
files : 7z
133
137
134
138
name: libgdiplus
135
139
id : libgdiplus/9df1e3b3b120_4cf7c08770db93922f54f38d2461b9122cddc898db58585864446e70c5ad3057.7z
140
+ repo: public
136
141
files : libgdiplus,lib2
137
142
*/
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 )
139
144
{
140
- var artifactNameIdFilesDictionary = new Dictionary < KeyValuePair < string , string > , List < NPath > > ( ) ;
145
+ var artifactNameIdFilesDictionary = new Dictionary < Tuple < string , string , string > , List < NPath > > ( ) ;
141
146
142
147
var fileStream = new FileStream ( buildDependenciesConfigFile , FileMode . Open , FileAccess . Read ) ;
143
148
using ( var streamReader = new StreamReader ( fileStream , Encoding . UTF8 ) )
@@ -152,6 +157,7 @@ private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildD
152
157
{
153
158
var name = "" ;
154
159
var id = "" ;
160
+ var repoName = "" ;
155
161
var files = "" ;
156
162
157
163
//read name
@@ -161,13 +167,19 @@ private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildD
161
167
if ( ( line = streamReader . ReadLine ( ) ) != null )
162
168
id = line . Split ( ':' ) [ 1 ] . Trim ( ) ;
163
169
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") ;
165
177
166
178
//read comma separated folder/files list
167
179
if ( ( line = streamReader . ReadLine ( ) ) != null )
168
180
files = line . Split ( ':' ) [ 1 ] . Trim ( ) ;
169
181
else
170
- throw new Exception ( $ ">>> Invalid { buildDependenciesConfigFile } ") ;
182
+ throw new Exception ( $ ">>> Invalid { buildDependenciesConfigFile } , files do not exist ") ;
171
183
172
184
var filesList = new List < NPath > ( ) ;
173
185
if ( ! string . IsNullOrEmpty ( files ) )
@@ -181,7 +193,7 @@ private static Dictionary<KeyValuePair<string, string>, List<NPath>> ParseBuildD
181
193
{
182
194
throw new Exception ( $ ">>> Invalid { buildDependenciesConfigFile } ") ;
183
195
}
184
- artifactNameIdFilesDictionary . Add ( new KeyValuePair < string , string > ( name , id ) , filesList ) ;
196
+ artifactNameIdFilesDictionary . Add ( new Tuple < string , string , string > ( name , id , repoName ) , filesList ) ;
185
197
}
186
198
}
187
199
}
0 commit comments