Skip to content

Commit

Permalink
try to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoC0de committed Jan 6, 2023
1 parent ffd13ad commit 5577ed7
Show file tree
Hide file tree
Showing 22 changed files with 646 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Assets/NuGet/Editor/NugetHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ private static HashSet<string> GetAlreadyImportedLibs()
LogVerbose("Already imported libs: {0}", string.Join(", ", alreadyImportedLibs));
}

// workaround not sure way but it reported as missing when not added as NuGet package
alreadyImportedLibs.Remove("System.Runtime.CompilerServices.Unsafe");

return alreadyImportedLibs;
}

Expand Down
8 changes: 6 additions & 2 deletions Assets/NuGet/Editor/NugetPackageAssetPostprocessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ private static void OnPostprocessAllAssets(string[] importedAssets, string[] del
}

// project relative nuget restore location with a pending '/'
var relativeRepositoryPath = NugetHelper.GetProjectRelativePath(NugetHelper.NugetConfigFile.RepositoryPath).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar;
var nugetForUnityAssets = importedAssets.Where(path => path.StartsWith(relativeRepositoryPath, StringComparison.OrdinalIgnoreCase) && path.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) && File.Exists(path));
var relativeRepositoryPath = NugetHelper.GetProjectRelativePath(NugetHelper.NugetConfigFile.RepositoryPath)
.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar;
var nugetForUnityAssets = importedAssets
.Where(path => path.StartsWith(relativeRepositoryPath, StringComparison.OrdinalIgnoreCase)
&& path.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)
&& File.Exists(path));

var results = new List<(string AssetType, string AssetPath, ResultStatus Status)>();
foreach (var assetPath in nugetForUnityAssets)
Expand Down
11 changes: 11 additions & 0 deletions Assets/NuGet/Editor/NugetPackageAssetPostprocessor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/NuGet/Editor/NugetWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ private void DrawPackage(NugetPackage package, GUIStyle packageStyle, GUIStyle c
{
GUI.DrawTexture(rect, package.Icon, ScaleMode.StretchToFill);
}
else
else if (defaultIcon != null)
{
GUI.DrawTexture(rect, defaultIcon, ScaleMode.StretchToFill);
}
Expand Down
2 changes: 1 addition & 1 deletion CreateDLL/CreateDLL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CreateDLL</RootNamespace>
<AssemblyName>NuGetForUnity</AssemblyName>
<AssemblyName>NugetForUnity</AssemblyName>
<TargetFramework>netstandard2.0</TargetFramework>
<FileAlignment>512</FileAlignment>
<EnableDefaultItems>false</EnableDefaultItems>
Expand Down
15 changes: 15 additions & 0 deletions Packager/Assets/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="NuGet" value="http://www.nuget.org/api/v2/" />
</packageSources>
<disabledPackageSources />
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<config>
<add key="repositoryPath" value="./Packages" />
<add key="DefaultPushSource" value="http://www.nuget.org/api/v2/" />
</config>
</configuration>
32 changes: 32 additions & 0 deletions Packager/Assets/NuGet.config.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packager/Assets/NuGet.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Packager/Assets/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<packages />
32 changes: 32 additions & 0 deletions Packager/Assets/packages.config.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions TestProjects/ImportAndUseNuGetPackages/.vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions TestProjects/ImportAndUseNuGetPackages/Assets/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions TestProjects/ImportAndUseNuGetPackages/Assets/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Serilog" version="2.12.0" />
<package id="System.Text.Json" version="7.0.1" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="7.0.0" />
<package id="Serilog" version="2.12.0" />
<package id="System.Text.Encodings.Web" version="7.0.0" />
<package id="System.Text.Json" version="7.0.1" />
</packages>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5577ed7

Please sign in to comment.