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

Support swift 5.9 with minimum 5.5 compatibility. #61

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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 .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "OpenTimelineIO"]
path = OpenTimelineIO
url = https://github.com/PixarAnimationStudios/OpenTimelineIO.git
url = https://github.com/wabiverse/OTIOInterop.git
2 changes: 1 addition & 1 deletion OpenTimelineIO
Submodule OpenTimelineIO updated 54 files
+22 −17 .github/workflows/python-package.yml
+1 −1 .gitmodules
+1 −1 CMakeLists.txt
+1 −1 OTIO_VERSION.json
+86 −48 docs/tutorials/otio-filebundles.md
+4 −0 docs/tutorials/otio-serialized-schema-only-fields.md
+4 −0 docs/tutorials/otio-serialized-schema.md
+58 −5 docs/tutorials/time-ranges.md
+6 −0 pyproject.toml
+1 −1 setup.py
+1 −1 src/deps/Imath
+53 −0 src/module.modulemap
+259 −0 src/opentime/swiftInterop.h
+32 −0 src/opentimelineio/CORE_VERSION_MAP.cpp
+32 −0 src/opentimelineio/CORE_VERSION_MAP.last.cpp
+2 −1 src/opentimelineio/clip.h
+2 −1 src/opentimelineio/composable.h
+3 −2 src/opentimelineio/composition.h
+5 −1 src/opentimelineio/effect.cpp
+9 −2 src/opentimelineio/effect.h
+2 −1 src/opentimelineio/externalReference.h
+2 −1 src/opentimelineio/freezeFrame.h
+2 −1 src/opentimelineio/gap.h
+2 −1 src/opentimelineio/generatorReference.h
+2 −1 src/opentimelineio/imageSequenceReference.h
+2 −1 src/opentimelineio/item.h
+2 −1 src/opentimelineio/linearTimeWarp.h
+2 −1 src/opentimelineio/marker.h
+2 −1 src/opentimelineio/mediaReference.h
+2 −1 src/opentimelineio/missingReference.h
+2 −1 src/opentimelineio/serializableCollection.h
+2 −1 src/opentimelineio/serializableObject.h
+2 −1 src/opentimelineio/serializableObjectWithMetadata.h
+20 −0 src/opentimelineio/stack.cpp
+6 −1 src/opentimelineio/stack.h
+3 −29 src/opentimelineio/stringUtils.cpp
+2 −1 src/opentimelineio/timeEffect.h
+2 −1 src/opentimelineio/timeline.h
+2 −1 src/opentimelineio/track.h
+2 −1 src/opentimelineio/transition.h
+2 −1 src/opentimelineio/typeRegistry.h
+2 −1 src/opentimelineio/unknownSchema.h
+9 −6 src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp
+15 −17 src/py-opentimelineio/opentimelineio/adapters/file_bundle_utils.py
+11 −10 src/py-opentimelineio/opentimelineio/adapters/otiod.py
+15 −12 src/py-opentimelineio/opentimelineio/adapters/otioz.py
+37 −6 src/py-opentimelineio/opentimelineio/console/otiotool.py
+5 −1 src/py-opentimelineio/opentimelineio/schema/effect.py
+43 −33 src/py-opentimelineio/opentimelineio/url_utils.py
+7 −0 tests/baselines/empty_effect.json
+17 −5 tests/test_effect.py
+4 −0 tests/test_json_backend.py
+58 −0 tests/test_track.cpp
+29 −0 tests/test_track.py
120 changes: 75 additions & 45 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
//
// SPDX-License-Identifier: Apache-2.0
Expand All @@ -8,69 +8,99 @@ import PackageDescription

let package = Package(
name: "OpenTimelineIO",
platforms: [.macOS(.v10_13),
.iOS(.v11)],
platforms: [
.macOS(.v14),
.visionOS(.v1),
.iOS(.v17),
.tvOS(.v17),
.watchOS(.v10),
],
products: [
.library(name: "Imath", targets: ["ImathConfig", "Imath"]),
.library(name: "rapidjson", targets: ["rapidjson"]),
.library(name: "OpenTime_CXX", targets: ["OpenTime_CXX"]),
.library(name: "OpenTimelineIO_CXX", targets: ["OpenTimelineIO_CXX"]),
.library(name: "OpenTimelineIO", targets: ["OpenTimelineIO"])
],

dependencies: [],
targets: [
.target(name: "otio_header_root",
path: ".",
.target(name: "ImathConfig"),

.target(name: "Imath",
dependencies: ["ImathConfig"],
path: "OpenTimelineIO/src/deps/Imath/src/Imath",
exclude: ["toFloat.cpp"],
publicHeadersPath: ".",
cxxSettings: [
.headerSearchPath("../.")
]),

.target(name: "rapidjson",
path: "OpenTimelineIO/src/deps/rapidjson",
exclude: [
"CONTRIBUTORS.md", "NOTICE.txt", "CONTRIBUTING.md", "LICENSE.txt", "CODE_OF_CONDUCT.md",
"OTIO_CLA_Corporate.pdf", "OTIO_CLA_Individual.pdf",
"README.md", "Examples", "OpenTimelineIO", "Tests", "Sources/objc", "Sources/swift"],
sources: ["Sources/shims/otio_header_root-shim.cpp"],
publicHeadersPath:"OpenTimelineIO/src"),
"bin", "CMakeModules", "contrib", "doc",
"docker", "example", "test", "thirdparty"
]),

.target(name: "OpenTime_CXX",
dependencies: ["otio_header_root"],
path: "OpenTimelineIO/src/opentime",
exclude: ["CMakeLists.txt", "OpenTimeConfig.cmake.in"],
sources: ["."],
publicHeadersPath: ".",
cxxSettings: [ .headerSearchPath(".")]),
dependencies: ["Imath"],
path: "OpenTimelineIO/src",
exclude: ["deps", "opentimelineio", "opentimelineview", "py-opentimelineio"],
publicHeadersPath: "."),

