Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: prefix resource bundles to prevent naming collisions #310

Merged
merged 3 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions PlayerUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ and display it as a SwiftUI view comprised of registered assets.

utils.source_files = 'ios/packages/test-utils-core/Sources/**/*'
Copy link
Contributor

Choose a reason for hiding this comment

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

i think the ReferenceAssets resource bundle on this file was missed?

utils.resource_bundles = {
'TestUtilities' => ['ios/packages/test-utils/Resources/**/*.js']
'PlayerUI_TestUtilities' => ['ios/packages/test-utils/Resources/**/*.js']
}
end

Expand All @@ -210,7 +210,7 @@ and display it as a SwiftUI view comprised of registered assets.

assets.source_files = 'ios/packages/reference-assets/Sources/**/*'
assets.resource_bundles = {
'ReferenceAssets' => [
'PlayerUI_ReferenceAssets' => [
'ios/packages/reference-assets/Resources/js/**/*.js',
'ios/packages/reference-assets/Resources/svg/*.xcassets',

Expand Down Expand Up @@ -238,7 +238,7 @@ and display it as a SwiftUI view comprised of registered assets.
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/AsyncNodePlugin/Sources/**/*'
plugin.resource_bundles = {
'AsyncNodePlugin' => ['ios/plugins/AsyncNodePlugin/Resources/**/*.js']
'PlayerUI_AsyncNodePlugin' => ['ios/plugins/AsyncNodePlugin/Resources/**/*.js']
}
end

Expand All @@ -257,7 +257,7 @@ and display it as a SwiftUI view comprised of registered assets.
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/BaseBeaconPlugin/Sources/**/*'
plugin.resource_bundles = {
'BaseBeaconPlugin' => ['ios/plugins/BaseBeaconPlugin/Resources/**/*.js']
'PlayerUI_BaseBeaconPlugin' => ['ios/plugins/BaseBeaconPlugin/Resources/**/*.js']
}
end

Expand All @@ -272,47 +272,47 @@ and display it as a SwiftUI view comprised of registered assets.
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/CheckPathPlugin/Sources/**/*'
plugin.resource_bundles = {
'CheckPathPlugin' => ['ios/plugins/CheckPathPlugin/Resources/**/*.js']
'PlayerUI_CheckPathPlugin' => ['ios/plugins/CheckPathPlugin/Resources/**/*.js']
}
end

s.subspec 'CommonTypesPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/CommonTypesPlugin/Sources/**/*'
plugin.resource_bundles = {
'CommonTypesPlugin' => ['ios/plugins/CommonTypesPlugin/Resources/**/*.js']
'PlayerUI_CommonTypesPlugin' => ['ios/plugins/CommonTypesPlugin/Resources/**/*.js']
}
end

s.subspec 'ComputedPropertiesPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/ComputedPropertiesPlugin/Sources/**/*'
plugin.resource_bundles = {
'ComputedPropertiesPlugin' => ['ios/plugins/ComputedPropertiesPlugin/Resources/**/*.js']
'PlayerUI_ComputedPropertiesPlugin' => ['ios/plugins/ComputedPropertiesPlugin/Resources/**/*.js']
}
end

s.subspec 'CommonExpressionsPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/CommonExpressionsPlugin/Sources/**/*'
plugin.resource_bundles = {
'CommonExpressionsPlugin' => ['ios/plugins/CommonExpressionsPlugin/Resources/**/*.js']
'PlayerUI_CommonExpressionsPlugin' => ['ios/plugins/CommonExpressionsPlugin/Resources/**/*.js']
}
end

s.subspec 'ExpressionPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/ExpressionPlugin/Sources/**/*'
plugin.resource_bundles = {
'ExpressionPlugin' => ['ios/plugins/ExpressionPlugin/Resources/**/*.js']
'PlayerUI_ExpressionPlugin' => ['ios/plugins/ExpressionPlugin/Resources/**/*.js']
}
end

s.subspec 'ExternalActionPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/ExternalActionPlugin/Sources/**/*'
plugin.resource_bundles = {
'ExternalActionPlugin' => ['ios/plugins/ExternalActionPlugin/Resources/**/*.js']
'PlayerUI_ExternalActionPlugin' => ['ios/plugins/ExternalActionPlugin/Resources/**/*.js']
}
end

Expand All @@ -328,23 +328,23 @@ and display it as a SwiftUI view comprised of registered assets.
plugin.dependency 'PlayerUI/SwiftUI'
plugin.source_files = 'ios/plugins/MetricsPlugin/Sources/**/*'
plugin.resource_bundles = {
'MetricsPlugin' => ['ios/plugins/MetricsPlugin/Resources/**/*.js']
'PlayerUI_MetricsPlugin' => ['ios/plugins/MetricsPlugin/Resources/**/*.js']
}
end

s.subspec 'PubSubPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/PubSubPlugin/Sources/**/*'
plugin.resource_bundles = {
'PubSubPlugin' => ['ios/plugins/PubSubPlugin/Resources/**/*.js']
'PlayerUI_PubSubPlugin' => ['ios/plugins/PubSubPlugin/Resources/**/*.js']
}
end

s.subspec 'StageRevertDataPlugin' do |plugin|
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/StageRevertDataPlugin/Sources/**/*'
plugin.resource_bundles = {
'StageRevertDataPlugin' => ['ios/plugins/StageRevertDataPlugin/Resources/**/*.js']
'PlayerUI_StageRevertDataPlugin' => ['ios/plugins/StageRevertDataPlugin/Resources/**/*.js']
}
end

Expand All @@ -365,7 +365,7 @@ and display it as a SwiftUI view comprised of registered assets.
plugin.dependency 'PlayerUI/Core'
plugin.source_files = 'ios/plugins/TypesProviderPlugin/Sources/**/*'
plugin.resource_bundles = {
'TypesProviderPlugin' => ['ios/plugins/TypesProviderPlugin/Resources/**/*.js']
'PlayerUI_TypesProviderPlugin' => ['ios/plugins/TypesProviderPlugin/Resources/**/*.js']
}
end
# </PLUGINS>
Expand Down
28 changes: 14 additions & 14 deletions generated.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -221,29 +221,29 @@ def PlayerUI(
"ios/plugins/TypesProviderPlugin/Sources/**/*.cpp",
]),
resource_bundles = {
"AsyncNodePlugin": glob(
"PlayerUI_AsyncNodePlugin": glob(
["ios/plugins/AsyncNodePlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"BaseBeaconPlugin": glob(
"PlayerUI_BaseBeaconPlugin": glob(
["ios/plugins/BaseBeaconPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"CheckPathPlugin": glob(
"PlayerUI_CheckPathPlugin": glob(
["ios/plugins/CheckPathPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"CommonExpressionsPlugin": glob(
"PlayerUI_CommonExpressionsPlugin": glob(
[
"ios/plugins/CommonExpressionsPlugin/Resources/**/*.js",
],
exclude_directories = 0,
),
"CommonTypesPlugin": glob(
"PlayerUI_CommonTypesPlugin": glob(
["ios/plugins/CommonTypesPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"ComputedPropertiesPlugin": glob(
"PlayerUI_ComputedPropertiesPlugin": glob(
[
"ios/plugins/ComputedPropertiesPlugin/Resources/**/*.js",
],
Expand All @@ -253,41 +253,41 @@ def PlayerUI(
["ios/packages/core/Resources/**/*.js"],
exclude_directories = 0,
),
"ExpressionPlugin": glob(
"PlayerUI_ExpressionPlugin": glob(
["ios/plugins/ExpressionPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"ExternalActionPlugin": glob(
"PlayerUI_ExternalActionPlugin": glob(
["ios/plugins/ExternalActionPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"MetricsPlugin": glob(
"PlayerUI_MetricsPlugin": glob(
["ios/plugins/MetricsPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"PubSubPlugin": glob(
"PlayerUI_PubSubPlugin": glob(
["ios/plugins/PubSubPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
"ReferenceAssets": glob(
"PlayerUI_ReferenceAssets": glob(
[
"ios/packages/reference-assets/Resources/js/**/*.js",
"ios/packages/reference-assets/Resources/svg/*.xcassets",
"ios/packages/reference-assets/Resources/svg/*.xcassets/**/*",
],
exclude_directories = 0,
),
"StageRevertDataPlugin": glob(
"PlayerUI_StageRevertDataPlugin": glob(
[
"ios/plugins/StageRevertDataPlugin/Resources/**/*.js",
],
exclude_directories = 0,
),
"TestUtilities": glob(
"PlayerUI_TestUtilities": glob(
["ios/packages/test-utils/Resources/**/*.js"],
exclude_directories = 0,
),
"TypesProviderPlugin": glob(
"PlayerUI_TypesProviderPlugin": glob(
["ios/plugins/TypesProviderPlugin/Resources/**/*.js"],
exclude_directories = 0,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public class ReferenceAssetsPlugin: JSBasePlugin, NativePlugin {
- returns: A URL if it exists in the bundle
*/
override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: ReferenceAssetsPlugin.self), pathComponent: "ReferenceAssets.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: ReferenceAssetsPlugin.self), pathComponent: "PlayerUI_ReferenceAssets.bundle")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension JSContext {
let url = ResourceUtilities.urlForFile(
name: "make-flow.prod",
ext: "js",
bundle: Bundle(for: MakeFlowResourceShim.self), pathComponent: "TestUtilities.bundle"),
bundle: Bundle(for: MakeFlowResourceShim.self), pathComponent: "PlayerUI_TestUtilities.bundle"),
let contents = try? String(contentsOf: url)
else { return }
evaluateScript(contents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class AsyncNodePlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: AsyncNodePlugin.self), pathComponent: "AsyncNodePlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: AsyncNodePlugin.self), pathComponent: "PlayerUI_AsyncNodePlugin.bundle")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ open class BaseBeaconPlugin<BeaconStruct: Decodable>: JSBasePlugin {
name: fileName,
ext: "js",
bundle: Bundle(for: BaseBeaconPlugin<DefaultBeacon>.self),
pathComponent: "BaseBeaconPlugin.bundle"
pathComponent: "PlayerUI_BaseBeaconPlugin.bundle"
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ open class BaseCheckPathPlugin: JSBasePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: BaseCheckPathPlugin.self), pathComponent: "CheckPathPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: BaseCheckPathPlugin.self), pathComponent: "PlayerUI_CheckPathPlugin.bundle")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class CommonExpressionsPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: CommonExpressionsPlugin.self), pathComponent: "CommonExpressionsPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: CommonExpressionsPlugin.self), pathComponent: "PlayerUI_CommonExpressionsPlugin.bundle")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class CommonTypesPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: CommonTypesPlugin.self), pathComponent: "CommonTypesPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: CommonTypesPlugin.self), pathComponent: "PlayerUI_CommonTypesPlugin.bundle")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ComputedPropertiesPlugin: JSBasePlugin, NativePlugin {
name: fileName,
ext: "js",
bundle: Bundle(for: ComputedPropertiesPlugin.self),
pathComponent: "ComputedPropertiesPlugin.bundle"
pathComponent: "PlayerUI_ComputedPropertiesPlugin.bundle"
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ExpressionPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: ExpressionPlugin.self), pathComponent: "ExpressionPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: ExpressionPlugin.self), pathComponent: "PlayerUI_ExpressionPlugin.bundle")
}

override public func getArguments() -> [Any] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ public class ExternalActionPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: ExternalActionPlugin.self), pathComponent: "ExternalActionPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: ExternalActionPlugin.self), pathComponent: "PlayerUI_ExternalActionPlugin.bundle")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ open class ExternalActionViewModifierPlugin<ModifierType: ExternalStateViewModif
ResourceUtilities.urlForFile(
name: fileName, ext: "js",
bundle: Bundle(for: ExternalActionPlugin.self),
pathComponent: "ExternalActionPlugin.bundle"
pathComponent: "PlayerUI_ExternalActionPlugin.bundle"
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ios/plugins/MetricsPlugin/Sources/MetricsPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RequestTimeWebPlugin: JSBasePlugin {
name: fileName,
ext: "js",
bundle: Bundle(for: MetricsPlugin.self),
pathComponent: "MetricsPlugin.bundle"
pathComponent: "PlayerUI_MetricsPlugin.bundle"
)
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ public class MetricsPlugin: JSBasePlugin, NativePlugin, WithSymbol {
name: fileName,
ext: "js",
bundle: Bundle(for: MetricsPlugin.self),
pathComponent: "MetricsPlugin.bundle"
pathComponent: "PlayerUI_MetricsPlugin.bundle"
)
}

Expand Down
2 changes: 1 addition & 1 deletion ios/plugins/PubSubPlugin/Sources/PubSubPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class PubSubPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: PubSubPlugin.self), pathComponent: "PubSubPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: PubSubPlugin.self), pathComponent: "PlayerUI_PubSubPlugin.bundle")
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class StageRevertDataPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: StageRevertDataPlugin.self), pathComponent: "StageRevertDataPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: StageRevertDataPlugin.self), pathComponent: "PlayerUI_StageRevertDataPlugin.bundle")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class TypesProviderPlugin: JSBasePlugin, NativePlugin {
}

override open func getUrlForFile(fileName: String) -> URL? {
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: TypesProviderPlugin.self), pathComponent: "TypesProviderPlugin.bundle")
ResourceUtilities.urlForFile(name: fileName, ext: "js", bundle: Bundle(for: TypesProviderPlugin.self), pathComponent: "PlayerUI_TypesProviderPlugin.bundle")
}

/**
Expand Down
Loading