Skip to content
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
2 changes: 1 addition & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 20 additions & 19 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ if libraryEvolutionCondition {

// MARK: - Targets

let openGraphTarget = Target.target(
let openAttributeGraphTarget = Target.target(
name: "OpenAttributeGraph",
dependencies: ["OpenAttributeGraphCxx"],
cSettings: sharedCSettings,
Expand All @@ -144,7 +144,7 @@ let openGraphTarget = Target.target(
// FIXME: Merge into one target
// OpenAttributeGraph is a C++ & Swift mix target.
// The SwiftPM support for such usage is still in progress.
let openGraphSPITarget = Target.target(
let openAttributeGraphSPITarget = Target.target(
name: "OpenAttributeGraphCxx",
cSettings: sharedCSettings + [
.define("__COREFOUNDATION_FORSWIFTFOUNDATIONONLY__", to: "1", .when(platforms: .nonDarwinPlatforms)),
Expand All @@ -153,15 +153,15 @@ let openGraphSPITarget = Target.target(
.linkedLibrary("z"),
]
)
let openGraphShimsTarget = Target.target(
let openAttributeGraphShimsTarget = Target.target(
name: "OpenAttributeGraphShims",
cSettings: sharedCSettings,
swiftSettings: sharedSwiftSettings
)

// MARK: - Test Targets

let openGraphTestsTarget = Target.testTarget(
let openAttributeGraphTestsTarget = Target.testTarget(
name: "OpenAttributeGraphTests",
dependencies: [
"OpenAttributeGraph",
Expand All @@ -170,15 +170,16 @@ let openGraphTestsTarget = Target.testTarget(
cSettings: sharedCSettings,
swiftSettings: sharedSwiftSettings
)
let openGraphCxxTestsTarget = Target.testTarget(
let openAttributeGraphCxxTestsTarget = Target.testTarget(
name: "OpenAttributeGraphCxxTests",
dependencies: [
"OpenAttributeGraphCxx",
],
exclude: ["README.md"],
cSettings: sharedCSettings + [.define("SWIFT_TESTING")],
swiftSettings: sharedSwiftSettings + [.interoperabilityMode(.Cxx)]
)
let openGraphShimsTestsTarget = Target.testTarget(
let openAttributeGraphShimsTestsTarget = Target.testTarget(
name: "OpenAttributeGraphShimsTests",
dependencies: [
"OpenAttributeGraphShims",
Expand All @@ -187,7 +188,7 @@ let openGraphShimsTestsTarget = Target.testTarget(
cSettings: sharedCSettings,
swiftSettings: sharedSwiftSettings
)
let openGraphCompatibilityTestsTarget = Target.testTarget(
let openAttributeGraphCompatibilityTestsTarget = Target.testTarget(
name: "OpenAttributeGraphCompatibilityTests",
dependencies: [
.product(name: "Numerics", package: "swift-numerics"),
Expand All @@ -209,14 +210,14 @@ let package = Package(
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.2"),
],
targets: [
openGraphTarget,
openGraphSPITarget,
openGraphShimsTarget,

openGraphTestsTarget,
openGraphCxxTestsTarget,
openGraphShimsTestsTarget,
openGraphCompatibilityTestsTarget,
openAttributeGraphTarget,
openAttributeGraphSPITarget,
openAttributeGraphShimsTarget,

openAttributeGraphTestsTarget,
openAttributeGraphCxxTestsTarget,
openAttributeGraphShimsTestsTarget,
openAttributeGraphCompatibilityTestsTarget,
],
cxxLanguageStandard: .cxx20
)
Expand Down Expand Up @@ -253,7 +254,7 @@ if attributeGraphCondition {
privateFrameworkRepo = Package.Dependency.package(url: "https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git", branch: "main")
}
package.dependencies.append(privateFrameworkRepo)
openGraphShimsTarget.addAGSettings()
openAttributeGraphShimsTarget.addAGSettings()

let agVersion = Context.environment["DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE"].flatMap { Int($0) } ?? 2024
package.platforms = switch agVersion {
Expand All @@ -262,15 +263,15 @@ if attributeGraphCondition {
default: nil
}
} else {
openGraphShimsTarget.dependencies.append("OpenAttributeGraph")
openAttributeGraphShimsTarget.dependencies.append("OpenAttributeGraph")
package.platforms = [.iOS(.v13), .macOS(.v10_15), .macCatalyst(.v13), .tvOS(.v13), .watchOS(.v5)]
}

let compatibilityTestCondition = envEnable("OPENATTRIBUTEGRAPH_COMPATIBILITY_TEST")
if compatibilityTestCondition && attributeGraphCondition {
openGraphCompatibilityTestsTarget.addCompatibilitySettings()
openAttributeGraphCompatibilityTestsTarget.addCompatibilitySettings()
} else {
openGraphCompatibilityTestsTarget.dependencies.append("OpenAttributeGraph")
openAttributeGraphCompatibilityTestsTarget.dependencies.append("OpenAttributeGraph")
}

extension [Platform] {
Expand Down
4 changes: 2 additions & 2 deletions Scripts/bump_ag_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ while [[ $# -gt 0 ]]; do
done

SCRIPT_ROOT="$(dirname $(dirname $(filepath $0)))"
OAG_REPO_DIR="$SCRIPT_ROOT/.og_repo"
OAG_REPO_DIR="$SCRIPT_ROOT/.oag_repo"
OPENATTRIBUTEGRAPH_ROOT="$OAG_REPO_DIR"
AG_REPO_DIR="$SCRIPT_ROOT/.ag_repo"

Expand Down Expand Up @@ -184,4 +184,4 @@ gh pr create \
--base main

echo "✅ PR created successfully!"
echo "Branch: update-ag-$TARGET_BRANCH"
echo "Branch: update-ag-$TARGET_BRANCH"
4 changes: 2 additions & 2 deletions Sources/OpenAttributeGraphCxx/DebugServer/DebugServer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

OAG_EXTERN_C_BEGIN
// DYLD_INTERPOSE does not work. Directly use the hook one here to match the semantics.
bool og_variant_has_internal_diagnostics(const char *subsystem);
bool oag_variant_has_internal_diagnostics(const char *subsystem);
OAG_EXTERN_C_END

// MARK: DebugServer public API Implementation
Expand Down Expand Up @@ -265,7 +265,7 @@
if (
(mode & OAGDebugServerModeValid)
&& !OAG::DebugServer::has_shared_server()
&& og_variant_has_internal_diagnostics("org.OpenSwiftUIProject.OpenAttributeGraph")
&& oag_variant_has_internal_diagnostics("org.OpenSwiftUIProject.OpenAttributeGraph")
) {
_shared_server = new DebugServer(mode);
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/OpenAttributeGraphCxx/DebugServer/interpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
extern bool os_variant_has_internal_diagnostics(const char *subsystem);
#endif

bool og_variant_has_internal_diagnostics(const char *subsystem) {
bool oag_variant_has_internal_diagnostics(const char *subsystem) {
if (strcmp(subsystem, "org.OpenSwiftUIProject.OpenAttributeGraph") == 0) {
return true;
} else if (strcmp(subsystem, "com.apple.AttributeGraph") == 0) {
Expand All @@ -30,5 +30,5 @@ bool og_variant_has_internal_diagnostics(const char *subsystem) {
__attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
__attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };

DYLD_INTERPOSE(og_variant_has_internal_diagnostics, os_variant_has_internal_diagnostics)
DYLD_INTERPOSE(oag_variant_has_internal_diagnostics, os_variant_has_internal_diagnostics)
#endif
Loading