|
6 | 6 | <!-- |
7 | 7 | Copies SKILL.md from this package to .agents/skills/cloudactors/ in the consuming repo root. |
8 | 8 | Uses InitializeSourceControlInformation (SourceLink) to locate the repo root. |
9 | | - Falls back to $(SolutionDir) if no git root can be determined. |
10 | | - Silently skips if neither source can be determined. |
| 9 | + Falls back to SolutionDir if the git root cannot be determined. |
| 10 | + Falls back to the directory containing the nearest AGENTS.md file found above the project file. |
| 11 | + Silently skips if the base directory cannot be determined. |
11 | 12 | Opt-out: set <CloudActorsSkill>false</CloudActorsSkill> in your project or Directory.Build.props. |
12 | 13 | --> |
13 | 14 | <Target Name="CopyCloudActorsSkill" |
14 | | - AfterTargets="Build" |
| 15 | + BeforeTargets="PrepareForBuild" |
15 | 16 | DependsOnTargets="InitializeSourceControlInformation" |
16 | 17 | Condition="'$(CloudActorsSkill)' != 'false'"> |
17 | 18 |
|
|
21 | 22 |
|
22 | 23 | <PropertyGroup> |
23 | 24 | <_CloudActorsSkillRepoRoot>@(_CloudActorsSkillSourceRoot)</_CloudActorsSkillRepoRoot> |
24 | | - <!-- Fall back to solution directory if no git root was found --> |
25 | 25 | <_CloudActorsSkillRepoRoot Condition="'$(_CloudActorsSkillRepoRoot)' == '' and '$(SolutionDir)' != '' and '$(SolutionDir)' != '*Undefined*'">$(SolutionDir)</_CloudActorsSkillRepoRoot> |
| 26 | + <_CloudActorsSkillAgentsMd Condition="'$(_CloudActorsSkillRepoRoot)' == ''">$([MSBuild]::GetPathOfFileAbove('AGENTS.md', '$(MSBuildProjectDirectory)'))</_CloudActorsSkillAgentsMd> |
| 27 | + <_CloudActorsSkillRepoRoot Condition="'$(_CloudActorsSkillRepoRoot)' == '' and '$(_CloudActorsSkillAgentsMd)' != ''">$([System.IO.Path]::GetDirectoryName('$(_CloudActorsSkillAgentsMd)'))\</_CloudActorsSkillRepoRoot> |
26 | 28 | </PropertyGroup> |
27 | 29 |
|
| 30 | + <MakeDir Directories="$(_CloudActorsSkillRepoRoot).agents\skills\cloudactors" |
| 31 | + Condition="'$(_CloudActorsSkillRepoRoot)' != '' and Exists('$(MSBuildThisFileDirectory)..\skills\cloudactors\SKILL.md')" |
| 32 | + ContinueOnError="true" /> |
| 33 | + |
28 | 34 | <Copy SourceFiles="$(MSBuildThisFileDirectory)..\skills\cloudactors\SKILL.md" |
29 | 35 | DestinationFiles="$(_CloudActorsSkillRepoRoot).agents\skills\cloudactors\SKILL.md" |
30 | 36 | SkipUnchangedFiles="true" |
|
0 commit comments