Skip to content

Refactored Bass, Bass.Enc and Bass.Midi projects to simplify cross-platform support#131

Merged
olitee merged 11 commits into
masterfrom
multitarget-fixes
Sep 1, 2025
Merged

Refactored Bass, Bass.Enc and Bass.Midi projects to simplify cross-platform support#131
olitee merged 11 commits into
masterfrom
multitarget-fixes

Conversation

@olitee

@olitee olitee commented Sep 1, 2025

Copy link
Copy Markdown
Member

After review, it seems there is no longer a need for this library to compile dedicated iOS and Windows (Desktop) versions of this library.

The primary reason for compiling a dedicated iOS version was to swap out the [DllImport] attribute targets with __Internal to support static linking of the native bass libraries. Since dynamic linking has been supported now since iOS 8.0 (2014), it seems unnecessary to continue supporting this requirement. Radio42 have followed suit with their Bass.NET wrapper, and now only target .NET Standard 2.0 and .NET 6, with no platform-specific builds.

This PR simplified the Bass, Bass.Enc and Bass.Midi projects, which were each comprised of 4 projects (12 in total!), catering for various platform specific concerns.

All iOS and Windows-specific features are now simply compiled in a single package. It's up to you to determine which platform you're on, and which methods are appropriate - rather than us simply hiding them from you.

This simplifies and modernises the solution structure.

olitee added 8 commits August 31, 2025 11:24
1. Added support for .NET Framework 4.5
2. Bumped .NET Standard support from 1.4 to 2.0
3. Added support for .NET 8+
…ed download instructions. Added note on iOS static linking requirement.
…ss platform concerns into a single project.

iOS-specific code has been moved into a PlatformSpecific/iOS folder within those projects.

iOS-specific builds are now created by specifying the 'iOS' platform at build time.

Also added new '__STATIC_LINKING__' constant to enable specific build for iOS < v8.0 where static linking is still required.
…migrated package metadata into respective `.csproj` files. Updated build pipeline to eliminate custom `.nuspec` packaging and streamline multi-target framework builds.
@olitee
olitee requested a review from Copilot September 1, 2025 21:49

This comment was marked as outdated.

# Conflicts:
#	README.md
#	src/AddOns/BassAac/BassAac.csproj
#	src/AddOns/BassEnc/Desktop/Desktop.csproj
#	src/AddOns/BassEnc/ManagedBass.Enc.nuspec
#	src/AddOns/BassEnc/Portable/BassEnc.csproj
#	src/AddOns/BassEnc/iOS/iOS.csproj
#	src/AddOns/BassMidi/Desktop/Desktop.csproj
#	src/AddOns/BassMidi/ManagedBass.Midi.nuspec
#	src/AddOns/BassMidi/Portable/BassMidi.csproj
#	src/AddOns/BassMidi/iOS/iOS.csproj
#	src/Bass/Desktop/Desktop.csproj
#	src/Bass/ManagedBass.nuspec
#	src/Bass/Portable/Bass.csproj
#	src/Bass/Portable/BassMarshal.cs
#	src/Bass/Portable/ChannelReferences.cs
#	src/Bass/Portable/CrossPlatformHelper.cs
#	src/Bass/Shared/Shared.projitems
#	src/Bass/Shared/Shared.shproj
#	src/Bass/iOS/iOS.csproj
…sMarshal methods. Adjusted `PtrToStructure` and `SizeOf` implementations for framework-specific differences in `Marshal` APIs.
@olitee
olitee requested a review from Copilot September 1, 2025 21:57

This comment was marked as outdated.

@olitee
olitee requested a review from Copilot September 1, 2025 22:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Bass, Bass.Enc and Bass.Midi projects to eliminate the need for dedicated iOS and Windows builds, consolidating from 12 separate projects to 3. The primary change replaces platform-specific static linking (__Internal) with conditional defines that allow runtime platform detection, simplifying the solution structure while maintaining iOS compatibility through dynamic linking available since iOS 8.0.

  • Replaced platform-specific builds with conditional compilation using __STATIC_LINKING__ instead of __IOS__
  • Consolidated multiple shared projects and iOS/Desktop variants into single portable projects
  • Updated project configurations to support both AnyCPU and iOS platforms

Reviewed Changes

Copilot reviewed 65 out of 200 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ManagedBass.sln Removed complex multi-project structure, added iOS platform configuration
Bass/Portable/Bass.csproj Consolidated main Bass project with iOS platform support
AddOns/Bass*/Portable/*.csproj Updated addon projects with unified configuration and iOS platform support
Various PInvoke/*.cs Changed DLL import conditionals from __IOS__ to __STATIC_LINKING__
README.md Updated documentation to reflect iOS support changes and added comprehensive addon platform matrix
Comments suppressed due to low confidence (2)

.github/workflows/package-and-release.yml:1

  • The workflow is configured to run on the multitarget-fixes branch, which appears to be a development/feature branch rather than a production branch. This should likely be updated to trigger on main/master or removed for production deployment.
name: Build and Package for Release

.github/workflows/package-and-release.yml:1

  • The condition if: github.event_name == 'release' was removed from the job level but only added to the "Push to NuGet Feed" step. This means the build-and-deploy job will now run on every push to the multitarget-fixes branch, potentially creating unnecessary artifacts. The condition should be restored at the job level or the branch trigger should be removed.
name: Build and Package for Release

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants