Skip to content

Commit

Permalink
Make docs.rs build work and fix READMEs to use the common one
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianEddy committed Oct 1, 2024
1 parent 482cb08 commit ef006e3
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 31 deletions.
2 changes: 1 addition & 1 deletion after-effects-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "after-effects-sys"
version = "0.2.0"
version = "0.2.1"
authors = [
"Adrian Eddy <[email protected]>, Moritz Moeller <[email protected]>",
]
Expand Down
2 changes: 1 addition & 1 deletion after-effects-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#[cfg(all(target_os = "windows", builtin_bindings))]
include!(concat!(env!("CARGO_MANIFEST_DIR"), "/bindings_win.rs"));

#[cfg(all(target_os = "macos", builtin_bindings))]
#[cfg(all(any(target_os = "macos", target_os = "linux"), builtin_bindings))]
include!(concat!(env!("CARGO_MANIFEST_DIR"), "/bindings_macos.rs"));

#[cfg(not(builtin_bindings))]
Expand Down
4 changes: 2 additions & 2 deletions after-effects/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "after-effects"
version = "0.2.0"
version = "0.2.1"
authors = [
"Adrian Eddy <[email protected]>, Moritz Moeller <[email protected]>",
]
Expand All @@ -9,7 +9,7 @@ edition = "2021"
description = "High level bindings for the Adobe After Effects® SDK"
keywords = ["motion-graphics", "after-effects", "graphics", "plugins"]
categories = ["graphics", "multimedia::video", "rendering::graphics-api"]
readme = "README.md"
readme = "../README.md"
homepage = "https://developer.adobe.com/after-effects/"
repository = "https://github.com/virtualritz/after-effects/"

Expand Down
9 changes: 0 additions & 9 deletions after-effects/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion after-effects/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: make ALL the functions below return Result-wrapped values

#![doc = include_str!("../../README.md")]
#![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))]
use after_effects_sys as ae_sys;
use num_traits::identities::Zero;
use std::{
Expand Down
2 changes: 1 addition & 1 deletion pipl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pipl"
version = "0.1.0"
version = "0.1.1"
authors = ["Adrian <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
15 changes: 11 additions & 4 deletions pipl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mod resource;
pub use resource::*;

#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "linux"))]
use byteorder::BigEndian as ByteOrder;
#[cfg(target_os = "windows")]
use byteorder::LittleEndian as ByteOrder;
Expand Down Expand Up @@ -52,7 +52,7 @@ const fn fourcc(code: &[u8; 4]) -> [u8; 4] {
{
[code[3], code[2], code[1], code[0]]
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "linux"))]
{
*code
}
Expand All @@ -62,7 +62,7 @@ const fn u32_bytes(v: u32) -> [u8; 4] {
{
v.to_le_bytes()
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "linux"))]
{
v.to_be_bytes()
}
Expand Down Expand Up @@ -1517,6 +1517,7 @@ pub fn build_pipl(properties: Vec<Property>) -> Result<Vec<u8>> {
}

pub fn plugin_build(properties: Vec<Property>) {
let mut any_entrypoint_emitted = false;
for prop in properties.iter() {
match prop {
Property::Kind(x) => {
Expand All @@ -1525,7 +1526,7 @@ pub fn plugin_build(properties: Vec<Property>) {
{
u32::from_le_bytes(x.as_bytes())
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "linux"))]
{
u32::from_be_bytes(x.as_bytes())
}
Expand All @@ -1545,12 +1546,15 @@ pub fn plugin_build(properties: Vec<Property>) {
println!("cargo:rustc-env=PIPL_SUPPORT_URL={x}");
}
Property::CodeWin64X86(x) => {
any_entrypoint_emitted = true;
println!("cargo:rustc-env=PIPL_ENTRYPOINT={x}");
}
Property::CodeMacIntel64(x) => {
any_entrypoint_emitted = true;
println!("cargo:rustc-env=PIPL_ENTRYPOINT={x}");
}
Property::CodeMacARM64(x) => {
any_entrypoint_emitted = true;
println!("cargo:rustc-env=PIPL_ENTRYPOINT={x}");
}
Property::AE_Effect_Spec_Version { major, minor } => {
Expand Down Expand Up @@ -1599,6 +1603,9 @@ pub fn plugin_build(properties: Vec<Property>) {
_ => {}
}
}
if !any_entrypoint_emitted {
println!("cargo:rustc-env=PIPL_ENTRYPOINT=EffectMain");
}
let pipl = build_pipl(properties).unwrap();

resource::produce_resource(
Expand Down
2 changes: 1 addition & 1 deletion premiere-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "premiere-sys"
version = "0.2.0"
version = "0.2.1"
authors = ["Adrian <[email protected]>"]
license = "Apache-2.0 OR BSD-3-Clause OR MIT OR Zlib"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion premiere-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#[cfg(all(target_os = "windows", builtin_bindings))]
include!(concat!(env!("CARGO_MANIFEST_DIR"), "/bindings_win.rs"));

#[cfg(all(target_os = "macos", builtin_bindings))]
#[cfg(all(any(target_os = "macos", target_os = "linux"), builtin_bindings))]
include!(concat!(env!("CARGO_MANIFEST_DIR"), "/bindings_macos.rs"));

#[cfg(not(builtin_bindings))]
Expand Down
3 changes: 2 additions & 1 deletion premiere/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "premiere"
version = "0.2.0"
version = "0.2.1"
authors = [
"Adrian Eddy <[email protected]>",
"Moritz Moeller <[email protected]>",
]
license = "Apache-2.0 OR BSD-3-Clause OR MIT OR Zlib"
edition = "2021"
readme = "../README.md"
description = "High level bindings for the Adobe Premiere® SDK"
keywords = ["motion-graphics", "premiere", "graphics", "plugins"]
categories = ["graphics", "multimedia::video", "rendering::graphics-api"]
Expand Down
9 changes: 0 additions & 9 deletions premiere/README.md

This file was deleted.

2 changes: 2 additions & 0 deletions premiere/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))]

use premiere_sys as pr_sys;
use std::ptr;
use std::cell::RefCell;
Expand Down

4 comments on commit ef006e3

@virtualritz
Copy link
Owner

Choose a reason for hiding this comment

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

LGTM

@virtualritz
Copy link
Owner

Choose a reason for hiding this comment

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

So cargo doc still fails on Ubuntu for me after merging. All of the SDK types from the *-sys crates are missing.

@virtualritz
Copy link
Owner

Choose a reason for hiding this comment

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

Ah, I think this is because the updated *-sys crates have not been published. Ignore. 😁

@virtualritz
Copy link
Owner

Choose a reason for hiding this comment

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

All re-published, docs are up!

Please sign in to comment.