brick-module 0.1.6 → 0.1.7

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.
@@ -25,6 +25,9 @@ Pod::Spec.new do |s|
25
25
  base_config = {
26
26
  "DEFINES_MODULE" => "YES",
27
27
  "SWIFT_VERSION" => "5.0",
28
+ "SWIFT_COMPILATION_MODE" => "wholemodule",
29
+ "SWIFT_INSTALL_OBJC_HEADER" => "YES",
30
+ "SWIFT_OBJC_INTERFACE_HEADER_NAME" => "BrickModule-Swift.h",
28
31
  "OTHER_SWIFT_FLAGS" => "-enable-experimental-feature AccessLevelOnImport"
29
32
  }
30
33
 
@@ -36,22 +39,17 @@ Pod::Spec.new do |s|
36
39
  else
37
40
  s.dependency "React-Core"
38
41
 
39
- # Don't install the dependencies when we run `pod install` in the old architecture.
40
- if ENV["RCT_NEW_ARCH_ENABLED"] == "1" then
41
42
  s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
42
43
  s.pod_target_xcconfig = base_config.merge({
43
44
  "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
44
45
  "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
45
46
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
46
47
  })
47
- s.dependency 'React'
48
+
48
49
  s.dependency "React-Codegen"
49
50
  s.dependency "RCT-Folly"
50
51
  s.dependency "RCTRequired"
51
52
  s.dependency "RCTTypeSafety"
52
53
  s.dependency "ReactCommon/turbomodule/core"
53
- else
54
- s.pod_target_xcconfig = base_config
55
- end
56
- end
57
- end
54
+ end
55
+ end
@@ -50,7 +50,8 @@ ext.findBrickJson = { startDir ->
50
50
  }
51
51
 
