Update Netwonsoft.Json dependency (#431)

Co-authored-by: Ruslan Urmeev <v-ruurme@microsoft.com>
Co-authored-by: Ivan Matkov <v-ivmatk@microsoft.com>
Co-authored-by: Anna Kocheshkova <v-annkoc@microsoft.com>
This commit is contained in:
AnastasiaKubova 2020-03-17 00:26:19 +03:00 коммит произвёл GitHub
Родитель 1a7f0d2eff
Коммит 1cc1407c3f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 96 добавлений и 49 удалений

3
.gitmodules поставляемый
Просмотреть файл

@ -1,3 +1,6 @@
[submodule "BreakpadSupport/breakpad-support/src/main/cpp/google-breakpad"] [submodule "BreakpadSupport/breakpad-support/src/main/cpp/google-breakpad"]
path = BreakpadSupport/breakpad-support/src/main/cpp/google-breakpad path = BreakpadSupport/breakpad-support/src/main/cpp/google-breakpad
url = https://github.com/microsoft/appcenter-sdk-android-breakpad.git url = https://github.com/microsoft/appcenter-sdk-android-breakpad.git
[submodule "Modules/Newtonsoft.Json-for-Unity"]
path = Modules/Newtonsoft.Json-for-Unity
url = https://github.com/jilleJr/Newtonsoft.Json-for-Unity.git

@ -0,0 +1 @@
Subproject commit dcc556f12e7663526356c828da9736f69048bbf0

Просмотреть файл

@ -11,6 +11,8 @@ App Center Unity SDK incorporates third party material from the projects listed
4. Protobuf 2.0.3 (https://github.com/protocolbuffers/protobuf) 4. Protobuf 2.0.3 (https://github.com/protocolbuffers/protobuf)
5. Protobuf-c (https://github.com/protobuf-c/protobuf-c) 5. Protobuf-c (https://github.com/protobuf-c/protobuf-c)
6. Reachability (https://developer.apple.com/library/content/samplecode/Reachability/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007324-Intro-DontLinkElementID_2) 6. Reachability (https://developer.apple.com/library/content/samplecode/Reachability/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007324-Intro-DontLinkElementID_2)
7. NewtonsoftJson for Unity (https://github.com/jilleJr/Newtonsoft.Json-for-Unity)
%% Google Play Services Jar Resolver Library for Unity NOTICES, INFORMATION, AND LICENSE BEGIN HERE %% Google Play Services Jar Resolver Library for Unity NOTICES, INFORMATION, AND LICENSE BEGIN HERE
========================================= =========================================
@ -378,4 +380,17 @@ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
========================================= =========================================
END OF Reachability NOTICES AND INFORMATION END OF Reachability NOTICES AND INFORMATION
%% NewtonsoftJson for Unity NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2019 Kalle Jillheden (jilleJr)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF NewtonsoftJson for Unity NOTICES AND INFORMATION

Просмотреть файл

@ -222,7 +222,9 @@ Task("Externals-Android").Does(() =>
}).OnError(HandleError); }).OnError(HandleError);
// Downloading iOS binaries. // Downloading iOS binaries.
Task("Externals-Ios").Does(() => Task("Externals-Ios")
.WithCriteria(IsRunningOnUnix)
.Does(() =>
{ {
var externalsDirectory = "externals/ios/"; var externalsDirectory = "externals/ios/";
var outputDirectory = "Assets/AppCenter/Plugins/iOS/"; var outputDirectory = "Assets/AppCenter/Plugins/iOS/";
@ -250,7 +252,9 @@ Task("Externals-Ios").Does(() =>
}).OnError(HandleError); }).OnError(HandleError);
// Downloading UWP binaries. // Downloading UWP binaries.
Task("Externals-Uwp").Does(() => Task("Externals-Uwp")
.WithCriteria(IsRunningOnWindows)
.Does(() =>
{ {
var externalsDirectory = "externals/uwp/"; var externalsDirectory = "externals/uwp/";
var outputDirectory = "Assets/AppCenter/Plugins/WSA/"; var outputDirectory = "Assets/AppCenter/Plugins/WSA/";
@ -349,20 +353,16 @@ void BuildAndroidLibrary(string appName, string libraryName, bool copyBinary = t
var aarSource = Path.Combine(libraryFolder, "build/outputs/aar/" + aarName); var aarSource = Path.Combine(libraryFolder, "build/outputs/aar/" + aarName);
var aarDestination = "Assets/AppCenter/Plugins/Android"; var aarDestination = "Assets/AppCenter/Plugins/Android";
// Delete the aar in case it already exists in the Assets folder // Move the .aar to destination folder.
var existingAar = Path.Combine(aarDestination, aarName); DeleteFileIfExists(Path.Combine(aarDestination, aarName));
if (FileExists(existingAar))
{
DeleteFile(existingAar);
}
// Move the .aar to Assets/AppCenter/Plugins/Android
MoveFileToDirectory(aarSource, aarDestination); MoveFileToDirectory(aarSource, aarDestination);
} }
} }
// Install Unity Editor for Windows // Install Unity Editor for Windows
Task("Install-Unity-Windows").Does(() => Task("Install-Unity-Windows")
.WithCriteria(IsRunningOnWindows)
.Does(() =>
{ {
string unityDownloadUrl = EnvironmentVariable("EDITOR_URL_WIN"); string unityDownloadUrl = EnvironmentVariable("EDITOR_URL_WIN");
string il2cppSupportDownloadUrl = EnvironmentVariable("IL2CPP_SUPPORT_URL"); string il2cppSupportDownloadUrl = EnvironmentVariable("IL2CPP_SUPPORT_URL");
@ -388,27 +388,50 @@ Task("Install-Unity-Windows").Does(() =>
// Downloading UWP IL2CPP dependencies. // Downloading UWP IL2CPP dependencies.
Task("Externals-Uwp-IL2CPP-Dependencies") Task("Externals-Uwp-IL2CPP-Dependencies")
.Does(async () => { .WithCriteria(IsRunningOnWindows)
var targetPath = "Assets/AppCenter/Plugins/WSA/IL2CPP"; .IsDependentOn("BuildNewtonsoftJson")
EnsureDirectoryExists(targetPath); .Does (async () =>
EnsureDirectoryExists(targetPath + "/ARM"); {
EnsureDirectoryExists(targetPath + "/ARM64"); var targetPath = "Assets/AppCenter/Plugins/WSA/IL2CPP";
EnsureDirectoryExists(targetPath + "/X86"); EnsureDirectoryExists(targetPath);
EnsureDirectoryExists(targetPath + "/X64"); EnsureDirectoryExists(targetPath + "/ARM");
EnsureDirectoryExists(targetPath + "/ARM64");
EnsureDirectoryExists(targetPath + "/X86");
EnsureDirectoryExists(targetPath + "/X64");
foreach (var dependency in UwpIL2CPPDependencies) foreach (var dependency in UwpIL2CPPDependencies)
{ {
await ProcessDependency(dependency, targetPath); await ProcessDependency(dependency, targetPath);
} }
// Process UWP IL2CPP dependencies. // Process UWP IL2CPP dependencies.
Information("Processing UWP IL2CPP dependencies. This could take a minute."); Information("Processing UWP IL2CPP dependencies. This could take a minute.");
var result = ExecuteUnityCommand("-executeMethod AppCenterPostBuild.ProcessUwpIl2CppDependencies"); var result = ExecuteUnityCommand("-executeMethod AppCenterPostBuild.ProcessUwpIl2CppDependencies");
if (result != 0) if (result != 0)
{ {
throw new Exception("Something went wrong while executing post build script. Unity result code: " + result); throw new Exception("Something went wrong while executing post build script. Unity result code: " + result);
} }
}).OnError (HandleError); }).OnError(HandleError);
Task("BuildNewtonsoftJson")
.WithCriteria(IsRunningOnWindows)
.Does(() =>
{
var outputDirectory = "Assets/AppCenter/Plugins/WSA/IL2CPP";
var projectPath = "Modules/Newtonsoft.Json-for-Unity/Src/Newtonsoft.Json";
var assemblyName = "Newtonsoft.Json.dll";
var assemblyPath = $"{projectPath}/bin/Release/unity-aot/{assemblyName}";
Information("Building Newtonsoft.Json project...");
MSBuild(Path.Combine(projectPath, "Newtonsoft.Json.csproj"), c => c
.WithRestore()
.WithProperty("UnityBuild", "AOT")
.SetConfiguration("Release"));
Information($"Moveing Newtonsoft.Json to {outputDirectory}...");
DeleteFileIfExists(Path.Combine(outputDirectory, assemblyName));
MoveFileToDirectory(assemblyPath, outputDirectory);
}).OnError(HandleError);
// Download and install all external Unity packages required. // Download and install all external Unity packages required.
Task("Externals-Unity-Packages").Does(() => Task("Externals-Unity-Packages").Does(() =>
@ -472,10 +495,7 @@ Task("Package").Does(() =>
{ {
// Remove AndroidManifest.xml // Remove AndroidManifest.xml
var path = "Assets/Plugins/Android/appcenter/AndroidManifest.xml"; var path = "Assets/Plugins/Android/appcenter/AndroidManifest.xml";
if (FileExists(path)) DeleteFileIfExists(path);
{
DeleteFile(path);
}
// Store packages in a clean folder. // Store packages in a clean folder.
const string outputDirectory = "output"; const string outputDirectory = "output";
@ -611,10 +631,10 @@ void VerifyWindowsAppsBuild(string type, string projectPath)
var solutionFilePath = slnFiles.Single(); var solutionFilePath = slnFiles.Single();
Statics.Context.Information("Attempting to build '" + solutionFilePath.ToString() + "'..."); Statics.Context.Information("Attempting to build '" + solutionFilePath.ToString() + "'...");
Statics.Context.MSBuild(solutionFilePath.ToString(), c => c Statics.Context.MSBuild(solutionFilePath.ToString(), c => c
.SetConfiguration("Master") .SetConfiguration("Master")
.WithProperty("Platform", "x86") .WithProperty("Platform", "x86")
.SetVerbosity(Verbosity.Minimal) .SetVerbosity(Verbosity.Minimal)
.SetMSBuildPlatform(MSBuildPlatform.x86)); .SetMSBuildPlatform(MSBuildPlatform.x86));
Statics.Context.Information("Successfully built '" + solutionFilePath.ToString() + "'"); Statics.Context.Information("Successfully built '" + solutionFilePath.ToString() + "'");
}); });
} }

Просмотреть файл

@ -27,6 +27,24 @@
} }
} }
}, },
{
"component": {
"type": "git",
"git": {
"repositoryUrl": "https://github.com/jilleJr/Newtonsoft.Json-for-Unity.git",
"commitHash": "dcc556f12e7663526356c828da9736f69048bbf0"
}
}
},
{
"component": {
"type": "git",
"git": {
"repositoryUrl": "https://github.com/microsoft/appcenter-sdk-android-breakpad.git",
"commitHash": "0d8e4133e2b9caadb012d438c4c12cf6daff2a40"
}
}
},
{ {
"Component": { "Component": {
"Type": "other", "Type": "other",
@ -37,15 +55,6 @@
} }
} }
}, },
{
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "Newtonsoft.Json",
"Version": "12.0.2"
}
}
},
{ {
"Component": { "Component": {
"Type": "NuGet", "Type": "NuGet",

Просмотреть файл

@ -18,7 +18,6 @@ const PackageSaveMode packageSaveMode = PackageSaveMode.Defaultv3;
* In case of any change or version bump this list MUST be changed manually. * In case of any change or version bump this list MUST be changed manually.
*/ */
var UwpIL2CPPDependencies = new [] { var UwpIL2CPPDependencies = new [] {
/* # */ new NuGetDependency("Newtonsoft.Json", "12.0.2"),
/* # */ new NuGetDependency("SQLitePCLRaw.bundle_green", "2.0.2"), /* # */ new NuGetDependency("SQLitePCLRaw.bundle_green", "2.0.2"),
/* ├─# */ new NuGetDependency("SQLitePCLRaw.core", "2.0.2"), /* ├─# */ new NuGetDependency("SQLitePCLRaw.core", "2.0.2"),
/* | └─# */ new NuGetDependency("System.Memory", "4.5.3"), /* | └─# */ new NuGetDependency("System.Memory", "4.5.3"),