Skip to content

Commit 9e4473a

Browse files
author
Thibault Brocherieux
committed
Adding icudtl download
1 parent aa8ed97 commit 9e4473a

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

example/simpleDemo/embedderDownloader.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,31 +244,38 @@ func main() {
244244
}
245245

246246
var platform = "undefined"
247-
var downloadURL = ""
247+
var downloadShareLibraryURL = ""
248+
downloadIcudtlURL := fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter//%s/artifacts.zip",platform)
248249

249250
// Retrieve the OS and set variable to retrieve correct flutter embedder
250251
switch runtime.GOOS {
251252
case "darwin":
252253
platform = "darwin-x64"
253-
downloadURL = fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%s/%s/FlutterEmbedder.framework.zip", hashResponse.Items[0].Sha, platform)
254-
254+
downloadShareLibraryURL = fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%s/%s/FlutterEmbedder.framework.zip", hashResponse.Items[0].Sha, platform)
255255
case "linux":
256256
platform = "linux-x64"
257-
downloadURL = fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%s/%s/%s-embedder", hashResponse.Items[0].Sha, platform, platform)
257+
downloadShareLibraryURL = fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%s/%s/%s-embedder", hashResponse.Items[0].Sha, platform, platform)
258258

259259
case "windows":
260260
platform = "windows-x64"
261-
downloadURL = fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%s/%s/%s-embedder", hashResponse.Items[0].Sha, platform, platform)
261+
downloadShareLibraryURL = fmt.Sprintf("https://storage.googleapis.com/flutter_infra/flutter/%s/%s/%s-embedder", hashResponse.Items[0].Sha, platform, platform)
262262

263263
default:
264264
log.Fatal("OS not supported")
265265
}
266266

267-
err3 := downloadFile(dir + "/.build/temp.zip", downloadURL)
268-
if err3 != nil {
267+
err3 := downloadFile(dir + "/.build/temp.zip", downloadShareLibraryURL)
268+
if err != nil {
269269
log.Fatal(err3)
270270
} else{
271-
fmt.Printf("Downloaded embedder for %s platform, matching version : %s\n", platform, hashResponse.Items[0].Sha)
271+
fmt.Printf("Downloaded share library for %s platform, matching version : %s\n", platform, hashResponse.Items[0].Sha)
272+
}
273+
274+
err4 := downloadFile(dir + "/.build/artifact.zip", downloadIcudtlURL)
275+
if err != nil {
276+
log.Fatal(err4)
277+
} else{
278+
fmt.Printf("Downloaded artifact for %s platform.")
272279
}
273280

274281
_, err = unzip(".build/temp.zip", dir + "/.build/")

0 commit comments

Comments
 (0)