52
52
  try {
53
- def current = new File(startDir).canonicalFile
53
+ // startDir can be either a File or String, handle both
54
+ def current = startDir instanceof File ? startDir.canonicalFile : new File(startDir).canonicalFile
54
55
  def root = new File('/').canonicalFile
55
56
 
56
57
  while (current != root && current != null) {
@@ -65,7 +65,6 @@ android {
65
65
  defaultConfig {
66
66
  minSdkVersion getExtOrIntegerDefault("minSdkVersion")
67
67
  targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
68
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
69
68
  consumerProguardFiles 'proguard-rules.pro'
70
69
  buildConfigField "long", "BUILD_TIMESTAMP", "${System.currentTimeMillis()}L"
71
70
  }
@@ -39,8 +39,7 @@ class BrickModulePackage : TurboReactPackage() {
39
39
  val currentClassLoader = Thread.currentThread().contextClassLoader
40
40
  val generatedClass =
41
41
  Class.forName("com.brickmodule.BrickModule", true, currentClassLoader)
42
- val constructor =
43
- generatedClass.getConstructor(ReactContext::class.java)
42
+ val constructor = generatedClass.getConstructor(ReactContext::class.java)
44
43
  val instance = constructor.newInstance(reactContext) as NativeModule
45
44
  println(
46
45
  "✅ BrickModule successfully created with thread classloader: ${instance.javaClass.name}"
@@ -68,7 +67,7 @@ class BrickModulePackage : TurboReactPackage() {
68
67
  println("🔍 BrickModulePackage.getReactModuleInfoProvider called")
69
68
  val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
70
69
  // Force TurboModule to true since we're using NativeBrickModuleSpec
71
- val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
70
+ val isTurboModule: Boolean = true
72
71
  moduleInfos["BrickModule"] =
73
72
  ReactModuleInfo(
74
73
  "BrickModule",
@@ -82,6 +82,10 @@ const BrickModule = {
82
82
  getRegisteredModules,
83
83
  clearCache
84
84
  };
85
+ /**
86
+ * Default export for convenience
87
+ */
88
+ var BrickModule_default = BrickModule;
85
89
 
86
90
  //#endregion
87
- export { BrickModule as default };
91
+ export { BrickModule_default as default };
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import BrickModule from "./BrickModule.js";
1
+ import BrickModule_default from "./BrickModule.js";
2
2
 
3
3
  //#region src/index.ts
4
4
  /**
5
5
  * Error types for Brick modules
6
6
  */
7
7
  var BrickModuleError = class extends Error {
8
- constructor(message, code = "GRANITE_ERROR", moduleName, methodName) {
8
+ constructor(message, code = "BRICK_ERROR", moduleName, methodName) {
9
9
  super(message);
10
10
  this.code = code;
11
11
  this.moduleName = moduleName;
@@ -15,4 +15,4 @@ var BrickModuleError = class extends Error {
15
15
  };
16
16
 
17
17
  //#endregion
18
- export { BrickModule, BrickModuleError };
18
+ export { BrickModule_default as BrickModule, BrickModuleError };
@@ -1,18 +1,39 @@
1
1
  import Foundation
2
+ import React
2
3
 
3
- @objc public protocol BrickModuleRegistableViewControllerType {
4
- @objc var moduleRegistry: BrickModuleRegistry? { get }
5
- }
6
4
  /**
7
- * Minimal protocol that all Brick modules must implement
8
- * Contains only essential properties for module identification
5
+ * Base class for all Brick modules
6
+ * Provides common functionality including event emission
9
7
  */
10
- public protocol BrickModuleBase {
8
+ open class BrickModuleBase: NSObject {
11
9
  /// The name of the module (required for registration)
12
- var moduleName: String { get }
13
- var controller: BrickModuleRegistableViewControllerType { get set }
10
+ public let moduleName: String
11
+
12
+ public weak var eventEmitter: RCTEventEmitter?
13
+ public weak var bridgeProxy: RCTBridgeProxy?
14
+
15
+ /// Initialize with module name
16
+ public init(moduleName: String) {
17
+ self.moduleName = moduleName
18
+ super.init()
19
+ }
14
20
 
15
- init (controller: BrickModuleRegistableViewControllerType)
21
+ /// Sends an event with the given name and data
22
+ /// Automatically prefixes with module name and uses the registry's event emitter
23
+ public func sendEvent(_ eventName: String, data: [String: Any]?) {
24
+ // Format event name with module prefix
25
+ let fullEventName = "\(moduleName)_\(eventName)"
26
+
27
+ // Get the shared event emitter instance and send event
28
+ if let eventEmitter = self.eventEmitter {
29
+ eventEmitter.sendEvent(withName: fullEventName, body: data)
30
+ } else {
31
+ let error = NSError(domain: "BrickModule", code: 500, userInfo: [
32
+ NSLocalizedDescriptionKey: "Event emitter not available, cannot send event: \(fullEventName)"
33
+ ])
34
+ print("Error: \(error.localizedDescription)")
35
+ }
36
+ }
16
37
  }
17
38
 
18
39
  /**
@@ -0,0 +1,26 @@
1
+ //
2
+ // BrickModuleRegistrable.swift
3
+ // BrickModule
4
+ //
5
+ // Protocol for BrickModule registration - Swift-style naming convention
6
+ //
7
+
8
+ import UIKit
9
+ import React
10
+
11
+ /// Protocol for BrickModule registration and management
12
+ /// This matches Android's BrickModuleRegistrar interface with Swift naming conventions
13
+ public protocol BrickModuleRegistrable {
14
+
15
+ // MARK: - Module Registry Management
16
+
17
+ /// Module registry - property instead of getter method
18
+ /// This registry manages all registered BrickModules
19
+ var moduleRegistry: BrickModuleRegistry { get }
20
+
21
+ /// Register modules when bridge is ready - using 'on' parameter label
22
+ /// Called after didInitializeBridge to register BrickModules
23
+ func registerModules()
24
+
25
+
26
+ }
@@ -0,0 +1,5 @@
1
+ import UIKit
2
+
3
+ public protocol BrickModuleRegistrableViewController: AnyObject {
4
+ var moduleRegistry: BrickModuleRegistry { get }
5
+ }
@@ -1,15 +1,17 @@
1
1
  import Foundation
2
2
  import React
3
3
 
4
+
4
5
  /**
5
6
  * Central registry for all Brick modules
6
7
  * Manages module lifecycle and provides simple module storage
7
8
  */
8
9
  @objc public class BrickModuleRegistry: NSObject {
9
10
 
10
- private var modules: [String: Any] = [:]
11
+ private var modules: [String: BrickModuleBase] = [:]
11
12
  private var isRegistered: Bool = false
12
- public weak var eventEmitter: RCTEventEmitter?
13
+ private weak var eventEmitter: RCTEventEmitter?
14
+ private weak var bridgeProxy: RCTBridgeProxy?;
13
15
 
14
16
  public override init() {
15
17
  super.init()
@@ -23,9 +25,8 @@ import React
23
25
  * This should be called once during app initialization
24
26
  */
25
27
  public func register(_ modules: [BrickModuleBase]) {
26
- guard !isRegistered else {
27
- print("⚠️ BrickModuleRegistry: Modules already registered. Skipping re-registration.")
28
- return
28
+ if isRegistered {
29
+ print("♻️ BrickModuleRegistry: Re-registering modules. Existing modules may be overwritten.")
29
30
  }
30
31
 
31
32
  for module in modules {
@@ -34,10 +35,6 @@ import React
34
35
 
35
36
  isRegistered = true
36
37
  print("✅ BrickModuleRegistry: Successfully registered \(self.modules.count) modules")
37
-
38
- if ProcessInfo.processInfo.environment["GRANITE_DEBUG"] == "1" {
39
- debugPrintRegisteredModules()
40
- }
41
38
  }
42
39
 
43
40
  /**
@@ -49,7 +46,7 @@ import React
49
46
  public func registerModules(_ modules: NSArray) {
50
47
  let brickModules = modules.compactMap { $0 as? BrickModuleBase }
51
48
  register(brickModules)
52
- }
49
+ }
53
50
 
54
51
  private func registerSingleModule(_ module: BrickModuleBase) {
55
52
  let moduleName = module.moduleName
@@ -60,14 +57,10 @@ import React
60
57
  return
61
58
  }
62
59
 
63
- // Check for module name conflicts
64
- if modules.keys.contains(moduleName) {
65
- print("⚠️ BrickModuleRegistry: Module '\(moduleName)' is already registered. Skipping.")
66
- return
67
- }
68
-
69
60
  // Register the module
70
61
  modules[moduleName] = module
62
+ modules[moduleName]?.eventEmitter = self.eventEmitter;
63
+ modules[moduleName]?.bridgeProxy = self.bridgeProxy;
71
64
  print("📦 BrickModuleRegistry: Registered module '\(moduleName)'")
72
65
  }
73
66
 
@@ -81,6 +74,14 @@ import React
81
74
  return modules[moduleName]
82
75
  }
83
76
 
77
+
78
+ public func setBridge(_ bridge: Any) {
79
+ self.bridgeProxy = bridge as? RCTBridgeProxy;
80
+ for module in modules {
81
+ module.value.bridgeProxy = self.bridgeProxy;
82
+ }
83
+ }
84
+
84
85
  /**
85
86
  * Returns list of registered module names
86
87
  */
@@ -92,11 +93,13 @@ import React
92
93
 
93
94
  /**
94
95
  * Sets the React Native event emitter instance for event emission
95
- * This should be called during app initialization from the main BrickModule
96
+ * This should be called during app initialization frBrickModuleom the main BrickModule
96
97
  */
97
- @objc public func setEventEmitter(_ eventEmitter: RCTEventEmitter) {
98
- self.eventEmitter = eventEmitter
99
- print("📡 BrickModuleRegistry: Event emitter connected for event emission")
98
+ public func setEventEmitter(_ eventEmitter: Any) {
99
+ self.eventEmitter = eventEmitter as? RCTEventEmitter
100
+ for module in modules {
101
+ module.value.eventEmitter = self.eventEmitter
102
+ }
100
103
  }
101
104
 
102
105
  /**
@@ -106,36 +109,24 @@ import React
106
109
  @objc public func getEventEmitter() -> RCTEventEmitter? {
107
110
  return eventEmitter
108
111
  }
109
-
110
- // MARK: - Debug & Development
111
-
112
- private func debugPrintRegisteredModules() {
113
- print("🔍 BrickModuleRegistry Debug Info:")
114
- print(" Total Modules: \(modules.count)")
115
112
 
116
- for (moduleName, module) in modules.sorted(by: { $0.key < $1.key }) {
117
- let moduleType = String(describing: type(of: module))
118
- print(" 📦 \(moduleName) (\(moduleType))")
119
- }
113
+ /**
114
+ * Unregisters all modules and clears their registry references
115
+ */
116
+ @objc public func unregister() {
117
+ modules.removeAll()
118
+ isRegistered = false
120
119
  }
121
120
 
122
121
  /**
123
122
  * Clears all registered modules (for testing purposes only)
124
123
  */
125
124
  @objc public func clearRegistry() {
126
- guard ProcessInfo.processInfo.environment["NODE_ENV"] == "test" ||
127
- ProcessInfo.processInfo.environment["GRANITE_ALLOW_CLEAR"] == "1" else {
128
- print("⚠️ BrickModuleRegistry: clearRegistry() is only allowed in test environment")
129
- return
130
- }
131
-
132
- modules.removeAll()
133
- isRegistered = false
134
-
135
- print("🧹 BrickModuleRegistry: Registry cleared")
125
+ unregister()
136
126
  }
137
127
  }
138
128
 
139
129
  public class ModuleRegistry {
140
130
 
141
131
  }
132
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brick-module",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Better React Native native module development",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -16,8 +16,19 @@
16
16
  },
17
17
  "files": [
18
18
  "dist/",
19
- "ios/",
20
- "android/",
19
+ "ios",
20
+ "android",
21
+ "react-native.config.js",
22
+ "!ios/build",
23
+ "!android/build",
24
+ "!android/gradle",
25
+ "!android/gradlew",
26
+ "!android/gradlew.bat",
27
+ "!android/local.properties",
28
+ "!**/__tests__",
29
+ "!**/__fixtures__",
30
+ "!**/__mocks__",
31
+ "!**/.*",
21
32
  "src/",
22
33
  "bin/",
23
34
  "BrickModule.podspec",
@@ -51,7 +62,7 @@
51
62
  "brick-codegen": "./bin/brick-codegen.js"
52
63
  },
53
64
  "dependencies": {
54
- "brick-codegen": "0.1.6"
65
+ "brick-codegen": "0.1.7"
55
66
  },
56
67
  "peerDependencies": {
57
68
  "react": ">=18.2.0",
package/podfile_helper.rb CHANGED
@@ -82,9 +82,6 @@ def use_brick_modules!
82
82
  discovered_modules = []
83
83
 
84
84
  begin
85
- # Discover Brick modules before running codegen
86
- discovered_modules = discover_brick_modules(brick_root)
87
-
88
85
  # Run brick-codegen with real-time output and colors (iOS only)
89
86
  exit_status = system("cd #{brick_root} && FORCE_COLOR=1 npx brick-codegen --platform ios")
90
87
 
@@ -95,9 +92,15 @@ def use_brick_modules!
95
92
  # Get iOS output path from brick.json if it exists
96
93
  ios_brick_path = get_brick_ios_path(brick_root)
97
94
 
95
+ # Handle relative vs absolute paths
96
+ if Pathname.new(ios_brick_path).absolute?
97
+ brick_codegen_pod_path = ios_brick_path
98
+ else
99
+ brick_codegen_pod_path = File.expand_path(File.join(brick_root, ios_brick_path))
100
+ end
101
+
98
102
  # Add generated BrickCodegen pod if it exists
99
- brick_codegen_podspec_path = "#{brick_root}/#{ios_brick_path}/BrickCodegen.podspec"
100
- brick_codegen_pod_path = "#{brick_root}/#{ios_brick_path}"
103
+ brick_codegen_podspec_path = File.join(brick_codegen_pod_path, "BrickCodegen.podspec")
101
104
 
102
105
  if File.exist?(brick_codegen_podspec_path)
103
106
  begin
@@ -180,13 +183,6 @@ def get_brick_ios_path(project_root)
180
183
  begin
181
184
  config = JSON.parse(File.read(brick_config_path))
182
185
 
183
- # Get the effective project root
184
- effective_root = project_root
185
- if config['projectRoot']
186
- resolved_root = resolve_project_root(config['projectRoot'], File.dirname(brick_config_path))
187
- effective_root = resolved_root if resolved_root
188
- end
189
-
190
186
  ios_path = config.dig('output', 'ios')
191
187
  if ios_path && !ios_path.empty?
192
188
  # Handle absolute paths (though not recommended)
@@ -194,8 +190,8 @@ def get_brick_ios_path(project_root)
194
190
  Pod::UI.warn "[Brick] Using absolute path for iOS output is not recommended: #{ios_path}"
195
191
  return ios_path
196
192
  else
197
- # Relative to effective project root
198
- return File.join(effective_root, ios_path)
193
+ # Relative to brick.json location, not project root
194
+ return File.expand_path(File.join(File.dirname(brick_config_path), ios_path))
199
195
  end
200
196
  end
201
197
  rescue => e
@@ -203,8 +199,8 @@ def get_brick_ios_path(project_root)
203
199
  end
204
200
  end
205
201
 
206
- # Return default path relative to project root
207
- return File.join(project_root, 'ios/.brick')
202
+ # Return default path - just the relative path, caller will resolve it
203
+ return 'ios/.brick'
208
204
  end
209
205
 
210
206
  def generate_brick_module_provider(project_root, modules)
@@ -213,8 +209,14 @@ def generate_brick_module_provider(project_root, modules)
213
209
  # Get iOS output path from brick.json
214
210
  ios_brick_path = get_brick_ios_path(project_root)
215
211
 
212
+ # Handle relative vs absolute paths
213
+ if Pathname.new(ios_brick_path).absolute?
214
+ brick_dir = ios_brick_path
215
+ else
216
+ brick_dir = File.expand_path(File.join(project_root, ios_brick_path))
217
+ end
218
+
216
219
  # Create the brick directory if it doesn't exist
217
- brick_dir = File.join(project_root, ios_brick_path)
218
220
  FileUtils.mkdir_p(brick_dir) unless File.exist?(brick_dir)
219
221
 
220
222
  # Generate imports and module instances
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ export { default as BrickModule } from "./BrickModule";
10
10
  export class BrickModuleError extends Error {
11
11
  constructor(
12
12
  message: string,
13
- public code: string = "GRANITE_ERROR",
13
+ public code: string = "BRICK_ERROR",
14
14
  public moduleName?: string,
15
15
  public methodName?: string
16
16
  ) {
@@ -1,14 +0,0 @@
1
- # Dummy CMakeLists.txt for React Native autolinking
2
- # This file is required by React Native's autolinking system
3
- # The actual TurboModule implementation is handled by brick-codegen in user projects
4
- cmake_minimum_required(VERSION 3.13)
5
- set(CMAKE_VERBOSE_MAKEFILE on)
6
-
7
- # Create a dummy source file
8
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "// Dummy file for BrickModuleSpec\n")
9
-
10
- # Create an empty static library to satisfy React Native's build system
11
- add_library(react_codegen_BrickModuleSpec STATIC ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
12
-
13
- # Set necessary properties
14
- target_include_directories(react_codegen_BrickModuleSpec PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
@@ -1,7 +0,0 @@
1
- distributionBase=GRADLE_USER_HOME
2
- distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4
- networkTimeout=10000
5
- validateDistributionUrl=true
6
- zipStoreBase=GRADLE_USER_HOME
7
- zipStorePath=wrapper/dists
package/android/gradlew DELETED
@@ -1,252 +0,0 @@
1
- #!/bin/sh
2
-
3
- #
4
- # Copyright © 2015-2021 the original authors.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # https://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- # SPDX-License-Identifier: Apache-2.0
19
- #
20
-
21
- ##############################################################################
22
- #
23
- # Gradle start up script for POSIX generated by Gradle.
24
- #
25
- # Important for running:
26
- #
27
- # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28
- # noncompliant, but you have some other compliant shell such as ksh or
29
- # bash, then to run this script, type that shell name before the whole
30
- # command line, like:
31
- #
32
- # ksh Gradle
33
- #
34
- # Busybox and similar reduced shells will NOT work, because this script
35
- # requires all of these POSIX shell features:
36
- # * functions;
37
- # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38
- # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39
- # * compound commands having a testable exit status, especially «case»;
40
- # * various built-in commands including «command», «set», and «ulimit».
41
- #
42
- # Important for patching:
43
- #
44
- # (2) This script targets any POSIX shell, so it avoids extensions provided
45
- # by Bash, Ksh, etc; in particular arrays are avoided.
46
- #
47
- # The "traditional" practice of packing multiple parameters into a
48
- # space-separated string is a well documented source of bugs and security
49
- # problems, so this is (mostly) avoided, by progressively accumulating
50
- # options in "$@", and eventually passing that to Java.
51
- #
52
- # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53
- # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54
- # see the in-line comments for details.
55
- #
56
- # There are tweaks for specific operating systems such as AIX, CygWin,
57
- # Darwin, MinGW, and NonStop.
58
- #
59
- # (3) This script is generated from the Groovy template
60
- # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61
- # within the Gradle project.
62
- #
63
- # You can find Gradle at https://github.com/gradle/gradle/.
64
- #
65
- ##############################################################################
66
-
67
- # Attempt to set APP_HOME
68
-
69
- # Resolve links: $0 may be a link
70
- app_path=$0
71
-
72
- # Need this for daisy-chained symlinks.
73
- while
74
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75
- [ -h "$app_path" ]
76
- do
77
- ls=$( ls -ld "$app_path" )
78
- link=${ls#*' -> '}
79
- case $link in #(
80
- /*) app_path=$link ;; #(
81
- *) app_path=$APP_HOME$link ;;
82
- esac
83
- done
84
-
85
- # This is normally unused
86
- # shellcheck disable=SC2034
87
- APP_BASE_NAME=${0##*/}
88
- # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89
- APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90
- ' "$PWD" ) || exit
91
-
92
- # Use the maximum available, or set MAX_FD != -1 to use that value.
93
- MAX_FD=maximum
94
-
95
- warn () {
96
- echo "$*"
97
- } >&2
98
-
99
- die () {
100
- echo
101
- echo "$*"
102
- echo
103
- exit 1
104
- } >&2
105
-
106
- # OS specific support (must be 'true' or 'false').
107
- cygwin=false
108
- msys=false
109
- darwin=false
110
- nonstop=false
111
- case "$( uname )" in #(
112
- CYGWIN* ) cygwin=true ;; #(
113
- Darwin* ) darwin=true ;; #(
114
- MSYS* | MINGW* ) msys=true ;; #(
115
- NONSTOP* ) nonstop=true ;;
116
- esac
117
-
118
- CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
119
-
120
-
121
- # Determine the Java command to use to start the JVM.
122
- if [ -n "$JAVA_HOME" ] ; then
123
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
124
- # IBM's JDK on AIX uses strange locations for the executables
125
- JAVACMD=$JAVA_HOME/jre/sh/java
126
- else
127
- JAVACMD=$JAVA_HOME/bin/java
128
- fi
129
- if [ ! -x "$JAVACMD" ] ; then
130
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
131
-
132
- Please set the JAVA_HOME variable in your environment to match the
133
- location of your Java installation."
134
- fi
135
- else
136
- JAVACMD=java
137
- if ! command -v java >/dev/null 2>&1
138
- then
139
- die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
140
-
141
- Please set the JAVA_HOME variable in your environment to match the
142
- location of your Java installation."
143
- fi
144
- fi
145
-
146
- # Increase the maximum file descriptors if we can.
147
- if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
148
- case $MAX_FD in #(
149
- max*)
150
- # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
151
- # shellcheck disable=SC2039,SC3045
152
- MAX_FD=$( ulimit -H -n ) ||
153
- warn "Could not query maximum file descriptor limit"
154
- esac
155
- case $MAX_FD in #(
156
- '' | soft) :;; #(
157
- *)
158
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
159
- # shellcheck disable=SC2039,SC3045
160
- ulimit -n "$MAX_FD" ||
161
- warn "Could not set maximum file descriptor limit to $MAX_FD"
162
- esac
163
- fi
164
-
165
- # Collect all arguments for the java command, stacking in reverse order:
166
- # * args from the command line
167
- # * the main class name
168
- # * -classpath
169
- # * -D...appname settings
170
- # * --module-path (only if needed)
171
- # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
172
-
173
- # For Cygwin or MSYS, switch paths to Windows format before running java
174
- if "$cygwin" || "$msys" ; then
175
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
176
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
177
-
178
- JAVACMD=$( cygpath --unix "$JAVACMD" )
179
-
180
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
181
- for arg do
182
- if
183
- case $arg in #(
184
- -*) false ;; # don't mess with options #(
185
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
186
- [ -e "$t" ] ;; #(
187
- *) false ;;
188
- esac
189
- then
190
- arg=$( cygpath --path --ignore --mixed "$arg" )
191
- fi
192
- # Roll the args list around exactly as many times as the number of
193
- # args, so each arg winds up back in the position where it started, but
194
- # possibly modified.
195
- #
196
- # NB: a `for` loop captures its iteration list before it begins, so
197
- # changing the positional parameters here affects neither the number of
198
- # iterations, nor the values presented in `arg`.
199
- shift # remove old arg
200
- set -- "$@" "$arg" # push replacement arg
201
- done
202
- fi
203
-
204
-
205
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
206
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207
-
208
- # Collect all arguments for the java command:
209
- # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210
- # and any embedded shellness will be escaped.
211
- # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212
- # treated as '${Hostname}' itself on the command line.
213
-
214
- set -- \
215
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
216
- -classpath "$CLASSPATH" \
217
- org.gradle.wrapper.GradleWrapperMain \
218
- "$@"
219
-
220
- # Stop when "xargs" is not available.
221
- if ! command -v xargs >/dev/null 2>&1
222
- then
223
- die "xargs is not available"
224
- fi
225
-
226
- # Use "xargs" to parse quoted args.
227
- #
228
- # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
229
- #
230
- # In Bash we could simply go:
231
- #
232
- # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
233
- # set -- "${ARGS[@]}" "$@"
234
- #
235
- # but POSIX shell has neither arrays nor command substitution, so instead we
236
- # post-process each arg (as a line of input to sed) to backslash-escape any
237
- # character that might be a shell metacharacter, then use eval to reverse
238
- # that process (while maintaining the separation between arguments), and wrap
239
- # the whole thing up as a single "set" statement.
240
- #
241
- # This will of course break if any of these variables contains a newline or
242
- # an unmatched quote.
243
- #
244
-
245
- eval "set -- $(
246
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
247
- xargs -n1 |
248
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
249
- tr '\n' ' '
250
- )" '"$@"'
251
-
252
- exec "$JAVACMD" "$@"
@@ -1,94 +0,0 @@
1
- @rem
2
- @rem Copyright 2015 the original author or authors.
3
- @rem
4
- @rem Licensed under the Apache License, Version 2.0 (the "License");
5
- @rem you may not use this file except in compliance with the License.
6
- @rem You may obtain a copy of the License at
7
- @rem
8
- @rem https://www.apache.org/licenses/LICENSE-2.0
9
- @rem
10
- @rem Unless required by applicable law or agreed to in writing, software
11
- @rem distributed under the License is distributed on an "AS IS" BASIS,
12
- @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- @rem See the License for the specific language governing permissions and
14
- @rem limitations under the License.
15
- @rem
16
- @rem SPDX-License-Identifier: Apache-2.0
17
- @rem
18
-
19
- @if "%DEBUG%"=="" @echo off
20
- @rem ##########################################################################
21
- @rem
22
- @rem Gradle startup script for Windows
23
- @rem
24
- @rem ##########################################################################
25
-
26
- @rem Set local scope for the variables with windows NT shell
27
- if "%OS%"=="Windows_NT" setlocal
28
-
29
- set DIRNAME=%~dp0
30
- if "%DIRNAME%"=="" set DIRNAME=.
31
- @rem This is normally unused
32
- set APP_BASE_NAME=%~n0
33
- set APP_HOME=%DIRNAME%
34
-
35
- @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36
- for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37
-
38
- @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39
- set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40
-
41
- @rem Find java.exe
42
- if defined JAVA_HOME goto findJavaFromJavaHome
43
-
44
- set JAVA_EXE=java.exe
45
- %JAVA_EXE% -version >NUL 2>&1
46
- if %ERRORLEVEL% equ 0 goto execute
47
-
48
- echo. 1>&2
49
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50
- echo. 1>&2
51
- echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52
- echo location of your Java installation. 1>&2
53
-
54
- goto fail
55
-
56
- :findJavaFromJavaHome
57
- set JAVA_HOME=%JAVA_HOME:"=%
58
- set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59
-
60
- if exist "%JAVA_EXE%" goto execute
61
-
62
- echo. 1>&2
63
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64
- echo. 1>&2
65
- echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66
- echo location of your Java installation. 1>&2
67
-
68
- goto fail
69
-
70
- :execute
71
- @rem Setup the command line
72
-
73
- set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
74
-
75
-
76
- @rem Execute Gradle
77
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
78
-
79
- :end
80
- @rem End local scope for the variables with windows NT shell
81
- if %ERRORLEVEL% equ 0 goto mainEnd
82
-
83
- :fail
84
- rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85
- rem the _cmd.exe /c_ return code!
86
- set EXIT_CODE=%ERRORLEVEL%
87
- if %EXIT_CODE% equ 0 set EXIT_CODE=1
88
- if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89
- exit /b %EXIT_CODE%
90
-
91
- :mainEnd
92
- if "%OS%"=="Windows_NT" endlocal
93
-
94
- :omega
@@ -1,341 +0,0 @@
1
- // Generated by Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
2
- #ifndef BRICKMODULE_SWIFT_H
3
- #define BRICKMODULE_SWIFT_H
4
- #pragma clang diagnostic push
5
- #pragma clang diagnostic ignored "-Wgcc-compat"
6
-
7
- #if !defined(__has_include)
8
- # define __has_include(x) 0
9
- #endif
10
- #if !defined(__has_attribute)
11
- # define __has_attribute(x) 0
12
- #endif
13
- #if !defined(__has_feature)
14
- # define __has_feature(x) 0
15
- #endif
16
- #if !defined(__has_warning)
17
- # define __has_warning(x) 0
18
- #endif
19
-
20
- #if __has_include(<swift/objc-prologue.h>)
21
- # include <swift/objc-prologue.h>
22
- #endif
23
-
24
- #pragma clang diagnostic ignored "-Wauto-import"
25
- #if defined(__OBJC__)
26
- #include <Foundation/Foundation.h>
27
- #endif
28
- #if defined(__cplusplus)
29
- #include <cstdint>
30
- #include <cstddef>
31
- #include <cstdbool>
32
- #include <cstring>
33
- #include <stdlib.h>
34
- #include <new>
35
- #include <type_traits>
36
- #else
37
- #include <stdint.h>
38
- #include <stddef.h>
39
- #include <stdbool.h>
40
- #include <string.h>
41
- #endif
42
- #if defined(__cplusplus)
43
- #pragma clang diagnostic push
44
- #pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
45
- #if defined(__arm64e__) && __has_include(<ptrauth.h>)
46
- # include <ptrauth.h>
47
- #else
48
- #pragma clang diagnostic push
49
- #pragma clang diagnostic ignored "-Wreserved-macro-identifier"
50
- # ifndef __ptrauth_swift_value_witness_function_pointer
51
- # define __ptrauth_swift_value_witness_function_pointer(x)
52
- # endif
53
- # ifndef __ptrauth_swift_class_method_pointer
54
- # define __ptrauth_swift_class_method_pointer(x)
55
- # endif
56
- #pragma clang diagnostic pop
57
- #endif
58
- #pragma clang diagnostic pop
59
- #endif
60
-
61
- #if !defined(SWIFT_TYPEDEFS)
62
- # define SWIFT_TYPEDEFS 1
63
- # if __has_include(<uchar.h>)
64
- # include <uchar.h>
65
- # elif !defined(__cplusplus)
66
- typedef uint_least16_t char16_t;
67
- typedef uint_least32_t char32_t;
68
- # endif
69
- typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
70
- typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
71
- typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
72
- typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
73
- typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
74
- typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
75
- typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
76
- typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
77
- typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
78
- typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
79
- typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
80
- typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
81
- #endif
82
-
83
- #if !defined(SWIFT_PASTE)
84
- # define SWIFT_PASTE_HELPER(x, y) x##y
85
- # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
86
- #endif
87
- #if !defined(SWIFT_METATYPE)
88
- # define SWIFT_METATYPE(X) Class
89
- #endif
90
- #if !defined(SWIFT_CLASS_PROPERTY)
91
- # if __has_feature(objc_class_property)
92
- # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
93
- # else
94
- # define SWIFT_CLASS_PROPERTY(...)
95
- # endif
96
- #endif
97
- #if !defined(SWIFT_RUNTIME_NAME)
98
- # if __has_attribute(objc_runtime_name)
99
- # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
100
- # else
101
- # define SWIFT_RUNTIME_NAME(X)
102
- # endif
103
- #endif
104
- #if !defined(SWIFT_COMPILE_NAME)
105
- # if __has_attribute(swift_name)
106
- # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
107
- # else
108
- # define SWIFT_COMPILE_NAME(X)
109
- # endif
110
- #endif
111
- #if !defined(SWIFT_METHOD_FAMILY)
112
- # if __has_attribute(objc_method_family)
113
- # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
114
- # else
115
- # define SWIFT_METHOD_FAMILY(X)
116
- # endif
117
- #endif
118
- #if !defined(SWIFT_NOESCAPE)
119
- # if __has_attribute(noescape)
120
- # define SWIFT_NOESCAPE __attribute__((noescape))
121
- # else
122
- # define SWIFT_NOESCAPE
123
- # endif
124
- #endif
125
- #if !defined(SWIFT_RELEASES_ARGUMENT)
126
- # if __has_attribute(ns_consumed)
127
- # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
128
- # else
129
- # define SWIFT_RELEASES_ARGUMENT
130
- # endif
131
- #endif
132
- #if !defined(SWIFT_WARN_UNUSED_RESULT)
133
- # if __has_attribute(warn_unused_result)
134
- # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
135
- # else
136
- # define SWIFT_WARN_UNUSED_RESULT
137
- # endif
138
- #endif
139
- #if !defined(SWIFT_NORETURN)
140
- # if __has_attribute(noreturn)
141
- # define SWIFT_NORETURN __attribute__((noreturn))
142
- # else
143
- # define SWIFT_NORETURN
144
- # endif
145
- #endif
146
- #if !defined(SWIFT_CLASS_EXTRA)
147
- # define SWIFT_CLASS_EXTRA
148
- #endif
149
- #if !defined(SWIFT_PROTOCOL_EXTRA)
150
- # define SWIFT_PROTOCOL_EXTRA
151
- #endif
152
- #if !defined(SWIFT_ENUM_EXTRA)
153
- # define SWIFT_ENUM_EXTRA
154
- #endif
155
- #if !defined(SWIFT_CLASS)
156
- # if __has_attribute(objc_subclassing_restricted)
157
- # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
158
- # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
159
- # else
160
- # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
161
- # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
162
- # endif
163
- #endif
164
- #if !defined(SWIFT_RESILIENT_CLASS)
165
- # if __has_attribute(objc_class_stub)
166
- # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
167
- # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
168
- # else
169
- # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
170
- # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
171
- # endif
172
- #endif
173
- #if !defined(SWIFT_PROTOCOL)
174
- # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
175
- # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
176
- #endif
177
- #if !defined(SWIFT_EXTENSION)
178
- # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
179
- #endif
180
- #if !defined(OBJC_DESIGNATED_INITIALIZER)
181
- # if __has_attribute(objc_designated_initializer)
182
- # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
183
- # else
184
- # define OBJC_DESIGNATED_INITIALIZER
185
- # endif
186
- #endif
187
- #if !defined(SWIFT_ENUM_ATTR)
188
- # if __has_attribute(enum_extensibility)
189
- # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
190
- # else
191
- # define SWIFT_ENUM_ATTR(_extensibility)
192
- # endif
193
- #endif
194
- #if !defined(SWIFT_ENUM)
195
- # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
196
- # if __has_feature(generalized_swift_name)
197
- # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
198
- # else
199
- # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
200
- # endif
201
- #endif
202
- #if !defined(SWIFT_UNAVAILABLE)
203
- # define SWIFT_UNAVAILABLE __attribute__((unavailable))
204
- #endif
205
- #if !defined(SWIFT_UNAVAILABLE_MSG)
206
- # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
207
- #endif
208
- #if !defined(SWIFT_AVAILABILITY)
209
- # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
210
- #endif
211
- #if !defined(SWIFT_WEAK_IMPORT)
212
- # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
213
- #endif
214
- #if !defined(SWIFT_DEPRECATED)
215
- # define SWIFT_DEPRECATED __attribute__((deprecated))
216
- #endif
217
- #if !defined(SWIFT_DEPRECATED_MSG)
218
- # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
219
- #endif
220
- #if !defined(SWIFT_DEPRECATED_OBJC)
221
- # if __has_feature(attribute_diagnose_if_objc)
222
- # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
223
- # else
224
- # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
225
- # endif
226
- #endif
227
- #if defined(__OBJC__)
228
- #if !defined(IBSegueAction)
229
- # define IBSegueAction
230
- #endif
231
- #endif
232
- #if !defined(SWIFT_EXTERN)
233
- # if defined(__cplusplus)
234
- # define SWIFT_EXTERN extern "C"
235
- # else
236
- # define SWIFT_EXTERN extern
237
- # endif
238
- #endif
239
- #if !defined(SWIFT_CALL)
240
- # define SWIFT_CALL __attribute__((swiftcall))
241
- #endif
242
- #if !defined(SWIFT_INDIRECT_RESULT)
243
- # define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
244
- #endif
245
- #if !defined(SWIFT_CONTEXT)
246
- # define SWIFT_CONTEXT __attribute__((swift_context))
247
- #endif
248
- #if !defined(SWIFT_ERROR_RESULT)
249
- # define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
250
- #endif
251
- #if defined(__cplusplus)
252
- # define SWIFT_NOEXCEPT noexcept
253
- #else
254
- # define SWIFT_NOEXCEPT
255
- #endif
256
- #if !defined(SWIFT_C_INLINE_THUNK)
257
- # if __has_attribute(always_inline)
258
- # if __has_attribute(nodebug)
259
- # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
260
- # else
261
- # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
262
- # endif
263
- # else
264
- # define SWIFT_C_INLINE_THUNK inline
265
- # endif
266
- #endif
267
- #if defined(_WIN32)
268
- #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
269
- # define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
270
- #endif
271
- #else
272
- #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
273
- # define SWIFT_IMPORT_STDLIB_SYMBOL
274
- #endif
275
- #endif
276
- #if defined(__OBJC__)
277
- #if __has_feature(objc_modules)
278
- #if __has_warning("-Watimport-in-framework-header")
279
- #pragma clang diagnostic ignored "-Watimport-in-framework-header"
280
- #endif
281
- @import Foundation;
282
- @import ObjectiveC;
283
- #endif
284
-
285
- #endif
286
- #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
287
- #pragma clang diagnostic ignored "-Wduplicate-method-arg"
288
- #if __has_warning("-Wpragma-clang-attribute")
289
- # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
290
- #endif
291
- #pragma clang diagnostic ignored "-Wunknown-pragmas"
292
- #pragma clang diagnostic ignored "-Wnullability"
293
- #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
294
- #pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
295
-
296
- #if __has_attribute(external_source_symbol)
297
- # pragma push_macro("any")
298
- # undef any
299
- # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="BrickModule",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
300
- # pragma pop_macro("any")
301
- #endif
302
-
303
- #if defined(__OBJC__)
304
- @class NSArray;
305
- @class NSString;
306
- @class RCTEventEmitter;
307
- @class RCTBridge;
308
-
309
- /// Central registry for all Brick modules
310
- /// Manages module lifecycle and provides simple module storage
311
- SWIFT_CLASS("_TtC11BrickModule19BrickModuleRegistry")
312
- @interface BrickModuleRegistry : NSObject
313
- @property (nonatomic, weak) RCTBridge * _Nullable bridge;
314
- //SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) BrickModuleRegistry * _Nonnull shared;)
315
- + (BrickModuleRegistry * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
316
- - (nonnull instancetype)init SWIFT_UNAVAILABLE;
317
- + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
318
- /// Registers an array of Brick modules (Objective-C API)
319
- /// Each module must implement BrickModuleBase protocol
320
- /// This should be called once during app initialization
321
- - (void)registerModules:(NSArray * _Nonnull)modules;
322
- /// Returns list of registered module names
323
- - (NSArray<NSString *> * _Nonnull)getRegisteredModules SWIFT_WARN_UNUSED_RESULT;
324
- /// Sets the React Native event emitter instance for event emission
325
- /// This should be called during app initialization from the main BrickModule
326
- - (void)setEventEmitter:(RCTEventEmitter * _Nonnull)eventEmitter;
327
- /// Returns the React Native event emitter instance for event emission
328
- /// Used by generated module code to emit events to JavaScript
329
- - (RCTEventEmitter * _Nullable)getEventEmitter SWIFT_WARN_UNUSED_RESULT;
330
- /// Clears all registered modules (for testing purposes only)
331
- - (void)clearRegistry;
332
- @end
333
-
334
- #endif
335
- #if __has_attribute(external_source_symbol)
336
- # pragma clang attribute pop
337
- #endif
338
- #if defined(__cplusplus)
339
- #endif
340
- #pragma clang diagnostic pop
341
- #endif