Aldaviva / WinampNowPlayingToFile

⚡ When Winamp plays a track, this plugin will save the track metadata and album art to files.
Apache License 2.0
17 stars 1 forks source link

Fix CI build by committing difficult-to-install dependencies into the repository #6

Closed Aldaviva closed 2 years ago

Aldaviva commented 2 years ago

I don't like checking dependencies into repos, but I think it's the best option here because

Aldaviva commented 2 years ago

I was able to get the build working on a standalone VM with the following PowerShell script. Daniel15.Sharpamp.dll was saved to the .\packages\ directory in the repo.

del -force -ErrorAction Ignore Sharpamp.exe,Sharpamp.log,WinampNowPlayingToFile\Daniel15.Sharpamp.dll
msbuild -t:clean
rmdir -Recurse -force -ErrorAction Ignore .\artifact\,.\gen_WinampNowPlayingToFile\Release,.\WinampNowPlayingToFile\bin,.\WinampNowPlayingToFile\obj

# Copy the dependency to a location where the C# build can find it.
# This build directory doesn't exist before the build is run, so create it early.
mkdir -force -ErrorAction Ignore .\WinampNowPlayingToFile\bin\Release\
copy .\packages\Daniel15.Sharpamp.dll .\WinampNowPlayingToFile\bin\Release\

Write-Output "Building plugins"
# Building the C++ plugin will transitively build the C# plugin. Unlike building the entire solution, this lets us skip the Test project for now, which is broken with some weird NuGet xUnit error.
msbuild /m /p:Configuration=Release gen_WinampNowPlayingToFile -restore

Write-Output "Preparing artifact"
mkdir .\artifact\
# The output directory is different based on whether the sln or vcxproj was built for some reason.
copy gen_WinampNowPlayingToFile\Release\*.dll .\artifact\
mkdir .\artifact\plugins\
move .\artifact\gen_WinampNowPlayingToFile.dll .\artifact\plugins\
Aldaviva commented 2 years ago

Build #8 succeeded with this change. The Daniel15.Sharpamp.dll file is now committed in the repo's packages/Daniel15.Sharpamp.1.0.0/ directory.