Skip to content

Commit

Permalink
make Framework-specific changes for build
Browse files Browse the repository at this point in the history
  • Loading branch information
kolohelios committed Sep 23, 2021
1 parent f84c7ab commit 62212e6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ open class AKCompressor: AKNode, AKToggleable, AUEffect, AKInput {
@objc open dynamic var masterGain: Double = 0 {
didSet {
masterGain = (-40...40).clamp(masterGain)
au[kDynamicsProcessorParam_MasterGain] = masterGain
au[kDynamicsProcessorParam_OverallGain] = masterGain
}
}

Expand Down Expand Up @@ -135,7 +135,7 @@ open class AKCompressor: AKNode, AKToggleable, AUEffect, AKInput {
au[kDynamicsProcessorParam_HeadRoom] = headRoom
au[kDynamicsProcessorParam_AttackTime] = attackDuration
au[kDynamicsProcessorParam_ReleaseTime] = releaseDuration
au[kDynamicsProcessorParam_MasterGain] = masterGain
au[kDynamicsProcessorParam_OverallGain] = masterGain
}

public var inputNode: AVAudioNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ open class AKDynamicsProcessor: AKNode, AKToggleable, AUEffect, AKInput {
@objc open dynamic var masterGain: Double = 0 {
didSet {
masterGain = (-40...40).clamp(masterGain)
au[kDynamicsProcessorParam_MasterGain] = masterGain
au[kDynamicsProcessorParam_OverallGain] = masterGain
}
}

Expand Down Expand Up @@ -174,7 +174,7 @@ open class AKDynamicsProcessor: AKNode, AKToggleable, AUEffect, AKInput {
au[kDynamicsProcessorParam_ExpansionThreshold] = expansionThreshold
au[kDynamicsProcessorParam_AttackTime] = attackDuration
au[kDynamicsProcessorParam_ReleaseTime] = releaseDuration
au[kDynamicsProcessorParam_MasterGain] = masterGain
au[kDynamicsProcessorParam_OverallGain] = masterGain
}

public var inputNode: AVAudioNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ open class AKExpander: AKNode, AKToggleable, AUEffect, AKInput {
@objc open dynamic var masterGain: Double = 0 {
didSet {
masterGain = (-40...40).clamp(masterGain)
au[kDynamicsProcessorParam_MasterGain] = masterGain
au[kDynamicsProcessorParam_OverallGain] = masterGain
}
}

Expand Down Expand Up @@ -145,7 +145,7 @@ open class AKExpander: AKNode, AKToggleable, AUEffect, AKInput {
au[kDynamicsProcessorParam_ExpansionThreshold] = expansionThreshold
au[kDynamicsProcessorParam_AttackTime] = attackDuration
au[kDynamicsProcessorParam_ReleaseTime] = releaseDuration
au[kDynamicsProcessorParam_MasterGain] = masterGain
au[kDynamicsProcessorParam_OverallGain] = masterGain
}

public var inputNode: AVAudioNode {
Expand Down
30 changes: 4 additions & 26 deletions Frameworks/build_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ create_xcframework()
-framework "${BUILD_DIR}/${CONFIGURATION}-appletvos/$1.framework" \
-framework "${BUILD_DIR}/${CONFIGURATION}-appletvsimulator/$1.framework" \
-framework "${BUILD_DIR}/${CONFIGURATION}/$1.framework" $CATA_ARG
# OMFG, we need to manually unfuck the generated swift interface files. WTF!
find $1.xcframework -name "*.swiftinterface" -exec sed -i -e "s/$1\.//g" {} \;
}

# Create individual static platform frameworks (device or simulator) in their own subdirectories
Expand Down Expand Up @@ -225,7 +227,7 @@ create_catalyst_framework()
rm -rf "${DIR}/${PROJECT_NAME}.framework" "${DIR}/${PROJECT_UI_NAME}.framework"
mkdir -p "$DIR"
xcodebuild archive -project "$PROJECT" -scheme $PROJECT_UI_NAME ONLY_ACTIVE_ARCH=$ACTIVE_ARCH CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" SKIP_INSTALL=NO \
-configuration ${CONFIGURATION} -destination 'platform=macOS,variant=Mac Catalyst' -archivePath "${BUILD_DIR}/Catalyst.xcarchive" \
-configuration ${CONFIGURATION} -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' -archivePath "${BUILD_DIR}/Catalyst.xcarchive" \
BUILD_DIR="${BUILD_DIR}" AUDIOKIT_VERSION="$VERSION" | tee -a build.log | $XCPRETTY || exit 2
cp -av "${BUILD_DIR}/Catalyst.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" "${BUILD_DIR}/Catalyst.xcarchive/Products/Library/Frameworks/${PROJECT_UI_NAME}.framework" "$DIR/"
if test -d "${BUILD_DIR}/${CONFIGURATION}/${PROJECT_NAME}.framework.dSYM";
Expand All @@ -245,28 +247,4 @@ create_catalyst_framework()
echo "Building frameworks for version $VERSION on platforms: $PLATFORMS"
rm -f build.log

for os in $PLATFORMS; do
if test $os = 'iOS'; then
#create_universal_framework iOS iphonesimulator iphoneos
create_framework iOS iphoneos
create_framework iOS iphonesimulator
elif test $os = 'tvOS'; then
#create_universal_framework tvOS appletvsimulator appletvos
create_framework tvOS appletvos
create_framework tvOS appletvsimulator
elif test $os = 'macOS'; then
create_macos_framework macOS macosx
create_catalyst_framework
fi
done

# Only create the xcframework if all platforms were built
if test "$PLATFORMS" = "iOS macOS tvOS"; then
create_xcframework AudioKit
create_xcframework AudioKitUI
fi

if [ -f distribute_built_frameworks.sh ]; then
./distribute_built_frameworks.sh
fi

create_universal_framework iOS iphonesimulator iphoneos
3 changes: 3 additions & 0 deletions Frameworks/simulator.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ CLANG_ENABLE_MODULE_DEBUGGING = NO

CODE_SIGNING_REQUIRED = NO
CODE_SIGN_IDENTITY =

EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))

0 comments on commit 62212e6

Please sign in to comment.