15 Commits
Author SHA1 Message Date
cneicy 377b69e054 chore: exclude .NET metadata from UPM packages
Publish UPM package / publish (push) Failing after 2s
Publish NuGet packages / publish (push) Successful in 42s
2026-09-05 04:07:42 +08:00
cneicy 65aabf9187 ci: trust bundled CAs during NuGet publish 2026-09-05 04:05:16 +08:00
cneicy 3929e56b4a ci: provide OpenSSL for .NET packaging
Publish UPM package / publish (push) Failing after 3s
Publish NuGet packages / publish (push) Failing after 30s
2026-09-05 04:02:09 +08:00
cneicy 7720d7b33b ci: run .NET packaging in invariant mode
Publish UPM package / publish (push) Failing after 3s
Publish NuGet packages / publish (push) Failing after 21s
2026-09-05 03:57:50 +08:00
cneicy 7c2df2fc13 ci: bootstrap .NET SDK without system packages
Publish NuGet packages / publish (push) Failing after 18s
Publish UPM package / publish (push) Failing after 2s
2026-09-05 03:55:06 +08:00
cneicy cb06005211 ci: publish NuGet without external actions
Publish UPM package / publish (push) Failing after 2s
Publish NuGet packages / publish (push) Failing after 6m56s
2026-09-05 03:50:07 +08:00
cneicy f1fa6d7019 ci: install .NET prerequisites for package publishing
Publish UPM package / publish (push) Failing after 2s
Publish NuGet packages / publish (push) Failing after 4m26s
2026-09-05 03:45:43 +08:00
cneicy 371e880b84 feat: add NuGet and Godot distribution
Publish NuGet packages / publish (push) Failing after 6s
Publish UPM package / publish (push) Successful in 6s
2026-09-05 03:41:44 +08:00
cneicy 5fd9b258d7 feat: extract shared Cecil weaving core 2026-09-05 02:34:06 +08:00
cneicy bfb463e4bc test(host): allow Unity test runner completion 2026-08-26 08:23:16 +08:00
cneicy a6f98534c3 ci: mirror Git package dependencies 2026-08-26 07:07:05 +08:00
cneicy ec48264704 test: enable standalone host discovery 2026-08-26 06:56:07 +08:00
cneicy b6807389e6 ci: stabilize standalone Unity host 2026-08-26 06:36:37 +08:00
ShrinkSDK Automation a2d2b8da7d ci: fetch immutable release archive 2026-08-26 04:29:41 +08:00
ShrinkSDK Automation 848d00c9eb ci: install Git in package publisher 2026-08-26 03:09:52 +08:00
103 changed files with 5244 additions and 190 deletions
+123
View File
@@ -0,0 +1,123 @@
name: Publish NuGet packages
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
NUGET_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
LD_LIBRARY_PATH: /opt/dotnet-libs/usr/lib/x86_64-linux-gnu
SSL_CERT_FILE: /opt/ca-certificates.crt
steps:
- name: Fetch exact tagged source
env:
GITEA_REF: ${{ gitea.ref }}
GITEA_REPOSITORY: ${{ gitea.repository }}
shell: bash
run: |
set -euo pipefail
tag="${GITEA_REF#refs/tags/}"
case "$tag" in
v[0-9]*) ;;
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
esac
export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/${GITEA_REPOSITORY}/archive/${tag}.tar.gz"
node --input-type=module <<'NODE'
import { writeFile } from 'node:fs/promises';
const response = await fetch(process.env.SHRINKSDK_ARCHIVE_URL);
if (!response.ok) {
throw new Error(`Release archive download failed: ${response.status} ${response.statusText}`);
}
await writeFile('release.tar.gz', new Uint8Array(await response.arrayBuffer()));
NODE
mkdir release
tar -xzf release.tar.gz --strip-components=1 -C release
rm -f release.tar.gz
printf '%s' "$tag" > release/.shrink-sdk-release-tag
- name: Install .NET 8 SDK
shell: bash
run: |
set -euo pipefail
node --input-type=module <<'NODE'
import { writeFile } from 'node:fs/promises';
import { rootCertificates } from 'node:tls';
await writeFile('/opt/ca-certificates.crt', rootCertificates.join('\n'));
const metadataResponse = await fetch('https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/8.0/releases.json');
if (!metadataResponse.ok) throw new Error(`Release metadata download failed: ${metadataResponse.status}`);
const metadata = await metadataResponse.json();
const sdkVersion = metadata['latest-sdk'];
const release = metadata.releases.find(item => item.sdk?.version === sdkVersion);
const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz'));
if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`);
const archiveResponse = await fetch(file.url);
if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`);
await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer()));
const poolUrl = 'https://deb.debian.org/debian-security/pool/updates/main/o/openssl/';
const poolResponse = await fetch(poolUrl);
if (!poolResponse.ok) throw new Error(`OpenSSL package index download failed: ${poolResponse.status}`);
const poolIndex = await poolResponse.text();
const packages = [...poolIndex.matchAll(/href="(libssl3_[^"]+_amd64\.deb)"/g)].map(match => match[1]).sort();
const packageName = packages.at(-1);
if (!packageName) throw new Error('Debian libssl3 package was not found');
const packageResponse = await fetch(poolUrl + packageName);
if (!packageResponse.ok) throw new Error(`OpenSSL package download failed: ${packageResponse.status}`);
await writeFile('/tmp/libssl3.deb', new Uint8Array(await packageResponse.arrayBuffer()));
NODE
mkdir -p /opt/dotnet
tar -xzf /tmp/dotnet-sdk.tar.gz -C /opt/dotnet
mkdir -p /opt/dotnet-libs
dpkg-deb -x /tmp/libssl3.deb /opt/dotnet-libs
rm -f /tmp/dotnet-sdk.tar.gz
rm -f /tmp/libssl3.deb
/opt/dotnet/dotnet --info
- name: Validate, pack and publish
shell: bash
run: |
set -euo pipefail
: "${NUGET_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
export PATH="/opt/dotnet:$PATH"
cd release
tag="$(cat .shrink-sdk-release-tag)"
projects=()
if [[ -d DotNet~ ]]; then
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find DotNet~ -type f -name '*.csproj' -print0)
fi
if [[ -d Godot~ ]]; then
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find Godot~ -type f -name '*.csproj' -print0)
fi
if [[ "${#projects[@]}" -eq 0 ]]; then
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find . -maxdepth 1 -type f -name '*.csproj' -print0)
fi
test "${#projects[@]}" -gt 0
if [[ -f package.json ]]; then
version="$(node -p "require('./package.json').version")"
else
version="$(dotnet msbuild "${projects[0]}" -getProperty:Version -nologo)"
fi
test "$tag" = "v$version"
mkdir -p packages
for project in "${projects[@]}"; do
dotnet restore "$project" --configfile NuGet.Config
dotnet pack "$project" --configuration Release --no-restore --output "$PWD/packages" --include-symbols --include-source
done
find packages -maxdepth 1 -name '*.nupkg' -type f | grep -q .
dotnet nuget push 'packages/*.nupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
if compgen -G 'packages/*.snupkg' > /dev/null; then
dotnet nuget push 'packages/*.snupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
fi
+27 -9
View File
@@ -15,22 +15,39 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
steps:
- name: Fetch tagged revision
- name: Fetch exact tagged release archive
env:
GITEA_REF: ${{ gitea.ref }}
shell: bash
run: |
set -eu
ref="${{ gitea.sha }}"
test -n "$ref"
git init .
git remote add origin "https://git.crash.work/ShrinkSDK/ShrinkShared.CodeGen.git"
git fetch --depth=1 origin "$ref"
git checkout --detach FETCH_HEAD
tag="${GITEA_REF#refs/tags/}"
case "$tag" in
v[0-9]*) ;;
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
esac
export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/ShrinkSDK/ShrinkShared.CodeGen/archive/${tag}.tar.gz"
node --input-type=module <<'NODE'
import { writeFile } from 'node:fs/promises';
const response = await fetch(process.env.SHRINKSDK_ARCHIVE_URL);
if (!response.ok) {
throw new Error(`Release archive download failed: ${response.status} ${response.statusText}`);
}
await writeFile('release.tar.gz', new Uint8Array(await response.arrayBuffer()));
NODE
mkdir release
tar -xzf release.tar.gz --strip-components=1 -C release
rm -f release.tar.gz
printf '%s' "$tag" > release/.shrink-sdk-release-tag
- name: Validate immutable release version
shell: bash
run: |
set -eu
tag="$(git describe --exact-match --tags HEAD)"
cd release
tag="$(cat .shrink-sdk-release-tag)"
version="$(node -p "require('./package.json').version")"
test "$tag" = "v$version"
npm pack --dry-run
@@ -40,10 +57,11 @@ jobs:
run: |
set -eu
: "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
cd release
npmrc="$HOME/.npmrc"
cleanup() { rm -f "$npmrc"; }
trap cleanup EXIT
printf '%s\n' \
'registry=https://git.crash.work/api/packages/ShrinkSDK/npm/' \
'//git.crash.work/api/packages/ShrinkSDK/npm/:_authToken=${NODE_AUTH_TOKEN}' > "$npmrc"
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
+6 -1
View File
@@ -26,12 +26,17 @@ jobs:
shell: bash
run: |
set -eu
machine_id_file="/root/.local/share/unity3d/Unity/.machine-id"
if test -s "$machine_id_file"; then
cat "$machine_id_file" > /etc/machine-id
echo "Unity machine identity restored"
fi
git config --global url."https://ghfast.top/https://github.com/".insteadOf "https://github.com/"
unity_bin="$(command -v unity-editor || command -v unity || command -v Unity || true)"
test -n "$unity_bin"
"$unity_bin" \
-batchmode \
-nographics \
-quit \
-projectPath "$PWD/Development~/UnityProject" \
-runTests \
-testPlatform EditMode \
+8
View File
@@ -8,3 +8,11 @@
/Tools~/**/[Oo]bj/
*.user
*.DotSettings.user
/DotNet~/**/[Bb]in/
/DotNet~/**/[Oo]bj/
/Godot~/**/[Bb]in/
/Godot~/**/[Oo]bj/
/artifacts/
/packages/
!DotNet~/**/*.csproj
!Godot~/**/*.csproj
+6
View File
@@ -6,3 +6,9 @@ Tools~/
*.sln
*.user
*.DotSettings.user
DotNet~/
Godot~/
NuGet.Config
Directory.Build.props
NuGet.Config.meta
Directory.Build.props.meta
@@ -11,5 +11,8 @@
"dependencies": {
"com.unity.test-framework": "1.1.33",
"com.cneicy.shrink-shared-codegen": "file:../../.."
}
},
"testables": [
"com.cneicy.shrink-shared-codegen"
]
}
+13
View File
@@ -0,0 +1,13 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Authors>ShrinkSDK</Authors>
<Company>ShrinkSDK</Company>
<RepositoryUrl>https://git.crash.work/ShrinkSDK</RepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
</Project>
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 678e5091bf1a6164ca11240ea133b497
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
## Release 0.1.0
### New Rules
Rule ID | Category | Severity | Notes
--------|----------|----------|-------
SHRINK001 | ShrinkSDK.CodeGen | Error | Invalid event subscriber signature
SHRINK002 | ShrinkSDK.CodeGen | Error | Duplicate network opcode and route
SHRINK003 | ShrinkSDK.CodeGen | Error | Invalid application installer
@@ -0,0 +1,75 @@
#nullable enable
using System;
using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
namespace ShrinkSDK.CodeGen.Analyzers;
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public sealed class ShrinkCodeGenAnalyzer : DiagnosticAnalyzer
{
private static readonly DiagnosticDescriptor InvalidEventHandler = new(
"SHRINK001", "Invalid event subscriber signature",
"Method '{0}' must use void(TEvent), UniTask(TEvent), or UniTask(TEvent, CancellationToken)",
"ShrinkSDK.CodeGen", DiagnosticSeverity.Error, true);
private static readonly DiagnosticDescriptor DuplicateNetworkContract = new(
"SHRINK002", "Duplicate network opcode and route",
"Network opcode/route '{0}' is already declared by '{1}'",
"ShrinkSDK.CodeGen", DiagnosticSeverity.Error, true);
private static readonly DiagnosticDescriptor InvalidInstaller = new(
"SHRINK003", "Invalid application installer",
"Type '{0}' has ShrinkAppModuleInstaller but does not implement IShrinkAppModuleInstaller",
"ShrinkSDK.CodeGen", DiagnosticSeverity.Error, true);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>
ImmutableArray.Create(InvalidEventHandler, DuplicateNetworkContract, InvalidInstaller);
public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
context.EnableConcurrentExecution();
context.RegisterCompilationStartAction(start =>
{
var networkContracts = new ConcurrentDictionary<string, INamedTypeSymbol>(StringComparer.Ordinal);
start.RegisterSymbolAction(symbolContext => AnalyzeMethod(symbolContext), SymbolKind.Method);
start.RegisterSymbolAction(symbolContext => AnalyzeType(symbolContext, networkContracts), SymbolKind.NamedType);
});
}
private static void AnalyzeMethod(SymbolAnalysisContext context)
{
var method = (IMethodSymbol)context.Symbol;
if (!HasAttribute(method, "ShrinkEventBus.ShrinkSubscribeAttribute")) return;
var parametersValid = method.Parameters.Length == 1 ||
method.Parameters.Length == 2 && method.Parameters[1].Type.ToDisplayString() == "System.Threading.CancellationToken";
var returnName = method.ReturnType.ToDisplayString();
var returnValid = method.Parameters.Length == 1 && (method.ReturnsVoid || returnName == "Cysharp.Threading.Tasks.UniTask") ||
method.Parameters.Length == 2 && returnName == "Cysharp.Threading.Tasks.UniTask";
if (!parametersValid || !returnValid)
context.ReportDiagnostic(Diagnostic.Create(InvalidEventHandler, method.Locations.FirstOrDefault(), method.Name));
}
private static void AnalyzeType(SymbolAnalysisContext context, ConcurrentDictionary<string, INamedTypeSymbol> networkContracts)
{
var type = (INamedTypeSymbol)context.Symbol;
if (HasAttribute(type, "ShrinkApp.ShrinkAppModuleInstallerAttribute") &&
!type.AllInterfaces.Any(item => item.ToDisplayString() == "ShrinkApp.IShrinkAppModuleInstaller"))
context.ReportDiagnostic(Diagnostic.Create(InvalidInstaller, type.Locations.FirstOrDefault(), type.Name));
var network = type.GetAttributes().FirstOrDefault(attribute =>
attribute.AttributeClass?.ToDisplayString() == "ShrinkNetwork.ShrinkNetworkMessageAttribute");
if (network == null || network.ConstructorArguments.Length == 0) return;
var opcode = network.ConstructorArguments[0].Value?.ToString() ?? string.Empty;
var route = network.ConstructorArguments.Length > 1 ? network.ConstructorArguments[1].Value as string ?? string.Empty : string.Empty;
var key = opcode + ":" + route;
if (!networkContracts.TryAdd(key, type) && networkContracts.TryGetValue(key, out var previous))
context.ReportDiagnostic(Diagnostic.Create(DuplicateNetworkContract, type.Locations.FirstOrDefault(), key, previous.Name));
}
private static bool HasAttribute(ISymbol symbol, string fullName) =>
symbol.GetAttributes().Any(attribute => attribute.AttributeClass?.ToDisplayString() == fullName);
}
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>ShrinkSDK.CodeGen.Analyzers</AssemblyName>
<RootNamespace>ShrinkSDK.CodeGen.Analyzers</RootNamespace>
<IsPackable>false</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all" />
</ItemGroup>
</Project>
@@ -0,0 +1,300 @@
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.0/",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"ShrinkSDK.CodeGen.Analyzers/1.0.0": {
"dependencies": {
"Microsoft.CodeAnalysis.CSharp": "4.14.0"
},
"runtime": {
"ShrinkSDK.CodeGen.Analyzers.dll": {}
}
},
"Microsoft.CodeAnalysis.Common/4.14.0": {
"dependencies": {
"System.Buffers": "4.5.1",
"System.Collections.Immutable": "9.0.0",
"System.Memory": "4.5.5",
"System.Numerics.Vectors": "4.5.0",
"System.Reflection.Metadata": "9.0.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encoding.CodePages": "7.0.0",
"System.Threading.Tasks.Extensions": "4.5.4"
},
"runtime": {
"lib/netstandard2.0/Microsoft.CodeAnalysis.dll": {
"assemblyVersion": "4.14.0.0",
"fileVersion": "4.1400.25.26210"
}
},
"resources": {
"lib/netstandard2.0/cs/Microsoft.CodeAnalysis.resources.dll": {
"locale": "cs"
},
"lib/netstandard2.0/de/Microsoft.CodeAnalysis.resources.dll": {
"locale": "de"
},
"lib/netstandard2.0/es/Microsoft.CodeAnalysis.resources.dll": {
"locale": "es"
},
"lib/netstandard2.0/fr/Microsoft.CodeAnalysis.resources.dll": {
"locale": "fr"
},
"lib/netstandard2.0/it/Microsoft.CodeAnalysis.resources.dll": {
"locale": "it"
},
"lib/netstandard2.0/ja/Microsoft.CodeAnalysis.resources.dll": {
"locale": "ja"
},
"lib/netstandard2.0/ko/Microsoft.CodeAnalysis.resources.dll": {
"locale": "ko"
},
"lib/netstandard2.0/pl/Microsoft.CodeAnalysis.resources.dll": {
"locale": "pl"
},
"lib/netstandard2.0/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
"locale": "pt-BR"
},
"lib/netstandard2.0/ru/Microsoft.CodeAnalysis.resources.dll": {
"locale": "ru"
},
"lib/netstandard2.0/tr/Microsoft.CodeAnalysis.resources.dll": {
"locale": "tr"
},
"lib/netstandard2.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
"locale": "zh-Hans"
},
"lib/netstandard2.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
"locale": "zh-Hant"
}
}
},
"Microsoft.CodeAnalysis.CSharp/4.14.0": {
"dependencies": {
"Microsoft.CodeAnalysis.Common": "4.14.0",
"System.Buffers": "4.5.1",
"System.Collections.Immutable": "9.0.0",
"System.Memory": "4.5.5",
"System.Numerics.Vectors": "4.5.0",
"System.Reflection.Metadata": "9.0.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encoding.CodePages": "7.0.0",
"System.Threading.Tasks.Extensions": "4.5.4"
},
"runtime": {
"lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.dll": {
"assemblyVersion": "4.14.0.0",
"fileVersion": "4.1400.25.26210"
}
},
"resources": {
"lib/netstandard2.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "cs"
},
"lib/netstandard2.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "de"
},
"lib/netstandard2.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "es"
},
"lib/netstandard2.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "fr"
},
"lib/netstandard2.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "it"
},
"lib/netstandard2.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "ja"
},
"lib/netstandard2.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "ko"
},
"lib/netstandard2.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "pl"
},
"lib/netstandard2.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "pt-BR"
},
"lib/netstandard2.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "ru"
},
"lib/netstandard2.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "tr"
},
"lib/netstandard2.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "zh-Hans"
},
"lib/netstandard2.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
"locale": "zh-Hant"
}
}
},
"System.Buffers/4.5.1": {
"runtime": {
"lib/netstandard2.0/System.Buffers.dll": {
"assemblyVersion": "4.0.3.0",
"fileVersion": "4.6.28619.1"
}
}
},
"System.Collections.Immutable/9.0.0": {
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/netstandard2.0/System.Collections.Immutable.dll": {
"assemblyVersion": "9.0.0.0",
"fileVersion": "9.0.24.52809"
}
}
},
"System.Memory/4.5.5": {
"dependencies": {
"System.Buffers": "4.5.1",
"System.Numerics.Vectors": "4.5.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/netstandard2.0/System.Memory.dll": {
"assemblyVersion": "4.0.1.2",
"fileVersion": "4.6.31308.1"
}
}
},
"System.Numerics.Vectors/4.5.0": {
"runtime": {
"lib/netstandard2.0/System.Numerics.Vectors.dll": {
"assemblyVersion": "4.1.4.0",
"fileVersion": "4.6.26515.6"
}
}
},
"System.Reflection.Metadata/9.0.0": {
"dependencies": {
"System.Collections.Immutable": "9.0.0",
"System.Memory": "4.5.5"
},
"runtime": {
"lib/netstandard2.0/System.Reflection.Metadata.dll": {
"assemblyVersion": "9.0.0.0",
"fileVersion": "9.0.24.52809"
}
}
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"runtime": {
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.21.52210"
}
}
},
"System.Text.Encoding.CodePages/7.0.0": {
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"System.Threading.Tasks.Extensions/4.5.4": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": {
"assemblyVersion": "4.2.0.1",
"fileVersion": "4.6.28619.1"
}
}
}
}
},
"libraries": {
"ShrinkSDK.CodeGen.Analyzers/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Microsoft.CodeAnalysis.Common/4.14.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==",
"path": "microsoft.codeanalysis.common/4.14.0",
"hashPath": "microsoft.codeanalysis.common.4.14.0.nupkg.sha512"
},
"Microsoft.CodeAnalysis.CSharp/4.14.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==",
"path": "microsoft.codeanalysis.csharp/4.14.0",
"hashPath": "microsoft.codeanalysis.csharp.4.14.0.nupkg.sha512"
},
"System.Buffers/4.5.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==",
"path": "system.buffers/4.5.1",
"hashPath": "system.buffers.4.5.1.nupkg.sha512"
},
"System.Collections.Immutable/9.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==",
"path": "system.collections.immutable/9.0.0",
"hashPath": "system.collections.immutable.9.0.0.nupkg.sha512"
},
"System.Memory/4.5.5": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==",
"path": "system.memory/4.5.5",
"hashPath": "system.memory.4.5.5.nupkg.sha512"
},
"System.Numerics.Vectors/4.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==",
"path": "system.numerics.vectors/4.5.0",
"hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512"
},
"System.Reflection.Metadata/9.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==",
"path": "system.reflection.metadata/9.0.0",
"hashPath": "system.reflection.metadata.9.0.0.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
"path": "system.runtime.compilerservices.unsafe/6.0.0",
"hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
},
"System.Text.Encoding.CodePages/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==",
"path": "system.text.encoding.codepages/7.0.0",
"hashPath": "system.text.encoding.codepages.7.0.0.nupkg.sha512"
},
"System.Threading.Tasks.Extensions/4.5.4": {
"type": "package",
"serviceable": true,
"sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==",
"path": "system.threading.tasks.extensions/4.5.4",
"hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512"
}
}
}
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ShrinkSDK")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5fd9b258d78a4eccff03b1da12ffd9f9a62526a4")]
[assembly: System.Reflection.AssemblyProductAttribute("ShrinkSDK.CodeGen.Analyzers")]
[assembly: System.Reflection.AssemblyTitleAttribute("ShrinkSDK.CodeGen.Analyzers")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.crash.work/ShrinkSDK")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
8c6d371fb2669eb81546bbe4990e35d6e23df1869fb22f4d099f3616dd4e7bdc
@@ -0,0 +1,16 @@
is_global = true
build_property.TargetFramework = netstandard2.0
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules = true
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = ShrinkSDK.CodeGen.Analyzers
build_property.ProjectDir = D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1 @@
dd656b0d56b480b28268325a874f26433a3d0356ca7f9d4e49fe23db743d3867
@@ -0,0 +1,10 @@
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\bin\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.deps.json
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\bin\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\bin\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.pdb
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.csproj.AssemblyReference.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.GeneratedMSBuildEditorConfig.editorconfig
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.AssemblyInfoInputs.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.AssemblyInfo.cs
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.csproj.CoreCompileInputs.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\obj\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.pdb
@@ -0,0 +1,79 @@
{
"format": 1,
"restore": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Analyzers\\ShrinkSDK.CodeGen.Analyzers.csproj": {}
},
"projects": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Analyzers\\ShrinkSDK.CodeGen.Analyzers.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Analyzers\\ShrinkSDK.CodeGen.Analyzers.csproj",
"projectName": "ShrinkSDK.CodeGen.Analyzers",
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Analyzers\\ShrinkSDK.CodeGen.Analyzers.csproj",
"packagesPath": "C:\\Users\\im\\.nuget\\packages\\",
"outputPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Analyzers\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\NuGet.Config",
"C:\\Users\\im\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"netstandard2.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json": {}
},
"frameworks": {
"netstandard2.0": {
"framework": "netstandard2.0",
"targetAlias": "netstandard2.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"netstandard2.0": {
"framework": "netstandard2.0",
"targetAlias": "netstandard2.0",
"dependencies": {
"Microsoft.CodeAnalysis.CSharp": {
"suppressParent": "All",
"target": "Package",
"version": "[4.14.0, )"
},
"NETStandard.Library": {
"suppressParent": "All",
"target": "Package",
"version": "[2.0.3, )",
"autoReferenced": true
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300\\RuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\im\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\im\.nuget\packages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.codeanalysis.analyzers\3.11.0\buildTransitive\Microsoft.CodeAnalysis.Analyzers.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codeanalysis.analyzers\3.11.0\buildTransitive\Microsoft.CodeAnalysis.Analyzers.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgMicrosoft_CodeAnalysis_Analyzers Condition=" '$(PkgMicrosoft_CodeAnalysis_Analyzers)' == '' ">C:\Users\im\.nuget\packages\microsoft.codeanalysis.analyzers\3.11.0</PkgMicrosoft_CodeAnalysis_Analyzers>
</PropertyGroup>
</Project>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.codeanalysis.analyzers\3.11.0\buildTransitive\Microsoft.CodeAnalysis.Analyzers.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codeanalysis.analyzers\3.11.0\buildTransitive\Microsoft.CodeAnalysis.Analyzers.targets')" />
</ImportGroup>
</Project>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
{
"version": 2,
"dgSpecHash": "b8S3yYi3RGU=",
"success": true,
"projectFilePath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Analyzers\\ShrinkSDK.CodeGen.Analyzers.csproj",
"expectedPackageFiles": [
"C:\\Users\\im\\.nuget\\packages\\microsoft.codeanalysis.analyzers\\3.11.0\\microsoft.codeanalysis.analyzers.3.11.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.codeanalysis.common\\4.14.0\\microsoft.codeanalysis.common.4.14.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.codeanalysis.csharp\\4.14.0\\microsoft.codeanalysis.csharp.4.14.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.collections.immutable\\9.0.0\\system.collections.immutable.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.numerics.vectors\\4.5.0\\system.numerics.vectors.4.5.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.reflection.metadata\\9.0.0\\system.reflection.metadata.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.text.encoding.codepages\\7.0.0\\system.text.encoding.codepages.7.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.threading.tasks.extensions\\4.5.4\\system.threading.tasks.extensions.4.5.4.nupkg.sha512"
],
"logs": []
}
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>ShrinkSDK.CodeGen.Core</AssemblyName>
<RootNamespace>ShrinkSDK.CodeGen</RootNamespace>
<PackageId>ShrinkSDK.CodeGen.Core</PackageId>
<Version>0.1.0</Version>
<IsPackable>false</IsPackable>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Editor\Core\*.cs" />
<PackageReference Include="Mono.Cecil" Version="0.11.6" />
</ItemGroup>
</Project>
@@ -0,0 +1,53 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"ShrinkSDK.CodeGen.Core/0.1.0": {
"dependencies": {
"Mono.Cecil": "0.11.6"
},
"runtime": {
"ShrinkSDK.CodeGen.Core.dll": {}
}
},
"Mono.Cecil/0.11.6": {
"runtime": {
"lib/netstandard2.0/Mono.Cecil.Mdb.dll": {
"assemblyVersion": "0.11.6.0",
"fileVersion": "0.11.6.0"
},
"lib/netstandard2.0/Mono.Cecil.Pdb.dll": {
"assemblyVersion": "0.11.6.0",
"fileVersion": "0.11.6.0"
},
"lib/netstandard2.0/Mono.Cecil.Rocks.dll": {
"assemblyVersion": "0.11.6.0",
"fileVersion": "0.11.6.0"
},
"lib/netstandard2.0/Mono.Cecil.dll": {
"assemblyVersion": "0.11.6.0",
"fileVersion": "0.11.6.0"
}
}
}
}
},
"libraries": {
"ShrinkSDK.CodeGen.Core/0.1.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Mono.Cecil/0.11.6": {
"type": "package",
"serviceable": true,
"sha512": "sha512-f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==",
"path": "mono.cecil/0.11.6",
"hashPath": "mono.cecil.0.11.6.nupkg.sha512"
}
}
}
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ShrinkSDK")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.1.0+5fd9b258d78a4eccff03b1da12ffd9f9a62526a4")]
[assembly: System.Reflection.AssemblyProductAttribute("ShrinkSDK.CodeGen.Core")]
[assembly: System.Reflection.AssemblyTitleAttribute("ShrinkSDK.CodeGen.Core")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.crash.work/ShrinkSDK")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
fb8b629c9a892f76c7f10d1027dfd3d11c122901386d6f05140057b22a57d898
@@ -0,0 +1,18 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property.EntryPointFilePath =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = ShrinkSDK.CodeGen
build_property.ProjectDir = D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1 @@
658531825cf8aebf1c5a2a5a797552ace7ec66b63a22e38d4de699f7c9131d6f
@@ -0,0 +1,12 @@
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\bin\Release\net8.0\ShrinkSDK.CodeGen.Core.deps.json
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\bin\Release\net8.0\ShrinkSDK.CodeGen.Core.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\bin\Release\net8.0\ShrinkSDK.CodeGen.Core.pdb
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.csproj.AssemblyReference.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.GeneratedMSBuildEditorConfig.editorconfig
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.AssemblyInfoInputs.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.AssemblyInfo.cs
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.csproj.CoreCompileInputs.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\refint\ShrinkSDK.CodeGen.Core.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ShrinkSDK.CodeGen.Core.pdb
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Core\obj\Release\net8.0\ref\ShrinkSDK.CodeGen.Core.dll
@@ -0,0 +1,91 @@
{
"format": 1,
"restore": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj": {}
},
"projects": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj": {
"version": "0.1.0",
"restore": {
"projectUniqueName": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"projectName": "ShrinkSDK.CodeGen.Core",
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"packagesPath": "C:\\Users\\im\\.nuget\\packages\\",
"outputPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\NuGet.Config",
"C:\\Users\\im\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"dependencies": {
"Mono.Cecil": {
"target": "Package",
"version": "[0.11.6, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[8.0.27, 8.0.27]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\im\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\im\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,158 @@
{
"version": 4,
"targets": {
"net8.0": {
"Mono.Cecil/0.11.6": {
"type": "package",
"compile": {
"lib/netstandard2.0/Mono.Cecil.Mdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Pdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Rocks.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.dll": {
"related": ".Mdb.pdb;.pdb;.Pdb.pdb;.Rocks.pdb"
}
},
"runtime": {
"lib/netstandard2.0/Mono.Cecil.Mdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Pdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Rocks.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.dll": {
"related": ".Mdb.pdb;.pdb;.Pdb.pdb;.Rocks.pdb"
}
}
}
}
},
"libraries": {
"Mono.Cecil/0.11.6": {
"sha512": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==",
"type": "package",
"path": "mono.cecil/0.11.6",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/net40/Mono.Cecil.Mdb.dll",
"lib/net40/Mono.Cecil.Mdb.pdb",
"lib/net40/Mono.Cecil.Pdb.dll",
"lib/net40/Mono.Cecil.Pdb.pdb",
"lib/net40/Mono.Cecil.Rocks.dll",
"lib/net40/Mono.Cecil.Rocks.pdb",
"lib/net40/Mono.Cecil.dll",
"lib/net40/Mono.Cecil.pdb",
"lib/netstandard2.0/Mono.Cecil.Mdb.dll",
"lib/netstandard2.0/Mono.Cecil.Mdb.pdb",
"lib/netstandard2.0/Mono.Cecil.Pdb.dll",
"lib/netstandard2.0/Mono.Cecil.Pdb.pdb",
"lib/netstandard2.0/Mono.Cecil.Rocks.dll",
"lib/netstandard2.0/Mono.Cecil.Rocks.pdb",
"lib/netstandard2.0/Mono.Cecil.dll",
"lib/netstandard2.0/Mono.Cecil.pdb",
"mono.cecil.0.11.6.nupkg.sha512",
"mono.cecil.nuspec"
]
}
},
"projectFileDependencyGroups": {
"net8.0": [
"Mono.Cecil >= 0.11.6"
]
},
"packageFolders": {
"C:\\Users\\im\\.nuget\\packages\\": {}
},
"project": {
"version": "0.1.0",
"restore": {
"projectUniqueName": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"projectName": "ShrinkSDK.CodeGen.Core",
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"packagesPath": "C:\\Users\\im\\.nuget\\packages\\",
"outputPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\NuGet.Config",
"C:\\Users\\im\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"dependencies": {
"Mono.Cecil": {
"target": "Package",
"version": "[0.11.6, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[8.0.27, 8.0.27]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,13 @@
{
"version": 2,
"dgSpecHash": "tJZD7ysiCNo=",
"success": true,
"projectFilePath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"expectedPackageFiles": [
"C:\\Users\\im\\.nuget\\packages\\mono.cecil\\0.11.6\\mono.cecil.0.11.6.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.netcore.app.ref\\8.0.27\\microsoft.netcore.app.ref.8.0.27.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\8.0.27\\microsoft.windowsdesktop.app.ref.8.0.27.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\8.0.27\\microsoft.aspnetcore.app.ref.8.0.27.nupkg.sha512"
],
"logs": []
}
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>ShrinkSDK.CodeGen.Task</AssemblyName>
<RootNamespace>ShrinkSDK.CodeGen</RootNamespace>
<PackageId>ShrinkSDK.CodeGen</PackageId>
<Version>0.1.0</Version>
<Description>MSBuild integration for ShrinkSDK Cecil weaving.</Description>
<IsPackable>true</IsPackable>
<BuildOutputTargetFolder>tools</BuildOutputTargetFolder>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeShrinkCodeGenDependencies</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ShrinkSDK.CodeGen.Core\ShrinkSDK.CodeGen.Core.csproj" />
<ProjectReference Include="..\ShrinkSDK.CodeGen.Analyzers\ShrinkSDK.CodeGen.Analyzers.csproj" ReferenceOutputAssembly="false" />
<PackageReference Include="Mono.Cecil" Version="0.11.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Framework" Version="17.14.28" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.14.28" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<None Include="buildTransitive\ShrinkSDK.CodeGen.props" Pack="true" PackagePath="buildTransitive\ShrinkSDK.CodeGen.props" />
<None Include="buildTransitive\ShrinkSDK.CodeGen.targets" Pack="true" PackagePath="buildTransitive\ShrinkSDK.CodeGen.targets" />
<None Include="..\ShrinkSDK.CodeGen.Analyzers\bin\$(Configuration)\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.dll"
Pack="true" PackagePath="analyzers\dotnet\cs\ShrinkSDK.CodeGen.Analyzers.dll" />
</ItemGroup>
<Target Name="IncludeShrinkCodeGenDependencies" DependsOnTargets="Build">
<ItemGroup>
<BuildOutputInPackage Include="$(OutputPath)ShrinkSDK.CodeGen.Core.dll" />
<BuildOutputInPackage Include="$(OutputPath)Mono.Cecil.dll" />
</ItemGroup>
</Target>
</Project>
@@ -0,0 +1,98 @@
#nullable enable
using System;
using System.IO;
using System.Linq;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace ShrinkSDK.CodeGen;
public sealed class ShrinkWeaveTask : Task
{
[Required]
public string AssemblyPath { get; set; } = string.Empty;
public string? PdbPath { get; set; }
public ITaskItem[] ReferencePaths { get; set; } = Array.Empty<ITaskItem>();
public string? StrongNameKeyFile { get; set; }
[Output] public bool Changed { get; private set; }
[Output] public int InstanceSubscriberCount { get; private set; }
[Output] public int StaticSubscriberCount { get; private set; }
[Output] public int RegistryEntryCount { get; private set; }
public override bool Execute()
{
if (!File.Exists(AssemblyPath))
{
Log.LogError($"[ShrinkSDK.CodeGen] Intermediate assembly does not exist: {AssemblyPath}");
return false;
}
var assemblyDirectory = Path.GetDirectoryName(Path.GetFullPath(AssemblyPath))!;
var temporaryAssembly = Path.Combine(assemblyDirectory, $".{Path.GetFileName(AssemblyPath)}.{Guid.NewGuid():N}.tmp");
var hasPdb = !string.IsNullOrWhiteSpace(PdbPath) && File.Exists(PdbPath);
var temporaryPdb = hasPdb
? Path.Combine(assemblyDirectory, $".{Path.GetFileName(PdbPath)}.{Guid.NewGuid():N}.tmp")
: null;
try
{
var result = ShrinkAssemblyWeaver.Weave(
AssemblyPath,
hasPdb ? PdbPath : null,
ReferencePaths.Select(item => item.ItemSpec),
temporaryAssembly,
temporaryPdb,
ShrinkCodeGenPlatform.EngineNeutral,
StrongNameKeyFile);
foreach (var diagnostic in result.Diagnostics)
{
switch (diagnostic.Severity)
{
case ShrinkCodeGenDiagnosticSeverity.Warning:
Log.LogWarning($"[ShrinkSDK.CodeGen] {diagnostic.Message}");
break;
case ShrinkCodeGenDiagnosticSeverity.Error:
Log.LogError($"[ShrinkSDK.CodeGen] {diagnostic.Message}");
break;
default:
Log.LogMessage(MessageImportance.Low, $"[ShrinkSDK.CodeGen] {diagnostic.Message}");
break;
}
}
if (!result.Succeeded)
return false;
Changed = result.Changed;
InstanceSubscriberCount = result.InstanceSubscribers;
StaticSubscriberCount = result.StaticSubscribers;
RegistryEntryCount = result.RegistryEntries;
if (Changed)
{
File.Move(temporaryAssembly, AssemblyPath, true);
if (hasPdb && temporaryPdb != null)
File.Move(temporaryPdb, PdbPath!, true);
}
Log.LogMessage(MessageImportance.High,
$"[ShrinkSDK.CodeGen] {Path.GetFileName(AssemblyPath)} woven: instance={InstanceSubscriberCount}, static={StaticSubscriberCount}, registry={RegistryEntryCount}.");
return true;
}
catch (Exception exception)
{
Log.LogErrorFromException(exception, true);
return false;
}
finally
{
TryDelete(temporaryAssembly);
if (temporaryPdb != null) TryDelete(temporaryPdb);
}
}
private static void TryDelete(string path)
{
try { if (File.Exists(path)) File.Delete(path); }
catch { }
}
}
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<ShrinkCodeGenEnabled Condition="'$(ShrinkCodeGenEnabled)' == ''">true</ShrinkCodeGenEnabled>
</PropertyGroup>
</Project>
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<_ShrinkCodeGenTaskAssembly Condition="'$(_ShrinkCodeGenTaskAssembly)' == ''">$(MSBuildThisFileDirectory)..\tools\net8.0\ShrinkSDK.CodeGen.Task.dll</_ShrinkCodeGenTaskAssembly>
</PropertyGroup>
<UsingTask TaskName="ShrinkSDK.CodeGen.ShrinkWeaveTask" AssemblyFile="$(_ShrinkCodeGenTaskAssembly)" />
<Target Name="ShrinkCodeGenWeave"
AfterTargets="CoreCompile"
BeforeTargets="CopyFilesToOutputDirectory"
Condition="'$(ShrinkCodeGenEnabled)' == 'true' and '$(DesignTimeBuild)' != 'true'">
<PropertyGroup>
<_ShrinkCodeGenIntermediateAssembly>$(IntermediateOutputPath)$(TargetName).dll</_ShrinkCodeGenIntermediateAssembly>
</PropertyGroup>
<ShrinkWeaveTask AssemblyPath="$(_ShrinkCodeGenIntermediateAssembly)"
PdbPath="$(IntermediateOutputPath)$(TargetName).pdb"
ReferencePaths="@(ReferencePath)"
StrongNameKeyFile="$(ShrinkCodeGenStrongNameKeyFile)" />
</Target>
</Project>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>ShrinkSDK.CodeGen</id>
<version>0.1.0</version>
<authors>ShrinkSDK</authors>
<description>MSBuild integration for ShrinkSDK Cecil weaving.</description>
<repository type="git" url="https://git.crash.work/ShrinkSDK" commit="5fd9b258d78a4eccff03b1da12ffd9f9a62526a4" />
</metadata>
<files>
<file src="bin\Release\net8.0\ShrinkSDK.CodeGen.Core.dll" target="tools\net8.0\ShrinkSDK.CodeGen.Core.dll" />
<file src="bin\Release\net8.0\Mono.Cecil.dll" target="tools\net8.0\Mono.Cecil.dll" />
<file src="D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\ShrinkSDK.CodeGen.Task.dll" target="tools\net8.0\ShrinkSDK.CodeGen.Task.dll" />
<file src="D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\buildTransitive\ShrinkSDK.CodeGen.props" target="buildTransitive\ShrinkSDK.CodeGen.props" />
<file src="D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\buildTransitive\ShrinkSDK.CodeGen.targets" target="buildTransitive\ShrinkSDK.CodeGen.targets" />
<file src="D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Analyzers\bin\Release\netstandard2.0\ShrinkSDK.CodeGen.Analyzers.dll" target="analyzers\dotnet\cs\ShrinkSDK.CodeGen.Analyzers.dll" />
</files>
</package>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>ShrinkSDK.CodeGen</id>
<version>0.1.0</version>
<authors>ShrinkSDK</authors>
<description>MSBuild integration for ShrinkSDK Cecil weaving.</description>
<repository type="git" url="https://git.crash.work/ShrinkSDK" commit="5fd9b258d78a4eccff03b1da12ffd9f9a62526a4" />
</metadata>
<files>
<file src="D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\ShrinkSDK.CodeGen.Task.pdb" target="tools\net8.0\ShrinkSDK.CodeGen.Task.pdb" />
</files>
</package>
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ShrinkSDK")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("MSBuild integration for ShrinkSDK Cecil weaving.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.1.0+5fd9b258d78a4eccff03b1da12ffd9f9a62526a4")]
[assembly: System.Reflection.AssemblyProductAttribute("ShrinkSDK.CodeGen.Task")]
[assembly: System.Reflection.AssemblyTitleAttribute("ShrinkSDK.CodeGen.Task")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.crash.work/ShrinkSDK")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
ec318fa27f4adfc8bd8c83222b64849b259facaa9d8947b3afd45671edfafc6d
@@ -0,0 +1,18 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property.EntryPointFilePath =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = ShrinkSDK.CodeGen
build_property.ProjectDir = D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1 @@
df6cb6b516c45ed88942ae2b5c6477c2c73fe92cbbf6dadc5a2571d8cd0b79a5
@@ -0,0 +1,25 @@
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\ShrinkSDK.CodeGen.Task.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\Mono.Cecil.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\ShrinkSDK.CodeGen.Core.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\Microsoft.NET.StringTools.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\Mono.Cecil.Mdb.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\Mono.Cecil.Pdb.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\Mono.Cecil.Rocks.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\System.Collections.Immutable.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\System.Configuration.ConfigurationManager.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\System.Diagnostics.DiagnosticSource.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\System.Diagnostics.EventLog.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\System.Security.Cryptography.ProtectedData.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\System.Text.Encoding.CodePages.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\runtimes\win\lib\net8.0\System.Diagnostics.EventLog.Messages.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\runtimes\win\lib\net8.0\System.Diagnostics.EventLog.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\runtimes\win\lib\net8.0\System.Text.Encoding.CodePages.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\bin\Release\net8.0\ShrinkSDK.CodeGen.Core.pdb
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.csproj.AssemblyReference.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.GeneratedMSBuildEditorConfig.editorconfig
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.AssemblyInfoInputs.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.AssemblyInfo.cs
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.csproj.CoreCompileInputs.cache
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\refint\ShrinkSDK.CodeGen.Task.dll
D:\UnityBuilds\ShrinkSDK\Assets\Modules\ShrinkShared.CodeGen\DotNet~\ShrinkSDK.CodeGen.Task\obj\Release\net8.0\ShrinkSDK.CodeGen.Task.pdb
@@ -0,0 +1,189 @@
{
"format": 1,
"restore": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj": {}
},
"projects": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj": {
"version": "0.1.0",
"restore": {
"projectUniqueName": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"projectName": "ShrinkSDK.CodeGen.Core",
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj",
"packagesPath": "C:\\Users\\im\\.nuget\\packages\\",
"outputPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\NuGet.Config",
"C:\\Users\\im\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"dependencies": {
"Mono.Cecil": {
"target": "Package",
"version": "[0.11.6, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[8.0.27, 8.0.27]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
},
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj": {
"version": "0.1.0",
"restore": {
"projectUniqueName": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj",
"projectName": "ShrinkSDK.CodeGen",
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj",
"packagesPath": "C:\\Users\\im\\.nuget\\packages\\",
"outputPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\NuGet.Config",
"C:\\Users\\im\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj": {
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.Build.Framework": {
"suppressParent": "All",
"target": "Package",
"version": "[17.14.28, )"
},
"Microsoft.Build.Utilities.Core": {
"suppressParent": "All",
"target": "Package",
"version": "[17.14.28, )"
},
"Mono.Cecil": {
"suppressParent": "All",
"target": "Package",
"version": "[0.11.6, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[8.0.27, 8.0.27]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\im\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\im\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,950 @@
{
"version": 4,
"targets": {
"net8.0": {
"Microsoft.Build.Framework/17.14.28": {
"type": "package",
"dependencies": {
"Microsoft.Win32.Registry": "5.0.0",
"System.Diagnostics.DiagnosticSource": "9.0.0",
"System.Memory": "4.6.0",
"System.Runtime.CompilerServices.Unsafe": "6.1.0",
"System.Security.Principal.Windows": "5.0.0"
},
"compile": {
"ref/netstandard2.0/Microsoft.Build.Framework.dll": {
"related": ".xml"
}
}
},
"Microsoft.Build.Utilities.Core/17.14.28": {
"type": "package",
"dependencies": {
"Microsoft.Build.Framework": "17.14.28",
"Microsoft.NET.StringTools": "17.14.28",
"Microsoft.Win32.Registry": "5.0.0",
"System.Collections.Immutable": "9.0.0",
"System.Configuration.ConfigurationManager": "9.0.0",
"System.Diagnostics.DiagnosticSource": "9.0.0",
"System.Memory": "4.6.0",
"System.Runtime.CompilerServices.Unsafe": "6.1.0",
"System.Security.Cryptography.ProtectedData": "9.0.0",
"System.Security.Principal.Windows": "5.0.0",
"System.Text.Encoding.CodePages": "9.0.0"
},
"compile": {
"ref/netstandard2.0/Microsoft.Build.Utilities.Core.dll": {
"related": ".xml"
}
}
},
"Microsoft.NET.StringTools/17.14.28": {
"type": "package",
"dependencies": {
"System.Memory": "4.6.0",
"System.Runtime.CompilerServices.Unsafe": "6.1.0"
},
"compile": {
"ref/netstandard2.0/Microsoft.NET.StringTools.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard2.0/Microsoft.NET.StringTools.dll": {
"related": ".pdb;.xml"
}
}
},
"Microsoft.NETCore.Platforms/5.0.0": {
"type": "package",
"compile": {
"lib/netstandard1.0/_._": {}
},
"runtime": {
"lib/netstandard1.0/_._": {}
}
},
"Microsoft.Win32.Registry/5.0.0": {
"type": "package",
"dependencies": {
"System.Security.AccessControl": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
},
"compile": {
"ref/netstandard2.0/Microsoft.Win32.Registry.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
"related": ".xml"
}
},
"runtimeTargets": {
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"Mono.Cecil/0.11.6": {
"type": "package",
"compile": {
"lib/netstandard2.0/Mono.Cecil.Mdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Pdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Rocks.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.dll": {
"related": ".Mdb.pdb;.pdb;.Pdb.pdb;.Rocks.pdb"
}
},
"runtime": {
"lib/netstandard2.0/Mono.Cecil.Mdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Pdb.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.Rocks.dll": {
"related": ".pdb"
},
"lib/netstandard2.0/Mono.Cecil.dll": {
"related": ".Mdb.pdb;.pdb;.Pdb.pdb;.Rocks.pdb"
}
}
},
"System.Collections.Immutable/9.0.0": {
"type": "package",
"compile": {
"lib/net8.0/System.Collections.Immutable.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Collections.Immutable.dll": {
"related": ".xml"
}
},
"build": {
"buildTransitive/net8.0/_._": {}
}
},
"System.Configuration.ConfigurationManager/9.0.0": {
"type": "package",
"dependencies": {
"System.Diagnostics.EventLog": "9.0.0",
"System.Security.Cryptography.ProtectedData": "9.0.0"
},
"compile": {
"lib/net8.0/System.Configuration.ConfigurationManager.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Configuration.ConfigurationManager.dll": {
"related": ".xml"
}
},
"build": {
"buildTransitive/net8.0/_._": {}
}
},
"System.Diagnostics.DiagnosticSource/9.0.0": {
"type": "package",
"compile": {
"lib/net8.0/System.Diagnostics.DiagnosticSource.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Diagnostics.DiagnosticSource.dll": {
"related": ".xml"
}
},
"contentFiles": {
"contentFiles/any/any/_._": {
"buildAction": "None",
"codeLanguage": "any",
"copyToOutput": false
}
},
"build": {
"buildTransitive/net8.0/_._": {}
}
},
"System.Diagnostics.EventLog/9.0.0": {
"type": "package",
"compile": {
"lib/net8.0/System.Diagnostics.EventLog.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Diagnostics.EventLog.dll": {
"related": ".xml"
}
},
"build": {
"buildTransitive/net8.0/_._": {}
},
"runtimeTargets": {
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll": {
"assetType": "runtime",
"rid": "win"
},
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Memory/4.6.0": {
"type": "package",
"compile": {
"lib/netcoreapp2.1/_._": {}
},
"runtime": {
"lib/netcoreapp2.1/_._": {}
}
},
"System.Runtime.CompilerServices.Unsafe/6.1.0": {
"type": "package",
"compile": {
"lib/net7.0/_._": {}
},
"runtime": {
"lib/net7.0/_._": {}
},
"build": {
"buildTransitive/net6.0/_._": {}
}
},
"System.Security.AccessControl/5.0.0": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
},
"compile": {
"ref/netstandard2.0/System.Security.AccessControl.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard2.0/System.Security.AccessControl.dll": {
"related": ".xml"
}
},
"runtimeTargets": {
"runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Security.Cryptography.ProtectedData/9.0.0": {
"type": "package",
"compile": {
"lib/net8.0/System.Security.Cryptography.ProtectedData.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Security.Cryptography.ProtectedData.dll": {
"related": ".xml"
}
},
"build": {
"buildTransitive/net8.0/_._": {}
}
},
"System.Security.Principal.Windows/5.0.0": {
"type": "package",
"compile": {
"ref/netcoreapp3.0/System.Security.Principal.Windows.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard2.0/System.Security.Principal.Windows.dll": {
"related": ".xml"
}
},
"runtimeTargets": {
"runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": {
"assetType": "runtime",
"rid": "unix"
},
"runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Text.Encoding.CodePages/9.0.0": {
"type": "package",
"compile": {
"lib/net8.0/System.Text.Encoding.CodePages.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Text.Encoding.CodePages.dll": {
"related": ".xml"
}
},
"build": {
"buildTransitive/net8.0/_._": {}
},
"runtimeTargets": {
"runtimes/win/lib/net8.0/System.Text.Encoding.CodePages.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"ShrinkSDK.CodeGen.Core/0.1.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v8.0",
"dependencies": {
"Mono.Cecil": "0.11.6"
},
"compile": {
"bin/placeholder/ShrinkSDK.CodeGen.Core.dll": {}
},
"runtime": {
"bin/placeholder/ShrinkSDK.CodeGen.Core.dll": {}
}
}
}
},
"libraries": {
"Microsoft.Build.Framework/17.14.28": {
"sha512": "wRcyTzGV0LRAtFdrddtioh59Ky4/zbvyraP0cQkDzRSRkhgAQb0K88D/JNC6VHLIXanRi3mtV1jU0uQkBwmiVg==",
"type": "package",
"path": "microsoft.build.framework/17.14.28",
"files": [
".nupkg.metadata",
".signature.p7s",
"MSBuild-NuGet-Icon.png",
"README.md",
"lib/net472/Microsoft.Build.Framework.dll",
"lib/net472/Microsoft.Build.Framework.pdb",
"lib/net472/Microsoft.Build.Framework.xml",
"lib/net9.0/Microsoft.Build.Framework.dll",
"lib/net9.0/Microsoft.Build.Framework.pdb",
"lib/net9.0/Microsoft.Build.Framework.xml",
"microsoft.build.framework.17.14.28.nupkg.sha512",
"microsoft.build.framework.nuspec",
"notices/THIRDPARTYNOTICES.txt",
"ref/net472/Microsoft.Build.Framework.dll",
"ref/net472/Microsoft.Build.Framework.xml",
"ref/net9.0/Microsoft.Build.Framework.dll",
"ref/net9.0/Microsoft.Build.Framework.xml",
"ref/netstandard2.0/Microsoft.Build.Framework.dll",
"ref/netstandard2.0/Microsoft.Build.Framework.xml"
]
},
"Microsoft.Build.Utilities.Core/17.14.28": {
"sha512": "rhSdPo8QfLXXWM+rY0x0z1G4KK4ZhMoIbHROyDj8MUBFab9nvHR0NaMnjzOgXldhmD2zi2ir8d6xCatNzlhF5g==",
"type": "package",
"path": "microsoft.build.utilities.core/17.14.28",
"files": [
".nupkg.metadata",
".signature.p7s",
"MSBuild-NuGet-Icon.png",
"README.md",
"lib/net472/Microsoft.Build.Utilities.Core.dll",
"lib/net472/Microsoft.Build.Utilities.Core.pdb",
"lib/net472/Microsoft.Build.Utilities.Core.xml",
"lib/net9.0/Microsoft.Build.Utilities.Core.dll",
"lib/net9.0/Microsoft.Build.Utilities.Core.pdb",
"lib/net9.0/Microsoft.Build.Utilities.Core.xml",
"microsoft.build.utilities.core.17.14.28.nupkg.sha512",
"microsoft.build.utilities.core.nuspec",
"notices/THIRDPARTYNOTICES.txt",
"ref/net472/Microsoft.Build.Utilities.Core.dll",
"ref/net472/Microsoft.Build.Utilities.Core.xml",
"ref/net9.0/Microsoft.Build.Utilities.Core.dll",
"ref/net9.0/Microsoft.Build.Utilities.Core.xml",
"ref/netstandard2.0/Microsoft.Build.Utilities.Core.dll",
"ref/netstandard2.0/Microsoft.Build.Utilities.Core.xml"
]
},
"Microsoft.NET.StringTools/17.14.28": {
"sha512": "DMIeWDlxe0Wz0DIhJZ2FMoGQAN2yrGZOi5jjFhRYHWR5ONd0CS6IpAHlRnA7uA/5BF+BADvgsETxW2XrPiFc1A==",
"type": "package",
"path": "microsoft.net.stringtools/17.14.28",
"files": [
".nupkg.metadata",
".signature.p7s",
"MSBuild-NuGet-Icon.png",
"README.md",
"lib/net472/Microsoft.NET.StringTools.dll",
"lib/net472/Microsoft.NET.StringTools.pdb",
"lib/net472/Microsoft.NET.StringTools.xml",
"lib/net9.0/Microsoft.NET.StringTools.dll",
"lib/net9.0/Microsoft.NET.StringTools.pdb",
"lib/net9.0/Microsoft.NET.StringTools.xml",
"lib/netstandard2.0/Microsoft.NET.StringTools.dll",
"lib/netstandard2.0/Microsoft.NET.StringTools.pdb",
"lib/netstandard2.0/Microsoft.NET.StringTools.xml",
"microsoft.net.stringtools.17.14.28.nupkg.sha512",
"microsoft.net.stringtools.nuspec",
"notices/THIRDPARTYNOTICES.txt",
"ref/net472/Microsoft.NET.StringTools.dll",
"ref/net472/Microsoft.NET.StringTools.xml",
"ref/net9.0/Microsoft.NET.StringTools.dll",
"ref/net9.0/Microsoft.NET.StringTools.xml",
"ref/netstandard2.0/Microsoft.NET.StringTools.dll",
"ref/netstandard2.0/Microsoft.NET.StringTools.xml"
]
},
"Microsoft.NETCore.Platforms/5.0.0": {
"sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
"type": "package",
"path": "microsoft.netcore.platforms/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/netstandard1.0/_._",
"microsoft.netcore.platforms.5.0.0.nupkg.sha512",
"microsoft.netcore.platforms.nuspec",
"runtime.json",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"Microsoft.Win32.Registry/5.0.0": {
"sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
"type": "package",
"path": "microsoft.win32.registry/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net46/Microsoft.Win32.Registry.dll",
"lib/net461/Microsoft.Win32.Registry.dll",
"lib/net461/Microsoft.Win32.Registry.xml",
"lib/netstandard1.3/Microsoft.Win32.Registry.dll",
"lib/netstandard2.0/Microsoft.Win32.Registry.dll",
"lib/netstandard2.0/Microsoft.Win32.Registry.xml",
"microsoft.win32.registry.5.0.0.nupkg.sha512",
"microsoft.win32.registry.nuspec",
"ref/net46/Microsoft.Win32.Registry.dll",
"ref/net461/Microsoft.Win32.Registry.dll",
"ref/net461/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/Microsoft.Win32.Registry.dll",
"ref/netstandard1.3/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/de/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/es/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/it/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml",
"ref/netstandard2.0/Microsoft.Win32.Registry.dll",
"ref/netstandard2.0/Microsoft.Win32.Registry.xml",
"runtimes/win/lib/net46/Microsoft.Win32.Registry.dll",
"runtimes/win/lib/net461/Microsoft.Win32.Registry.dll",
"runtimes/win/lib/net461/Microsoft.Win32.Registry.xml",
"runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll",
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll",
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"Mono.Cecil/0.11.6": {
"sha512": "f33RkDtZO8VlGXCtmQIviOtxgnUdym9xx/b1p9h91CRGOsJFxCFOFK1FDbVt1OCf1aWwYejUFa2MOQyFWTFjbA==",
"type": "package",
"path": "mono.cecil/0.11.6",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/net40/Mono.Cecil.Mdb.dll",
"lib/net40/Mono.Cecil.Mdb.pdb",
"lib/net40/Mono.Cecil.Pdb.dll",
"lib/net40/Mono.Cecil.Pdb.pdb",
"lib/net40/Mono.Cecil.Rocks.dll",
"lib/net40/Mono.Cecil.Rocks.pdb",
"lib/net40/Mono.Cecil.dll",
"lib/net40/Mono.Cecil.pdb",
"lib/netstandard2.0/Mono.Cecil.Mdb.dll",
"lib/netstandard2.0/Mono.Cecil.Mdb.pdb",
"lib/netstandard2.0/Mono.Cecil.Pdb.dll",
"lib/netstandard2.0/Mono.Cecil.Pdb.pdb",
"lib/netstandard2.0/Mono.Cecil.Rocks.dll",
"lib/netstandard2.0/Mono.Cecil.Rocks.pdb",
"lib/netstandard2.0/Mono.Cecil.dll",
"lib/netstandard2.0/Mono.Cecil.pdb",
"mono.cecil.0.11.6.nupkg.sha512",
"mono.cecil.nuspec"
]
},
"System.Collections.Immutable/9.0.0": {
"sha512": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==",
"type": "package",
"path": "system.collections.immutable/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Collections.Immutable.targets",
"buildTransitive/net462/_._",
"buildTransitive/net8.0/_._",
"buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets",
"lib/net462/System.Collections.Immutable.dll",
"lib/net462/System.Collections.Immutable.xml",
"lib/net8.0/System.Collections.Immutable.dll",
"lib/net8.0/System.Collections.Immutable.xml",
"lib/net9.0/System.Collections.Immutable.dll",
"lib/net9.0/System.Collections.Immutable.xml",
"lib/netstandard2.0/System.Collections.Immutable.dll",
"lib/netstandard2.0/System.Collections.Immutable.xml",
"system.collections.immutable.9.0.0.nupkg.sha512",
"system.collections.immutable.nuspec",
"useSharedDesignerContext.txt"
]
},
"System.Configuration.ConfigurationManager/9.0.0": {
"sha512": "PdkuMrwDhXoKFo/JxISIi9E8L+QGn9Iquj2OKDWHB6Y/HnUOuBouF7uS3R4Hw3FoNmwwMo6hWgazQdyHIIs27A==",
"type": "package",
"path": "system.configuration.configurationmanager/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Configuration.ConfigurationManager.targets",
"buildTransitive/net462/_._",
"buildTransitive/net8.0/_._",
"buildTransitive/netcoreapp2.0/System.Configuration.ConfigurationManager.targets",
"lib/net462/System.Configuration.ConfigurationManager.dll",
"lib/net462/System.Configuration.ConfigurationManager.xml",
"lib/net8.0/System.Configuration.ConfigurationManager.dll",
"lib/net8.0/System.Configuration.ConfigurationManager.xml",
"lib/net9.0/System.Configuration.ConfigurationManager.dll",
"lib/net9.0/System.Configuration.ConfigurationManager.xml",
"lib/netstandard2.0/System.Configuration.ConfigurationManager.dll",
"lib/netstandard2.0/System.Configuration.ConfigurationManager.xml",
"system.configuration.configurationmanager.9.0.0.nupkg.sha512",
"system.configuration.configurationmanager.nuspec",
"useSharedDesignerContext.txt"
]
},
"System.Diagnostics.DiagnosticSource/9.0.0": {
"sha512": "ddppcFpnbohLWdYKr/ZeLZHmmI+DXFgZ3Snq+/E7SwcdW4UnvxmaugkwGywvGVWkHPGCSZjCP+MLzu23AL5SDw==",
"type": "package",
"path": "system.diagnostics.diagnosticsource/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Diagnostics.DiagnosticSource.targets",
"buildTransitive/net462/_._",
"buildTransitive/net8.0/_._",
"buildTransitive/netcoreapp2.0/System.Diagnostics.DiagnosticSource.targets",
"content/ILLink/ILLink.Descriptors.LibraryBuild.xml",
"contentFiles/any/net462/ILLink/ILLink.Descriptors.LibraryBuild.xml",
"contentFiles/any/net8.0/ILLink/ILLink.Descriptors.LibraryBuild.xml",
"contentFiles/any/net9.0/ILLink/ILLink.Descriptors.LibraryBuild.xml",
"contentFiles/any/netstandard2.0/ILLink/ILLink.Descriptors.LibraryBuild.xml",
"lib/net462/System.Diagnostics.DiagnosticSource.dll",
"lib/net462/System.Diagnostics.DiagnosticSource.xml",
"lib/net8.0/System.Diagnostics.DiagnosticSource.dll",
"lib/net8.0/System.Diagnostics.DiagnosticSource.xml",
"lib/net9.0/System.Diagnostics.DiagnosticSource.dll",
"lib/net9.0/System.Diagnostics.DiagnosticSource.xml",
"lib/netstandard2.0/System.Diagnostics.DiagnosticSource.dll",
"lib/netstandard2.0/System.Diagnostics.DiagnosticSource.xml",
"system.diagnostics.diagnosticsource.9.0.0.nupkg.sha512",
"system.diagnostics.diagnosticsource.nuspec",
"useSharedDesignerContext.txt"
]
},
"System.Diagnostics.EventLog/9.0.0": {
"sha512": "qd01+AqPhbAG14KtdtIqFk+cxHQFZ/oqRSCoxU1F+Q6Kv0cl726sl7RzU9yLFGd4BUOKdN4XojXF0pQf/R6YeA==",
"type": "package",
"path": "system.diagnostics.eventlog/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Diagnostics.EventLog.targets",
"buildTransitive/net462/_._",
"buildTransitive/net8.0/_._",
"buildTransitive/netcoreapp2.0/System.Diagnostics.EventLog.targets",
"lib/net462/System.Diagnostics.EventLog.dll",
"lib/net462/System.Diagnostics.EventLog.xml",
"lib/net8.0/System.Diagnostics.EventLog.dll",
"lib/net8.0/System.Diagnostics.EventLog.xml",
"lib/net9.0/System.Diagnostics.EventLog.dll",
"lib/net9.0/System.Diagnostics.EventLog.xml",
"lib/netstandard2.0/System.Diagnostics.EventLog.dll",
"lib/netstandard2.0/System.Diagnostics.EventLog.xml",
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll",
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll",
"runtimes/win/lib/net8.0/System.Diagnostics.EventLog.xml",
"runtimes/win/lib/net9.0/System.Diagnostics.EventLog.Messages.dll",
"runtimes/win/lib/net9.0/System.Diagnostics.EventLog.dll",
"runtimes/win/lib/net9.0/System.Diagnostics.EventLog.xml",
"system.diagnostics.eventlog.9.0.0.nupkg.sha512",
"system.diagnostics.eventlog.nuspec",
"useSharedDesignerContext.txt"
]
},
"System.Memory/4.6.0": {
"sha512": "OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg==",
"type": "package",
"path": "system.memory/4.6.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"PACKAGE.md",
"buildTransitive/net461/System.Memory.targets",
"buildTransitive/net462/_._",
"lib/net462/System.Memory.dll",
"lib/net462/System.Memory.xml",
"lib/netcoreapp2.1/_._",
"lib/netstandard2.0/System.Memory.dll",
"lib/netstandard2.0/System.Memory.xml",
"system.memory.4.6.0.nupkg.sha512",
"system.memory.nuspec"
]
},
"System.Runtime.CompilerServices.Unsafe/6.1.0": {
"sha512": "5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==",
"type": "package",
"path": "system.runtime.compilerservices.unsafe/6.1.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"PACKAGE.md",
"buildTransitive/net461/System.Runtime.CompilerServices.Unsafe.targets",
"buildTransitive/net462/_._",
"buildTransitive/net6.0/_._",
"buildTransitive/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.targets",
"lib/net462/System.Runtime.CompilerServices.Unsafe.dll",
"lib/net462/System.Runtime.CompilerServices.Unsafe.xml",
"lib/net7.0/_._",
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll",
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml",
"system.runtime.compilerservices.unsafe.6.1.0.nupkg.sha512",
"system.runtime.compilerservices.unsafe.nuspec"
]
},
"System.Security.AccessControl/5.0.0": {
"sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
"type": "package",
"path": "system.security.accesscontrol/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net46/System.Security.AccessControl.dll",
"lib/net461/System.Security.AccessControl.dll",
"lib/net461/System.Security.AccessControl.xml",
"lib/netstandard1.3/System.Security.AccessControl.dll",
"lib/netstandard2.0/System.Security.AccessControl.dll",
"lib/netstandard2.0/System.Security.AccessControl.xml",
"lib/uap10.0.16299/_._",
"ref/net46/System.Security.AccessControl.dll",
"ref/net461/System.Security.AccessControl.dll",
"ref/net461/System.Security.AccessControl.xml",
"ref/netstandard1.3/System.Security.AccessControl.dll",
"ref/netstandard1.3/System.Security.AccessControl.xml",
"ref/netstandard1.3/de/System.Security.AccessControl.xml",
"ref/netstandard1.3/es/System.Security.AccessControl.xml",
"ref/netstandard1.3/fr/System.Security.AccessControl.xml",
"ref/netstandard1.3/it/System.Security.AccessControl.xml",
"ref/netstandard1.3/ja/System.Security.AccessControl.xml",
"ref/netstandard1.3/ko/System.Security.AccessControl.xml",
"ref/netstandard1.3/ru/System.Security.AccessControl.xml",
"ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml",
"ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml",
"ref/netstandard2.0/System.Security.AccessControl.dll",
"ref/netstandard2.0/System.Security.AccessControl.xml",
"ref/uap10.0.16299/_._",
"runtimes/win/lib/net46/System.Security.AccessControl.dll",
"runtimes/win/lib/net461/System.Security.AccessControl.dll",
"runtimes/win/lib/net461/System.Security.AccessControl.xml",
"runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll",
"runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml",
"runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll",
"runtimes/win/lib/uap10.0.16299/_._",
"system.security.accesscontrol.5.0.0.nupkg.sha512",
"system.security.accesscontrol.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"System.Security.Cryptography.ProtectedData/9.0.0": {
"sha512": "CJW+x/F6fmRQ7N6K8paasTw9PDZp4t7G76UjGNlSDgoHPF0h08vTzLYbLZpOLEJSg35d5wy2jCXGo84EN05DpQ==",
"type": "package",
"path": "system.security.cryptography.protecteddata/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Security.Cryptography.ProtectedData.targets",
"buildTransitive/net462/_._",
"buildTransitive/net8.0/_._",
"buildTransitive/netcoreapp2.0/System.Security.Cryptography.ProtectedData.targets",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net462/System.Security.Cryptography.ProtectedData.dll",
"lib/net462/System.Security.Cryptography.ProtectedData.xml",
"lib/net8.0/System.Security.Cryptography.ProtectedData.dll",
"lib/net8.0/System.Security.Cryptography.ProtectedData.xml",
"lib/net9.0/System.Security.Cryptography.ProtectedData.dll",
"lib/net9.0/System.Security.Cryptography.ProtectedData.xml",
"lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll",
"lib/netstandard2.0/System.Security.Cryptography.ProtectedData.xml",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"system.security.cryptography.protecteddata.9.0.0.nupkg.sha512",
"system.security.cryptography.protecteddata.nuspec",
"useSharedDesignerContext.txt"
]
},
"System.Security.Principal.Windows/5.0.0": {
"sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
"type": "package",
"path": "system.security.principal.windows/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net46/System.Security.Principal.Windows.dll",
"lib/net461/System.Security.Principal.Windows.dll",
"lib/net461/System.Security.Principal.Windows.xml",
"lib/netstandard1.3/System.Security.Principal.Windows.dll",
"lib/netstandard2.0/System.Security.Principal.Windows.dll",
"lib/netstandard2.0/System.Security.Principal.Windows.xml",
"lib/uap10.0.16299/_._",
"ref/net46/System.Security.Principal.Windows.dll",
"ref/net461/System.Security.Principal.Windows.dll",
"ref/net461/System.Security.Principal.Windows.xml",
"ref/netcoreapp3.0/System.Security.Principal.Windows.dll",
"ref/netcoreapp3.0/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/System.Security.Principal.Windows.dll",
"ref/netstandard1.3/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/de/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/es/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/fr/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/it/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/ja/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/ko/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/ru/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml",
"ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml",
"ref/netstandard2.0/System.Security.Principal.Windows.dll",
"ref/netstandard2.0/System.Security.Principal.Windows.xml",
"ref/uap10.0.16299/_._",
"runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll",
"runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml",
"runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll",
"runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml",
"runtimes/win/lib/net46/System.Security.Principal.Windows.dll",
"runtimes/win/lib/net461/System.Security.Principal.Windows.dll",
"runtimes/win/lib/net461/System.Security.Principal.Windows.xml",
"runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll",
"runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml",
"runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll",
"runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml",
"runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll",
"runtimes/win/lib/uap10.0.16299/_._",
"system.security.principal.windows.5.0.0.nupkg.sha512",
"system.security.principal.windows.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"System.Text.Encoding.CodePages/9.0.0": {
"sha512": "GxJTSFPQpoVd0vQRgq8hwesicxgZoHTbYMvR/UMM4IzhkHMT+ebZE11c2C1gUyxz55zWtGCWktMTHvmgLzob9g==",
"type": "package",
"path": "system.text.encoding.codepages/9.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Text.Encoding.CodePages.targets",
"buildTransitive/net462/_._",
"buildTransitive/net8.0/_._",
"buildTransitive/netcoreapp2.0/System.Text.Encoding.CodePages.targets",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net462/System.Text.Encoding.CodePages.dll",
"lib/net462/System.Text.Encoding.CodePages.xml",
"lib/net8.0/System.Text.Encoding.CodePages.dll",
"lib/net8.0/System.Text.Encoding.CodePages.xml",
"lib/net9.0/System.Text.Encoding.CodePages.dll",
"lib/net9.0/System.Text.Encoding.CodePages.xml",
"lib/netstandard2.0/System.Text.Encoding.CodePages.dll",
"lib/netstandard2.0/System.Text.Encoding.CodePages.xml",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"runtimes/win/lib/net8.0/System.Text.Encoding.CodePages.dll",
"runtimes/win/lib/net8.0/System.Text.Encoding.CodePages.xml",
"runtimes/win/lib/net9.0/System.Text.Encoding.CodePages.dll",
"runtimes/win/lib/net9.0/System.Text.Encoding.CodePages.xml",
"system.text.encoding.codepages.9.0.0.nupkg.sha512",
"system.text.encoding.codepages.nuspec",
"useSharedDesignerContext.txt"
]
},
"ShrinkSDK.CodeGen.Core/0.1.0": {
"type": "project",
"path": "../ShrinkSDK.CodeGen.Core/ShrinkSDK.CodeGen.Core.csproj",
"msbuildProject": "../ShrinkSDK.CodeGen.Core/ShrinkSDK.CodeGen.Core.csproj"
}
},
"projectFileDependencyGroups": {
"net8.0": [
"Microsoft.Build.Framework >= 17.14.28",
"Microsoft.Build.Utilities.Core >= 17.14.28",
"Mono.Cecil >= 0.11.6",
"ShrinkSDK.CodeGen.Core >= 0.1.0"
]
},
"packageFolders": {
"C:\\Users\\im\\.nuget\\packages\\": {}
},
"project": {
"version": "0.1.0",
"restore": {
"projectUniqueName": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj",
"projectName": "ShrinkSDK.CodeGen",
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj",
"packagesPath": "C:\\Users\\im\\.nuget\\packages\\",
"outputPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\NuGet.Config",
"C:\\Users\\im\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {
"D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj": {
"projectPath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Core\\ShrinkSDK.CodeGen.Core.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.Build.Framework": {
"suppressParent": "All",
"target": "Package",
"version": "[17.14.28, )"
},
"Microsoft.Build.Utilities.Core": {
"suppressParent": "All",
"target": "Package",
"version": "[17.14.28, )"
},
"Mono.Cecil": {
"suppressParent": "All",
"target": "Package",
"version": "[0.11.6, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[8.0.27, 8.0.27]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[8.0.27, 8.0.27]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,28 @@
{
"version": 2,
"dgSpecHash": "mRLfY2bvDH8=",
"success": true,
"projectFilePath": "D:\\UnityBuilds\\ShrinkSDK\\Assets\\Modules\\ShrinkShared.CodeGen\\DotNet~\\ShrinkSDK.CodeGen.Task\\ShrinkSDK.CodeGen.Task.csproj",
"expectedPackageFiles": [
"C:\\Users\\im\\.nuget\\packages\\microsoft.build.framework\\17.14.28\\microsoft.build.framework.17.14.28.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.build.utilities.core\\17.14.28\\microsoft.build.utilities.core.17.14.28.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.net.stringtools\\17.14.28\\microsoft.net.stringtools.17.14.28.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\mono.cecil\\0.11.6\\mono.cecil.0.11.6.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.collections.immutable\\9.0.0\\system.collections.immutable.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.configuration.configurationmanager\\9.0.0\\system.configuration.configurationmanager.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.diagnostics.diagnosticsource\\9.0.0\\system.diagnostics.diagnosticsource.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.diagnostics.eventlog\\9.0.0\\system.diagnostics.eventlog.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.memory\\4.6.0\\system.memory.4.6.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.1.0\\system.runtime.compilerservices.unsafe.6.1.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.security.cryptography.protecteddata\\9.0.0\\system.security.cryptography.protecteddata.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\system.text.encoding.codepages\\9.0.0\\system.text.encoding.codepages.9.0.0.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.netcore.app.ref\\8.0.27\\microsoft.netcore.app.ref.8.0.27.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\8.0.27\\microsoft.windowsdesktop.app.ref.8.0.27.nupkg.sha512",
"C:\\Users\\im\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\8.0.27\\microsoft.aspnetcore.app.ref.8.0.27.nupkg.sha512"
],
"logs": []
}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b1a24493006c49947af5054cc6df0993
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+51
View File
@@ -0,0 +1,51 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Mono.Cecil;
namespace ShrinkSDK.CodeGen
{
internal sealed class PathAssemblyResolver : IAssemblyResolver
{
private readonly Dictionary<string, string> _paths = new(StringComparer.OrdinalIgnoreCase);
private readonly Dictionary<string, AssemblyDefinition> _assemblies = new(StringComparer.OrdinalIgnoreCase);
private AssemblyDefinition? _self;
public PathAssemblyResolver(IEnumerable<string> references)
{
foreach (var path in references.Where(File.Exists))
_paths[Path.GetFileNameWithoutExtension(path)] = Path.GetFullPath(path);
}
public void SetSelf(AssemblyDefinition assembly) => _self = assembly;
public AssemblyDefinition? Resolve(AssemblyNameReference name) => Resolve(name, new ReaderParameters());
public AssemblyDefinition? Resolve(AssemblyNameReference name, ReaderParameters parameters)
{
if (string.Equals(name.Name, _self?.Name.Name, StringComparison.OrdinalIgnoreCase))
return _self;
if (_assemblies.TryGetValue(name.Name, out var cached))
return cached;
if (!_paths.TryGetValue(name.Name, out var path))
return null;
parameters.AssemblyResolver = this;
parameters.ReadingMode = ReadingMode.Immediate;
var assembly = AssemblyDefinition.ReadAssembly(path, parameters);
_assemblies[name.Name] = assembly;
return assembly;
}
public void Dispose()
{
foreach (var assembly in _assemblies.Values)
assembly.Dispose();
_assemblies.Clear();
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1e04c8f9f51f98b4faa2da03df29b2d9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+744
View File
@@ -0,0 +1,744 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;
namespace ShrinkSDK.CodeGen
{
public static class ShrinkAssemblyWeaver
{
public const string Version = "0.1.0";
private const string EventRuntime = "ShrinkEventBus.Runtime";
private const string NetworkEventIntegration = "ShrinkNetwork.Integration.EventBus";
public static ShrinkWeaveResult Weave(
string assemblyPath,
string? pdbPath,
IEnumerable<string> referencePaths,
string outputAssemblyPath,
string? outputPdbPath,
ShrinkCodeGenPlatform platform = ShrinkCodeGenPlatform.EngineNeutral,
string? strongNameKeyPath = null)
{
var diagnostics = new List<ShrinkCodeGenDiagnostic>();
var references = referencePaths.Where(File.Exists).Select(Path.GetFullPath).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
using var resolver = new PathAssemblyResolver(references.Append(assemblyPath));
try
{
var hasSymbols = !string.IsNullOrWhiteSpace(pdbPath) && File.Exists(pdbPath);
var reader = new ReaderParameters
{
AssemblyResolver = resolver,
ReadingMode = ReadingMode.Immediate,
ReadSymbols = hasSymbols,
SymbolReaderProvider = hasSymbols ? new PortablePdbReaderProvider() : null
};
using var assemblyInput = new MemoryStream(File.ReadAllBytes(assemblyPath));
using var symbolInput = hasSymbols ? new MemoryStream(File.ReadAllBytes(pdbPath!)) : null;
if (hasSymbols)
reader.SymbolStream = symbolInput;
using var assembly = AssemblyDefinition.ReadAssembly(assemblyInput, reader);
resolver.SetSelf(assembly);
byte[]? strongNameKey = null;
if (assembly.Name.HasPublicKey)
{
if (string.IsNullOrWhiteSpace(strongNameKeyPath))
throw new InvalidOperationException("Signed assemblies are not modified unless ShrinkCodeGenStrongNameKeyFile is configured.");
if (!File.Exists(strongNameKeyPath))
throw new InvalidOperationException($"Strong-name key file does not exist: {strongNameKeyPath}");
strongNameKey = File.ReadAllBytes(strongNameKeyPath);
}
var module = assembly.MainModule;
var marker = FindType(module, "ShrinkSDK.Runtime.ShrinkCodeGenWovenAttribute", "ShrinkRuntime.Abstractions");
var existingMarker = marker == null ? null : assembly.CustomAttributes.FirstOrDefault(a => a.AttributeType.FullName == marker.FullName);
if (existingMarker != null)
{
var wovenVersion = existingMarker.ConstructorArguments.Count > 0
? existingMarker.ConstructorArguments[0].Value as string
: null;
if (wovenVersion == Version)
return new ShrinkWeaveResult(false, 0, 0, 0, diagnostics);
throw new InvalidOperationException($"Assembly was woven by ShrinkSDK.CodeGen {wovenVersion ?? "unknown"}. Run a clean rebuild before weaving with {Version}.");
}
var inputMvid = module.Mvid.ToString("D");
var instanceCount = 0;
var staticCount = 0;
if (References(module, EventRuntime))
WeaveEventBus(module, platform, ref instanceCount, ref staticCount);
var registryCount = WeaveRegistries(module);
if (References(module, NetworkEventIntegration))
registryCount += WeaveNetworkEventBindings(module);
if (marker != null)
AddMarker(module, marker, inputMvid);
Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(outputAssemblyPath))!);
using var symbolOutput = hasSymbols ? new MemoryStream() : null;
var writer = new WriterParameters
{
WriteSymbols = hasSymbols,
SymbolWriterProvider = hasSymbols ? new PortablePdbWriterProvider() : null,
SymbolStream = symbolOutput,
StrongNameKeyBlob = strongNameKey
};
assembly.Write(outputAssemblyPath, writer);
if (hasSymbols && !string.IsNullOrWhiteSpace(outputPdbPath))
File.WriteAllBytes(outputPdbPath!, symbolOutput!.ToArray());
return new ShrinkWeaveResult(true, instanceCount, staticCount, registryCount, diagnostics);
}
catch (Exception exception)
{
diagnostics.Add(new ShrinkCodeGenDiagnostic(ShrinkCodeGenDiagnosticSeverity.Error, exception.Message));
return new ShrinkWeaveResult(false, 0, 0, 0, diagnostics);
}
}
private static void WeaveEventBus(ModuleDefinition module, ShrinkCodeGenPlatform platform,
ref int instanceCount, ref int staticCount)
{
var subscriberAttribute = RequireType(module, "ShrinkEventBus.ShrinkEventSubscriberAttribute", EventRuntime);
var subscribeAttribute = RequireType(module, "ShrinkEventBus.ShrinkSubscribeAttribute", EventRuntime);
var allTypes = AllTypes(module.Types).Where(type => !type.IsInterface).ToArray();
foreach (var type in allTypes.Where(type => HasAttribute(type, subscriberAttribute)))
{
var instanceHandlers = type.Methods.Where(method => !method.IsStatic && HasAttribute(method, subscribeAttribute)).ToArray();
if (instanceHandlers.Length > 0)
{
var lifetime = ReadInt(type.CustomAttributes.First(a => a.AttributeType.FullName == subscriberAttribute.FullName), "Lifetime", 0);
if (InjectInstanceBinding(module, type, instanceHandlers, subscribeAttribute))
instanceCount++;
if (lifetime == 1 && platform == ShrinkCodeGenPlatform.Unity)
InjectAwakeToDestroyLifetime(type, module);
else if (lifetime != 0)
throw new InvalidOperationException($"{type.FullName}: engine-neutral weaving supports Manual lifetime only. Godot Nodes should attach from _Ready and dispose from _ExitTree.");
}
}
var staticTypes = allTypes.Where(type => HasAttribute(type, subscriberAttribute))
.Where(type => type.Methods.Any(method => method.IsStatic && HasAttribute(method, subscribeAttribute)))
.ToArray();
if (staticTypes.Length > 0)
{
staticCount = staticTypes.Sum(type => type.Methods.Count(method => method.IsStatic && HasAttribute(method, subscribeAttribute)));
InjectStaticBootstrap(module, staticTypes, subscriberAttribute, subscribeAttribute);
}
}
private static void InjectAwakeToDestroyLifetime(TypeDefinition type, ModuleDefinition module)
{
if (!InheritsFrom(type, "UnityEngine.MonoBehaviour"))
throw new InvalidOperationException($"[ShrinkEventSubscriber(Lifetime = AwakeToDestroy)] requires MonoBehaviour: {type.FullName}.");
const string bindingFieldName = "__shrinkEventBusAwakeToDestroyBinding";
if (type.Fields.Any(field => field.Name == bindingFieldName))
throw new InvalidOperationException($"Reserved generated field already exists on {type.FullName}: {bindingFieldName}.");
var disposableType = module.ImportReference(typeof(IDisposable));
var bindingField = new FieldDefinition(bindingFieldName, FieldAttributes.Private, disposableType);
type.Fields.Add(bindingField);
var eventBusType = RequireType(module, "ShrinkEventBus.EventBus", EventRuntime);
var attachMethod = ImportMethod(module, eventBusType,
method => method.Name == "Attach" && method.IsStatic && method.Parameters.Count == 2);
var disposeMethod = module.ImportReference(typeof(IDisposable).GetMethod(nameof(IDisposable.Dispose))
?? throw new InvalidOperationException("IDisposable.Dispose was not found."));
InjectAwake(type, module, bindingField, attachMethod);
InjectOnDestroy(type, module, bindingField, disposeMethod);
}
private static void InjectAwake(TypeDefinition type, ModuleDefinition module,
FieldDefinition bindingField, MethodReference attachMethod)
{
var awake = type.Methods.FirstOrDefault(method =>
method.Name == "Awake" && !method.IsStatic && method.Parameters.Count == 0);
if (awake != null)
{
InsertAttachAtStart(awake, module, bindingField, attachMethod);
return;
}
var baseAwake = FindBaseMethodReference(type, "Awake", module);
awake = new MethodDefinition("Awake",
baseAwake != null
? MethodAttributes.Family | MethodAttributes.HideBySig | MethodAttributes.Virtual
: MethodAttributes.Family | MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.NewSlot,
module.TypeSystem.Void);
awake.Body.InitLocals = true;
var il = awake.Body.GetILProcessor();
if (baseAwake != null)
{
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Call, baseAwake);
}
EmitAttach(il, awake, module, bindingField, attachMethod);
il.Emit(OpCodes.Ret);
type.Methods.Add(awake);
}
private static void InjectOnDestroy(TypeDefinition type, ModuleDefinition module,
FieldDefinition bindingField, MethodReference disposeMethod)
{
var onDestroy = type.Methods.FirstOrDefault(method =>
method.Name == "OnDestroy" && !method.IsStatic && method.Parameters.Count == 0);
if (onDestroy != null)
{
InsertDisposeAtStart(onDestroy, bindingField, disposeMethod);
return;
}
var baseOnDestroy = FindBaseMethodReference(type, "OnDestroy", module);
onDestroy = new MethodDefinition("OnDestroy",
baseOnDestroy != null
? MethodAttributes.Family | MethodAttributes.HideBySig | MethodAttributes.Virtual
: MethodAttributes.Family | MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.NewSlot,
module.TypeSystem.Void);
var il = onDestroy.Body.GetILProcessor();
EmitDispose(il, bindingField, disposeMethod);
if (baseOnDestroy != null)
{
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Call, baseOnDestroy);
}
il.Emit(OpCodes.Ret);
type.Methods.Add(onDestroy);
}
private static void InsertAttachAtStart(MethodDefinition method, ModuleDefinition module,
FieldDefinition bindingField, MethodReference attachMethod)
{
if (!method.HasBody || method.Body.Instructions.Count == 0)
throw new InvalidOperationException($"Awake has no body: {method.FullName}.");
method.Body.InitLocals = true;
var processor = method.Body.GetILProcessor();
var instructions = BuildAttachInstructions(processor, method, module, bindingField, attachMethod);
var first = method.Body.Instructions[0];
foreach (var instruction in instructions)
processor.InsertBefore(first, instruction);
}
private static void EmitAttach(ILProcessor il, MethodDefinition method, ModuleDefinition module,
FieldDefinition bindingField, MethodReference attachMethod)
{
foreach (var instruction in BuildAttachInstructions(il, method, module, bindingField, attachMethod))
il.Append(instruction);
}
private static IReadOnlyList<Instruction> BuildAttachInstructions(ILProcessor il,
MethodDefinition method, ModuleDefinition module, FieldDefinition bindingField,
MethodReference attachMethod)
{
var defaultBusType = module.ImportReference(attachMethod.Parameters[1].ParameterType);
var defaultBus = new VariableDefinition(defaultBusType);
method.Body.Variables.Add(defaultBus);
var attached = il.Create(OpCodes.Nop);
return new[]
{
il.Create(OpCodes.Ldarg_0),
il.Create(OpCodes.Ldfld, bindingField),
il.Create(OpCodes.Brtrue_S, attached),
il.Create(OpCodes.Ldarg_0),
il.Create(OpCodes.Ldarg_0),
il.Create(OpCodes.Ldloca_S, defaultBus),
il.Create(OpCodes.Initobj, defaultBusType),
il.Create(OpCodes.Ldloc, defaultBus),
il.Create(OpCodes.Call, attachMethod),
il.Create(OpCodes.Stfld, bindingField),
attached
};
}
private static void InsertDisposeAtStart(MethodDefinition method,
FieldDefinition bindingField, MethodReference disposeMethod)
{
if (!method.HasBody || method.Body.Instructions.Count == 0)
throw new InvalidOperationException($"OnDestroy has no body: {method.FullName}.");
var processor = method.Body.GetILProcessor();
var instructions = BuildDisposeInstructions(processor, bindingField, disposeMethod);
var first = method.Body.Instructions[0];
foreach (var instruction in instructions)
processor.InsertBefore(first, instruction);
}
private static void EmitDispose(ILProcessor il, FieldDefinition bindingField,
MethodReference disposeMethod)
{
foreach (var instruction in BuildDisposeInstructions(il, bindingField, disposeMethod))
il.Append(instruction);
}
private static IReadOnlyList<Instruction> BuildDisposeInstructions(ILProcessor il,
FieldDefinition bindingField, MethodReference disposeMethod)
{
var disposed = il.Create(OpCodes.Nop);
return new[]
{
il.Create(OpCodes.Ldarg_0),
il.Create(OpCodes.Ldfld, bindingField),
il.Create(OpCodes.Brfalse_S, disposed),
il.Create(OpCodes.Ldarg_0),
il.Create(OpCodes.Ldfld, bindingField),
il.Create(OpCodes.Callvirt, disposeMethod),
il.Create(OpCodes.Ldarg_0),
il.Create(OpCodes.Ldnull),
il.Create(OpCodes.Stfld, bindingField),
disposed
};
}
private static MethodReference? FindBaseMethodReference(TypeDefinition type,
string methodName, ModuleDefinition module)
{
try
{
var baseTypeReference = type.BaseType;
while (baseTypeReference != null)
{
var baseType = baseTypeReference.Resolve();
if (baseType == null) break;
var method = baseType.Methods.FirstOrDefault(candidate =>
candidate.Name == methodName && !candidate.IsStatic && candidate.IsVirtual &&
candidate.Parameters.Count == 0);
if (method != null)
{
if (baseTypeReference is GenericInstanceType genericBase)
{
return new MethodReference(method.Name, module.ImportReference(method.ReturnType),
module.ImportReference(genericBase))
{
HasThis = method.HasThis,
ExplicitThis = method.ExplicitThis,
CallingConvention = method.CallingConvention
};
}
return module.ImportReference(method);
}
baseTypeReference = baseType.BaseType;
}
}
catch { }
return null;
}
private static bool InheritsFrom(TypeDefinition type, string expectedFullName)
{
var current = type.BaseType;
while (current != null)
{
if (current.FullName == expectedFullName) return true;
try { current = current.Resolve()?.BaseType; }
catch { return false; }
}
return false;
}
private static bool InjectInstanceBinding(ModuleDefinition module, TypeDefinition owner,
IReadOnlyList<MethodDefinition> handlers, TypeReference subscribeAttribute)
{
var generatedInterface = RequireType(module, "ShrinkEventBus.IShrinkGeneratedSubscriber", EventRuntime);
if (owner.Interfaces.Any(item => item.InterfaceType.FullName == generatedInterface.FullName))
return false;
var resolverType = RequireType(module, "ShrinkEventBus.IShrinkBusResolver", EventRuntime);
var busKeyType = RequireType(module, "ShrinkEventBus.ShrinkBusKey", EventRuntime);
var bindingType = RequireType(module, "ShrinkEventBus.ShrinkEventBinding", EventRuntime);
var helperType = RequireType(module, "ShrinkEventBus.ShrinkGeneratedBinding", EventRuntime);
var disposableType = RequireType(module, "System.IDisposable", module.TypeSystem.CoreLibrary.Name);
var nullableBusKey = GenericType(module, "System.Nullable`1", true, busKeyType);
var bindingCtor = ImportMethod(module, bindingType, method => method.IsConstructor && method.Parameters.Count == 0);
var bindingAdd = ImportMethod(module, bindingType, method => method.Name == "Add" && method.Parameters.Count == 1);
var interfaceMethod = ImportMethod(module, generatedInterface, method => method.Name == "AttachGenerated");
var syncSubscribe = ImportMethod(module, helperType, method => method.Name == "Subscribe" && method.HasGenericParameters);
var asyncSubscribe = ImportMethod(module, helperType, method => method.Name == "SubscribeAsync" && method.HasGenericParameters);
var legacySubscribe = ImportMethod(module, helperType, method => method.Name == "SubscribeAsyncLegacy" && method.HasGenericParameters);
var asyncHandlerType = RequireType(module, "ShrinkEventBus.ShrinkAsyncEventHandler`1", EventRuntime);
var generated = new MethodDefinition("ShrinkEventBus.IShrinkGeneratedSubscriber.AttachGenerated",
MethodAttributes.Private | MethodAttributes.Final | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual,
disposableType);
generated.Parameters.Add(new ParameterDefinition("resolver", ParameterAttributes.None, resolverType));
generated.Parameters.Add(new ParameterDefinition("defaultBus", ParameterAttributes.Optional, nullableBusKey));
generated.Overrides.Add(interfaceMethod);
generated.Body.InitLocals = true;
var bindingLocal = new VariableDefinition(bindingType);
generated.Body.Variables.Add(bindingLocal);
var il = generated.Body.GetILProcessor();
il.Emit(OpCodes.Newobj, bindingCtor);
il.Emit(OpCodes.Stloc, bindingLocal);
var classDefaultBus = ReadString(owner.CustomAttributes.First(a => a.AttributeType.FullName == "ShrinkEventBus.ShrinkEventSubscriberAttribute"), "DefaultBus");
foreach (var handler in handlers)
EmitInstanceSubscription(module, il, handler, handler.CustomAttributes.First(a => a.AttributeType.FullName == subscribeAttribute.FullName), classDefaultBus,
bindingLocal, bindingAdd, syncSubscribe, asyncSubscribe, legacySubscribe, asyncHandlerType);
il.Emit(OpCodes.Ldloc, bindingLocal);
il.Emit(OpCodes.Ret);
owner.Interfaces.Add(new InterfaceImplementation(generatedInterface));
owner.Methods.Add(generated);
return true;
}
private static void EmitInstanceSubscription(ModuleDefinition module, ILProcessor il, MethodDefinition handler,
CustomAttribute attribute, string classDefaultBus, VariableDefinition bindingLocal, MethodReference bindingAdd,
MethodReference syncSubscribe, MethodReference asyncSubscribe, MethodReference legacySubscribe, TypeReference asyncHandlerType)
{
var signature = ResolveEventHandler(module, handler, syncSubscribe, asyncSubscribe, legacySubscribe, asyncHandlerType);
var bus = ReadString(attribute, "Bus");
if (string.IsNullOrWhiteSpace(bus)) bus = classDefaultBus;
il.Emit(OpCodes.Ldloc, bindingLocal);
il.Emit(OpCodes.Ldarg_1);
il.Emit(OpCodes.Ldarg_2);
il.Emit(OpCodes.Ldstr, bus ?? string.Empty);
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldftn, module.ImportReference(handler));
il.Emit(OpCodes.Newobj, DelegateConstructor(module, signature.DelegateType));
EmitOptions(il, attribute);
il.Emit(OpCodes.Call, signature.Method);
il.Emit(OpCodes.Callvirt, bindingAdd);
}
private static void InjectStaticBootstrap(ModuleDefinition module, IReadOnlyList<TypeDefinition> types,
TypeReference subscriberAttribute, TypeReference subscribeAttribute)
{
if (module.Types.Any(type => type.FullName == "ShrinkEventBus.Generated.ShrinkGeneratedStaticBindings"))
return;
var registry = RequireType(module, "ShrinkEventBus.ShrinkStaticBindingRegistry", EventRuntime);
var syncRegister = ImportMethod(module, registry, method => method.Name == "Register" && method.HasGenericParameters);
var asyncRegister = ImportMethod(module, registry, method => method.Name == "RegisterAsync" && method.HasGenericParameters);
var legacyRegister = ImportMethod(module, registry, method => method.Name == "RegisterAsyncLegacy" && method.HasGenericParameters);
var asyncHandlerType = RequireType(module, "ShrinkEventBus.ShrinkAsyncEventHandler`1", EventRuntime);
var bootstrap = new TypeDefinition("ShrinkEventBus.Generated", "ShrinkGeneratedStaticBindings",
TypeAttributes.Abstract | TypeAttributes.Sealed | TypeAttributes.NotPublic, module.TypeSystem.Object);
module.Types.Add(bootstrap);
var register = new MethodDefinition("Register", MethodAttributes.Assembly | MethodAttributes.Static | MethodAttributes.HideBySig, module.TypeSystem.Void);
bootstrap.Methods.Add(register);
var il = register.Body.GetILProcessor();
foreach (var type in types)
{
var classBus = ReadString(type.CustomAttributes.First(a => a.AttributeType.FullName == subscriberAttribute.FullName), "DefaultBus");
foreach (var handler in type.Methods.Where(method => method.IsStatic && HasAttribute(method, subscribeAttribute)).ToArray())
{
var attribute = handler.CustomAttributes.First(a => a.AttributeType.FullName == subscribeAttribute.FullName);
var signature = ResolveEventHandler(module, handler, syncRegister, asyncRegister, legacyRegister, asyncHandlerType);
var bus = ReadString(attribute, "Bus");
if (string.IsNullOrWhiteSpace(bus)) bus = classBus;
var bridge = CreateStaticBridge(module, handler);
il.Emit(OpCodes.Ldstr, bus ?? string.Empty);
il.Emit(OpCodes.Ldnull);
il.Emit(OpCodes.Ldftn, bridge);
il.Emit(OpCodes.Newobj, DelegateConstructor(module, signature.DelegateType));
EmitOptions(il, attribute);
il.Emit(OpCodes.Call, signature.Method);
}
}
il.Emit(OpCodes.Ret);
var moduleType = module.Types.First(type => type.Name == "<Module>");
var initializer = moduleType.Methods.FirstOrDefault(method => method.Name == ".cctor");
if (initializer == null)
{
initializer = new MethodDefinition(".cctor", MethodAttributes.Private | MethodAttributes.Static | MethodAttributes.HideBySig |
MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, module.TypeSystem.Void);
initializer.Body.GetILProcessor().Emit(OpCodes.Ret);
moduleType.Methods.Add(initializer);
}
initializer.Body.GetILProcessor().InsertBefore(initializer.Body.Instructions[0], Instruction.Create(OpCodes.Call, register));
}
private static (MethodReference Method, TypeReference DelegateType) ResolveEventHandler(ModuleDefinition module,
MethodDefinition handler, MethodReference sync, MethodReference async, MethodReference legacy, TypeReference asyncHandlerType)
{
if (handler.Parameters.Count is < 1 or > 2)
throw new InvalidOperationException($"{handler.FullName}: [ShrinkSubscribe] requires one event parameter and an optional CancellationToken.");
var eventType = module.ImportReference(handler.Parameters[0].ParameterType);
var eventInterface = RequireType(module, "ShrinkEventBus.IShrinkEvent", EventRuntime);
if (!Implements(eventType, eventInterface.FullName))
throw new InvalidOperationException($"{handler.FullName}: event parameter must implement IShrinkEvent.");
MethodReference open;
TypeReference delegateType;
if (handler.ReturnType.MetadataType == MetadataType.Void && handler.Parameters.Count == 1)
{
open = sync;
delegateType = GenericType(module, "System.Action`1", false, eventType);
}
else if (handler.ReturnType.FullName == "Cysharp.Threading.Tasks.UniTask" && handler.Parameters.Count == 1)
{
open = legacy;
delegateType = GenericType(module, "System.Func`2", false, eventType, module.ImportReference(handler.ReturnType));
}
else if (handler.ReturnType.FullName == "Cysharp.Threading.Tasks.UniTask" && handler.Parameters.Count == 2 &&
handler.Parameters[1].ParameterType.FullName == "System.Threading.CancellationToken")
{
open = async;
delegateType = new GenericInstanceType(asyncHandlerType) { GenericArguments = { eventType } };
}
else
throw new InvalidOperationException($"Unsupported [ShrinkSubscribe] signature: {handler.FullName}.");
var closed = new GenericInstanceMethod(open);
closed.GenericArguments.Add(eventType);
return (closed, delegateType);
}
private static MethodReference CreateStaticBridge(ModuleDefinition module, MethodDefinition handler)
{
var bridge = new MethodDefinition($"ShrinkEventBus.GeneratedStaticHandler_{handler.MetadataToken.ToInt32():X8}",
MethodAttributes.Assembly | MethodAttributes.Static | MethodAttributes.HideBySig, module.ImportReference(handler.ReturnType));
foreach (var parameter in handler.Parameters)
bridge.Parameters.Add(new ParameterDefinition(parameter.Name, parameter.Attributes, module.ImportReference(parameter.ParameterType)));
var il = bridge.Body.GetILProcessor();
foreach (var parameter in bridge.Parameters) il.Emit(OpCodes.Ldarg, parameter);
il.Emit(OpCodes.Call, module.ImportReference(handler));
il.Emit(OpCodes.Ret);
handler.DeclaringType.Methods.Add(bridge);
return bridge;
}
private static void EmitOptions(ILProcessor il, CustomAttribute attribute)
{
il.Emit(OpCodes.Ldc_I4, ReadInt(attribute, "Priority", 2));
il.Emit(OpCodes.Ldc_I4, ReadInt(attribute, "NumericPriority", 0));
il.Emit(ReadBool(attribute, "ReceiveCanceled", false) ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0);
}
private static int WeaveRegistries(ModuleDefinition module)
{
var count = 0;
count += AddRegistry(module, "ShrinkCommand.ShrinkCommandSubscriberAttribute", "ShrinkCommand.Runtime",
"ShrinkCommand.ShrinkCommandStaticRegistryAttribute", type =>
type.Methods.Any(method => method.IsStatic && HasAttribute(method, "ShrinkCommand.ShrinkCommandAttribute")));
count += AddRegistry(module, "ShrinkNetwork.ShrinkNetworkMessageAttribute", "ShrinkNetwork.Runtime",
"ShrinkNetwork.ShrinkNetworkMessageRegistryAttribute", _ => true);
count += AddRegistry(module, "ShrinkNetwork.ShrinkNetworkSubscriberAttribute", "ShrinkNetwork.Runtime",
"ShrinkNetwork.ShrinkNetworkStaticSubscriberRegistryAttribute", type =>
type.Methods.Any(method => method.IsStatic && HasAttribute(method, "ShrinkNetwork.ShrinkNetworkSubscribeAttribute")));
count += AddAppRegistry(module);
ValidateDuplicateNetworkContracts(module);
ValidateDuplicateCommandPaths(module);
return count;
}
private static int WeaveNetworkEventBindings(ModuleDefinition module)
{
if (module.Types.Any(type => type.FullName ==
"ShrinkNetwork.Integration.Generated.ShrinkGeneratedNetworkEventBindings"))
return 0;
var networkEventAttribute = FindType(module,
"ShrinkNetwork.Integration.ShrinkNetworkEventAttribute", NetworkEventIntegration);
var messageAttribute = FindType(module,
"ShrinkNetwork.ShrinkNetworkMessageAttribute", "ShrinkNetwork.Runtime");
var registryType = FindType(module,
"ShrinkNetwork.Integration.ShrinkNetworkEventRegistry", NetworkEventIntegration);
if (networkEventAttribute == null || messageAttribute == null || registryType == null)
return 0;
var registrations = AllTypes(module.Types)
.Where(type => !type.IsAbstract && HasAttribute(type, networkEventAttribute))
.Select(type => new
{
Type = type,
Message = type.CustomAttributes.FirstOrDefault(attribute =>
attribute.AttributeType.FullName == messageAttribute.FullName)
})
.Where(item => item.Message != null)
.ToArray();
if (registrations.Length == 0) return 0;
var registerOpen = ImportMethod(module, registryType,
method => method.Name == "Register" && method.HasGenericParameters);
var bootstrap = new TypeDefinition("ShrinkNetwork.Integration.Generated",
"ShrinkGeneratedNetworkEventBindings",
TypeAttributes.Abstract | TypeAttributes.Sealed | TypeAttributes.NotPublic,
module.TypeSystem.Object);
module.Types.Add(bootstrap);
var register = new MethodDefinition("Register",
MethodAttributes.Assembly | MethodAttributes.Static | MethodAttributes.HideBySig,
module.TypeSystem.Void);
bootstrap.Methods.Add(register);
var il = register.Body.GetILProcessor();
foreach (var item in registrations)
{
var attribute = item.Message!;
if (attribute.ConstructorArguments.Count == 0)
throw new InvalidOperationException($"[ShrinkNetworkMessage] on {item.Type.FullName} has no opcode.");
var opcode = Convert.ToInt32(attribute.ConstructorArguments[0].Value);
var route = attribute.ConstructorArguments.Count > 1
? attribute.ConstructorArguments[1].Value as string
: null;
var registerClosed = new GenericInstanceMethod(registerOpen);
registerClosed.GenericArguments.Add(module.ImportReference(item.Type));
il.Emit(OpCodes.Ldc_I4, opcode);
if (route == null) il.Emit(OpCodes.Ldnull);
else il.Emit(OpCodes.Ldstr, route);
il.Emit(OpCodes.Call, registerClosed);
}
il.Emit(OpCodes.Ret);
var moduleType = module.Types.First(type => type.Name == "<Module>");
var initializer = moduleType.Methods.FirstOrDefault(method => method.Name == ".cctor");
if (initializer == null)
{
initializer = new MethodDefinition(".cctor",
MethodAttributes.Private | MethodAttributes.Static | MethodAttributes.HideBySig |
MethodAttributes.SpecialName | MethodAttributes.RTSpecialName,
module.TypeSystem.Void);
initializer.Body.GetILProcessor().Emit(OpCodes.Ret);
moduleType.Methods.Add(initializer);
}
initializer.Body.GetILProcessor().InsertBefore(initializer.Body.Instructions[0],
Instruction.Create(OpCodes.Call, register));
return registrations.Length;
}
private static int AddRegistry(ModuleDefinition module, string markerName, string assemblyName,
string registryName, Func<TypeDefinition, bool> predicate)
{
var marker = FindType(module, markerName, assemblyName);
var registry = FindType(module, registryName, assemblyName);
if (marker == null || registry == null) return 0;
if (module.Assembly.CustomAttributes.Any(attribute => attribute.AttributeType.FullName == registry.FullName))
return 0;
var types = AllTypes(module.Types).Where(type => HasAttribute(type, marker)).Where(predicate).ToArray();
if (types.Length == 0) return 0;
AddTypeArrayAttribute(module, registry, types);
return types.Length;
}
private static int AddAppRegistry(ModuleDefinition module)
{
var marker = FindType(module, "ShrinkApp.ShrinkAppModuleInstallerAttribute", "ShrinkApp.Core.Runtime");
var contract = FindType(module, "ShrinkApp.IShrinkAppModuleInstaller", "ShrinkApp.Core.Runtime");
var registry = FindType(module, "ShrinkApp.ShrinkAppInstallerRegistryAttribute", "ShrinkApp.Core.Runtime");
if (marker == null || contract == null || registry == null) return 0;
if (module.Assembly.CustomAttributes.Any(attribute => attribute.AttributeType.FullName == registry.FullName))
return 0;
var types = AllTypes(module.Types).Where(type => !type.IsAbstract && HasAttribute(type, marker) && Implements(type, contract.FullName)).ToArray();
if (types.Length == 0) return 0;
AddTypeArrayAttribute(module, registry, types);
return types.Length;
}
private static void AddTypeArrayAttribute(ModuleDefinition module, TypeReference registry, IReadOnlyList<TypeDefinition> types)
{
var ctor = ImportMethod(module, registry, method => method.IsConstructor && method.Parameters.Count == 1 && method.Parameters[0].ParameterType.IsArray);
var typeRef = new TypeReference("System", "Type", module, module.TypeSystem.CoreLibrary);
var typeArray = new ArrayType(typeRef);
var attribute = new CustomAttribute(ctor);
attribute.ConstructorArguments.Add(new CustomAttributeArgument(typeArray,
types.Select(type => new CustomAttributeArgument(typeRef, module.ImportReference(type))).ToArray()));
module.Assembly.CustomAttributes.Add(attribute);
}
private static void ValidateDuplicateNetworkContracts(ModuleDefinition module)
{
var seen = new Dictionary<string, string>(StringComparer.Ordinal);
foreach (var type in AllTypes(module.Types))
foreach (var attribute in type.CustomAttributes.Where(a => a.AttributeType.FullName == "ShrinkNetwork.ShrinkNetworkMessageAttribute"))
{
var opcode = Convert.ToInt32(attribute.ConstructorArguments[0].Value);
var route = attribute.ConstructorArguments.Count > 1 ? attribute.ConstructorArguments[1].Value as string ?? string.Empty : string.Empty;
var key = $"{opcode}:{route}";
if (seen.TryGetValue(key, out var previous))
throw new InvalidOperationException($"Duplicate network opcode/route {key}: {previous} and {type.FullName}.");
seen[key] = type.FullName;
}
}
private static void ValidateDuplicateCommandPaths(ModuleDefinition module)
{
var seen = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
foreach (var type in AllTypes(module.Types))
foreach (var method in type.Methods)
foreach (var attribute in method.CustomAttributes.Where(a => a.AttributeType.FullName == "ShrinkCommand.ShrinkCommandAttribute"))
{
var path = attribute.ConstructorArguments[0].Value as string ?? string.Empty;
if (seen.TryGetValue(path, out var previous))
throw new InvalidOperationException($"Duplicate command path '{path}': {previous} and {method.FullName}.");
seen[path] = method.FullName;
}
}
private static void AddMarker(ModuleDefinition module, TypeReference marker, string inputMvid)
{
var ctor = ImportMethod(module, marker, method => method.IsConstructor && method.Parameters.Count == 2);
var attribute = new CustomAttribute(ctor);
attribute.ConstructorArguments.Add(new CustomAttributeArgument(module.TypeSystem.String, Version));
attribute.ConstructorArguments.Add(new CustomAttributeArgument(module.TypeSystem.String, inputMvid));
module.Assembly.CustomAttributes.Add(attribute);
}
private static bool References(ModuleDefinition module, string assemblyName) =>
module.AssemblyReferences.Any(reference => string.Equals(reference.Name, assemblyName, StringComparison.Ordinal));
private static TypeReference RequireType(ModuleDefinition module, string fullName, string assemblyName) =>
FindType(module, fullName, assemblyName) ?? throw new InvalidOperationException($"Required type {fullName} was not found in {assemblyName}.");
private static TypeReference? FindType(ModuleDefinition module, string fullName, string assemblyName)
{
if (string.Equals(module.Assembly.Name.Name, assemblyName, StringComparison.Ordinal))
return module.GetType(fullName);
var reference = module.AssemblyReferences.FirstOrDefault(item => string.Equals(item.Name, assemblyName, StringComparison.Ordinal));
if (reference == null) return null;
var assembly = module.AssemblyResolver.Resolve(reference);
return assembly?.MainModule.GetType(fullName) is { } definition ? module.ImportReference(definition) : null;
}
private static MethodReference ImportMethod(ModuleDefinition module, TypeReference type, Func<MethodDefinition, bool> predicate)
{
var definition = type.Resolve() ?? throw new InvalidOperationException($"Unable to resolve {type.FullName}.");
var method = definition.Methods.SingleOrDefault(predicate) ?? throw new InvalidOperationException($"Required method was not found on {type.FullName}.");
return module.ImportReference(method);
}
private static IEnumerable<TypeDefinition> AllTypes(IEnumerable<TypeDefinition> roots)
{
foreach (var type in roots)
{
yield return type;
foreach (var nested in AllTypes(type.NestedTypes)) yield return nested;
}
}
private static bool HasAttribute(ICustomAttributeProvider provider, TypeReference attribute) => HasAttribute(provider, attribute.FullName);
private static bool HasAttribute(ICustomAttributeProvider provider, string fullName) => provider.CustomAttributes.Any(a => a.AttributeType.FullName == fullName);
private static bool Implements(TypeReference type, string interfaceFullName)
{
try
{
TypeDefinition? current = type.Resolve();
while (current != null)
{
if (current.Interfaces.Any(item => item.InterfaceType.FullName == interfaceFullName)) return true;
current = current.BaseType?.Resolve();
}
}
catch { }
return false;
}
private static TypeReference GenericType(ModuleDefinition module, string name, bool valueType, params TypeReference[] arguments)
{
var open = new TypeReference("System", name.Substring(name.LastIndexOf('.') + 1), module, module.TypeSystem.CoreLibrary, valueType);
var result = new GenericInstanceType(open);
foreach (var argument in arguments) result.GenericArguments.Add(argument);
return result;
}
private static MethodReference DelegateConstructor(ModuleDefinition module, TypeReference delegateType)
{
var ctor = new MethodReference(".ctor", module.TypeSystem.Void, delegateType) { HasThis = true };
ctor.Parameters.Add(new ParameterDefinition(module.TypeSystem.Object));
ctor.Parameters.Add(new ParameterDefinition(module.TypeSystem.IntPtr));
return ctor;
}
private static string ReadString(CustomAttribute attribute, string name) =>
attribute.Properties.FirstOrDefault(item => item.Name == name).Argument.Value as string ?? string.Empty;
private static int ReadInt(CustomAttribute attribute, string name, int fallback) =>
attribute.Properties.FirstOrDefault(item => item.Name == name) is { Name: not null } item ? Convert.ToInt32(item.Argument.Value) : fallback;
private static bool ReadBool(CustomAttribute attribute, string name, bool fallback) =>
attribute.Properties.FirstOrDefault(item => item.Name == name) is { Name: not null } item ? Convert.ToBoolean(item.Argument.Value) : fallback;
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b69b5dbb86d6283449a451032ff780e6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+43
View File
@@ -0,0 +1,43 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
namespace ShrinkSDK.CodeGen
{
public enum ShrinkCodeGenDiagnosticSeverity { Info, Warning, Error }
public enum ShrinkCodeGenPlatform { EngineNeutral, Unity }
public sealed class ShrinkCodeGenDiagnostic
{
public ShrinkCodeGenDiagnostic(ShrinkCodeGenDiagnosticSeverity severity, string message)
{
Severity = severity;
Message = message;
}
public ShrinkCodeGenDiagnosticSeverity Severity { get; }
public string Message { get; }
}
public sealed class ShrinkWeaveResult
{
public ShrinkWeaveResult(bool changed, int instanceSubscribers, int staticSubscribers,
int registryEntries, IReadOnlyList<ShrinkCodeGenDiagnostic> diagnostics)
{
Changed = changed;
InstanceSubscribers = instanceSubscribers;
StaticSubscribers = staticSubscribers;
RegistryEntries = registryEntries;
Diagnostics = diagnostics;
}
public bool Changed { get; }
public int InstanceSubscribers { get; }
public int StaticSubscribers { get; }
public int RegistryEntries { get; }
public IReadOnlyList<ShrinkCodeGenDiagnostic> Diagnostics { get; }
public bool Succeeded => Diagnostics.All(item => item.Severity != ShrinkCodeGenDiagnosticSeverity.Error);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3bf901de99a2ad2488e3ad1aec8d7aaa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+7 -177
View File
@@ -1,11 +1,6 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Pdb;
using Unity.CompilationPipeline.Common.Diagnostics;
using Unity.CompilationPipeline.Common.ILPostProcessing;
@@ -15,178 +10,13 @@ namespace ShrinkShared.CodeGen
{
public override ILPostProcessor GetInstance() => this;
public override bool WillProcess(ICompiledAssembly compiledAssembly)
{
// 注意:不能因为"引用了 ShrinkEventBus.Runtime"就处理该程序集。
// 一旦把 ShrinkApp.Core.Runtime 等核心程序集卷入 Cecil 读写,写回的 dll
// 会被 Unity 判定为 "references itself" 而整条依赖链拒绝加载。
// 只处理直接承载 Command/Network/App 注册表的程序集。
return compiledAssembly.References.Any(path =>
Path.GetFileNameWithoutExtension(path) is "ShrinkCommand.Runtime" or "ShrinkNetwork.Runtime"
or "ShrinkApp.Core.Runtime");
}
public override bool WillProcess(ICompiledAssembly compiledAssembly) =>
UnityShrinkCodeGenAdapter.ReferencesAny(compiledAssembly,
"ShrinkCommand.Runtime", "ShrinkNetwork.Runtime", "ShrinkApp.Core.Runtime");
public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly)
{
var diagnostics = new List<DiagnosticMessage>();
if (!WillProcess(compiledAssembly))
return new ILPostProcessResult(compiledAssembly.InMemoryAssembly, diagnostics);
var assemblyDefinition = AssemblyDefinitionFor(compiledAssembly);
var module = assemblyDefinition.MainModule;
try
{
InjectShrinkCommandRegistry(module);
InjectShrinkNetworkRegistry(module);
InjectShrinkAppRegistry(module);
}
catch (Exception ex)
{
diagnostics.Add(new DiagnosticMessage
{
DiagnosticType = DiagnosticType.Error,
MessageData = $"[ShrinkShared.CodeGen] {ex.Message}"
});
}
return GetResult(assemblyDefinition, diagnostics);
}
private void InjectShrinkCommandRegistry(ModuleDefinition module)
{
var subscriberType = FindType(module, "ShrinkCommand.ShrinkCommandSubscriberAttribute", "ShrinkCommand.Runtime");
var commandAttributeType = FindType(module, "ShrinkCommand.ShrinkCommandAttribute", "ShrinkCommand.Runtime");
var registryCtor = FindTypeArrayConstructor(module,
"ShrinkCommand.ShrinkCommandStaticRegistryAttribute",
"ShrinkCommand.Runtime");
if (subscriberType == null || commandAttributeType == null || registryCtor == null)
return;
var subscriberTypes = module.Types
.Where(type => HasAttribute(type, subscriberType))
.Where(type => type.Methods.Any(method => method.IsStatic && HasAttribute(method, commandAttributeType)))
.Select(type => module.ImportReference(type))
.ToArray();
if (subscriberTypes.Length > 0)
AddAssemblyTypeArrayAttribute(module, registryCtor, subscriberTypes);
}
private void InjectShrinkNetworkRegistry(ModuleDefinition module)
{
var messageAttributeType = FindType(module, "ShrinkNetwork.ShrinkNetworkMessageAttribute", "ShrinkNetwork.Runtime");
var subscriberAttributeType = FindType(module, "ShrinkNetwork.ShrinkNetworkSubscriberAttribute", "ShrinkNetwork.Runtime");
var subscribeAttributeType = FindType(module, "ShrinkNetwork.ShrinkNetworkSubscribeAttribute", "ShrinkNetwork.Runtime");
var messageCtor = FindTypeArrayConstructor(module, "ShrinkNetwork.ShrinkNetworkMessageRegistryAttribute", "ShrinkNetwork.Runtime");
var subscriberCtor = FindTypeArrayConstructor(module, "ShrinkNetwork.ShrinkNetworkStaticSubscriberRegistryAttribute", "ShrinkNetwork.Runtime");
if (messageAttributeType != null && messageCtor != null)
{
var messageTypes = module.Types
.Where(type => HasAttribute(type, messageAttributeType))
.Select(type => module.ImportReference(type))
.ToArray();
if (messageTypes.Length > 0)
AddAssemblyTypeArrayAttribute(module, messageCtor, messageTypes);
}
if (subscriberAttributeType != null && subscribeAttributeType != null && subscriberCtor != null)
{
var subscriberTypes = module.Types
.Where(type => HasAttribute(type, subscriberAttributeType))
.Where(type => type.Methods.Any(method => method.IsStatic && HasAttribute(method, subscribeAttributeType)))
.Select(type => module.ImportReference(type))
.ToArray();
if (subscriberTypes.Length > 0)
AddAssemblyTypeArrayAttribute(module, subscriberCtor, subscriberTypes);
}
}
private void InjectShrinkAppRegistry(ModuleDefinition module)
{
var installerAttributeType = FindType(module, "ShrinkApp.ShrinkAppModuleInstallerAttribute", "ShrinkApp.Core.Runtime");
var installerInterfaceType = FindType(module, "ShrinkApp.IShrinkAppModuleInstaller", "ShrinkApp.Core.Runtime");
var registryCtor = FindTypeArrayConstructor(module, "ShrinkApp.ShrinkAppInstallerRegistryAttribute", "ShrinkApp.Core.Runtime");
if (installerAttributeType == null || installerInterfaceType == null || registryCtor == null)
return;
var installerTypes = module.Types
.Where(type => !type.IsAbstract)
.Where(type => HasAttribute(type, installerAttributeType))
.Where(type => type.Interfaces.Any(item => item.InterfaceType.FullName == installerInterfaceType.FullName))
.Select(type => module.ImportReference(type))
.ToArray();
if (installerTypes.Length > 0)
AddAssemblyTypeArrayAttribute(module, registryCtor, installerTypes);
}
private static bool HasAttribute(ICustomAttributeProvider provider, TypeReference expectedAttributeType)
{
return provider.CustomAttributes.Any(attribute => attribute.AttributeType.FullName == expectedAttributeType.FullName);
}
private static void AddAssemblyTypeArrayAttribute(ModuleDefinition module, MethodReference ctor, TypeReference[] types)
{
var attribute = new CustomAttribute(ctor);
var typeTypeRef = module.ImportReference(typeof(Type));
attribute.ConstructorArguments.Add(new CustomAttributeArgument(
module.ImportReference(typeof(Type[])),
types.Select(type => new CustomAttributeArgument(typeTypeRef, type)).ToArray()));
module.Assembly.CustomAttributes.Add(attribute);
}
private static TypeReference? FindType(ModuleDefinition module, string fullName, string assemblyName)
{
var resolved = Type.GetType($"{fullName}, {assemblyName}", false);
return resolved == null ? null : module.ImportReference(resolved);
}
private static MethodReference? FindTypeArrayConstructor(ModuleDefinition module, string fullName, string assemblyName)
{
var typeRef = FindType(module, fullName, assemblyName);
var typeDef = typeRef?.Resolve();
var ctor = typeDef?.Methods.FirstOrDefault(method =>
method.IsConstructor &&
method.Parameters.Count == 1 &&
method.Parameters[0].ParameterType.IsArray &&
method.Parameters[0].ParameterType.GetElementType().FullName == module.ImportReference(typeof(Type)).FullName);
return ctor == null ? null : module.ImportReference(ctor);
}
private static AssemblyDefinition AssemblyDefinitionFor(ICompiledAssembly compiledAssembly)
{
var assemblyResolver = new PostProcessorAssemblyResolver(compiledAssembly);
var readerParameters = new ReaderParameters
{
SymbolStream = new MemoryStream(compiledAssembly.InMemoryAssembly.PdbData.ToArray()),
SymbolReaderProvider = new PdbReaderProvider(),
AssemblyResolver = assemblyResolver,
ReflectionImporterProvider = new PostProcessorReflectionImporterProvider(),
ReadingMode = ReadingMode.Immediate
};
var assemblyDefinition = AssemblyDefinition.ReadAssembly(
new MemoryStream(compiledAssembly.InMemoryAssembly.PeData.ToArray()),
readerParameters);
assemblyResolver.AddAssemblyDefinitionBeingOperatedOn(assemblyDefinition);
return assemblyDefinition;
}
private static ILPostProcessResult GetResult(AssemblyDefinition assemblyDefinition, List<DiagnosticMessage> diagnostics)
{
var pe = new MemoryStream();
var pdb = new MemoryStream();
assemblyDefinition.Write(pe, new WriterParameters
{
SymbolWriterProvider = new PdbWriterProvider(),
SymbolStream = pdb,
WriteSymbols = true
});
return new ILPostProcessResult(new InMemoryAssembly(pe.ToArray(), pdb.ToArray()), diagnostics);
}
public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly) =>
WillProcess(compiledAssembly)
? UnityShrinkCodeGenAdapter.Process(compiledAssembly, "ShrinkShared.CodeGen")
: new ILPostProcessResult(compiledAssembly.InMemoryAssembly, new List<DiagnosticMessage>());
}
}
+76
View File
@@ -0,0 +1,76 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ShrinkSDK.CodeGen;
using Unity.CompilationPipeline.Common.Diagnostics;
using Unity.CompilationPipeline.Common.ILPostProcessing;
namespace ShrinkShared.CodeGen
{
public static class UnityShrinkCodeGenAdapter
{
public static ILPostProcessResult Process(ICompiledAssembly compiledAssembly, string diagnosticPrefix)
{
var diagnostics = new List<DiagnosticMessage>();
var tempRoot = Path.Combine(Path.GetTempPath(), "ShrinkSDK.CodeGen", Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(tempRoot);
try
{
var inputAssembly = Path.Combine(tempRoot, compiledAssembly.Name + ".dll");
var inputPdb = Path.Combine(tempRoot, compiledAssembly.Name + ".pdb");
var outputAssembly = Path.Combine(tempRoot, compiledAssembly.Name + ".woven.dll");
var outputPdb = Path.Combine(tempRoot, compiledAssembly.Name + ".woven.pdb");
File.WriteAllBytes(inputAssembly, compiledAssembly.InMemoryAssembly.PeData);
var hasSymbols = compiledAssembly.InMemoryAssembly.PdbData != null &&
compiledAssembly.InMemoryAssembly.PdbData.Length > 0;
if (hasSymbols)
File.WriteAllBytes(inputPdb, compiledAssembly.InMemoryAssembly.PdbData);
var result = ShrinkAssemblyWeaver.Weave(inputAssembly, hasSymbols ? inputPdb : null,
compiledAssembly.References, outputAssembly, hasSymbols ? outputPdb : null,
ShrinkCodeGenPlatform.Unity);
foreach (var item in result.Diagnostics)
{
diagnostics.Add(new DiagnosticMessage
{
DiagnosticType = item.Severity == ShrinkCodeGenDiagnosticSeverity.Error
? DiagnosticType.Error
: DiagnosticType.Warning,
MessageData = $"[{diagnosticPrefix}] {item.Message}"
});
}
if (!result.Succeeded || !result.Changed)
return new ILPostProcessResult(compiledAssembly.InMemoryAssembly, diagnostics);
var pe = File.ReadAllBytes(outputAssembly);
var pdb = hasSymbols && File.Exists(outputPdb)
? File.ReadAllBytes(outputPdb)
: compiledAssembly.InMemoryAssembly.PdbData ?? Array.Empty<byte>();
return new ILPostProcessResult(new InMemoryAssembly(pe, pdb), diagnostics);
}
catch (Exception exception)
{
diagnostics.Add(new DiagnosticMessage
{
DiagnosticType = DiagnosticType.Error,
MessageData = $"[{diagnosticPrefix}] {exception.Message}"
});
return new ILPostProcessResult(compiledAssembly.InMemoryAssembly, diagnostics);
}
finally
{
try { Directory.Delete(tempRoot, true); }
catch { }
}
}
public static bool ReferencesAny(ICompiledAssembly compiledAssembly, params string[] assemblyNames)
{
return compiledAssembly.References.Any(reference => assemblyNames.Any(name =>
string.Equals(Path.GetFileNameWithoutExtension(reference), name, StringComparison.Ordinal)));
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8ce38c62eefa4af4d9813fc6b1f880e6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="ShrinkSDK" value="https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

Some files were not shown because too many files have changed in this diff Show More