.target(name: "OpenTimelineIO_CXX",
dependencies: ["OpenTime_CXX"],
path: "OpenTimelineIO/src/opentimelineio",
exclude: ["CMakeLists.txt", "CORE_VERSION_MAP.last.cpp", "OpenTimelineIOConfig.cmake.in"],
sources: ["."],
publicHeadersPath: ".",
cxxSettings: [
.headerSearchPath("."),
.headerSearchPath("../deps/any/"),
.headerSearchPath("../deps/Imath/src/Imath"),
.headerSearchPath("../../../Sources/cpp"),
.headerSearchPath("../deps/rapidjson/include")]),
dependencies: ["Imath", "rapidjson", "OpenTime_CXX"],
path: "OpenTimelineIO/src",
exclude: ["deps", "opentime", "opentimelineview", "py-opentimelineio", "opentimelineio/CORE_VERSION_MAP.last.cpp"],
publicHeadersPath: "."),

// .target(name: "OpenTimelineIO_objc",
// dependencies: ["OpenTimelineIO_CXX"],
// path: "Sources",
// exclude: ["swift", "shims", "interop", "ImathConfig"],
// sources: ["objc"],
// publicHeadersPath: "objc/include",
// cxxSettings: [
// .headerSearchPath("../OpenTimelineIO/src/deps/Imath/src/Imath"),
// .headerSearchPath("objc/include")]),

.target(name: "OpenTimelineIO_objc",
.target(name: "OpenTimelineIO_cpp",
dependencies: ["OpenTimelineIO_CXX"],
path: "Sources",
exclude: ["swift", "shims"],
sources: ["objc"],
publicHeadersPath: "objc/include",
cxxSettings: [
.headerSearchPath("../OpenTimelineIO/src/deps/Imath/src/Imath"),
.headerSearchPath("../Sources/cpp"),
.headerSearchPath("objc/include")]),
path: "Sources/cpp"),

// public target
// public swift/c++ target
.target(name: "OpenTimelineIO",
dependencies: ["OpenTimelineIO_objc"],
path: "Sources",
exclude: ["objc", "shims"],
sources: ["swift"]),
dependencies: ["OpenTimelineIO_cpp"],
path: "Sources/interop",
swiftSettings: [
.interoperabilityMode(.Cxx)]),

// public swift/objc target
// .target(name: "OpenTimelineIO_OLD",
// dependencies: ["OpenTimelineIO_objc"],
// path: "Sources",
// exclude: ["objc", "shims", "interop", "ImathConfig"],
// sources: ["swift"]),

// .testTarget(name: "OpenTimelineIOTests",
// dependencies: ["OpenTimelineIO"],
// path: "Tests",
// sources: ["OpenTimelineIOTests"],
// resources: [ .copy("data") ],
// swiftSettings: [
// .interoperabilityMode(.Cxx)
// ])

.testTarget(name: "OpenTimelineIOTests",
.testTarget(name: "OpenTimelineIOInteropTests",
dependencies: ["OpenTimelineIO"],
path: "Tests",
sources: ["OpenTimelineIOTests"],
resources: [ .copy("data") ])
exclude: ["OpenTimelineIOTests"],
sources: ["OpenTimelineIOInteropTests"],
resources: [ .copy("data") ],
swiftSettings: [
.interoperabilityMode(.Cxx)
])
],
cxxLanguageStandard: CXXLanguageStandard.cxx17
cxxLanguageStandard: .cxx17
)
76 changes: 76 additions & 0 deletions Package@swift-5.5.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
//
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

import PackageDescription

