Skip to content

Commit

Permalink
Fix Unity project CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoco007 committed Oct 15, 2024
1 parent a2cb6ca commit 111ba67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
8 changes: 8 additions & 0 deletions Source/CustomAvatar-Editor/CustomAvatar-Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- Copy the assembly and PDB to the Unity Project's folder -->
<Target Name="CopyToUnityProject" AfterTargets="CopyToArtifact" Condition="'$(UnityProjectDir)' != ''">
<Message Text="$(MSBuildProjectName) -&gt; $(UnityProjectDir)" Importance="high" />
<ItemGroup>
<FilesToCopy Include="$(ArtifactDir)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)" DestinationFiles="@(FilesToCopy->'$(UnityProjectDir)\Assets\Libraries\%(RecursiveDir)%(Filename)%(Extension)')" Condition="!Exists('$(UnityProjectDir)\Assets\Libraries\%(RecursiveDir)%(Filename)%(Extension)') OR '%(Extension)' != '.meta'" />
</Target>
</Project>
19 changes: 3 additions & 16 deletions Source/CustomAvatar-Editor/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<Version Condition="$(BuildMetadata) != ''">$(Version)+$(BuildMetadata)</Version>

<ArtifactDir>$(TargetDir)Artifact\</ArtifactDir>
<ArtifactTargetDir>$(ArtifactDir)Plugins\</ArtifactTargetDir>
<ArtifactTargetDir Condition="'$(BeatSaberOutputType)' == 'Library'">$(ArtifactDir)Libs\</ArtifactTargetDir>
</PropertyGroup>

<!-- If we're building for a tag in CI, make sure it matches the version defined here -->
Expand Down Expand Up @@ -50,25 +48,14 @@
<Message Text="$(MSBuildProjectName) -&gt; $(ArtifactDir)" Importance="high" />

<MakeDir Directories="$(ArtifactDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ArtifactTargetDir)" />
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="$(ArtifactTargetDir)" Condition="Exists('$(TargetDir)$(TargetName).pdb')" />
<Copy SourceFiles="$(TargetDir)$(TargetName).xml" DestinationFolder="$(ArtifactTargetDir)" Condition="Exists('$(TargetDir)$(TargetName).xml') AND '$(CopyDocumentationFileToArtifact)' == 'True'" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ArtifactDir)" />
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="$(ArtifactDir)" Condition="Exists('$(TargetDir)$(TargetName).pdb')" />
<Copy SourceFiles="$(TargetDir)$(TargetName).xml" DestinationFolder="$(ArtifactDir)" Condition="Exists('$(TargetDir)$(TargetName).xml') AND '$(CopyDocumentationFileToArtifact)' == 'True'" />
<Copy SourceFiles="$(TargetDir)$(TargetName).manifest" DestinationFolder="$(ArtifactDir)Plugins" Condition="Exists('$(TargetDir)$(TargetName).manifest')" />

<Copy SourceFiles="@(AdditionalArtifactFiles)" DestinationFolder="$(ArtifactDir)%(AdditionalArtifactFiles.TargetDir)\%(AdditionalArtifactFiles.RecursiveDir)" />
</Target>

<!-- Copy the assembly and PDB to the Beat Saber folder -->
<Target Name="CopyToPlugins" AfterTargets="CopyToArtifact" Condition="'$(BeatSaberDir)' != '' AND '$(CI)' == '' AND '$(NCrunch)' != '1'">
<Message Text="$(MSBuildProjectName) -&gt; $(BeatSaberDir)" Importance="high" />

<ItemGroup>
<FilesToCopy Include="$(ArtifactDir)\**\*" />
</ItemGroup>

<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(BeatSaberDir)%(RecursiveDir)" />
</Target>

<!-- Set GitHub Actions output variables -->
<Target Name="SetGitHubActionsOutput" AfterTargets="CopyToArtifact" Condition="'$(GITHUB_ACTIONS)' == 'true'">
<Message Text="Writing to GitHub output" Importance="high" />
Expand Down

0 comments on commit 111ba67

Please sign in to comment.