Skip to content

Commit

Permalink
Alternative build script
Browse files Browse the repository at this point in the history
  • Loading branch information
BAndysc committed Sep 9, 2024
1 parent b34a0d0 commit 1b03845
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 31 deletions.
5 changes: 1 addition & 4 deletions LoaderAvalonia/LoaderAvalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
<Import Project="..\Module.props" />
<Import Project="..\Avalonia.props" />

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
</ItemGroup>

<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<ProjectReference Include="..\AvaloniaStyles\AvaloniaStyles.csproj" />
<ProjectReference Include="..\BaseDesktopLoader\BaseDesktopLoader.csproj" />
<ProjectReference Include="..\Modules\WDE.DatabaseDefinitionEditor\WDE.DatabaseDefinitionEditor.csproj" />
Expand Down
17 changes: 9 additions & 8 deletions WoWDatabaseEditorCore.Avalonia/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,15 @@ protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)

private IEnumerable<string> GetPluginDlls()
{
#if !DEBUG
if (OperatingSystem.IsWindows())
{
return Directory.GetFiles(".", "WDE*.dll")
.Where(path => !path.Contains("Test.dll") && !path.Contains("WPF") && !path.Contains("WDE.Common.Avalonia.dll"))
.Select(Path.GetFullPath);
}
#endif
// uncomment for plugins support
// #if !DEBUG
// if (OperatingSystem.IsWindows())
// {
// return Directory.GetFiles(".", "WDE*.dll")
// .Where(path => !path.Contains("Test.dll") && !path.Contains("WPF") && !path.Contains("WDE.Common.Avalonia.dll"))
// .Select(Path.GetFullPath);
// }
// #endif

return Array.Empty<string>();
}
Expand Down
35 changes: 16 additions & 19 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ set -e
# Display installed .NET SDKs
dotnet --list-sdks

echo $APPVEYOR_PULL_REQUEST_NUMBER

if [ -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
git clone -b avalonia11 https://$REPO_TOKEN@github.com/BAndysc/WoWDatabaseEditorExtras --recurse-submodules

cd WoWDatabaseEditorExtras/WoWDatabaseEditor
git checkout $APPVEYOR_REPO_COMMIT
cd ..
cd ..

EXTRA_CSPROJ='<ProjectReference Include="..\\WoWDatabaseEditorExtras\\WDE.Github\\WDE.Github.csproj" />'
sed -i "\#</ItemGroup>#i $EXTRA_CSPROJ" "LoaderAvalonia/LoaderAvalonia.csproj"
sed -i '/};/i ,typeof(GithubModule)' "LoaderAvalonia/Program.cs"
sed -i '/using WoWDatabaseEditorCore.Avalonia;/i using WDE.Github;' "LoaderAvalonia/Program.cs"
fi

# Publish projects for Windows, macOS, and Linux
dotnet publish -c Release --self-contained false -f net8.0 -o bin/wowdatabaseeditor-avalonia-win/ LoaderAvalonia/LoaderAvalonia.csproj -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=false

Expand Down Expand Up @@ -40,25 +56,6 @@ mv bin/wowdatabaseeditor-avalonia-linux/WoWDatabaseEditor bin/wowdatabaseeditor-

mv bin/wowdatabaseeditor-avalonia-win/WoWDatabaseEditor.exe bin/wowdatabaseeditor-avalonia-win/WoWDatabaseEditorCore.Avalonia.exe

echo $APPVEYOR_PULL_REQUEST_NUMBER

if [ -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
git clone -b avalonia11 https://$REPO_TOKEN@github.com/BAndysc/WoWDatabaseEditorExtras --recurse-submodules

cd WoWDatabaseEditorExtras/WoWDatabaseEditor
git checkout $APPVEYOR_REPO_COMMIT
cd ..

mkdir modules
dotnet publish WDE.Github/WDE.Github.csproj -o modules/ -c Release -f net8.0

cp modules/WDE.Github.dll ../bin/wowdatabaseeditor-avalonia-win/WDE.Github.dll
cp modules/WDE.Github.dll ../bin/wowdatabaseeditor-avalonia-mac/WDE.Github.dll
cp modules/WDE.Github.dll ../bin/wowdatabaseeditor-avalonia-linux/WDE.Github.dll

cd ..
fi

# Cleanup operations in Windows bin directory
cd bin/wowdatabaseeditor-avalonia-win/
rm -rf *.pdb *.xml
Expand Down

0 comments on commit 1b03845

Please sign in to comment.