-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOfficeTool.csproj
More file actions
150 lines (135 loc) · 7.48 KB
/
Copy pathOfficeTool.csproj
File metadata and controls
150 lines (135 loc) · 7.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Library</OutputType>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<!-- Plugin binaries must be OS-neutral: AnyCPU and NO RuntimeIdentifier. The MSBuild
target that ships this plugin into the host's Tools/ folder forces
RuntimeIdentifier= empty (see AIOffice.csproj, BuildToolPlugins). -->
<PlatformTarget>AnyCPU</PlatformTarget>
<Papyrine_SponsorshipLicenseIgnored>true</Papyrine_SponsorshipLicenseIgnored>
<Configurations>Debug;Release;Test</Configurations>
<!-- This project is ONLY the adapter (OfficeTool.cs): the vendored OfficeCLI engine
lives in ExternalDependencies/officecli as a separate Library project (converted
from Exe by the sync script; InternalsVisibleTo grants this adapter access to its
internal APIs). OfficeTool.cs is regenerated by update-vendor.ps1. -->
<AssemblyName>OfficeTool</AssemblyName>
<RootNamespace>AIOrchestrator.API</RootNamespace>
<PackageId>Graphene.OfficeTool</PackageId>
<Version>$([System.DateTime]::Now.ToString("1.yy.MM.dd"))</Version>
<Description>Office document (DOCX/XLSX/PPTX) agent tool for AIOrchestrator, powered by the vendored OfficeCLI engine: create/open, view, path-based DOM get/query/set/add/remove, validate, batch, schema help, save/restore.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<Copyright>Andrea Bruno</Copyright>
<RepositoryUrl>https://github.com/Graphene-Lab/OfficeTool</RepositoryUrl>
<PackageTags>agent;tool;office;docx;xlsx;pptx;openxml;document;llm;automation</PackageTags>
</PropertyGroup>
<!-- Runtime plugin identity: AIOrchestrator.PluginUpdater reads these assembly metadata
attributes to know which NuGet package and version a loaded plugin comes from. -->
<ItemGroup>
<AssemblyMetadata Include="NuGetPackageId" Value="Graphene.OfficeTool" />
<AssemblyMetadata Include="NuGetPackageVersion" Value="$(Version)" />
</ItemGroup>
<!-- Dual-reference pattern (as in AIOrchestrator): the local sibling project wins when
present (solution builds); otherwise the NuGet package (1.* floating = always latest)
is restored — required for CI/standalone builds where the sibling sources are absent. -->
<ItemGroup>
<ProjectReference Include="..\AIOrchestrator\AIOrchestrator.csproj" Condition="Exists('..\AIOrchestrator\AIOrchestrator.csproj')" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Graphene.AIOrchestrator" Version="1.*" />
</ItemGroup>
<!-- The vendored engine: a Library project inside this repo (not a NuGet package).
PrivateAssets=all keeps it OUT of the nuspec dependency graph — the engine dll is
added to the package lib folder manually below, so consumers get both assemblies.
The officecli project embeds its own resources (preview, skills, schemas) with the
upstream logical names; this adapter references none of them directly. -->
<ItemGroup>
<ProjectReference Include="ExternalDependencies\officecli\officecli.csproj" PrivateAssets="all" />
</ItemGroup>
<!-- Host dependency: the app provides DocumentFormat.OpenXml; the floor must not be
lower than what the engine's own 3.4.1 reference resolves to under unification
(NU1605 would flag a downgrade). System.CommandLine is no longer referenced here:
it is the engine's compile-time-only dependency and never executed at runtime. -->
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="3.5.1" />
</ItemGroup>
<!-- The vendored project sources must NOT be compiled into this adapter assembly:
the SDK **/*.cs default glob would otherwise include ExternalDependencies/** and
duplicate every engine type (CS0433). The engine compiles only in its own project. -->
<ItemGroup>
<Compile Remove="ExternalDependencies\**\*.cs" />
</ItemGroup>
<!-- The nested test harness must NOT be compiled into this library: the SDK default
**/*.cs glob would otherwise include its sources (Main + duplicate tool types),
polluting the plugin assembly. -->
<ItemGroup>
<Compile Remove="OfficeTool.Tests\**\*.cs" />
</ItemGroup>
<!-- The harness drives the adapter through its public surface (the engine's own
InternalsVisibleTo, added by the sync transform, covers engine internals if a
golden vendor regression ever needs them). -->
<ItemGroup>
<InternalsVisibleTo Include="OfficeTool.Tests" />
</ItemGroup>
<ItemGroup>
<None Update="LICENSE.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="NOTICE.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<!-- The NuGet package must carry BOTH assemblies: the adapter (OfficeTool.dll, the
plugin the host loads) and the vendored engine (officecli.dll, its only runtime
dependency). The engine ProjectReference is PrivateAssets=all, so it would not
flow into the package by itself. TargetsForTfmSpecificContentInPackage is the
documented per-TFM package-file hook (runs inside _LoadPackInputItems). -->
<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeVendoredEngineInPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<Target Name="IncludeVendoredEngineInPackage">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)officecli.dll">
<PackagePath>lib/net10.0/</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
<!-- Date-based auto version + NuGet publishing, same mechanism as AIOrchestrator.
Local/VS: dotnet pack publishes with the NuGetApiKey env var; CI: publish.yml on master. -->
<Target Name="SetPackageVersion" DependsOnTargets="Build">
<PropertyGroup>
<PackageVersion>$(Version)</PackageVersion>
</PropertyGroup>
</Target>
<PropertyGroup>
<NuGetSource Condition="'$(NuGetSource)' == ''">https://api.nuget.org/v3/index.json</NuGetSource>
</PropertyGroup>
<Target Name="CleanOldNuGetPackages" BeforeTargets="GenerateNuspec">
<CreateItem Include="$(PackageOutputPath)*.nupkg">
<Output TaskParameter="Include" ItemName="_OldNupkg" />
</CreateItem>
<Delete Files="@(_OldNupkg)" />
</Target>
<Target Name="PublishPackageToNuGet" AfterTargets="Pack" Condition="'$(SkipNuGetPush)' != 'true'">
<Error Condition="'$(NuGetApiKey)' == ''"
Text="NuGetApiKey env var not set: run `setx NuGetApiKey <key>` and restart Visual Studio." />
<CreateItem Include="$(PackageOutputPath)*.nupkg">
<Output TaskParameter="Include" ItemName="_NuGetPackageToPush" />
</CreateItem>
<Error Condition="'@(_NuGetPackageToPush)' == ''"
Text="No package found in $(PackageOutputPath): pack produced no expected file." />
<Message Importance="High" Text="Publishing %(_NuGetPackageToPush.Identity) to $(NuGetSource) ..." />
<Exec Command="dotnet nuget push "%(_NuGetPackageToPush.Identity)" --api-key "$(NuGetApiKey)" --source "$(NuGetSource)" --skip-duplicate" />
</Target>
</Project>