From 10789c8a05f3f9e873b4e4f46f87c8d6714ff2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L!=CE=B5sA=CE=BC=CE=B5r?= Date: Tue, 22 Oct 2019 22:56:20 +0800 Subject: [PATCH] v1.1.0 Release --- .vscode/launch.json | 18 +- Gopkg.lock | 17 - Gopkg.toml | 34 - Makefile | 8 +- NetCoreBeautyNuget/Beauty.targets | 9 +- NetCoreBeautyNuget/NetCoreBeauty.nuspec | 2 +- .../NetCoreBeautyTest.csproj | 10 +- README.md | 10 +- assets/runtime.compatibility.json | 4451 ----------------- assets/runtime.supported.json | 6 - src/log/log.go | 60 + src/main/beauty.go | 463 +- src/main/bindata.go | 269 - src/manager/manager.go | 488 ++ src/util/util.go | 45 + 15 files changed, 828 insertions(+), 5062 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml delete mode 100644 assets/runtime.compatibility.json delete mode 100644 assets/runtime.supported.json create mode 100644 src/log/log.go delete mode 100644 src/main/bindata.go create mode 100644 src/manager/manager.go create mode 100644 src/util/util.go diff --git a/.vscode/launch.json b/.vscode/launch.json index 048f288..f221444 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,9 +10,21 @@ "env": {}, "cwd": "${workspaceFolder}", "args": [ - "./test/", - "libraries", - ] + "--gitcdn", + "https://github.com/nulastudio/HostFXRPatcher", + // "https://gitee.com/liesauer/HostFXRPatcher", + "--loglevel=Info", + "--nopatch=False", + "./test/", + "runtimes", + ], + "dlvLoadConfig": { + "followPointers": true, + "maxVariableRecurse": 1, + "maxStringLen": 1024, + "maxArrayValues": 1000, + "maxStructFields": -1 + } } ] } \ No newline at end of file diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 5799bba..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,17 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:b520b55fc1146c5b0eea03b07233f7a3d4a9be985c037c91ea6b82ecb81bd521" - name = "github.com/bitly/go-simplejson" - packages = ["."] - pruneopts = "UT" - revision = "aabad6e819789e569bd6aabf444c935aa9ba1e44" - version = "v0.5.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = ["github.com/bitly/go-simplejson"] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 5c29f8d..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,34 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" -# -# [prune] -# non-go = false -# go-tests = true -# unused-packages = true - - -[[constraint]] - name = "github.com/bitly/go-simplejson" - version = "0.5.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/Makefile b/Makefile index 9363de0..d3f3bbd 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,13 @@ BUILD_FLAGS=-ldflags="-s -w" build-all: build-win-x86 build-win-x64 build-linux-x64 build-osx-x64 build-win-x86: - CGO_ENABLED=0 GOOS=windows GOARCH=386 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_WIN_X86) ./src/main/beauty.go ./src/main/bindata.go + CGO_ENABLED=0 GOOS=windows GOARCH=386 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_WIN_X86) github.com/nulastudio/NetCoreBeauty/src/main build-win-x64: - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_WIN_X64) ./src/main/beauty.go ./src/main/bindata.go + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_WIN_X64) github.com/nulastudio/NetCoreBeauty/src/main build-linux-x64: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_LINUX_X64) ./src/main/beauty.go ./src/main/bindata.go + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_LINUX_X64) github.com/nulastudio/NetCoreBeauty/src/main build-osx-x64: - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_MAC_X64) ./src/main/beauty.go ./src/main/bindata.go + CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAGS) -o ./$(OUTPUT)/$(BINARY_MAC_X64) github.com/nulastudio/NetCoreBeauty/src/main diff --git a/NetCoreBeautyNuget/Beauty.targets b/NetCoreBeautyNuget/Beauty.targets index 2a5d036..be5de07 100644 --- a/NetCoreBeautyNuget/Beauty.targets +++ b/NetCoreBeautyNuget/Beauty.targets @@ -9,12 +9,15 @@ .exe "$(MSBuildThisFileDirectory)../tools/$(RuntimeOS)/ncbeauty$(BeautyBinExt)" "$(MSBuildProjectDirectory)/$(PublishDir).HERE/.." - libraries + runtimes Publish;$(BeautyAfterTasks) - False + --gitcdn $(GitCDN) + --loglevel $(BeautyLogLevel) + --nopatch + - + \ No newline at end of file diff --git a/NetCoreBeautyNuget/NetCoreBeauty.nuspec b/NetCoreBeautyNuget/NetCoreBeauty.nuspec index e131faa..1b4a75a 100644 --- a/NetCoreBeautyNuget/NetCoreBeauty.nuspec +++ b/NetCoreBeautyNuget/NetCoreBeauty.nuspec @@ -3,7 +3,7 @@ nulastudio.NetCoreBeauty Move a .NET Core app runtime components and dependencies into a sub-directory and make it beauty. - 1.0.4 + 1.1.0 LiesAuer nulastudio https://github.com/nulastudio/NetCoreBeauty diff --git a/NetCoreBeautyNugetTest/NetCoreBeautyTest.csproj b/NetCoreBeautyNugetTest/NetCoreBeautyTest.csproj index a0bfa0b..0e8d93d 100644 --- a/NetCoreBeautyNugetTest/NetCoreBeautyTest.csproj +++ b/NetCoreBeautyNugetTest/NetCoreBeautyTest.csproj @@ -4,18 +4,20 @@ Exe netcoreapp2.1 - libraries + runtimes False - True + False + + Error - https://github-like.com/someone/HostFXRPatcherMirror + - + diff --git a/README.md b/README.md index ea4f2af..5ca29b3 100644 --- a/README.md +++ b/README.md @@ -22,18 +22,20 @@ your `*.csproj` should be similar like this Exe netcoreapp2.1 - libraries + runtimes False False + + Error - https://github-like.com/someone/HostFXRPatcherMirror + - + @@ -43,7 +45,7 @@ when you run `dotnet publish` , everything is done automatically. 2. Use the binary application if your project has already be published. ``` Usage: -ncbeauty [] +ncbeauty [--] [--] [--] [] ``` for example ``` diff --git a/assets/runtime.compatibility.json b/assets/runtime.compatibility.json deleted file mode 100644 index 1e5c380..0000000 --- a/assets/runtime.compatibility.json +++ /dev/null @@ -1,4451 +0,0 @@ -{ - "alpine": [ - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine-x64": [ - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "alpine.3.10": [ - "alpine.3.10", - "alpine.3.9", - "alpine.3.8", - "alpine.3.7", - "alpine.3.6", - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine.3.10-x64": [ - "alpine.3.10-x64", - "alpine.3.10", - "alpine.3.9-x64", - "alpine.3.9", - "alpine.3.8-x64", - "alpine.3.8", - "alpine.3.7-x64", - "alpine.3.7", - "alpine.3.6-x64", - "alpine.3.6", - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "alpine.3.11": [ - "alpine.3.11", - "alpine.3.10", - "alpine.3.9", - "alpine.3.8", - "alpine.3.7", - "alpine.3.6", - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine.3.11-x64": [ - "alpine.3.11-x64", - "alpine.3.11", - "alpine.3.10-x64", - "alpine.3.10", - "alpine.3.9-x64", - "alpine.3.9", - "alpine.3.8-x64", - "alpine.3.8", - "alpine.3.7-x64", - "alpine.3.7", - "alpine.3.6-x64", - "alpine.3.6", - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "alpine.3.6": [ - "alpine.3.6", - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine.3.6-x64": [ - "alpine.3.6-x64", - "alpine.3.6", - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "alpine.3.7": [ - "alpine.3.7", - "alpine.3.6", - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine.3.7-x64": [ - "alpine.3.7-x64", - "alpine.3.7", - "alpine.3.6-x64", - "alpine.3.6", - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "alpine.3.8": [ - "alpine.3.8", - "alpine.3.7", - "alpine.3.6", - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine.3.8-x64": [ - "alpine.3.8-x64", - "alpine.3.8", - "alpine.3.7-x64", - "alpine.3.7", - "alpine.3.6-x64", - "alpine.3.6", - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "alpine.3.9": [ - "alpine.3.9", - "alpine.3.8", - "alpine.3.7", - "alpine.3.6", - "alpine", - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "alpine.3.9-x64": [ - "alpine.3.9-x64", - "alpine.3.9", - "alpine.3.8-x64", - "alpine.3.8", - "alpine.3.7-x64", - "alpine.3.7", - "alpine.3.6-x64", - "alpine.3.6", - "alpine-x64", - "alpine", - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "android": [ - "android", - "linux", - "unix", - "any", - "base" - ], - "android-arm": [ - "android-arm", - "android", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "android-arm64": [ - "android-arm64", - "android", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "android.21": [ - "android.21", - "android", - "linux", - "unix", - "any", - "base" - ], - "android.21-arm": [ - "android.21-arm", - "android.21", - "android-arm", - "android", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "android.21-arm64": [ - "android.21-arm64", - "android.21", - "android-arm64", - "android", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "any": [ - "any", - "base" - ], - "aot": [ - "aot", - "any", - "base" - ], - "base": [ - "base" - ], - "centos": [ - "centos", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "centos-x64": [ - "centos-x64", - "centos", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "centos.7": [ - "centos.7", - "centos", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "centos.7-x64": [ - "centos.7-x64", - "centos.7", - "centos-x64", - "rhel.7-x64", - "centos", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "centos.8": [ - "centos.8", - "centos", - "rhel.8", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "centos.8-x64": [ - "centos.8-x64", - "centos.8", - "centos-x64", - "rhel.8-x64", - "centos", - "rhel.8", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "debian": [ - "debian", - "linux", - "unix", - "any", - "base" - ], - "debian-arm": [ - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "debian-arm64": [ - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "debian-armel": [ - "debian-armel", - "debian", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "debian-x64": [ - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "debian-x86": [ - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "debian.10": [ - "debian.10", - "debian", - "linux", - "unix", - "any", - "base" - ], - "debian.10-arm": [ - "debian.10-arm", - "debian.10", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "debian.10-arm64": [ - "debian.10-arm64", - "debian.10", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "debian.10-armel": [ - "debian.10-armel", - "debian.10", - "debian-armel", - "debian", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "debian.10-x64": [ - "debian.10-x64", - "debian.10", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "debian.10-x86": [ - "debian.10-x86", - "debian.10", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "debian.8": [ - "debian.8", - "debian", - "linux", - "unix", - "any", - "base" - ], - "debian.8-arm": [ - "debian.8-arm", - "debian.8", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "debian.8-arm64": [ - "debian.8-arm64", - "debian.8", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "debian.8-armel": [ - "debian.8-armel", - "debian.8", - "debian-armel", - "debian", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "debian.8-x64": [ - "debian.8-x64", - "debian.8", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "debian.8-x86": [ - "debian.8-x86", - "debian.8", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "debian.9": [ - "debian.9", - "debian", - "linux", - "unix", - "any", - "base" - ], - "debian.9-arm": [ - "debian.9-arm", - "debian.9", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "debian.9-arm64": [ - "debian.9-arm64", - "debian.9", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "debian.9-armel": [ - "debian.9-armel", - "debian.9", - "debian-armel", - "debian", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "debian.9-x64": [ - "debian.9-x64", - "debian.9", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "debian.9-x86": [ - "debian.9-x86", - "debian.9", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "fedora": [ - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora-arm64": [ - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora-x64": [ - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.23": [ - "fedora.23", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.23-arm64": [ - "fedora.23-arm64", - "fedora.23", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.23-x64": [ - "fedora.23-x64", - "fedora.23", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.24": [ - "fedora.24", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.24-arm64": [ - "fedora.24-arm64", - "fedora.24", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.24-x64": [ - "fedora.24-x64", - "fedora.24", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.25": [ - "fedora.25", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.25-arm64": [ - "fedora.25-arm64", - "fedora.25", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.25-x64": [ - "fedora.25-x64", - "fedora.25", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.26": [ - "fedora.26", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.26-arm64": [ - "fedora.26-arm64", - "fedora.26", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.26-x64": [ - "fedora.26-x64", - "fedora.26", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.27": [ - "fedora.27", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.27-arm64": [ - "fedora.27-arm64", - "fedora.27", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.27-x64": [ - "fedora.27-x64", - "fedora.27", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.28": [ - "fedora.28", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.28-arm64": [ - "fedora.28-arm64", - "fedora.28", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.28-x64": [ - "fedora.28-x64", - "fedora.28", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.29": [ - "fedora.29", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.29-arm64": [ - "fedora.29-arm64", - "fedora.29", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.29-x64": [ - "fedora.29-x64", - "fedora.29", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.30": [ - "fedora.30", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.30-arm64": [ - "fedora.30-arm64", - "fedora.30", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.30-x64": [ - "fedora.30-x64", - "fedora.30", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.31": [ - "fedora.31", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.31-arm64": [ - "fedora.31-arm64", - "fedora.31", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.31-x64": [ - "fedora.31-x64", - "fedora.31", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "fedora.32": [ - "fedora.32", - "fedora", - "linux", - "unix", - "any", - "base" - ], - "fedora.32-arm64": [ - "fedora.32-arm64", - "fedora.32", - "fedora-arm64", - "fedora", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "fedora.32-x64": [ - "fedora.32-x64", - "fedora.32", - "fedora-x64", - "fedora", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "freebsd": [ - "freebsd", - "unix", - "any", - "base" - ], - "freebsd-x64": [ - "freebsd-x64", - "freebsd", - "unix-x64", - "unix", - "any", - "base" - ], - "freebsd.11": [ - "freebsd.11", - "freebsd", - "unix", - "any", - "base" - ], - "freebsd.11-x64": [ - "freebsd.11-x64", - "freebsd.11", - "freebsd-x64", - "freebsd", - "unix-x64", - "unix", - "any", - "base" - ], - "freebsd.11.0": [ - "freebsd.11.0", - "freebsd.11", - "freebsd", - "unix", - "any", - "base" - ], - "freebsd.11.0-x64": [ - "freebsd.11.0-x64", - "freebsd.11.0", - "freebsd.11-x64", - "freebsd.11", - "freebsd-x64", - "freebsd", - "unix-x64", - "unix", - "any", - "base" - ], - "freebsd.11.1": [ - "freebsd.11.1", - "freebsd.11.0", - "freebsd.11", - "freebsd", - "unix", - "any", - "base" - ], - "freebsd.11.1-x64": [ - "freebsd.11.1-x64", - "freebsd.11.1", - "freebsd.11.0-x64", - "freebsd.11.0", - "freebsd.11-x64", - "freebsd.11", - "freebsd-x64", - "freebsd", - "unix-x64", - "unix", - "any", - "base" - ], - "freebsd.11.2": [ - "freebsd.11.2", - "freebsd.11.1", - "freebsd.11.0", - "freebsd.11", - "freebsd", - "unix", - "any", - "base" - ], - "freebsd.11.2-x64": [ - "freebsd.11.2-x64", - "freebsd.11.2", - "freebsd.11.1-x64", - "freebsd.11.1", - "freebsd.11.0-x64", - "freebsd.11.0", - "freebsd.11-x64", - "freebsd.11", - "freebsd-x64", - "freebsd", - "unix-x64", - "unix", - "any", - "base" - ], - "freebsd.11.3": [ - "freebsd.11.3", - "freebsd.11.2", - "freebsd.11.1", - "freebsd.11.0", - "freebsd.11", - "freebsd", - "unix", - "any", - "base" - ], - "freebsd.11.3-x64": [ - "freebsd.11.3-x64", - "freebsd.11.3", - "freebsd.11.2-x64", - "freebsd.11.2", - "freebsd.11.1-x64", - "freebsd.11.1", - "freebsd.11.0-x64", - "freebsd.11.0", - "freebsd.11-x64", - "freebsd.11", - "freebsd-x64", - "freebsd", - "unix-x64", - "unix", - "any", - "base" - ], - "gentoo": [ - "gentoo", - "linux", - "unix", - "any", - "base" - ], - "gentoo-x64": [ - "gentoo-x64", - "gentoo", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linux": [ - "linux", - "unix", - "any", - "base" - ], - "linux-arm": [ - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "linux-arm64": [ - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "linux-armel": [ - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "linux-musl": [ - "linux-musl", - "linux", - "unix", - "any", - "base" - ], - "linux-musl-arm": [ - "linux-musl-arm", - "linux-musl", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "linux-musl-arm64": [ - "linux-musl-arm64", - "linux-musl", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "linux-musl-armel": [ - "linux-musl-armel", - "linux-musl", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "linux-musl-x64": [ - "linux-musl-x64", - "linux-musl", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linux-musl-x86": [ - "linux-musl-x86", - "linux-musl", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "linux-x64": [ - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linux-x86": [ - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "linuxmint.17": [ - "linuxmint.17", - "ubuntu.14.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.17-x64": [ - "linuxmint.17-x64", - "linuxmint.17", - "ubuntu.14.04-x64", - "ubuntu.14.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.17.1": [ - "linuxmint.17.1", - "linuxmint.17", - "ubuntu.14.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.17.1-x64": [ - "linuxmint.17.1-x64", - "linuxmint.17.1", - "linuxmint.17-x64", - "linuxmint.17", - "ubuntu.14.04-x64", - "ubuntu.14.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.17.2": [ - "linuxmint.17.2", - "linuxmint.17.1", - "linuxmint.17", - "ubuntu.14.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.17.2-x64": [ - "linuxmint.17.2-x64", - "linuxmint.17.2", - "linuxmint.17.1-x64", - "linuxmint.17.1", - "linuxmint.17-x64", - "linuxmint.17", - "ubuntu.14.04-x64", - "ubuntu.14.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.17.3": [ - "linuxmint.17.3", - "linuxmint.17.2", - "linuxmint.17.1", - "linuxmint.17", - "ubuntu.14.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.17.3-x64": [ - "linuxmint.17.3-x64", - "linuxmint.17.3", - "linuxmint.17.2-x64", - "linuxmint.17.2", - "linuxmint.17.1-x64", - "linuxmint.17.1", - "linuxmint.17-x64", - "linuxmint.17", - "ubuntu.14.04-x64", - "ubuntu.14.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.18": [ - "linuxmint.18", - "ubuntu.16.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.18-x64": [ - "linuxmint.18-x64", - "linuxmint.18", - "ubuntu.16.04-x64", - "ubuntu.16.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.18.1": [ - "linuxmint.18.1", - "linuxmint.18", - "ubuntu.16.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.18.1-x64": [ - "linuxmint.18.1-x64", - "linuxmint.18.1", - "linuxmint.18-x64", - "linuxmint.18", - "ubuntu.16.04-x64", - "ubuntu.16.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.18.2": [ - "linuxmint.18.2", - "linuxmint.18.1", - "linuxmint.18", - "ubuntu.16.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.18.2-x64": [ - "linuxmint.18.2-x64", - "linuxmint.18.2", - "linuxmint.18.1-x64", - "linuxmint.18.1", - "linuxmint.18-x64", - "linuxmint.18", - "ubuntu.16.04-x64", - "ubuntu.16.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.18.3": [ - "linuxmint.18.3", - "linuxmint.18.2", - "linuxmint.18.1", - "linuxmint.18", - "ubuntu.16.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.18.3-x64": [ - "linuxmint.18.3-x64", - "linuxmint.18.3", - "linuxmint.18.2-x64", - "linuxmint.18.2", - "linuxmint.18.1-x64", - "linuxmint.18.1", - "linuxmint.18-x64", - "linuxmint.18", - "ubuntu.16.04-x64", - "ubuntu.16.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.19": [ - "linuxmint.19", - "ubuntu.18.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.19-x64": [ - "linuxmint.19-x64", - "linuxmint.19", - "ubuntu.18.04-x64", - "ubuntu.18.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.19.1": [ - "linuxmint.19.1", - "linuxmint.19", - "ubuntu.18.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.19.1-x64": [ - "linuxmint.19.1-x64", - "linuxmint.19.1", - "linuxmint.19-x64", - "linuxmint.19", - "ubuntu.18.04-x64", - "ubuntu.18.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "linuxmint.19.2": [ - "linuxmint.19.2", - "linuxmint.19.1", - "linuxmint.19", - "ubuntu.18.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "linuxmint.19.2-x64": [ - "linuxmint.19.2-x64", - "linuxmint.19.2", - "linuxmint.19.1-x64", - "linuxmint.19.1", - "linuxmint.19-x64", - "linuxmint.19", - "ubuntu.18.04-x64", - "ubuntu.18.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol": [ - "ol", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol-x64": [ - "ol-x64", - "ol", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7": [ - "ol.7", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7-x64": [ - "ol.7-x64", - "ol.7", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.0": [ - "ol.7.0", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.0-x64": [ - "ol.7.0-x64", - "ol.7.0", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.1": [ - "ol.7.1", - "ol.7.0", - "rhel.7.1", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.1-x64": [ - "ol.7.1-x64", - "ol.7.1", - "ol.7.0-x64", - "rhel.7.1-x64", - "ol.7.0", - "rhel.7.1", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.2": [ - "ol.7.2", - "ol.7.1", - "rhel.7.2", - "ol.7.0", - "rhel.7.1", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.2-x64": [ - "ol.7.2-x64", - "ol.7.2", - "ol.7.1-x64", - "rhel.7.2-x64", - "ol.7.1", - "rhel.7.2", - "ol.7.0-x64", - "rhel.7.1-x64", - "ol.7.0", - "rhel.7.1", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.3": [ - "ol.7.3", - "ol.7.2", - "rhel.7.3", - "ol.7.1", - "rhel.7.2", - "ol.7.0", - "rhel.7.1", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.3-x64": [ - "ol.7.3-x64", - "ol.7.3", - "ol.7.2-x64", - "rhel.7.3-x64", - "ol.7.2", - "rhel.7.3", - "ol.7.1-x64", - "rhel.7.2-x64", - "ol.7.1", - "rhel.7.2", - "ol.7.0-x64", - "rhel.7.1-x64", - "ol.7.0", - "rhel.7.1", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.4": [ - "ol.7.4", - "ol.7.3", - "rhel.7.4", - "ol.7.2", - "rhel.7.3", - "ol.7.1", - "rhel.7.2", - "ol.7.0", - "rhel.7.1", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.4-x64": [ - "ol.7.4-x64", - "ol.7.4", - "ol.7.3-x64", - "rhel.7.4-x64", - "ol.7.3", - "rhel.7.4", - "ol.7.2-x64", - "rhel.7.3-x64", - "ol.7.2", - "rhel.7.3", - "ol.7.1-x64", - "rhel.7.2-x64", - "ol.7.1", - "rhel.7.2", - "ol.7.0-x64", - "rhel.7.1-x64", - "ol.7.0", - "rhel.7.1", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.5": [ - "ol.7.5", - "ol.7.4", - "rhel.7.5", - "ol.7.3", - "rhel.7.4", - "ol.7.2", - "rhel.7.3", - "ol.7.1", - "rhel.7.2", - "ol.7.0", - "rhel.7.1", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.5-x64": [ - "ol.7.5-x64", - "ol.7.5", - "ol.7.4-x64", - "rhel.7.5-x64", - "ol.7.4", - "rhel.7.5", - "ol.7.3-x64", - "rhel.7.4-x64", - "ol.7.3", - "rhel.7.4", - "ol.7.2-x64", - "rhel.7.3-x64", - "ol.7.2", - "rhel.7.3", - "ol.7.1-x64", - "rhel.7.2-x64", - "ol.7.1", - "rhel.7.2", - "ol.7.0-x64", - "rhel.7.1-x64", - "ol.7.0", - "rhel.7.1", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.7.6": [ - "ol.7.6", - "ol.7.5", - "rhel.7.6", - "ol.7.4", - "rhel.7.5", - "ol.7.3", - "rhel.7.4", - "ol.7.2", - "rhel.7.3", - "ol.7.1", - "rhel.7.2", - "ol.7.0", - "rhel.7.1", - "ol.7", - "rhel.7.0", - "ol", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.7.6-x64": [ - "ol.7.6-x64", - "ol.7.6", - "ol.7.5-x64", - "rhel.7.6-x64", - "ol.7.5", - "rhel.7.6", - "ol.7.4-x64", - "rhel.7.5-x64", - "ol.7.4", - "rhel.7.5", - "ol.7.3-x64", - "rhel.7.4-x64", - "ol.7.3", - "rhel.7.4", - "ol.7.2-x64", - "rhel.7.3-x64", - "ol.7.2", - "rhel.7.3", - "ol.7.1-x64", - "rhel.7.2-x64", - "ol.7.1", - "rhel.7.2", - "ol.7.0-x64", - "rhel.7.1-x64", - "ol.7.0", - "rhel.7.1", - "ol.7-x64", - "rhel.7.0-x64", - "ol.7", - "rhel.7.0", - "ol-x64", - "rhel.7-x64", - "ol", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.8": [ - "ol.8", - "ol", - "rhel.8", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.8-x64": [ - "ol.8-x64", - "ol.8", - "ol-x64", - "rhel.8-x64", - "ol", - "rhel.8", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ol.8.0": [ - "ol.8.0", - "ol.8", - "rhel.8.0", - "ol", - "rhel.8", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "ol.8.0-x64": [ - "ol.8.0-x64", - "ol.8.0", - "ol.8-x64", - "rhel.8.0-x64", - "ol.8", - "rhel.8.0", - "ol-x64", - "rhel.8-x64", - "ol", - "rhel.8", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse": [ - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse-x64": [ - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse.13.2": [ - "opensuse.13.2", - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse.13.2-x64": [ - "opensuse.13.2-x64", - "opensuse.13.2", - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse.15.0": [ - "opensuse.15.0", - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse.15.0-x64": [ - "opensuse.15.0-x64", - "opensuse.15.0", - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse.15.1": [ - "opensuse.15.1", - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse.15.1-x64": [ - "opensuse.15.1-x64", - "opensuse.15.1", - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse.42.1": [ - "opensuse.42.1", - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse.42.1-x64": [ - "opensuse.42.1-x64", - "opensuse.42.1", - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse.42.2": [ - "opensuse.42.2", - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse.42.2-x64": [ - "opensuse.42.2-x64", - "opensuse.42.2", - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "opensuse.42.3": [ - "opensuse.42.3", - "opensuse", - "linux", - "unix", - "any", - "base" - ], - "opensuse.42.3-x64": [ - "opensuse.42.3-x64", - "opensuse.42.3", - "opensuse-x64", - "opensuse", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "osx": [ - "osx", - "unix", - "any", - "base" - ], - "osx-x64": [ - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "osx.10.10": [ - "osx.10.10", - "osx", - "unix", - "any", - "base" - ], - "osx.10.10-x64": [ - "osx.10.10-x64", - "osx.10.10", - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "osx.10.11": [ - "osx.10.11", - "osx.10.10", - "osx", - "unix", - "any", - "base" - ], - "osx.10.11-x64": [ - "osx.10.11-x64", - "osx.10.11", - "osx.10.10-x64", - "osx.10.10", - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "osx.10.12": [ - "osx.10.12", - "osx.10.11", - "osx.10.10", - "osx", - "unix", - "any", - "base" - ], - "osx.10.12-x64": [ - "osx.10.12-x64", - "osx.10.12", - "osx.10.11-x64", - "osx.10.11", - "osx.10.10-x64", - "osx.10.10", - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "osx.10.13": [ - "osx.10.13", - "osx.10.12", - "osx.10.11", - "osx.10.10", - "osx", - "unix", - "any", - "base" - ], - "osx.10.13-x64": [ - "osx.10.13-x64", - "osx.10.13", - "osx.10.12-x64", - "osx.10.12", - "osx.10.11-x64", - "osx.10.11", - "osx.10.10-x64", - "osx.10.10", - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "osx.10.14": [ - "osx.10.14", - "osx.10.13", - "osx.10.12", - "osx.10.11", - "osx.10.10", - "osx", - "unix", - "any", - "base" - ], - "osx.10.14-x64": [ - "osx.10.14-x64", - "osx.10.14", - "osx.10.13-x64", - "osx.10.13", - "osx.10.12-x64", - "osx.10.12", - "osx.10.11-x64", - "osx.10.11", - "osx.10.10-x64", - "osx.10.10", - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "osx.10.15": [ - "osx.10.15", - "osx.10.14", - "osx.10.13", - "osx.10.12", - "osx.10.11", - "osx.10.10", - "osx", - "unix", - "any", - "base" - ], - "osx.10.15-x64": [ - "osx.10.15-x64", - "osx.10.15", - "osx.10.14-x64", - "osx.10.14", - "osx.10.13-x64", - "osx.10.13", - "osx.10.12-x64", - "osx.10.12", - "osx.10.11-x64", - "osx.10.11", - "osx.10.10-x64", - "osx.10.10", - "osx-x64", - "osx", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel": [ - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel-arm64": [ - "rhel-arm64", - "rhel", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "rhel-x64": [ - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.6": [ - "rhel.6", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.6-x64": [ - "rhel.6-x64", - "rhel.6", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7": [ - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7-x64": [ - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.0": [ - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.0-x64": [ - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.1": [ - "rhel.7.1", - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.1-x64": [ - "rhel.7.1-x64", - "rhel.7.1", - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.2": [ - "rhel.7.2", - "rhel.7.1", - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.2-x64": [ - "rhel.7.2-x64", - "rhel.7.2", - "rhel.7.1-x64", - "rhel.7.1", - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.3": [ - "rhel.7.3", - "rhel.7.2", - "rhel.7.1", - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.3-x64": [ - "rhel.7.3-x64", - "rhel.7.3", - "rhel.7.2-x64", - "rhel.7.2", - "rhel.7.1-x64", - "rhel.7.1", - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.4": [ - "rhel.7.4", - "rhel.7.3", - "rhel.7.2", - "rhel.7.1", - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.4-x64": [ - "rhel.7.4-x64", - "rhel.7.4", - "rhel.7.3-x64", - "rhel.7.3", - "rhel.7.2-x64", - "rhel.7.2", - "rhel.7.1-x64", - "rhel.7.1", - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.5": [ - "rhel.7.5", - "rhel.7.4", - "rhel.7.3", - "rhel.7.2", - "rhel.7.1", - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.5-x64": [ - "rhel.7.5-x64", - "rhel.7.5", - "rhel.7.4-x64", - "rhel.7.4", - "rhel.7.3-x64", - "rhel.7.3", - "rhel.7.2-x64", - "rhel.7.2", - "rhel.7.1-x64", - "rhel.7.1", - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.7.6": [ - "rhel.7.6", - "rhel.7.5", - "rhel.7.4", - "rhel.7.3", - "rhel.7.2", - "rhel.7.1", - "rhel.7.0", - "rhel.7", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.7.6-x64": [ - "rhel.7.6-x64", - "rhel.7.6", - "rhel.7.5-x64", - "rhel.7.5", - "rhel.7.4-x64", - "rhel.7.4", - "rhel.7.3-x64", - "rhel.7.3", - "rhel.7.2-x64", - "rhel.7.2", - "rhel.7.1-x64", - "rhel.7.1", - "rhel.7.0-x64", - "rhel.7.0", - "rhel.7-x64", - "rhel.7", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.8": [ - "rhel.8", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.8-arm64": [ - "rhel.8-arm64", - "rhel.8", - "rhel-arm64", - "rhel", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "rhel.8-x64": [ - "rhel.8-x64", - "rhel.8", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.8.0": [ - "rhel.8.0", - "rhel.8", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.8.0-arm64": [ - "rhel.8.0-arm64", - "rhel.8.0", - "rhel.8-arm64", - "rhel.8", - "rhel-arm64", - "rhel", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "rhel.8.0-x64": [ - "rhel.8.0-x64", - "rhel.8.0", - "rhel.8-x64", - "rhel.8", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "rhel.8.1": [ - "rhel.8.1", - "rhel.8.0", - "rhel.8", - "rhel", - "linux", - "unix", - "any", - "base" - ], - "rhel.8.1-arm64": [ - "rhel.8.1-arm64", - "rhel.8.1", - "rhel.8.0-arm64", - "rhel.8.0", - "rhel.8-arm64", - "rhel.8", - "rhel-arm64", - "rhel", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "rhel.8.1-x64": [ - "rhel.8.1-x64", - "rhel.8.1", - "rhel.8.0-x64", - "rhel.8.0", - "rhel.8-x64", - "rhel.8", - "rhel-x64", - "rhel", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles": [ - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles-x64": [ - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.12": [ - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.12-x64": [ - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.12.1": [ - "sles.12.1", - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.12.1-x64": [ - "sles.12.1-x64", - "sles.12.1", - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.12.2": [ - "sles.12.2", - "sles.12.1", - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.12.2-x64": [ - "sles.12.2-x64", - "sles.12.2", - "sles.12.1-x64", - "sles.12.1", - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.12.3": [ - "sles.12.3", - "sles.12.2", - "sles.12.1", - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.12.3-x64": [ - "sles.12.3-x64", - "sles.12.3", - "sles.12.2-x64", - "sles.12.2", - "sles.12.1-x64", - "sles.12.1", - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.12.4": [ - "sles.12.4", - "sles.12.3", - "sles.12.2", - "sles.12.1", - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.12.4-x64": [ - "sles.12.4-x64", - "sles.12.4", - "sles.12.3-x64", - "sles.12.3", - "sles.12.2-x64", - "sles.12.2", - "sles.12.1-x64", - "sles.12.1", - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.15": [ - "sles.15", - "sles.12.4", - "sles.12.3", - "sles.12.2", - "sles.12.1", - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.15-x64": [ - "sles.15-x64", - "sles.15", - "sles.12.4-x64", - "sles.12.4", - "sles.12.3-x64", - "sles.12.3", - "sles.12.2-x64", - "sles.12.2", - "sles.12.1-x64", - "sles.12.1", - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "sles.15.1": [ - "sles.15.1", - "sles.15", - "sles.12.4", - "sles.12.3", - "sles.12.2", - "sles.12.1", - "sles.12", - "sles", - "linux", - "unix", - "any", - "base" - ], - "sles.15.1-x64": [ - "sles.15.1-x64", - "sles.15.1", - "sles.15-x64", - "sles.15", - "sles.12.4-x64", - "sles.12.4", - "sles.12.3-x64", - "sles.12.3", - "sles.12.2-x64", - "sles.12.2", - "sles.12.1-x64", - "sles.12.1", - "sles.12-x64", - "sles.12", - "sles-x64", - "sles", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "tizen": [ - "tizen", - "linux", - "unix", - "any", - "base" - ], - "tizen-armel": [ - "tizen-armel", - "tizen", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "tizen-x86": [ - "tizen-x86", - "tizen", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "tizen.4.0.0": [ - "tizen.4.0.0", - "tizen", - "linux", - "unix", - "any", - "base" - ], - "tizen.4.0.0-armel": [ - "tizen.4.0.0-armel", - "tizen.4.0.0", - "tizen-armel", - "tizen", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "tizen.4.0.0-x86": [ - "tizen.4.0.0-x86", - "tizen.4.0.0", - "tizen-x86", - "tizen", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "tizen.5.0.0": [ - "tizen.5.0.0", - "tizen.4.0.0", - "tizen", - "linux", - "unix", - "any", - "base" - ], - "tizen.5.0.0-armel": [ - "tizen.5.0.0-armel", - "tizen.5.0.0", - "tizen.4.0.0-armel", - "tizen.4.0.0", - "tizen-armel", - "tizen", - "linux-armel", - "linux", - "unix-armel", - "unix", - "any", - "base" - ], - "tizen.5.0.0-x86": [ - "tizen.5.0.0-x86", - "tizen.5.0.0", - "tizen.4.0.0-x86", - "tizen.4.0.0", - "tizen-x86", - "tizen", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu": [ - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu-arm": [ - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu-arm64": [ - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu-x64": [ - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu-x86": [ - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.14.04": [ - "ubuntu.14.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.14.04-arm": [ - "ubuntu.14.04-arm", - "ubuntu.14.04", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.14.04-x64": [ - "ubuntu.14.04-x64", - "ubuntu.14.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.14.04-x86": [ - "ubuntu.14.04-x86", - "ubuntu.14.04", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.14.10": [ - "ubuntu.14.10", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.14.10-arm": [ - "ubuntu.14.10-arm", - "ubuntu.14.10", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.14.10-x64": [ - "ubuntu.14.10-x64", - "ubuntu.14.10", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.14.10-x86": [ - "ubuntu.14.10-x86", - "ubuntu.14.10", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.15.04": [ - "ubuntu.15.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.15.04-arm": [ - "ubuntu.15.04-arm", - "ubuntu.15.04", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.15.04-x64": [ - "ubuntu.15.04-x64", - "ubuntu.15.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.15.04-x86": [ - "ubuntu.15.04-x86", - "ubuntu.15.04", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.15.10": [ - "ubuntu.15.10", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.15.10-arm": [ - "ubuntu.15.10-arm", - "ubuntu.15.10", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.15.10-x64": [ - "ubuntu.15.10-x64", - "ubuntu.15.10", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.15.10-x86": [ - "ubuntu.15.10-x86", - "ubuntu.15.10", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.16.04": [ - "ubuntu.16.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.16.04-arm": [ - "ubuntu.16.04-arm", - "ubuntu.16.04", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.16.04-arm64": [ - "ubuntu.16.04-arm64", - "ubuntu.16.04", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.16.04-x64": [ - "ubuntu.16.04-x64", - "ubuntu.16.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.16.04-x86": [ - "ubuntu.16.04-x86", - "ubuntu.16.04", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.16.10": [ - "ubuntu.16.10", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.16.10-arm": [ - "ubuntu.16.10-arm", - "ubuntu.16.10", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.16.10-arm64": [ - "ubuntu.16.10-arm64", - "ubuntu.16.10", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.16.10-x64": [ - "ubuntu.16.10-x64", - "ubuntu.16.10", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.16.10-x86": [ - "ubuntu.16.10-x86", - "ubuntu.16.10", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.17.04": [ - "ubuntu.17.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.17.04-arm": [ - "ubuntu.17.04-arm", - "ubuntu.17.04", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.17.04-arm64": [ - "ubuntu.17.04-arm64", - "ubuntu.17.04", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.17.04-x64": [ - "ubuntu.17.04-x64", - "ubuntu.17.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.17.04-x86": [ - "ubuntu.17.04-x86", - "ubuntu.17.04", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.17.10": [ - "ubuntu.17.10", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.17.10-arm": [ - "ubuntu.17.10-arm", - "ubuntu.17.10", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.17.10-arm64": [ - "ubuntu.17.10-arm64", - "ubuntu.17.10", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.17.10-x64": [ - "ubuntu.17.10-x64", - "ubuntu.17.10", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.17.10-x86": [ - "ubuntu.17.10-x86", - "ubuntu.17.10", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.18.04": [ - "ubuntu.18.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.18.04-arm": [ - "ubuntu.18.04-arm", - "ubuntu.18.04", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.18.04-arm64": [ - "ubuntu.18.04-arm64", - "ubuntu.18.04", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.18.04-x64": [ - "ubuntu.18.04-x64", - "ubuntu.18.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.18.04-x86": [ - "ubuntu.18.04-x86", - "ubuntu.18.04", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.18.10": [ - "ubuntu.18.10", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.18.10-arm": [ - "ubuntu.18.10-arm", - "ubuntu.18.10", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.18.10-arm64": [ - "ubuntu.18.10-arm64", - "ubuntu.18.10", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.18.10-x64": [ - "ubuntu.18.10-x64", - "ubuntu.18.10", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.18.10-x86": [ - "ubuntu.18.10-x86", - "ubuntu.18.10", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.19.04": [ - "ubuntu.19.04", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.19.04-arm": [ - "ubuntu.19.04-arm", - "ubuntu.19.04", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.19.04-arm64": [ - "ubuntu.19.04-arm64", - "ubuntu.19.04", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.19.04-x64": [ - "ubuntu.19.04-x64", - "ubuntu.19.04", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.19.04-x86": [ - "ubuntu.19.04-x86", - "ubuntu.19.04", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "ubuntu.19.10": [ - "ubuntu.19.10", - "ubuntu", - "debian", - "linux", - "unix", - "any", - "base" - ], - "ubuntu.19.10-arm": [ - "ubuntu.19.10-arm", - "ubuntu.19.10", - "ubuntu-arm", - "ubuntu", - "debian-arm", - "debian", - "linux-arm", - "linux", - "unix-arm", - "unix", - "any", - "base" - ], - "ubuntu.19.10-arm64": [ - "ubuntu.19.10-arm64", - "ubuntu.19.10", - "ubuntu-arm64", - "ubuntu", - "debian-arm64", - "debian", - "linux-arm64", - "linux", - "unix-arm64", - "unix", - "any", - "base" - ], - "ubuntu.19.10-x64": [ - "ubuntu.19.10-x64", - "ubuntu.19.10", - "ubuntu-x64", - "ubuntu", - "debian-x64", - "debian", - "linux-x64", - "linux", - "unix-x64", - "unix", - "any", - "base" - ], - "ubuntu.19.10-x86": [ - "ubuntu.19.10-x86", - "ubuntu.19.10", - "ubuntu-x86", - "ubuntu", - "debian-x86", - "debian", - "linux-x86", - "linux", - "unix-x86", - "unix", - "any", - "base" - ], - "unix": [ - "unix", - "any", - "base" - ], - "unix-arm": [ - "unix-arm", - "unix", - "any", - "base" - ], - "unix-arm64": [ - "unix-arm64", - "unix", - "any", - "base" - ], - "unix-armel": [ - "unix-armel", - "unix", - "any", - "base" - ], - "unix-x64": [ - "unix-x64", - "unix", - "any", - "base" - ], - "unix-x86": [ - "unix-x86", - "unix", - "any", - "base" - ], - "win": [ - "win", - "any", - "base" - ], - "win-aot": [ - "win-aot", - "win", - "aot", - "any", - "base" - ], - "win-arm": [ - "win-arm", - "win", - "any", - "base" - ], - "win-arm-aot": [ - "win-arm-aot", - "win-aot", - "win-arm", - "win", - "aot", - "any", - "base" - ], - "win-arm64": [ - "win-arm64", - "win", - "any", - "base" - ], - "win-arm64-aot": [ - "win-arm64-aot", - "win-aot", - "win-arm64", - "win", - "aot", - "any", - "base" - ], - "win-x64": [ - "win-x64", - "win", - "any", - "base" - ], - "win-x64-aot": [ - "win-x64-aot", - "win-aot", - "win-x64", - "win", - "aot", - "any", - "base" - ], - "win-x86": [ - "win-x86", - "win", - "any", - "base" - ], - "win-x86-aot": [ - "win-x86-aot", - "win-aot", - "win-x86", - "win", - "aot", - "any", - "base" - ], - "win10": [ - "win10", - "win81", - "win8", - "win7", - "win", - "any", - "base" - ], - "win10-aot": [ - "win10-aot", - "win10", - "win81-aot", - "win81", - "win8-aot", - "win8", - "win7-aot", - "win7", - "win-aot", - "win", - "aot", - "any", - "base" - ], - "win10-arm": [ - "win10-arm", - "win10", - "win81-arm", - "win81", - "win8-arm", - "win8", - "win7-arm", - "win7", - "win-arm", - "win", - "any", - "base" - ], - "win10-arm-aot": [ - "win10-arm-aot", - "win10-aot", - "win10-arm", - "win10", - "win81-arm-aot", - "win81-aot", - "win81-arm", - "win81", - "win8-arm-aot", - "win8-aot", - "win8-arm", - "win8", - "win7-arm-aot", - "win7-aot", - "win7-arm", - "win7", - "win-arm-aot", - "win-aot", - "win-arm", - "win", - "aot", - "any", - "base" - ], - "win10-arm64": [ - "win10-arm64", - "win10", - "win81-arm64", - "win81", - "win8-arm64", - "win8", - "win7-arm64", - "win7", - "win-arm64", - "win", - "any", - "base" - ], - "win10-arm64-aot": [ - "win10-arm64-aot", - "win10-aot", - "win10-arm64", - "win10", - "win81-arm64-aot", - "win81-aot", - "win81-arm64", - "win81", - "win8-arm64-aot", - "win8-aot", - "win8-arm64", - "win8", - "win7-arm64-aot", - "win7-aot", - "win7-arm64", - "win7", - "win-arm64-aot", - "win-aot", - "win-arm64", - "win", - "aot", - "any", - "base" - ], - "win10-x64": [ - "win10-x64", - "win10", - "win81-x64", - "win81", - "win8-x64", - "win8", - "win7-x64", - "win7", - "win-x64", - "win", - "any", - "base" - ], - "win10-x64-aot": [ - "win10-x64-aot", - "win10-aot", - "win10-x64", - "win10", - "win81-x64-aot", - "win81-aot", - "win81-x64", - "win81", - "win8-x64-aot", - "win8-aot", - "win8-x64", - "win8", - "win7-x64-aot", - "win7-aot", - "win7-x64", - "win7", - "win-x64-aot", - "win-aot", - "win-x64", - "win", - "aot", - "any", - "base" - ], - "win10-x86": [ - "win10-x86", - "win10", - "win81-x86", - "win81", - "win8-x86", - "win8", - "win7-x86", - "win7", - "win-x86", - "win", - "any", - "base" - ], - "win10-x86-aot": [ - "win10-x86-aot", - "win10-aot", - "win10-x86", - "win10", - "win81-x86-aot", - "win81-aot", - "win81-x86", - "win81", - "win8-x86-aot", - "win8-aot", - "win8-x86", - "win8", - "win7-x86-aot", - "win7-aot", - "win7-x86", - "win7", - "win-x86-aot", - "win-aot", - "win-x86", - "win", - "aot", - "any", - "base" - ], - "win7": [ - "win7", - "win", - "any", - "base" - ], - "win7-aot": [ - "win7-aot", - "win7", - "win-aot", - "win", - "aot", - "any", - "base" - ], - "win7-arm": [ - "win7-arm", - "win7", - "win-arm", - "win", - "any", - "base" - ], - "win7-arm-aot": [ - "win7-arm-aot", - "win7-aot", - "win7-arm", - "win7", - "win-arm-aot", - "win-aot", - "win-arm", - "win", - "aot", - "any", - "base" - ], - "win7-arm64": [ - "win7-arm64", - "win7", - "win-arm64", - "win", - "any", - "base" - ], - "win7-arm64-aot": [ - "win7-arm64-aot", - "win7-aot", - "win7-arm64", - "win7", - "win-arm64-aot", - "win-aot", - "win-arm64", - "win", - "aot", - "any", - "base" - ], - "win7-x64": [ - "win7-x64", - "win7", - "win-x64", - "win", - "any", - "base" - ], - "win7-x64-aot": [ - "win7-x64-aot", - "win7-aot", - "win7-x64", - "win7", - "win-x64-aot", - "win-aot", - "win-x64", - "win", - "aot", - "any", - "base" - ], - "win7-x86": [ - "win7-x86", - "win7", - "win-x86", - "win", - "any", - "base" - ], - "win7-x86-aot": [ - "win7-x86-aot", - "win7-aot", - "win7-x86", - "win7", - "win-x86-aot", - "win-aot", - "win-x86", - "win", - "aot", - "any", - "base" - ], - "win8": [ - "win8", - "win7", - "win", - "any", - "base" - ], - "win8-aot": [ - "win8-aot", - "win8", - "win7-aot", - "win7", - "win-aot", - "win", - "aot", - "any", - "base" - ], - "win8-arm": [ - "win8-arm", - "win8", - "win7-arm", - "win7", - "win-arm", - "win", - "any", - "base" - ], - "win8-arm-aot": [ - "win8-arm-aot", - "win8-aot", - "win8-arm", - "win8", - "win7-arm-aot", - "win7-aot", - "win7-arm", - "win7", - "win-arm-aot", - "win-aot", - "win-arm", - "win", - "aot", - "any", - "base" - ], - "win8-arm64": [ - "win8-arm64", - "win8", - "win7-arm64", - "win7", - "win-arm64", - "win", - "any", - "base" - ], - "win8-arm64-aot": [ - "win8-arm64-aot", - "win8-aot", - "win8-arm64", - "win8", - "win7-arm64-aot", - "win7-aot", - "win7-arm64", - "win7", - "win-arm64-aot", - "win-aot", - "win-arm64", - "win", - "aot", - "any", - "base" - ], - "win8-x64": [ - "win8-x64", - "win8", - "win7-x64", - "win7", - "win-x64", - "win", - "any", - "base" - ], - "win8-x64-aot": [ - "win8-x64-aot", - "win8-aot", - "win8-x64", - "win8", - "win7-x64-aot", - "win7-aot", - "win7-x64", - "win7", - "win-x64-aot", - "win-aot", - "win-x64", - "win", - "aot", - "any", - "base" - ], - "win8-x86": [ - "win8-x86", - "win8", - "win7-x86", - "win7", - "win-x86", - "win", - "any", - "base" - ], - "win8-x86-aot": [ - "win8-x86-aot", - "win8-aot", - "win8-x86", - "win8", - "win7-x86-aot", - "win7-aot", - "win7-x86", - "win7", - "win-x86-aot", - "win-aot", - "win-x86", - "win", - "aot", - "any", - "base" - ], - "win81": [ - "win81", - "win8", - "win7", - "win", - "any", - "base" - ], - "win81-aot": [ - "win81-aot", - "win81", - "win8-aot", - "win8", - "win7-aot", - "win7", - "win-aot", - "win", - "aot", - "any", - "base" - ], - "win81-arm": [ - "win81-arm", - "win81", - "win8-arm", - "win8", - "win7-arm", - "win7", - "win-arm", - "win", - "any", - "base" - ], - "win81-arm-aot": [ - "win81-arm-aot", - "win81-aot", - "win81-arm", - "win81", - "win8-arm-aot", - "win8-aot", - "win8-arm", - "win8", - "win7-arm-aot", - "win7-aot", - "win7-arm", - "win7", - "win-arm-aot", - "win-aot", - "win-arm", - "win", - "aot", - "any", - "base" - ], - "win81-arm64": [ - "win81-arm64", - "win81", - "win8-arm64", - "win8", - "win7-arm64", - "win7", - "win-arm64", - "win", - "any", - "base" - ], - "win81-arm64-aot": [ - "win81-arm64-aot", - "win81-aot", - "win81-arm64", - "win81", - "win8-arm64-aot", - "win8-aot", - "win8-arm64", - "win8", - "win7-arm64-aot", - "win7-aot", - "win7-arm64", - "win7", - "win-arm64-aot", - "win-aot", - "win-arm64", - "win", - "aot", - "any", - "base" - ], - "win81-x64": [ - "win81-x64", - "win81", - "win8-x64", - "win8", - "win7-x64", - "win7", - "win-x64", - "win", - "any", - "base" - ], - "win81-x64-aot": [ - "win81-x64-aot", - "win81-aot", - "win81-x64", - "win81", - "win8-x64-aot", - "win8-aot", - "win8-x64", - "win8", - "win7-x64-aot", - "win7-aot", - "win7-x64", - "win7", - "win-x64-aot", - "win-aot", - "win-x64", - "win", - "aot", - "any", - "base" - ], - "win81-x86": [ - "win81-x86", - "win81", - "win8-x86", - "win8", - "win7-x86", - "win7", - "win-x86", - "win", - "any", - "base" - ], - "win81-x86-aot": [ - "win81-x86-aot", - "win81-aot", - "win81-x86", - "win81", - "win8-x86-aot", - "win8-aot", - "win8-x86", - "win8", - "win7-x86-aot", - "win7-aot", - "win7-x86", - "win7", - "win-x86-aot", - "win-aot", - "win-x86", - "win", - "aot", - "any", - "base" - ] -} \ No newline at end of file diff --git a/assets/runtime.supported.json b/assets/runtime.supported.json deleted file mode 100644 index cc4dbf2..0000000 --- a/assets/runtime.supported.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "win-x86", - "win-x64", - "linux-x64", - "osx-x64" -] \ No newline at end of file diff --git a/src/log/log.go b/src/log/log.go new file mode 100644 index 0000000..b4d22a9 --- /dev/null +++ b/src/log/log.go @@ -0,0 +1,60 @@ +package log + +import ( + "fmt" + "os" +) + +type LogLevel int + +const ( + Error LogLevel = iota + Detail + Info +) + +type Logger struct { + LogLevel LogLevel +} + +var DefaultLogger = &Logger{Info} + +func (logger *Logger) Log(message string, level LogLevel) { + if logger.LogLevel >= level { + if logger.LogLevel == Error { + message = "Error: " + message + } + fmt.Println(message) + } +} + +func (logger *Logger) PanicLog(message string, level LogLevel, code int) { + logger.Log(message, level) + os.Exit(code) +} + +func LogError(err error, panic bool) { + code := 0 + if panic { + code = 1 + } + LogPanic(err, code) +} + +func LogPanic(err error, code int) { + if err != nil { + if code != 0 { + DefaultLogger.PanicLog(err.Error(), Error, code) + } else { + DefaultLogger.Log(err.Error(), Error) + } + } +} + +func LogInfo(message string) { + DefaultLogger.Log(message, Info) +} + +func LogDetail(message string) { + DefaultLogger.Log(message, Detail) +} diff --git a/src/main/beauty.go b/src/main/beauty.go index d03431e..77f3232 100644 --- a/src/main/beauty.go +++ b/src/main/beauty.go @@ -2,327 +2,258 @@ package main import ( "errors" + "flag" "fmt" "io/ioutil" - "net/http" "os" "path" "path/filepath" - "regexp" "strings" + log "github.com/nulastudio/NetCoreBeauty/src/log" + manager "github.com/nulastudio/NetCoreBeauty/src/manager" + util "github.com/nulastudio/NetCoreBeauty/src/util" + "github.com/bitly/go-simplejson" ) +const ( + errorLevel string = "Error" // log errors only + detailLevel string = "Detail" // log useful infos + infoLevel string = "Info" // log everything +) + var workingDir, _ = os.Getwd() -var beautyDir = "" -var libsDir = "libs" -var disablePatch = false -var gitcdn = "https://github.com/nulastudio/HostFXRPatcher" var runtimeCompatibilityJSON *simplejson.Json var runtimeSupportedJSON *simplejson.Json +var gitcdn string +var nopatch bool +var loglevel string +var beautyDir string +var libsDir = "runtimes" + func main() { - // arguments check - if len(os.Args) < 2 { - fmt.Println("no beauty path specify") - fmt.Println("") - help() - os.Exit(0) - } else { - beautyDir = os.Args[1] - if len(os.Args) >= 3 { - libsDir = os.Args[2] - } - beautyDir = strings.Trim(beautyDir, "\"") - libsDir = strings.Trim(libsDir, "\"") - beautyDir, _ = filepath.Abs(beautyDir) - if len(os.Args) >= 4 { - disablePatch = os.Args[3] == "True" - } - if len(os.Args) >= 5 { - gitcdn = os.Args[4] - } + initCLI() + + // 设置CDN + manager.GitCDN = gitcdn + + // 设置LogLevel + log.DefaultLogger.LogLevel = map[string]log.LogLevel{ + errorLevel: log.Error, + detailLevel: log.Detail, + infoLevel: log.Info, + }[loglevel] + manager.Logger.LogLevel = log.DefaultLogger.LogLevel + + log.LogInfo("running ncbeauty...") + + beautyCheck := path.Join(beautyDir, "NetCoreBeauty") + + // 检查是否已beauty + if util.PathExists(beautyCheck) { + log.LogDetail("already beauty. Enjoy it!") + return } - fmt.Println("running ncbeauty...") + // 必须检查 + manager.CheckRunConfigJSON() // fix runtimeconfig.json - fmt.Println("fixing runtimeconfig.json...") - runtimeConfigs, _ := filepath.Glob(beautyDir + "/*runtimeconfig*.json") - for _, runtimeConfig := range runtimeConfigs { - fixRuntimeConfig(runtimeConfig, libsDir) + runtimeConfigs := manager.FindRuntimeConfigJSON(beautyDir) + if len(runtimeConfigs) != 0 { + for _, runtimeConfig := range runtimeConfigs { + log.LogDetail(fmt.Sprintf("fixing %s", runtimeConfig)) + manager.FixRuntimeConfig(runtimeConfig, libsDir) + log.LogDetail(fmt.Sprintf("%s fixed", runtimeConfig)) + } + } else { + log.LogDetail(fmt.Sprintf("no runtimeconfig.json found in %s", beautyDir)) + log.LogDetail("skipping") + os.Exit(0) } - fmt.Println("runtimeconfig.json fixed") // fix deps.json - fmt.Println("fixing deps.json...") - dependencies, _ := filepath.Glob(beautyDir + "/*deps.json") - for _, deps := range dependencies { - deps = strings.ReplaceAll(deps, "\\", "/") - mainProgram := strings.Replace(path.Base(deps), "deps.json", "", -1) - depsFiles := fixDependencies(deps, mainProgram) - // 移动文件 - for _, depsFile := range depsFiles { - if strings.Contains(depsFile, mainProgram) { - continue + dependencies := manager.FindDepsJSON(beautyDir) + if len(dependencies) != 0 { + for _, deps := range dependencies { + log.LogDetail(fmt.Sprintf("fixing %s", deps)) + deps = strings.ReplaceAll(deps, "\\", "/") + mainProgram := strings.Replace(path.Base(deps), ".deps.json", "", -1) + depsFiles, fxrVersion, rid := manager.FixDeps(deps) + // patch + if nopatch { + fmt.Println("hostfxr patch has been disable, skipped") + } else if fxrVersion != "" && rid != "" { + patch(fxrVersion, rid) + } else { + log.LogError(errors.New("incomplete fxr info, skipping patch"), false) } - if strings.Contains(depsFile, "hostfxr") { + if len(depsFiles) == 0 { continue } - if strings.Contains(depsFile, "hostpolicy") { - continue - } - - absDepsFile := path.Join(beautyDir, depsFile) - absDesFile := path.Join(beautyDir, libsDir, depsFile) - oldPath := path.Dir(absDepsFile) - newPath := path.Dir(absDesFile) - if pathExists(absDepsFile) { - if !pathExists(newPath) { - os.MkdirAll(newPath, 0777) - } - os.Rename(absDepsFile, absDesFile) - - fileName := strings.TrimSuffix(path.Base(depsFile), path.Ext(depsFile)) - extFiles := []string{".pdb", ".xml"} - for _, extFile := range extFiles { - oldFile := path.Join(oldPath, fileName+extFile) - newFile := path.Join(newPath, fileName+extFile) - if pathExists(oldFile) { - os.Rename(oldFile, newFile) - } - } - dir, _ := ioutil.ReadDir(oldPath) - if len(dir) == 0 { - os.Remove(oldPath) - } - } + log.LogDetail(fmt.Sprintf("%s fixed", deps)) + log.LogInfo("moving runtime...") + moved := moveDeps(depsFiles, mainProgram) + log.LogDetail(fmt.Sprintf("%d of %d runtime files moved", moved, len(depsFiles))) } + } else { + log.LogDetail(fmt.Sprintf("no deps.json found in %s", beautyDir)) + log.LogDetail("skipping") + os.Exit(0) } - fmt.Println("deps.json fixed") - fmt.Println("ncbeauty done. Enjoy it!") -} -func readAsset(name string) ([]byte, error) { - return Asset(strings.TrimPrefix(name, "/")) -} + // 写入beauty标记 + if err := ioutil.WriteFile(beautyCheck, nil, 0666); err != nil { + log.LogPanic(fmt.Errorf("beauty sign failed: %s", err.Error()), 1) + } -func help() { - fmt.Println("Usage:") - fmt.Println("ncbeauty [] [] []") + log.LogDetail("ncbeauty done. Enjoy it!") } -func pathExists(path string) bool { - _, err := os.Stat(path) - if err == nil { - return true - } - if os.IsNotExist(err) { - return false - } - return false -} +func initCLI() { + flag.CommandLine = flag.NewFlagSet("ncbeauty", flag.ContinueOnError) + flag.CommandLine.Usage = usage + flag.CommandLine.SetOutput(os.Stdout) + flag.StringVar(&gitcdn, "gitcdn", "https://github.com/nulastudio/HostFXRPatcher", `specify a HostFXRPatcher mirror repo if you have troble in connecting github. +RECOMMEND https://gitee.com/liesauer/HostFXRPatcher for mainland china users. +`) + flag.StringVar(&loglevel, "loglevel", "Error", `log level. valid values: Error/Detail/Log +Error: Log errors only. +Detail: Log useful infos. +Info: Log everything. +`) + flag.BoolVar(&nopatch, "nopatch", false, `disable hostfxr patch. +DO NOT DISABLE!!! +hostfxr patch fixes https://github.com/nulastudio/NetCoreBeauty/issues/1`) + + flag.Parse() -func fixRuntimeConfig(runtimeConfig string, libsDir string) { - jsonBytes, _ := ioutil.ReadFile(runtimeConfig) - json, _ := simplejson.NewJson(jsonBytes) - - var found = false - runtimeOptions := json.Get("runtimeOptions") - paths, _ := runtimeOptions.Get("additionalProbingPaths").StringArray() - for _, path := range paths { - if path == libsDir { - found = true - break + args := make([]string, 0) + + // 内置的坑爹flag不对空格做忽略处理 + for _, arg := range flag.Args() { + if arg != "" && arg != " " { + args = append(args, arg) } } - if !found { - paths = append(paths, libsDir) - } - runtimeOptions.Set("additionalProbingPaths", paths) - jsonBytes, _ = json.EncodePretty() - ioutil.WriteFile(runtimeConfig, jsonBytes, 0666) -} + argv := len(args) -func fixDependencies(deps string, mainProgram string) []string { - jsonBytes, _ := ioutil.ReadFile(deps) - json, _ := simplejson.NewJson(jsonBytes) - files := []string{} - rid := "" - fxrVersion := "" - fxrName := "" - - // targets - targets, _ := json.Get("targets").Map() - for _, target := range targets { - for targetName, depsObj := range target.(map[string]interface{}) { - // 解析出fxr信息 - if strings.HasPrefix(targetName, "runtime") && strings.Contains(targetName, "Microsoft.NETCore.DotNetHostResolver") { - regex, _ := regexp.Compile("^runtime\\.([\\w-]+)\\.Microsoft\\.NETCore\\.DotNetHostResolver\\/([\\d\\.]+)$") - matches := regex.FindStringSubmatch(targetName) - rid = matches[1] - fxrVersion = matches[2] - fmt.Printf("fxr %s.%s detected\n", rid, fxrVersion) - } - if depsObj != nil { - // runtime - runtimes := depsObj.(map[string]interface{})["runtime"] - if runtimes != nil { - newRuntimes := make(map[string]interface{}) - for k := range runtimes.(map[string]interface{}) { - components := strings.Split(strings.ReplaceAll(k, "\\", "/"), "/") - fileName := components[len(components)-1] - files = append(files, fileName) - newRuntimes["./"+fileName] = make(map[string]interface{}) - } - depsObj.(map[string]interface{})["runtime"] = newRuntimes - } - // NOTE: runtimeTargets未确认是否需要处理 - // runtimeTargets - // runtimeTargets := depsObj.(map[string]interface{})["runtimeTargets"] - // if runtimeTargets != nil { - // newRuntimeTargets := make(map[string]interface{}) - // for k := range runtimeTargets.(map[string]interface{}) { - // components := strings.Split(strings.ReplaceAll(k, "\\", "/"), "/") - // fileName := components[len(components)-1] - // files = append(files, fileName) - // newRuntimeTargets["./"+fileName] = make(map[string]interface{}) - // } - // depsObj.(map[string]interface{})["runtimeTargets"] = newRuntimeTargets - // } - // native - natives := depsObj.(map[string]interface{})["native"] - if natives != nil { - newNatives := make(map[string]interface{}) - for k := range natives.(map[string]interface{}) { - components := strings.Split(strings.ReplaceAll(k, "\\", "/"), "/") - fileName := components[len(components)-1] - files = append(files, fileName) - newNatives["./"+fileName] = make(map[string]interface{}) - if strings.Contains(fileName, "hostfxr") { - fxrName = fileName - } - } - depsObj.(map[string]interface{})["native"] = newNatives - } - // compile - compiles := depsObj.(map[string]interface{})["compile"] - if compiles != nil { - newCompiles := make(map[string]interface{}) - for k := range compiles.(map[string]interface{}) { - components := strings.Split(strings.ReplaceAll(k, "\\", "/"), "/") - fileName := components[len(components)-1] - files = append(files, fileName) - newCompiles["./"+fileName] = make(map[string]interface{}) - } - depsObj.(map[string]interface{})["compile"] = newCompiles - } - // resources - resources := depsObj.(map[string]interface{})["resources"] - if resources != nil { - newResources := make(map[string]interface{}) - for k := range resources.(map[string]interface{}) { - components := strings.Split(strings.ReplaceAll(k, "\\", "/"), "/") - fileName := components[len(components)-2] + "/" + components[len(components)-1] - files = append(files, fileName) - newResources["./"+fileName] = make(map[string]interface{}) - } - depsObj.(map[string]interface{})["resources"] = newResources - } - } - } + // 必需参数检查 + if argv == 0 { + usage() + os.Exit(0) } - json.Set("targets", targets) - - // libraries - libraries, _ := json.Get("libraries").Map() - for k, lib := range libraries { - fixLib := lib.(map[string]interface{}) - fixLib["path"] = "./" - libraries[k] = fixLib + beautyDir = args[0] + + if len(args) >= 2 { + libsDir = flag.Arg(1) } - json.Set("libraries", libraries) - jsonBytes, _ = json.EncodePretty() - ioutil.WriteFile(deps, jsonBytes, 0666) + beautyDir = strings.Trim(beautyDir, `"`) + libsDir = strings.Trim(libsDir, `"`) + absDir, err := filepath.Abs(beautyDir) + if err != nil { + log.LogPanic(fmt.Errorf("invalid beautyDir: %s", err.Error()), 1) + } + beautyDir = absDir - // patch - if disablePatch { - fmt.Println("hostfxr patch has been disable, skipped.") - return files + // logLevel检查 + if loglevel != errorLevel && loglevel != detailLevel && loglevel != infoLevel { + loglevel = errorLevel } - fmt.Println("patching hostfxr...") +} - runtimeJSONBytes, _ := readAsset("/assets/runtime.compatibility.json") - runtimeCompatibilityJSON, _ = simplejson.NewJson(runtimeJSONBytes) - runtimeJSONBytes, _ = readAsset("/assets/runtime.supported.json") - runtimeSupportedJSON, _ = simplejson.NewJson(runtimeJSONBytes) - crid := findCompatibleRID(rid) +func usage() { + fmt.Println("Usage:") + fmt.Println("ncbeauty [--] [--] [--] []") + flag.PrintDefaults() +} + +func patch(fxrVersion string, rid string) bool { + log.LogDetail("patching hostfxr...") + + crid := manager.FindCompatibleRID(rid) + fxrName := manager.GetHostFXRNameByRID(rid) if crid == "" { - fmt.Printf("cannot find a compatible rid for %s\n", rid) - os.Exit(1) - } - if rid != crid { - fmt.Printf("using compatible rid %s for %s\n", crid, rid) - rid = crid + log.LogPanic(fmt.Errorf("cannot find a compatible rid for %s", rid), 1) } - fmt.Printf("downloading patched hostfxr: %s.%s\n", rid, fxrVersion) - fxrURL := fmt.Sprintf("%s/raw/master/artifacts/v%s/%s.Release/%s", gitcdn, fxrVersion, rid, fxrName) - response, err := http.Get(fxrURL) - var fxrData []byte - if err == nil { - if response.StatusCode != 200 { - err = errors.New(response.Status) - } else { - fxrData, err = ioutil.ReadAll(response.Body) + + log.LogDetail(fmt.Sprintf("using compatible rid %s for %s", crid, rid)) + rid = crid + + if manager.GetLocalArtifactsVersion(fxrVersion, rid) == "" { + log.LogDetail(fmt.Sprintf("downloading patched hostfxr: %s/%s", fxrVersion, rid)) + + if !manager.DownloadArtifact(fxrVersion, rid) || !manager.WriteLocalArtifactsVersion(fxrVersion, rid, manager.GetOnlineArtifactsVersion()) { + log.LogPanic(errors.New("download patch failed"), 1) } } - if err != nil { - fmt.Println("download patch failed due to:") - // ensure download - fmt.Println(err) - os.Exit(1) - } + absFxrName := path.Join(beautyDir, fxrName) absFxrBakName := absFxrName + ".bak" - fmt.Printf("backuping fxr to %s\n", absFxrBakName) - if pathExists(absFxrBakName) { - fmt.Println("fxr backup found, skipped.") + log.LogInfo(fmt.Sprintf("backuping fxr to %s\n", absFxrBakName)) + + if util.PathExists(absFxrBakName) { + log.LogDetail("fxr backup found, skipped") } else { - err := os.Rename(absFxrName, absFxrBakName) - if err != nil { - fmt.Println("backup failed.") - fmt.Println(err) - return files + if _, err := util.CopyFile(absFxrName, absFxrBakName); err != nil { + log.LogError(fmt.Errorf("backup failed: %s", err.Error()), false) + return false } } - f, err := os.Create(absFxrName) - if err != nil { - fmt.Printf("open %s failed\n", absFxrName) - fmt.Println(err) - return files - } - bytes, err := f.Write(fxrData) - if err != nil || bytes == 0 { - fmt.Printf("write %s failed\n", absFxrName) - fmt.Println(err) - return files + + success := manager.CopyArtifactTo(fxrVersion, rid, beautyDir) + if success { + log.LogInfo("patch succeeded") + } else { + fmt.Println("patch failed") } - fmt.Println("patch succeed") - return files + return success } -func findCompatibleRID(rid string) string { - crids, _ := runtimeCompatibilityJSON.Get(rid).StringArray() - srids, _ := runtimeSupportedJSON.StringArray() - for _, crid := range crids { - for _, srid := range srids { - if crid == srid { - return srid +func moveDeps(depsFiles []string, mainProgram string) int { + moved := 0 + for _, depsFile := range depsFiles { + if strings.Contains(depsFile, mainProgram) || + strings.Contains(depsFile, "apphost") || + strings.Contains(depsFile, "hostfxr") || + strings.Contains(depsFile, "hostpolicy") { + // 将其加一,不然每次看到日志的文件移动数少3会造成疑惑 + moved++ + continue + } + + absDepsFile := path.Join(beautyDir, depsFile) + absDesFile := path.Join(beautyDir, libsDir, depsFile) + oldPath := path.Dir(absDepsFile) + newPath := path.Dir(absDesFile) + if util.PathExists(absDepsFile) { + if !util.EnsureDirExists(newPath, 0777) { + log.LogError(fmt.Errorf("%s is not writeable", newPath), false) + } + if err := os.Rename(absDepsFile, absDesFile); err == nil { + moved++ + } + + // NOTE: 需要移动附带的pdb、xml文件吗? + // NOTE: pdb、xml文件是跟随程序还是跟随依赖dll? + fileName := strings.TrimSuffix(path.Base(depsFile), path.Ext(depsFile)) + extFiles := []string{".pdb", ".xml"} + for _, extFile := range extFiles { + oldFile := path.Join(oldPath, fileName+extFile) + newFile := path.Join(newPath, fileName+extFile) + if util.PathExists(oldFile) { + os.Rename(oldFile, newFile) + } + } + dir, _ := ioutil.ReadDir(oldPath) + if len(dir) == 0 { + os.Remove(oldPath) } } } - return "" + return moved } diff --git a/src/main/bindata.go b/src/main/bindata.go deleted file mode 100644 index 0925cee..0000000 --- a/src/main/bindata.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated for package main by go-bindata DO NOT EDIT. (@generated) -// sources: -// assets/runtime.compatibility.json -// assets/runtime.supported.json -package main - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -// Name return file name -func (fi bindataFileInfo) Name() string { - return fi.name -} - -// Size return file size -func (fi bindataFileInfo) Size() int64 { - return fi.size -} - -// Mode return file mode -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} - -// Mode return file modify time -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} - -// IsDir return file whether a directory -func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 -} - -// Sys return file is sys mode -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _assetsRuntimeCompatibilityJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\xd1\x92\xa3\xba\x11\x7d\xdf\xaf\x98\xba\xcf\xac\xcb\x80\x41\x52\x7e\x25\x95\x87\xd9\xac\x93\x4c\xd5\x5c\xfb\xd6\xce\x4c\xc5\x37\xa9\xfc\x7b\x6a\x6c\x6c\xa4\xee\xd3\x12\xd8\x02\xc9\x63\xde\x86\x96\x91\x4e\x9f\xd3\xad\x16\x82\x81\xff\x7e\x7b\x7a\xfa\xed\xf9\xf5\x8f\x97\xdd\xf6\xb7\xbf\x3c\xfd\xf5\xdb\xd3\x53\x7f\x5c\x9c\x8e\x5e\x5f\x76\x1f\x87\xef\xbf\x7f\xbc\xbd\x3a\x96\xf3\xc1\xc7\xee\xe5\xf2\xf7\xf3\xee\xcf\xf3\x9f\x3f\x9e\xdf\xb6\xbf\x7d\x7b\x7a\xfa\x5b\xd1\x8f\xf0\xfd\xd0\x6e\xe8\x28\x47\x5b\xe1\x1f\xd7\xfe\x8d\x80\x86\xfd\xc4\x86\x67\x37\x8e\x80\xbb\xaa\x57\xe5\x9a\xe2\x3d\x19\x0b\x62\x32\xcc\xa2\x99\x45\x31\x4b\x1b\x72\xfc\x56\xc2\x8f\x60\x11\xeb\x7d\x03\xc5\x84\x9c\x83\x3f\x04\x2e\xc3\xdf\x01\x22\xe0\xef\x00\x3d\xf0\x77\x84\xb4\xcc\xe3\xa7\x44\xcc\x97\x83\x58\xcf\x37\xa4\x4a\x29\xa4\x4a\x1c\x52\xc8\xdf\x25\xf8\x26\x0f\xbe\x16\x48\x34\x47\x7c\xb4\x42\x78\x7c\x01\x4a\x15\x70\x2b\x4d\x12\x2a\x81\xe4\x07\x8a\x6f\x0d\xdc\xcf\x65\x8e\xd4\x82\x3c\xcb\x34\xc5\xa8\x32\x80\xa6\x7c\x8b\x9f\x11\x84\x5d\xea\xd4\xe8\x00\xd8\xfd\xfc\xb5\x7f\xf9\x69\x71\xd9\x19\xae\x17\xe9\xd4\xc1\xf7\xe7\x5f\xbf\xb3\x5e\x8f\xc6\x42\x1e\xc8\x6e\xe7\xbe\x59\x8d\x63\x91\x38\xd1\xe2\x98\x03\x68\x7c\x5c\x3b\xcd\x63\x10\xad\xaa\x92\xc1\xf9\xb4\x79\xb0\x5c\x39\x0c\x54\xe1\x6c\x2f\x02\x00\x92\xa8\xd5\x81\x03\x82\xf5\x2d\x43\x80\xcf\x2f\xed\x9f\x36\x62\xe9\x57\xfb\x77\xeb\x57\xfb\xf7\x60\xb7\xc7\xa3\xcb\x19\x6e\xdb\xdf\xb7\xbb\xf7\xfd\x5b\xdf\xda\x1d\x77\xfd\xfc\xfa\xd7\xf6\x86\xa9\xf6\xd4\x97\x3b\xcd\x5a\xb6\x42\x1a\xd1\x6e\x65\x08\xe2\x4e\x5d\xa7\xc1\xed\xd5\xe0\xc5\x22\xc2\xeb\xdb\x62\xd0\x43\xd7\x7f\x8e\xb5\xf0\x61\xa2\x34\xa1\x73\x64\xdc\xf3\x93\xac\x99\x93\xda\x03\x56\x47\x25\x59\x43\x92\x35\x20\x59\x07\x48\x06\xe7\xc8\xb8\x67\x24\xf9\xe7\xf6\xc7\xcb\xf3\xae\x77\xb1\x3b\xbe\x9a\xb8\xd3\xf9\xee\xdc\x6f\xd9\x0a\x71\x94\xb8\x33\x7a\x3f\xa4\xad\x9f\x63\xf5\x43\x89\x3b\x43\xf7\x03\x6f\x5f\x11\x9c\x5e\x62\x01\x8e\x27\x96\xdd\xe6\x31\x70\x0e\x80\x9b\x83\x9f\x99\x09\x62\xef\xfb\x41\xb7\x1c\x86\x6e\xbd\x30\xfa\x66\x00\xa3\x6f\x1c\x01\xc3\xd9\xea\xed\x4d\x32\x88\xeb\xc6\x40\x99\x71\x36\x17\xde\xc1\x13\xe4\x4f\x07\x8c\x87\x49\xdf\x10\xc6\x9c\x24\xd5\x3a\x80\x3c\xdb\xfa\x86\x30\xf2\x24\x59\xc9\x36\xec\x5d\x73\x00\xf5\xfc\xe9\x7b\x04\xc6\x33\xf8\x6c\x0e\xe1\x9d\x3f\xcf\x35\x83\xaa\x23\x67\xb9\x86\x49\xae\x41\x8e\xeb\xf4\x29\xae\x85\x0c\xd7\x30\xc1\x01\xe0\x34\xf9\xad\x85\xf4\xd6\x30\xbb\x01\xec\x34\xc9\xad\x61\x6e\x6b\x90\xda\x14\x72\x82\xcc\xd6\x30\xb1\x35\xc8\x6b\x06\x76\xfe\xb4\x36\x0c\xa8\x89\x9c\xd6\x06\xa6\xb5\x01\x69\x6d\xd2\xa7\xb5\x11\xd2\xda\xc0\xb4\x06\x80\xd3\xa4\xb5\x11\xd2\xda\xc0\xb4\x06\xb0\xd3\xa4\xb5\x81\x69\x6d\x40\x5a\x53\xc8\x09\xd2\xda\xc0\xb4\x36\x20\xad\x19\xd8\x19\xd3\xfa\x1f\xdb\x9f\xfb\x5f\xcf\x3d\xcc\xee\xf8\xea\x24\x3e\x9d\x4f\xb3\xc2\xb1\x16\xe2\x48\xf1\xe3\xbd\x1b\xf8\x00\xc0\x1c\xfc\x50\xa2\x86\xc4\x69\x80\x55\x55\x53\x14\x9f\x26\x19\xc4\x75\x63\x60\xf2\xfb\x86\xc2\x0b\x20\x99\x48\x9f\x00\x81\x4e\x67\x73\x00\x75\x0a\x35\x01\x56\x1f\x88\xeb\xc6\x90\xd4\xdc\x60\x35\x37\xd9\xa8\xb9\xc1\x6a\x6e\x90\x9a\x14\x75\x0a\x35\x1b\x8e\xb5\x89\xad\x66\x23\xa9\xd9\x60\x35\x9b\x6c\xd4\x6c\xb0\x9a\x0d\x52\x93\xa2\x4e\xa1\x66\xcb\xb1\xb6\xb1\xd5\x6c\x25\x35\x5b\xac\x66\x9b\x8d\x9a\x2d\x56\xb3\x45\x6a\x52\xd4\x29\xd4\x54\x1c\xab\x8a\xad\xa6\x92\xd4\x54\x58\x4d\x95\x8d\x9a\x0a\xab\xa9\x90\x9a\x14\x75\x0a\x35\x35\xc7\xaa\x63\xab\xc9\xf6\x5b\x68\x43\xe1\x05\x90\x50\x4d\x8d\xd5\xd4\x48\x4d\x8a\x3a\x85\x9a\x86\x63\x35\xb1\xd5\x64\x97\xd9\xb4\xa1\xf0\x02\x48\xa8\xa6\xc1\x6a\x1a\xa4\x26\x45\x9d\x40\xcd\x7a\xcd\xb0\xd6\xeb\xc8\x6a\xd6\xec\x6e\x07\x6d\x28\xbc\x00\xd2\xa9\x59\xaf\xa1\x9a\xf5\x1a\xa8\xc9\x50\xa7\x50\xb3\xe4\x58\xcb\xd8\x6a\xb2\x87\x79\x68\x43\xe1\x05\x90\x50\xcd\x12\xab\x59\x22\x35\x29\xea\x14\x6a\x56\x1c\x6b\x15\x5b\xcd\x4a\x52\xb3\xc2\x6a\x56\xd9\xa8\x59\x61\x35\x2b\xa4\x26\x45\x3d\xab\x9a\xbf\xb6\xdb\x1f\x6f\xd6\xf3\x98\x67\xc3\x15\x9d\x10\x97\x2d\x63\x21\xf6\x7d\x2d\x60\xe7\x9f\x6c\x2c\x9b\x3c\xd2\x88\x9e\xa1\x23\xe4\x1f\x5d\xc4\x31\xa7\x73\x78\xb5\x46\xa0\x56\xeb\x20\xa4\xab\xc7\x93\x88\x58\xad\x31\x15\x08\x4b\x6a\xd2\x60\x9c\xac\x28\x80\x69\x89\x14\x23\x6a\x25\xd0\x83\xf1\xdd\x0f\xe9\x15\x74\xb6\x1a\xea\xe8\x64\x42\xd0\x69\x99\xb6\x70\x2c\x10\xf3\xd7\x14\xad\x86\xc4\xd4\x43\x49\x99\x55\x48\xba\x3b\x4f\x5b\x38\x16\xe8\xc7\x83\x8a\xfe\xcf\xed\xee\x7d\xbf\xef\xe9\xeb\x8e\xa5\x55\xc5\xc0\xfe\x5c\x49\x2c\x5b\x21\x8e\x12\x77\x31\x73\xea\xe1\x82\x60\xbc\x1f\xfd\xad\x79\xb7\x93\xb8\x77\xeb\xed\xa5\x27\x1f\x27\xee\x7a\xd4\xbe\x05\xce\xc7\x8a\x7b\x5f\xfc\xd4\xed\xf1\x1f\x88\xc8\x50\xb7\xfd\x1b\x56\xdf\x07\x92\xe6\x62\x2f\xbc\x23\x4e\x21\xe1\x79\x68\xae\xa3\xd5\x12\x86\x35\x85\xe2\x67\x00\x5c\x76\xab\x25\x0c\x6d\xaa\x00\x71\xa7\x0a\x62\x0f\xc0\x8a\x3f\x65\x74\x43\xdb\x0f\x48\x10\x7b\x08\x52\xcc\x87\x20\x7a\x2f\x09\x9a\x09\x1c\x07\x3e\xc7\xf7\xe5\xf7\x97\xdd\xfb\xaa\x54\x64\xa0\xb3\xf5\xdc\xdd\x8f\x8f\xdd\xfb\xc7\xaa\xdc\xac\xd6\x1b\xd7\x76\x3e\xba\xf5\x89\x2e\x7b\x54\x40\xaf\xdd\x52\x0c\xc3\xe9\x90\x2e\xe2\xe7\xbf\x72\x3d\x9a\xf5\x71\x20\xdb\x25\xfb\xd2\x88\xd8\x07\x12\x30\xbd\x50\xf4\xd2\x09\xb4\x01\xac\xd8\x83\x47\x92\xb6\x12\x28\xab\x86\xd3\x95\x48\xf0\xca\x23\x78\x25\x0a\x2e\xf8\xb5\x04\x88\x44\x73\x2d\x50\x5c\x8f\xa1\x37\xa3\xb0\xa9\x3d\x61\x53\x8b\x61\x20\x78\xbb\x84\x59\x9c\x30\xd3\x50\x10\x4d\x1d\x6a\xe7\x08\x11\x2d\x06\x88\x16\x04\x81\x38\x91\x20\x1c\x7f\xb6\x82\x08\x35\x5f\xc3\x48\x4d\x24\x94\xa7\xe6\x6b\x31\xd7\x04\x0f\x1e\x49\x5a\x5c\xf3\x35\x9c\xb4\xf2\x12\x5c\xae\xf9\x5a\x9c\x8c\x45\xbf\x96\x00\x91\x68\xc6\x35\x5f\xc3\x2a\x78\x0f\x61\x23\xd7\x7c\x2d\xd6\x7c\xd1\xdb\x25\xcc\xe2\x84\x99\x81\x82\x18\xea\x90\x9e\x23\x44\x8c\x18\x20\x46\x10\x04\xe2\x44\x82\x70\xfc\xd9\x0a\x22\xd4\x7c\x03\x23\x35\x91\x50\x9e\x9a\x6f\xc4\x5c\x13\x3c\x78\x24\x69\x71\xcd\x37\x70\xd2\xca\x4b\x70\xb9\xe6\x1b\x71\x32\x16\xfd\x5a\x02\xc4\xa2\x79\x6f\xed\xf9\xef\x2f\x3b\xd5\xb7\xbd\x1b\x67\x4f\xb6\xec\xf7\xce\x56\xbd\x3b\x8a\xdd\x32\xf1\x9b\x6c\xf6\xaf\xf6\xfb\x98\xf6\xd6\x7b\x8b\x5c\x48\xb1\xde\xc3\xb4\x7f\xa5\xef\x60\xda\x93\x77\x29\xb9\x18\x28\x15\xf4\xb7\x32\xc6\x99\x49\xb4\x9f\x2d\xea\x8e\x81\x43\x27\x98\x76\xdb\x54\x24\xd3\x67\x8f\x2c\x5b\x21\xa1\xe4\x64\xf3\x33\x64\x4f\xee\x47\xaa\x92\xd0\x52\x62\x4a\x3a\x17\xcb\xc4\x42\x96\x40\xc8\x92\x09\x49\x7c\x00\x52\xf2\x73\xbc\x9e\x3e\x4a\x30\x54\x84\xda\x0a\xd3\xda\xb9\x58\x65\x1d\x2a\x15\x08\x95\x8a\xc9\x4e\x3c\x04\x42\xf3\x73\x02\x3c\x2c\xe1\x36\x54\xa2\x9a\xc8\x53\x63\x69\x3a\x17\xeb\x3b\x0e\xc6\x1a\x04\x63\xcd\x82\x82\xf8\x0f\xc2\x80\x9f\x13\x60\x69\x09\xe8\x39\x03\x9a\x4a\x2c\xc8\xdb\xb9\x38\x4a\xc8\xbb\x0a\xf7\x0d\x08\xf7\x0d\x0b\x19\xc2\x0e\x08\x12\x7e\x4e\x80\xc3\x25\x65\xee\x2d\x65\x1a\x12\x26\x0d\x0e\x91\xce\xc5\xe6\x41\x13\xaa\x01\x09\xd5\xb0\x80\x22\xdc\x81\x10\xe2\xe7\x04\x18\x5e\x92\xf2\x11\x93\xb2\x25\xa1\xd6\xe2\x30\xeb\x5c\x6c\x97\x94\x45\x1c\x82\x94\x6d\x59\xb8\x11\x66\x41\x80\xf1\x73\x02\xfc\x2f\x69\xbf\xa4\xfd\x35\x69\xaf\x9d\x60\xd5\x02\xc0\x48\xaf\x47\xdf\xbf\xd2\x37\x59\xee\xc9\x2b\xce\x5d\x0c\x8c\x44\xed\x21\x31\xd5\xab\xd0\x3f\x21\x93\xbd\x4f\xed\xec\x2a\x6a\x17\xa6\x38\x0f\x45\x24\x19\xec\x7d\x6a\x16\xbd\x04\x25\x27\x9b\x9f\x21\x7b\x72\x1f\x52\xfd\xb1\xdd\xbd\x7d\xd8\x9f\xa7\xb8\x58\xae\xa7\xbb\xeb\x81\x10\x6e\x5b\x0b\xcf\x58\xd3\x38\xb8\x2a\x6b\x67\x5b\xcf\x31\xfb\xe0\x5c\x3f\x1a\xf6\xbf\x6f\x2a\x06\x40\x49\xc6\x56\xe3\x24\xb0\x63\x9e\x80\xad\x86\xa5\x27\x6b\x62\x6c\x01\x28\x09\xd9\x2a\x31\xf6\x72\x1a\xb6\xe8\xfe\x3f\x6b\x02\x6c\x31\x28\xa9\xd8\xda\x54\x90\xad\xa3\x39\x3e\x5b\x9f\xdd\x0a\x6c\x5d\x9a\x28\x5b\x08\x4a\x42\xb6\xd0\xbc\x75\x34\x4f\xc2\x96\x34\x6f\x5d\x9a\x00\x5b\xd9\xcc\x5b\x9b\xca\xd9\x4d\x77\xcc\x93\xb0\x45\x77\xb4\x59\x13\x60\x8b\x41\x99\x9b\xad\x37\xeb\x1f\x7a\x3f\x0f\x46\x9e\x4c\x5c\x7e\x73\x10\x90\xfe\xae\x01\xb7\x2a\xd7\xce\x47\x44\x7a\x13\x1e\x63\x78\x9f\x0c\xb9\x65\x2e\xe4\xc1\xa6\xf0\xaf\xe4\x38\x4a\x1f\x86\xeb\x06\xc1\x0e\x97\xc8\x61\x3e\x7a\x0a\x5a\x2a\x8e\xb6\x0a\x23\xbd\x95\x27\x3a\xe7\x39\xe6\x22\x04\x27\x5f\x36\x6b\xee\x53\x1d\xf6\x27\x3a\xbd\x74\x92\x74\xcc\x45\x08\xdf\xbd\x8b\x00\x3c\x1f\xe0\xf5\xf4\xaa\xd0\xbb\x53\x8e\xb9\x08\x01\x7e\x0c\xed\x1a\xce\x4f\x13\xe6\x26\x81\x98\xf4\xce\x88\x63\x2e\x42\x1e\x2c\x92\x77\x3b\x2d\x17\x02\x6f\xdb\x71\x3a\xee\xe2\x90\x97\x58\x58\xb6\x42\x18\x23\xfe\x8b\x2b\x2e\xdb\x49\x2e\x8c\xf9\x36\x98\x8e\xbb\x5b\xad\x3b\x7c\xbf\x53\x7f\x3b\xcb\xf4\xfe\x82\x65\x2b\xa4\x11\xe7\x76\x5f\x11\x78\x91\x6e\xaf\x58\x9b\xe8\xa4\x7f\xbe\xd5\x9e\xd4\x7d\x7b\x2b\x89\xde\x17\x88\x4f\x08\xdd\x4a\x42\x77\x2a\x30\x8a\xdc\x68\x2b\x99\x13\xf4\x16\xcf\x94\x34\x96\x90\x46\x74\x2b\x8a\xa1\xba\x3f\xaa\x2b\xe6\x28\xbd\x23\x37\x27\xf5\x15\xa4\x1e\xdd\x49\x64\x28\xbf\xa6\x3c\x35\x23\x83\xde\x74\x4d\x29\x57\x0d\xe5\x42\x37\x8f\x19\xea\xc7\x95\x94\x13\x16\x24\x2b\xa1\xc4\x1b\x28\x31\x7a\xc6\x80\x79\xb1\x84\x81\x8f\xd8\x86\x91\x4a\x1f\xeb\xc8\x39\x2c\x1a\x18\x16\xe8\xf1\x15\xe6\xd5\x12\x3a\xb7\x86\x0e\xbd\xaa\x50\xee\x2a\xff\xce\x42\x09\x5d\xc7\x28\x70\x25\x03\xbc\x5c\xc2\x6d\xfa\x70\xd3\x44\x9a\x48\x8f\xa6\x9c\xfa\x42\x5b\x05\xf4\xbb\xc1\x7c\xd4\x24\x9b\x09\xf4\x71\x25\xcb\x26\x03\x9d\x5b\x2b\x76\xc1\xa9\x49\x70\x45\x55\x6f\xc5\xbe\x76\x42\xec\x85\x0f\x49\xa6\x2a\xc3\xab\x68\x0d\xf2\x96\x3b\x94\x59\x2c\xd0\xab\x68\x4d\x26\xa3\x69\x63\x83\x7d\x3b\x85\xd8\x0b\x3f\xb2\x7b\x8e\x20\xb4\x81\xa0\x41\x75\x40\x6e\xdf\x4f\x94\xbd\xbd\x6e\xdf\x7a\x27\x8f\x47\x57\xc7\xcc\xe7\xd9\x2e\x69\x17\x4b\x21\xf4\x1f\xdf\x19\xe7\x1e\xec\xd9\x20\x0d\x7f\x4d\xef\xdc\x43\x72\xd7\x00\x0c\x3a\x3f\x07\xf6\xbc\xd1\x9b\x64\x84\x37\xd3\x42\xf3\xc5\x35\x17\x7e\x24\xf9\xd1\xc7\x83\x68\x55\x85\xbc\x88\xcb\x27\x0e\xb4\x15\xe2\x0a\x40\xbb\x4f\xd6\x6b\xee\x6f\x1d\xf6\x75\x52\x19\x6a\x2c\x43\x8d\x08\xe6\x58\xbf\xb2\x58\x80\x95\x01\x8c\xcc\xab\xde\x06\xab\xb7\x41\x8c\x73\xf0\x8f\xae\x71\x43\x99\x6b\xc2\x9c\x25\x15\xbc\x41\x72\x37\x9c\x56\xee\xc7\x12\x10\x83\xf8\xe5\xcb\x8a\x86\x82\xce\x3e\x46\xf0\x4a\xa5\x41\x8a\x70\xe7\x96\x58\xba\x3d\x96\xde\x5f\xfe\xb3\xdd\xf5\xfc\x9f\x0e\xaf\x56\xf5\x78\x3a\xfd\xae\x89\x6d\x2c\xa4\x61\xe2\x7f\xcd\xe4\x34\xac\xf3\x05\x8d\xde\x24\xe3\x88\xfa\x7d\x8d\x63\xff\xab\xcd\x6a\x6d\x6f\x23\xd9\x46\x11\xc7\xb5\xc3\x40\xf2\x9d\xa6\xc2\x8f\x22\x91\x50\x1d\x44\x2e\x97\xd5\x10\x42\x3e\xbb\xb0\x0d\x12\xb6\x61\xc0\x26\xd0\xba\x91\xb5\x6e\x24\xad\x25\x60\x79\xc7\x45\x23\xc5\x45\x83\xe3\x42\xf4\x32\xb3\x08\xea\x5e\x43\x79\x71\x2a\xee\xab\x3c\xbb\xd7\x5e\x3a\xdf\xe3\xb2\x6c\x85\x3c\xa6\xdd\x8e\x5e\x85\x19\xf5\x3b\x5d\x3d\x24\x7b\x11\xe0\x58\x03\x50\xfb\x5f\x08\x60\xe3\xee\x47\x5a\xaf\x13\xa5\x70\x0f\x01\xb0\x07\x3f\xd4\xa8\x55\xfd\x0c\xc9\xce\x1a\xcb\xe6\x85\xd9\xb7\x43\x98\xf1\x73\xa0\xfb\x62\x06\x01\x3a\xe5\x97\x49\x9c\x2f\x78\x80\x1c\xb1\x5a\x8a\x10\xa6\x0c\xf3\xc9\xfa\x34\x09\x76\x8c\x85\x6a\xf6\x1f\x2d\x71\xe1\xf3\xb0\xb6\x5a\x06\x38\x96\x65\x0a\xd8\xff\xa6\xe6\x58\x27\x4e\x81\x72\x2d\xa5\x40\xd7\xc2\x08\xa5\x98\x32\x4d\x01\xfa\x3f\x7a\xac\x25\xec\x58\x9e\x29\x50\xae\xa5\x14\x28\xd7\x38\x05\xb8\x63\x19\xa6\x40\x03\xab\x40\x33\x79\x15\x68\xc4\x2a\xd0\x08\x55\x80\x63\xca\x32\x05\x1a\xb1\x0a\x34\x42\x15\x00\x8e\xe5\x98\x02\x8d\x58\x05\x1a\xa1\x0a\x20\xc7\xb2\x4c\x01\x54\x05\x9a\xc9\xab\x40\x23\x56\x81\x46\xa8\x02\x1c\x53\xa6\x29\x20\x55\x81\x46\xa8\x02\xc0\xb1\x3c\x53\x40\xaa\x02\x8d\x50\x05\x90\x63\x19\xa6\x40\x0b\xab\xc0\x74\x5f\x2c\x72\xbe\xec\x03\x53\xa0\x15\xaa\x00\xf8\xe6\x4f\x8e\x29\x70\x86\x8f\x92\xc0\x6a\x1b\xe4\x5c\xa6\xd7\xe3\xd6\x77\x99\xb0\x8b\x20\xcf\x33\xff\x62\x93\x0b\x1f\xe5\x79\x2b\x94\x3a\xe4\x58\x96\x79\x8e\x4a\x5d\x3b\x79\xa9\x6b\xc5\x52\xd7\x0a\xa5\x8e\x63\xca\x34\xcf\x4b\xf6\xf4\x28\x68\x1b\xe4\x5c\xc6\x79\x2e\xd5\xf3\x56\xa8\xe7\xc0\xc1\x3c\xf3\x5c\xaa\xe7\xad\x50\xcf\x91\x63\x19\xe6\xb9\x82\xf5\x5c\x4d\x5e\xcf\x95\x58\xcf\x95\x50\xcf\x39\xa6\x2c\xf3\x5c\x79\xea\xb9\x12\xeb\x39\x76\x2e\xdb\x3c\x57\x62\x3d\x57\x42\x3d\x07\x0e\xe6\x98\xe7\x4a\xac\xe7\x4a\xa8\xe7\xc8\xb1\x2c\xf3\x1c\xd5\x73\x35\x79\x3d\x57\x62\x3d\x57\x42\x3d\xe7\x98\x32\xcd\x73\xb9\x9e\x2b\xb1\x9e\x63\xe7\x32\xce\x73\xa9\x9e\x2b\xa1\x9e\x03\x07\xf3\xcc\x73\xa9\x9e\x2b\xa1\x9e\x23\xc7\x32\xcc\x73\x0d\xeb\xf9\x74\x1f\xa5\xb4\x47\xc0\x79\xae\x85\x7a\x0e\x3e\x03\x99\x63\x9e\x6b\x4f\x3d\xd7\x62\x3d\xc7\xce\x65\x9b\xe7\x5a\xac\xe7\x77\xfa\x11\x4f\x17\x3e\xca\x73\x2d\xd4\x73\xe4\x58\x96\x79\x8e\xea\xb9\x9e\xbc\x9e\x6b\xb1\x9e\x6b\xa1\x9e\x73\x4c\x99\xe6\xb9\x5c\xcf\xb5\x58\xcf\xb1\x73\x19\xe7\xb9\x54\xcf\xb5\x50\xcf\x81\x83\x79\xe6\xb9\x54\xcf\xb5\x50\xcf\x91\x63\x19\xe6\xb9\x81\xf5\xdc\x4c\x5e\xcf\x8d\x58\xcf\x8d\x50\xcf\x39\xa6\x2c\xf3\xdc\x78\xea\xb9\x11\xeb\x39\x76\x2e\xdb\x3c\x37\x62\x3d\x37\x42\x3d\x07\x0e\xe6\x98\xe7\x46\xac\xe7\x46\xa8\xe7\xc8\xb1\x2c\xf3\x1c\xd5\x73\x33\x79\x3d\x37\x62\x3d\x37\x42\x3d\xe7\x98\x32\xcd\x73\xb9\x9e\x1b\xb1\x9e\x63\xe7\x32\xce\x73\xa9\x9e\x1b\xa1\x9e\x03\x07\xf3\xcc\x73\xa9\x9e\x1b\xa1\x9e\x23\xc7\x72\xca\xf3\xcf\x1f\xf5\xce\x0c\x3d\x85\xa4\xe6\x55\x09\xd1\x87\x18\xeb\x68\xac\x3a\xfd\x7f\x0a\xb0\xae\x46\xfe\xf7\xc0\x25\x3a\xdc\x8e\x46\xc7\xcb\x59\x0b\xd2\xcd\x48\x75\xfe\xfd\x62\xfd\x93\xd5\xe7\xc1\x80\x13\xbe\x3f\xef\xdf\x9d\x93\x8e\x86\x82\xf7\xd1\x5b\xfd\xdd\xd9\x4a\x9f\x0d\xa0\xbb\x40\x1f\x00\x56\x67\x2c\x24\xa4\xd2\x48\xc3\x81\xdb\x3a\xf6\xa6\xf1\xe0\xdb\x0d\x84\xdf\x99\xbd\x0e\xe0\xf1\x06\xba\x70\xa0\x0e\x1c\xc6\xc3\x3f\x20\xf0\x87\x20\x74\x61\xa4\xa1\xc0\xed\xd0\x3f\x1b\xc6\x02\xd7\x2d\x00\xde\x19\x3d\xc0\xf1\x48\xc3\x80\xdb\x8b\x9d\xd3\x61\xdf\x95\x2e\xed\x03\xeb\x6f\x35\xd2\xb3\xcf\x22\x4f\xfc\xea\x4c\x85\x34\x32\x69\x75\xa1\xd0\x46\x1b\x1a\x69\x53\x32\x71\xa3\x99\x62\x33\x83\xbb\x2e\x43\x4e\x38\xad\xd4\x09\xb7\xd1\x75\xc2\x69\x53\x03\xe6\x88\x20\x72\x28\x01\x9b\x91\x80\x2e\x61\x1f\x99\x58\xc0\x10\x60\x82\x9e\xc1\x8f\xfd\x6c\x51\xd9\xf9\xb1\x97\xd1\x29\xe7\x65\xbe\xfc\xb5\x8d\x5e\x62\x9d\x76\x4e\x9a\xdb\x4c\xdd\x75\x5a\xa9\xc3\xa3\xa7\xd5\x33\x60\x21\x8c\xd8\xf4\x2a\x04\x52\xd8\xe3\x61\xc1\x14\x64\x66\x48\x40\x85\xf8\x1b\x12\x54\x01\x96\xa7\xad\x97\xf4\xa2\xa3\x37\xc9\x24\x1f\x7c\xd4\x1d\x3c\x94\x1c\x64\x57\xc7\x57\xe9\x13\x4c\x14\x4c\xbc\x52\xa3\x50\x0a\xfa\x38\x20\x8c\x42\x4c\x04\x43\x28\xc0\x56\x30\x7c\xfc\x8c\x4e\xb9\x5e\xa1\x17\x75\xbd\xc9\x43\xaa\xd3\x4a\xe9\x72\x1b\x5d\x37\x9d\x36\xd7\xcd\xd1\xab\xa4\x13\x4c\x18\x38\x6c\xa5\x04\x03\x27\xe4\xe3\x90\xc0\x09\x30\x11\x0e\x1c\x3f\x5b\xe1\xc0\xf1\x32\x3a\xe5\x7a\x51\x39\xac\x8f\x5d\x08\x2a\xa6\xdb\x74\xeb\x35\xc5\x96\x6b\x91\x97\x55\x0a\xae\xaa\x72\x5f\x8d\x28\xb0\x18\x99\x60\xb9\xa0\x84\xd5\xc2\xbd\x54\x56\xc5\x0a\x6b\xe4\x02\xa8\x60\xfd\xcb\xbd\x6e\x28\x56\x36\x22\x4f\xef\x0a\xce\xee\xb9\xcf\x8a\xda\x41\x7b\xcb\xa5\xb2\x66\xbe\xa7\xb9\xda\xd5\x6c\xf6\x9c\xf1\x82\x55\xc3\x99\xf5\xab\x5f\x27\xb2\x77\x92\xa7\xb8\xcc\xd3\xc2\xbc\xfd\x48\x57\x55\x9a\xcd\xfd\x33\x5e\x18\x69\x58\x17\xbe\xfa\xf5\x88\x66\x75\x65\xc6\x4b\x0a\x0d\x6b\xce\x57\x5f\xc9\xeb\xd2\x75\x37\xd6\x66\x6f\x77\xc1\xe4\xf6\x9d\xdf\x76\x6e\xb7\x27\x49\x61\x66\xb1\x61\x6b\xed\xaa\x72\x7c\xcb\x66\x6b\x98\x3a\x3a\x7d\xe7\xb6\x99\xea\xec\x75\x22\xa4\xcb\x26\xe8\x28\xc9\x59\xbd\xce\x65\x9b\xd3\xda\x8b\xe4\xf8\x96\x2d\xca\x10\x75\x74\x4d\x90\xcb\x26\xa4\xb5\x53\xc8\xf1\x2d\x1b\x88\x88\xba\x6f\xff\xfb\x7f\x00\x00\x00\xff\xff\xa4\x12\x39\x55\xaf\xfd\x00\x00") - -func assetsRuntimeCompatibilityJsonBytes() ([]byte, error) { - return bindataRead( - _assetsRuntimeCompatibilityJson, - "assets/runtime.compatibility.json", - ) -} - -func assetsRuntimeCompatibilityJson() (*asset, error) { - bytes, err := assetsRuntimeCompatibilityJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "assets/runtime.compatibility.json", size: 64943, mode: os.FileMode(420), modTime: time.Unix(1570344135, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _assetsRuntimeSupportedJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8a\xe6\x52\x50\x50\x50\x50\x2a\xcf\xcc\xd3\xad\xb0\x30\x53\xd2\x41\xe2\x9a\x99\xc0\xb8\x39\x99\x79\xa5\x15\xc8\x02\xf9\xc5\x10\x2e\x57\x2c\x20\x00\x00\xff\xff\x6c\xfd\xc1\xad\x40\x00\x00\x00") - -func assetsRuntimeSupportedJsonBytes() ([]byte, error) { - return bindataRead( - _assetsRuntimeSupportedJson, - "assets/runtime.supported.json", - ) -} - -func assetsRuntimeSupportedJson() (*asset, error) { - bytes, err := assetsRuntimeSupportedJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "assets/runtime.supported.json", size: 64, mode: os.FileMode(420), modTime: time.Unix(1570411694, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "assets/runtime.compatibility.json": assetsRuntimeCompatibilityJson, - "assets/runtime.supported.json": assetsRuntimeSupportedJson, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "assets": &bintree{nil, map[string]*bintree{ - "runtime.compatibility.json": &bintree{assetsRuntimeCompatibilityJson, map[string]*bintree{}}, - "runtime.supported.json": &bintree{assetsRuntimeSupportedJson, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} diff --git a/src/manager/manager.go b/src/manager/manager.go new file mode 100644 index 0000000..474367a --- /dev/null +++ b/src/manager/manager.go @@ -0,0 +1,488 @@ +package manager + +import ( + "errors" + "fmt" + "io/ioutil" + "net/http" + "os" + "path" + "path/filepath" + "regexp" + "strings" + "time" + + "github.com/bitly/go-simplejson" + + log "github.com/nulastudio/NetCoreBeauty/src/log" + util "github.com/nulastudio/NetCoreBeauty/src/util" +) + +// GitCDN git仓库镜像(默认为github) +var GitCDN = "https://github.com/nulastudio/HostFXRPatcher" + +// Logger 日志记录器 +var Logger = log.DefaultLogger + +var timeout = 60 * time.Second + +var localPath = os.TempDir() + "/NetCoreBeauty" +var localArtifactsPath = localPath + "/artifacts" +var artifactsVersionTXT = "/ArtifactsVersion.txt" +var artifactsVersionJSON = "/ArtifactsVersion.json" +var artifactsVersionPath = localArtifactsPath + artifactsVersionJSON + +var runtimeCompatibilityJSONName = "runtime.compatibility.json" +var runtimeSupportedJSONName = "runtime.supported.json" + +var pathNotWriteableErr = "cannot create path or path is not writeable: %s" +var getLocalArtifactsVersionErr = "get local artifacts version failed: %s" +var encodeJSONErr = "cannot encode json: %s" + +var onlineVersionCache string = "" + +func formatError(format string, err error) string { + return fmt.Sprintf(format, err) +} + +func onlinePath() string { + return GitCDN + "/raw/master" +} + +func artifactsOnlinePath() string { + return onlinePath() + "/artifacts" +} + +func artifactsVersionURL() string { + return artifactsOnlinePath() + artifactsVersionTXT +} + +func runtimeJSONPath(specific string) string { + return path.Join(localArtifactsPath, specific) +} + +func runtimeCompatibilityJSONPath() string { + return runtimeJSONPath(runtimeCompatibilityJSONName) +} + +func runtimeSupportedJSONPath() string { + return runtimeJSONPath(runtimeSupportedJSONName) +} + +func runtimeJSONURL(specific string) string { + return artifactsOnlinePath() + "/" + specific +} + +func runtimeCompatibilityJSONURL() string { + return runtimeJSONURL(runtimeCompatibilityJSONName) +} + +func runtimeSupportedJSONURL() string { + return runtimeJSONURL(runtimeSupportedJSONName) +} + +func artifactFile(version string, rid string) string { + return path.Join(localArtifactsPath, version, rid+".Release", GetHostFXRNameByRID(rid)) +} + +// GetHostFXRNameByRID 根据RID取hostfxr文件名 +func GetHostFXRNameByRID(rid string) string { + if strings.Contains(rid, "win") { + return "hostfxr.dll" + } else if strings.Contains(rid, "osx") { + return "libhostfxr.dylib" + } + return "libhostfxr.so" +} + +func readJSON(path string) *simplejson.Json { + bytes, err := ioutil.ReadFile(artifactsVersionPath) + if err != nil { + log.LogInfo(fmt.Sprintf("read json failed: %s : %s", path, err.Error())) + return nil + } + json, err := simplejson.NewJson(bytes) + if err != nil { + log.LogDetail(fmt.Sprintf("parse json failed: %s : %s", path, err.Error())) + return nil + } + return json +} + +func readLocalArtifactsVersionJSON() map[string]interface{} { + json := readJSON(artifactsVersionPath) + if json == nil { + return nil + } + localVersions, err := json.Map() + if err == nil { + return localVersions + } + errMsg := formatError(getLocalArtifactsVersionErr, errors.New("invalid artifactsVersion Json: "+artifactsVersionPath)) + log.LogPanic(errors.New(errMsg), 1) + return nil +} + +func updateLocalArtifactsVersionJSON(data map[string]interface{}) bool { + if !util.EnsureDirExists(localArtifactsPath, 0666) { + log.LogError(fmt.Errorf(pathNotWriteableErr, localArtifactsPath), false) + return false + } + + json := simplejson.New() + for k, v := range data { + json.Set(k, v) + } + + jsonBytes, err := json.EncodePretty() + if err != nil { + log.LogError(fmt.Errorf(encodeJSONErr, err.Error()), false) + return false + } + err = ioutil.WriteFile(artifactsVersionPath, jsonBytes, 0666) + if err != nil { + log.LogError(fmt.Errorf(pathNotWriteableErr, artifactsVersionPath), false) + } + return err == nil +} + +// GetLocalArtifactsVersion 获取本地补丁版本 +func GetLocalArtifactsVersion(version string, rid string) string { + localVersions := readLocalArtifactsVersionJSON() + if localVersions != nil { + for verid, localVer := range localVersions { + // verid: version/rid + localVerStr := localVer.(string) + s := strings.Split(verid, "/") + if version == s[0] && rid == s[1] { + return localVerStr + } + } + } + return "" +} + +func getLocalRuntimeCompatibilityVersion() string { + return GetLocalArtifactsVersion("runtime", "compatibility") +} + +func getLocalRuntimeSupportedVersion() string { + return GetLocalArtifactsVersion("runtime", "supported") +} + +// WriteLocalArtifactsVersion 更新本地补丁版本 +func WriteLocalArtifactsVersion(fxrVersion string, rid string, version string) bool { + if !util.EnsureDirExists(localArtifactsPath, 0666) { + log.LogError(fmt.Errorf(pathNotWriteableErr, localArtifactsPath), false) + return false + } + var json map[string]interface{} + if util.PathExists(artifactsVersionPath) { + json = readLocalArtifactsVersionJSON() + } else { + json = make(map[string]interface{}) + } + key := fxrVersion + "/" + rid + if version == "" { + delete(json, key) + } else { + json[key] = version + } + return updateLocalArtifactsVersionJSON(json) +} + +// GetOnlineArtifactsVersion 获取线上补丁版本 +func GetOnlineArtifactsVersion() string { + if onlineVersionCache != "" { + return onlineVersionCache + } + // 获取版本超时短一点可减少网络环境差所造成的影响 + http.DefaultClient.Timeout = 10 * time.Second + if response, err := http.Get(artifactsVersionURL()); err == nil && response.StatusCode == 200 { + defer response.Body.Close() + if bytes, err := ioutil.ReadAll(response.Body); err == nil { + onlineVersionCache = string(bytes) + return onlineVersionCache + } + } + // 获取失败就清除缓存吧 + onlineVersionCache = "" + return onlineVersionCache +} + +// IsLocalArtifactExists 判断本地是否存在某个版本的补丁 +func IsLocalArtifactExists(version string, rid string) bool { + return util.PathExists(artifactFile(version, rid)) +} + +// CheckRunConfigJSON 检查本地runtimeConfig,自动下载最新(强制性) +func CheckRunConfigJSON() { + log.LogInfo("checking runtime.*.json version...") + onlineVersion := GetOnlineArtifactsVersion() + if onlineVersion == "" { + log.LogDetail("checking runtime.*.json version failed") + return + } + localCVersion := getLocalRuntimeCompatibilityVersion() + localSVersion := getLocalRuntimeSupportedVersion() + var mapping = map[string]string{ + runtimeCompatibilityJSONName: localCVersion, + runtimeSupportedJSONName: localSVersion, + } + for name, version := range mapping { + if version != onlineVersion { + log.LogDetail(fmt.Sprintf("updating %s...", name)) + url := runtimeJSONURL(name) + path := runtimeJSONPath(name) + specific := strings.TrimSuffix(strings.TrimPrefix(name, "runtime."), ".json") + if !DownloadFile(url, path) || !WriteLocalArtifactsVersion("runtime", specific, onlineVersion) { + log.LogDetail(fmt.Sprintf("update %s failed", name)) + } else { + log.LogInfo(fmt.Sprintf("update %s succeeded", name)) + } + } else { + log.LogInfo(fmt.Sprintf("%s no need to update", name)) + } + } +} + +// FindCompatibleRID 匹配线上所支持的RID +func FindCompatibleRID(rid string) string { + runtimeCompatibilityJSON := readJSON(runtimeCompatibilityJSONPath()) + runtimeSupportedJSON := readJSON(runtimeSupportedJSONPath()) + if runtimeCompatibilityJSON == nil || runtimeSupportedJSON == nil { + return rid + } + crids, _ := runtimeCompatibilityJSON.Get(rid).StringArray() + srids, _ := runtimeSupportedJSON.StringArray() + for _, crid := range crids { + for _, srid := range srids { + if crid == srid { + return srid + } + } + } + return rid +} + +// DownloadFile 下载文件 +func DownloadFile(url string, des string) bool { + http.DefaultClient.Timeout = timeout + + response, err := http.Get(url) + if err == nil && response.StatusCode == 200 { + defer response.Body.Close() + if bytes, err := ioutil.ReadAll(response.Body); err != nil { + log.LogError(err, false) + } else { + des = strings.ReplaceAll(des, "\\", "/") + path := path.Dir(des) + if !util.EnsureDirExists(path, 0666) { + log.LogError(errors.New(pathNotWriteableErr+path), false) + } else { + f, err := os.Create(des) + defer f.Close() + log.LogError(err, false) + if err == nil { + if _, err := f.Write(bytes); err == nil { + return true + } + log.LogError(err, false) + } + } + } + } + return false +} + +// DownloadArtifact 下载指定版本、RID的补丁 +func DownloadArtifact(version string, rid string) bool { + fileName := GetHostFXRNameByRID(rid) + artifactURL := fmt.Sprintf("%s/%s/%s.Release/%s", artifactsOnlinePath(), version, rid, fileName) + + artifactFile := path.Join(localArtifactsPath, version, rid+".Release", fileName) + + return DownloadFile(artifactURL, artifactFile) +} + +// DeleteArtifact 下载指定版本、RID的补丁 +func DeleteArtifact(version string, rid string) bool { + artifactFile := artifactFile(version, rid) + ret := WriteLocalArtifactsVersion(version, rid, "") + if !ret { + return false + } + if util.PathExists(artifactFile) { + return os.Remove(artifactFile) == nil + } + return true +} + +// UpdateArtifact 更新指定版本、RID的补丁 +func UpdateArtifact(version string, rid string) bool { + onlineVersion := GetOnlineArtifactsVersion() + // 为了避免残留过时缓存,强制删除再下载 + return DeleteArtifact(version, rid) && + DownloadArtifact(version, rid) && + WriteLocalArtifactsVersion(version, rid, onlineVersion) +} + +// CopyArtifactTo 复制补丁到指定文件夹 +func CopyArtifactTo(version string, rid string, des string) bool { + if !IsLocalArtifactExists(version, rid) { + log.LogError(fmt.Errorf("Artifact does not exist. %s/%s", version, rid), false) + return false + } + artifactName := GetHostFXRNameByRID(rid) + artifactFile := artifactFile(version, rid) + des = path.Join(path.Clean(des), artifactName) + if _, err := util.CopyFile(artifactFile, des); err != nil { + log.LogError(fmt.Errorf("Cannot copy artifact from %s to %s. %s", artifactFile, des, err.Error()), false) + } + return true +} + +// FindRuntimeConfigJSON 寻找指定目录下的*runtimeconfig*.json +func FindRuntimeConfigJSON(dir string) []string { + files, err := filepath.Glob(path.Join(dir, "*runtimeconfig*.json")) + if err != nil { + log.LogDetail(formatError("find runtimeconfig.json failed: %s", err)) + } + return files +} + +// FindDepsJSON 寻找指定目录下的*deps.json +func FindDepsJSON(dir string) []string { + files, err := filepath.Glob(path.Join(dir, "*deps.json")) + if err != nil { + log.LogDetail(formatError("find deps.json failed: %s", err)) + } + return files +} + +// FixRuntimeConfig 添加additionalProbingPaths +func FixRuntimeConfig(runtimeConfigFile string, libsDir string) bool { + jsonBytes, err := ioutil.ReadFile(runtimeConfigFile) + if err != nil { + log.LogError(fmt.Errorf("can not read runtimeconfig.json: %s", err.Error()), false) + return false + } + json, err := simplejson.NewJson(jsonBytes) + if err != nil { + log.LogPanic(fmt.Errorf("invalid runtimeconfig.json: %s", err.Error()), 1) + } + + var found = false + runtimeOptions, ok := json.CheckGet("runtimeOptions") + if !ok { + runtimeOptions = simplejson.New() + json.Set("runtimeOptions", runtimeOptions) + } + additionalProbingPaths, ok := runtimeOptions.CheckGet("additionalProbingPaths") + var paths []string = []string{} + if ok { + paths, err = additionalProbingPaths.StringArray() + if err != nil { + log.LogPanic(fmt.Errorf("invalid runtimeconfig.json: %s", err.Error()), 1) + } + } + for _, path := range paths { + if path == libsDir { + found = true + break + } + } + if !found { + paths = append(paths, libsDir) + } + runtimeOptions.Set("additionalProbingPaths", paths) + jsonBytes, err = json.EncodePretty() + if err != nil { + log.LogPanic(fmt.Errorf("can not encode runtimeconfig.json: %s", err.Error()), 1) + } + err = ioutil.WriteFile(runtimeConfigFile, jsonBytes, 0666) + if err != nil { + log.LogError(fmt.Errorf("can not write runtimeconfig.json: %s", err.Error()), false) + } + return err == nil +} + +// FixDeps 修改deps.json +func FixDeps(deps string) ([]string, string, string) { + jsonBytes, err := ioutil.ReadFile(deps) + if err != nil { + log.LogError(fmt.Errorf("can not open deps.json: %s : %s", deps, err.Error()), false) + return nil, "", "" + } + + json, err := simplejson.NewJson(jsonBytes) + if err != nil { + log.LogError(fmt.Errorf("invalid deps.json: %s : %s", deps, err.Error()), false) + return nil, "", "" + } + + files := []string{} + rid := "" + fxrVersion := "" + + // targets + targets, _ := json.Get("targets").Map() + for _, target := range targets { + for targetName, depsObj := range target.(map[string]interface{}) { + // 解析出fxr信息 + if strings.HasPrefix(targetName, "runtime") && strings.Contains(targetName, "Microsoft.NETCore.DotNetHostResolver") { + regex, _ := regexp.Compile("^runtime\\.([\\w-]+)\\.Microsoft\\.NETCore\\.DotNetHostResolver\\/([\\d\\.]+)$") + matches := regex.FindStringSubmatch(targetName) + rid = matches[1] + fxrVersion = matches[2] + log.LogInfo(fmt.Sprintf("fxr v%s/%s detected in %s", fxrVersion, rid, deps)) + } + if depsObj != nil { + components := map[string]int{ + // NOTE: runtimeTargets未确认是否需要处理 + // "runtimeTargets": 1, + "runtime": 1, + "native": 1, + "compile": 1, + "resources": 2, + } + for cname, segments := range components { + component := depsObj.(map[string]interface{})[cname] + if component != nil { + newComponent := make(map[string]interface{}) + for k := range component.(map[string]interface{}) { + components := strings.Split(strings.ReplaceAll(k, "\\", "/"), "/") + length := len(components) + fileName := strings.Join(components[length-segments:], "/") + files = append(files, fileName) + newComponent["./"+fileName] = make(map[string]interface{}) + } + depsObj.(map[string]interface{})[cname] = newComponent + } + } + } + } + } + json.Set("targets", targets) + + // libraries + libraries, _ := json.Get("libraries").Map() + for k, lib := range libraries { + fixLib := lib.(map[string]interface{}) + fixLib["path"] = "./" + libraries[k] = fixLib + } + json.Set("libraries", libraries) + + jsonBytes, _ = json.EncodePretty() + if err := ioutil.WriteFile(deps, jsonBytes, 0666); err != nil { + log.LogError(fmt.Errorf("fix deps.json failed: %s : %s", deps, err.Error()), false) + return nil, "", "" + } + + if fxrVersion == "" || rid == "" { + log.LogError(fmt.Errorf("incomplete fxr info [%s/%s] found in deps.json: %s", fxrVersion, rid, deps), false) + } + + return files, "v" + fxrVersion, rid +} diff --git a/src/util/util.go b/src/util/util.go new file mode 100644 index 0000000..4bf9328 --- /dev/null +++ b/src/util/util.go @@ -0,0 +1,45 @@ +package util + +import ( + "errors" + "io" + "os" + "path/filepath" +) + +func PathExists(path string) bool { + _, err := os.Stat(path) + return err == nil || os.IsExist(err) +} + +func EnsureDirExists(dir string, perm os.FileMode) bool { + if !PathExists(dir) { + return os.MkdirAll(dir, perm) == nil + } else { + return os.Chmod(dir, perm) == nil + } +} + +func CopyFile(src string, des string) (written int64, err error) { + srcFile, err := os.Open(src) + if err != nil { + return 0, err + } + defer srcFile.Close() + + fi, _ := srcFile.Stat() + perm := fi.Mode() + + dir := filepath.Dir(des) + if !EnsureDirExists(dir, perm) { + return 0, errors.New("cannot create path: " + dir) + } + + desFile, err := os.OpenFile(des, os.O_RDWR|os.O_CREATE|os.O_TRUNC, perm) + if err != nil { + return 0, err + } + defer desFile.Close() + + return io.Copy(desFile, srcFile) +}