react-native-audio-api 0.4.12-beta.3 → 0.4.12-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,10 @@
1
1
  require "json"
2
- require_relative './scripts/audioapi_utils'
3
2
 
4
3
  package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
5
4
 
6
- $config = find_config()
7
- assert_minimal_react_native_version($config)
8
5
  $new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
9
6
 
10
- folly_flags = "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=#{$config[:react_native_minor_version]}"
7
+ folly_flags = "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32"
11
8
  fabric_flags = $new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
12
9
  version_flag = "-DAUDIOAPI_VERSION=#{package_json['version']}"
13
10
 
@@ -36,28 +33,13 @@ Pod::Spec.new do |s|
36
33
 
37
34
  s.ios.frameworks = 'CoreFoundation', 'CoreAudio', 'AudioToolbox', 'Accelerate'
38
35
 
39
- s.pod_target_xcconfig = {
36
+ s.compiler_flags = "#{folly_flags}"
37
+
38
+ s.pod_target_xcconfig = {
40
39
  "USE_HEADERMAP" => "YES",
41
- "DEFINES_MODULE" => "YES",
42
- "HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/ReactCommon" "$(PODS_TARGET_SRCROOT)" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/DoubleConversion" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
43
- "FRAMEWORK_SEARCH_PATHS" => '"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes"',
44
40
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
45
41
  "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) HAVE_ACCELERATE=1',
46
- }
47
- s.compiler_flags = "#{folly_flags}"
48
-
49
- s.xcconfig = {
50
- "HEADER_SEARCH_PATHS" => [
51
- '"$(PODS_ROOT)/boost"',
52
- '"$(PODS_ROOT)/boost-for-react-native"',
53
- '"$(PODS_ROOT)/glog"',
54
- '"$(PODS_ROOT)/RCT-Folly"',
55
- '"$(PODS_ROOT)/Headers/Public/React-hermes"',
56
- '"$(PODS_ROOT)/Headers/Public/hermes-engine"',
57
- "\"$(PODS_ROOT)/#{$config[:react_native_common_dir]}\"",
58
- "\"$(PODS_ROOT)/#{$config[:react_native_audioapi_dir_from_pods_root]}/ios/audioapi/ios\"",
59
- "\"$(PODS_ROOT)/#{$config[:react_native_audioapi_dir_from_pods_root]}/common/cpp/audioapi\"",
60
- ].join(' '),
42
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\" \"$(PODS_TARGET_SRCROOT)/ios\"",
61
43
  'OTHER_CFLAGS' => "$(inherited) #{folly_flags} #{fabric_flags} #{version_flag}"
62
44
  }
63
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-audio-api",
3
- "version": "0.4.12-beta.3",
3
+ "version": "0.4.12-beta.4",
4
4
  "description": "react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,56 +0,0 @@
1
- def try_to_parse_react_native_package_json(node_modules_dir)
2
- react_native_package_json_path = File.join(node_modules_dir, 'react-native/package.json')
3
- if !File.exist?(react_native_package_json_path)
4
- return nil
5
- end
6
- return JSON.parse(File.read(react_native_package_json_path))
7
- end
8
-
9
- def find_config()
10
- result = {
11
- :react_native_version => nil,
12
- :react_native_minor_version => nil,
13
- :react_native_node_modules_dir => nil,
14
- :react_native_common_dir => nil,
15
- :react_native_audioapi_dir_from_pods_root => nil,
16
- }
17
-
18
- react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..')
19
- react_native_json = try_to_parse_react_native_package_json(react_native_node_modules_dir)
20
-
21
- if react_native_json == nil
22
- # user configuration, just in case
23
- node_modules_dir = ENV["REACT_NATIVE_NODE_MODULES_DIR"]
24
- react_native_json = try_to_parse_react_native_package_json(node_modules_dir)
25
- end
26
-
27
- if react_native_json == nil
28
- raise '[Audio API] Unable to recognize your `react-native` version. Please set environmental variable with `react-native` location: `export REACT_NATIVE_NODE_MODULES_DIR="<path to react-native>" && pod install`.'
29
- end
30
-
31
- result[:react_native_version] = react_native_json['version']
32
- result[:react_native_minor_version] = react_native_json['version'].split('.')[1].to_i
33
- if result[:react_native_minor_version] == 0 # nightly
34
- result[:react_native_minor_version] = 1000
35
- end
36
- result[:react_native_node_modules_dir] = File.expand_path(react_native_node_modules_dir)
37
-
38
- pods_root = Pod::Config.instance.project_pods_root
39
- react_native_common_dir_absolute = File.join(react_native_node_modules_dir, 'react-native', 'ReactCommon')
40
- react_native_common_dir_relative = Pathname.new(react_native_common_dir_absolute).relative_path_from(pods_root).to_s
41
- result[:react_native_common_dir] = react_native_common_dir_relative
42
-
43
- react_native_audioapi_dir_absolute = File.join(__dir__, '..')
44
- react_native_audioapi_dir_relative = Pathname.new(react_native_audioapi_dir_absolute).relative_path_from(pods_root).to_s
45
- result[:react_native_audioapi_dir_from_pods_root] = react_native_audioapi_dir_relative
46
-
47
- return result
48
- end
49
-
50
- def assert_minimal_react_native_version(config)
51
- # If you change the minimal React Native version remember to update Compatibility Table in docs
52
- minimalReactNativeVersion = 75
53
- if config[:react_native_minor_version] < minimalReactNativeVersion
54
- raise "[Audio API] Unsupported React Native version. Please use #{minimalReactNativeVersion} or newer."
55
- end
56
- end