let package = Package(
name: "OpenTimelineIO",
platforms: [.macOS(.v10_13),
.iOS(.v11)],
products: [
.library(name: "OpenTime_CXX", targets: ["OpenTime_CXX"]),
.library(name: "OpenTimelineIO_CXX", targets: ["OpenTimelineIO_CXX"]),
.library(name: "OpenTimelineIO", targets: ["OpenTimelineIO"])
],

dependencies: [],
targets: [
.target(name: "otio_header_root",
path: ".",
exclude: [
"CONTRIBUTORS.md", "NOTICE.txt", "CONTRIBUTING.md", "LICENSE.txt", "CODE_OF_CONDUCT.md",
"OTIO_CLA_Corporate.pdf", "OTIO_CLA_Individual.pdf",
"README.md", "Examples", "OpenTimelineIO", "Tests", "Sources/objc", "Sources/swift"],
sources: ["Sources/shims/otio_header_root-shim.cpp"],
publicHeadersPath:"OpenTimelineIO/src"),

.target(name: "OpenTime_CXX",
dependencies: ["otio_header_root"],
path: "OpenTimelineIO/src/opentime",
exclude: ["CMakeLists.txt", "OpenTimeConfig.cmake.in"],
sources: ["."],
publicHeadersPath: ".",
cxxSettings: [ .headerSearchPath(".")]),

.target(name: "OpenTimelineIO_CXX",
dependencies: ["OpenTime_CXX"],
path: "OpenTimelineIO/src/opentimelineio",
exclude: ["CMakeLists.txt", "CORE_VERSION_MAP.last.cpp", "OpenTimelineIOConfig.cmake.in"],
sources: ["."],
publicHeadersPath: ".",
cxxSettings: [
.headerSearchPath("."),
.headerSearchPath("../deps/any/"),
.headerSearchPath("../deps/Imath/src/Imath"),
.headerSearchPath("../../../Sources/cpp"),
.headerSearchPath("../deps/rapidjson/include")]),

.target(name: "OpenTimelineIO_objc",
dependencies: ["OpenTimelineIO_CXX"],
path: "Sources",
exclude: ["swift", "shims"],
sources: ["objc"],
publicHeadersPath: "objc/include",
cxxSettings: [
.headerSearchPath("../OpenTimelineIO/src/deps/Imath/src/Imath"),
.headerSearchPath("../Sources/cpp"),
.headerSearchPath("objc/include")]),

// public target
.target(name: "OpenTimelineIO",
dependencies: ["OpenTimelineIO_objc"],
path: "Sources",
exclude: ["objc", "shims"],
sources: ["swift"]),

.testTarget(name: "OpenTimelineIOTests",
dependencies: ["OpenTimelineIO"],
path: "Tests",
sources: ["OpenTimelineIOTests"],
resources: [ .copy("data") ])
],
cxxLanguageStandard: .cxx17
)
3 changes: 3 additions & 0 deletions Sources/ImathConfig/ImathConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <ImathConfig.h>

int imath_config_header_version = 1;
File renamed without changes.
59 changes: 59 additions & 0 deletions Sources/cpp/include/opentimelineio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// opentimelineio.h
//
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

#include <opentimelineio/clip.h>
#include <opentimelineio/composable.h>
#include <opentimelineio/composition.h>
#include <opentimelineio/effect.h>
#include <opentimelineio/externalReference.h>
#include <opentimelineio/freezeFrame.h>
#include <opentimelineio/gap.h>
#include <opentimelineio/generatorReference.h>
#include <opentimelineio/item.h>
#include <opentimelineio/linearTimeWarp.h>
#include <opentimelineio/marker.h>
#include <opentimelineio/mediaReference.h>
#include <opentimelineio/missingReference.h>
#include <opentimelineio/serializableCollection.h>
#include <opentimelineio/serializableObject.h>
#include <opentimelineio/serializableObjectWithMetadata.h>
#include <opentimelineio/stack.h>
#include <opentimelineio/timeEffect.h>
#include <opentimelineio/timeline.h>
#include <opentimelineio/track.h>
#include <opentimelineio/transition.h>
#include <opentimelineio/stack.h>
#include <opentimelineio/stringUtils.h>
#include <opentimelineio/unknownSchema.h>
#include <opentimelineio/stringUtils.h>
#include <opentimelineio/trackAlgorithm.h>
#include <opentimelineio/stackAlgorithm.h>

namespace otio {
using namespace opentimelineio::OPENTIMELINEIO_VERSION;

Clip* otio_new_clip();
Composable* otio_new_composable();
Composition* otio_new_composition();
Effect* otio_new_effect();
ExternalReference* otio_new_external_reference();
FreezeFrame* otio_new_freeze_frame();
Gap* otio_new_gap();
GeneratorReference* otio_new_generator_reference();
Item* otio_new_item();
LinearTimeWarp* otio_new_linear_time_warp();
Marker* otio_new_marker();
MediaReference* otio_new_media_reference();
MissingReference* otio_new_missing_reference();
SerializableCollection* otio_new_serializable_collection();
SerializableObject* otio_new_serializable_object();
SerializableObjectWithMetadata* otio_new_serializable_object_with_metadata();
Stack* otio_new_stack();
TimeEffect* otio_new_time_effect();
Timeline* otio_new_timeline();
Track* otio_new_track();
Transition* otio_new_transition();
}
Loading