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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ The release run heads these entries with the version and opens a fresh

## Unreleased

- **Breaking**: `GlobalParams` is gone, with its java, python and objc mirrors,
`OdrAndroid.init`, and the `ODR_WITH_LIBMAGIC` / `ODR_BUNDLE_ASSETS` cmake
options. All of it was inert; delete the calls, nothing replaces them.

- **Breaking**: building `odr` from source now needs a **C++23** compiler. Using
it does not — the public headers still compile as C++20, and the package
forces no standard on a consumer.
Expand Down
19 changes: 0 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ option(ODR_TEST_FETCH_DATA "Fetch the test data pinned in test/data.cmake" OFF)
option(ODR_CLI "enable command line interface" ON)
option(ODR_WITH_HTTP_SERVER "Build the HTTP server (requires cpp-httplib)" ON)
option(ODR_CLANG_TIDY "Run clang-tidy static analysis" OFF)
# Removed, and accepted only so a consumer still passing it keeps configuring.
# `odr::mimetype` is our own detection now: it reads inside zip and cfb
# containers, which libmagic cannot, and it costs neither a dependency nor the
# 8 MB `magic.mgc` database every consumer had to ship and point us at.
option(ODR_WITH_LIBMAGIC "Removed, does nothing (deprecated)" OFF)
option(ODR_BUNDLE_ASSETS "Removed, does nothing (deprecated)" OFF)
option(ODR_PYTHON "Build Python bindings" OFF)
option(ODR_JNI "Build JNI bindings" OFF)
option(ODR_APPLE "Build Objective-C bindings as a framework" OFF)
Expand Down Expand Up @@ -100,7 +94,6 @@ set(ODR_SOURCE_FILES
"src/odr/exceptions.cpp"
"src/odr/file.cpp"
"src/odr/filesystem.cpp"
"src/odr/global_params.cpp"
"src/odr/html.cpp"
"src/odr/logger.cpp"
"src/odr/odr.cpp"
Expand Down Expand Up @@ -346,18 +339,6 @@ if (ODR_WITH_HTTP_SERVER)
ODR_WITH_HTTP_SERVER
)
endif ()
if (ODR_WITH_LIBMAGIC)
message(DEPRECATION
"ODR_WITH_LIBMAGIC no longer does anything: libmagic is gone and "
"`odr::mimetype` is our own detection. Drop the option; "
"`GlobalParams::libmagic_database_path` is inert too.")
endif ()
if (ODR_BUNDLE_ASSETS)
message(DEPRECATION
"ODR_BUNDLE_ASSETS no longer does anything: the css and js are "
"part of the library and there is nothing left to ship. Drop the "
"option; `GlobalParams::odr_core_data_path` is inert too.")
endif ()

configure_file("src/odr/internal/project_info.cpp.in" "src/odr/internal/project_info.cpp")

Expand Down
8 changes: 4 additions & 4 deletions android/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ first — the java API and its android constraints live there. User facing docs:
|------|------|
| `build.gradle.kts` | The library module: sources from `../jni/java`, prebuilt native libs, lint, publishing. Single project — `rootProject.name` *is* the artifactId. |
| `build_native.py` | conan + cmake per ABI → `native/prebuilt/jniLibs`. Invoked by the `buildNative` gradle task and directly by CI. |
| `src/main/java/.../android/OdrAndroid.kt` | The only android specific production code, and a deprecated no-op: it used to extract the renderer's assets, which are part of the library now. |
| `src/androidTest/` | Instrumented suite, JUnit 4 + androidx.test, inputs from `../jni/testfixtures`. |
| `consumer-rules.pro` | Keeps `app.opendocument.core.**` — JNI resolves it by name, R8 cannot see that. |

Expand Down Expand Up @@ -41,9 +40,10 @@ calls it.
- **What this module writes is kotlin; what it borrows is java.** `../jni/java`
and `../jni/testfixtures` are compiled by CMake's `add_jar` for the maven jar
and the host junit suite, which have no kotlin toolchain, so they stay java —
the kotlin here is only `OdrAndroid` and `src/androidTest`. Anything crossing
back to a java caller keeps its java shape: `@JvmStatic` so `OdrAndroid.init`
stays a static call, `@Throws` so the `IOException` stays checked.
the kotlin here is only `src/androidTest` — the module ships no production
code of its own. Anything added that crosses back to a java caller keeps its
java shape: `@JvmStatic` for a static call, `@Throws` for a checked
exception.
- **Formatting is ktfmt** (kotlinlang style) via spotless, the same version
OpenDocument.droid runs. `./gradlew spotlessApply`; CI checks it in
`.github/workflows/format.yml`, which needs neither the NDK nor conan.
Expand Down
6 changes: 2 additions & 4 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library for every ABI, and the runtime data the renderer needs, in one artifact.

```
odr-core-android.aar
├── classes.jar app.opendocument.core (../jni/java) + OdrAndroid
├── classes.jar app.opendocument.core (../jni/java)
├── jni/<abi>/libodr_jni.so the bindings with the core linked in
├── jni/<abi>/libc++_shared.so the c++ runtime they were built against
└── proguard.txt keeps the classes JNI resolves by name
Expand Down Expand Up @@ -39,9 +39,7 @@ val html = service.bringOffline(outputDir.path)
```

Nothing needs initialising: the renderer's css and js are part of the native
library. `OdrAndroid.init(context)` is a deprecated no-op — it used to unpack
the assets that carried them — and stays callable, checked `IOException` and
all, so apps written against the older AAR keep compiling.
library, and the AAR carries no assets to unpack.

Serving the rendered HTML through `HttpServer` needs two things from the app,
neither of which a library may decide on its own: `android.permission.INTERNET`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app.opendocument.core

import androidx.test.ext.junit.runners.AndroidJUnit4
import app.opendocument.core.android.OdrAndroid
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
Expand All @@ -10,7 +9,7 @@ import org.junit.runner.RunWith

/** The AAR's own contract: the native library loads and works without any setup. */
@RunWith(AndroidJUnit4::class)
class OdrAndroidTest {
class AarContractTest {
@Test
fun nativeLibraryLoads() {
// reaching the native side at all means the .so, its ABI and libc++_shared
Expand All @@ -20,14 +19,6 @@ class OdrAndroidTest {
assertNotNull(Odr.commitHash())
}

@Test
@Suppress("DEPRECATION")
fun initIsANoOp() {
// it is still called by apps built against the versions that needed it
OdrAndroid.init(TestSupport.context())
OdrAndroid.init(TestSupport.context())
}

@Test
fun detectsTypeInsideTheContainer() {
val directory = TestSupport.tempDir("magic")
Expand Down
23 changes: 0 additions & 23 deletions android/src/main/java/app/opendocument/core/android/OdrAndroid.kt

This file was deleted.

2 changes: 0 additions & 2 deletions apple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ set(ODR_APPLE_PUBLIC_HEADERS
"include/OdrCoreObjC/OdrCoreObjC.h"
"include/OdrCoreObjC/ODRDocumentElement.h"
"include/OdrCoreObjC/ODRError.h"
"include/OdrCoreObjC/ODRGlobalParams.h"
"include/OdrCoreObjC/ODRDocument.h"
"include/OdrCoreObjC/ODRFile.h"
"include/OdrCoreObjC/ODRFilesystem.h"
Expand All @@ -54,7 +53,6 @@ set(ODR_APPLE_PUBLIC_HEADERS

add_library(odr_apple SHARED
"src/ODRInternal.mm"
"src/ODRGlobalParams.mm"
"src/ODRDocument.mm"
"src/ODRDocumentElement.mm"
"src/ODRFile.mm"
Expand Down
35 changes: 0 additions & 35 deletions apple/include/OdrCoreObjC/ODRGlobalParams.h

This file was deleted.

1 change: 0 additions & 1 deletion apple/include/OdrCoreObjC/OdrCoreObjC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#import <OdrCoreObjC/ODRError.h>
#import <OdrCoreObjC/ODRFile.h>
#import <OdrCoreObjC/ODRFilesystem.h>
#import <OdrCoreObjC/ODRGlobalParams.h>
#import <OdrCoreObjC/ODRHtml.h>
#import <OdrCoreObjC/ODRHttpServer.h>
#import <OdrCoreObjC/ODRLogger.h>
Expand Down
51 changes: 0 additions & 51 deletions apple/src/ODRGlobalParams.mm

This file was deleted.

9 changes: 0 additions & 9 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,22 @@ class OpenDocumentCoreConan(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
# removed and inert, kept only so a consumer still passing it does not
# hard-fail on an unknown option; see CMakeLists.txt
"with_libmagic": [True, False],
"with_http_server": [True, False],
"with_cli": [True, False],
"with_python": [True, False],
"with_jni": [True, False],
"with_apple": [True, False],
"with_wasm": [True, False],
"bundle_assets": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_libmagic": False,
"with_http_server": True,
"with_cli": True,
"with_python": False,
"with_jni": False,
"with_apple": False,
"with_wasm": False,
"bundle_assets": False,
# paired with PUGIXML_COMPACT in CMakeLists.txt: no prebuilt library
# to mismatch against the node layout the define changes
"pugixml/*:header_only": True,
Expand All @@ -48,7 +42,6 @@ class OpenDocumentCoreConan(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
del self.options.with_libmagic

def requirements(self):
self.requires("pugixml/1.15")
Expand Down Expand Up @@ -82,14 +75,12 @@ def generate(self):
tc.variables["ODR_TEST"] = False
# forwarded only so the CMake deprecation warning reaches a consumer
# who still sets it; neither end does anything with it
tc.variables["ODR_WITH_LIBMAGIC"] = self.options.get_safe("with_libmagic", False)
tc.variables["ODR_WITH_HTTP_SERVER"] = self.options.get_safe("with_http_server", False)
tc.variables["ODR_CLI"] = self.options.get_safe("with_cli", True)
tc.variables["ODR_PYTHON"] = self.options.get_safe("with_python", False)
tc.variables["ODR_JNI"] = self.options.get_safe("with_jni", False)
tc.variables["ODR_APPLE"] = self.options.get_safe("with_apple", False)
tc.variables["ODR_WASM"] = self.options.get_safe("with_wasm", False)
tc.variables["ODR_BUNDLE_ASSETS"] = self.options.get_safe("bundle_assets", False)

tc.generate()

Expand Down
18 changes: 4 additions & 14 deletions docs/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,10 @@

### Open tasks

- drop the last inert traces of the shipped css/js once consumers have moved
off them: `GlobalParams::odr_core_data_path` and its java, python and objc
mirrors, plus `OdrAndroid.init`,
`ODRGlobalParams.bootstrapFromFrameworkBundle` and the `ODR_BUNDLE_ASSETS` /
conan `bundle_assets` option, all still accepted and all doing nothing. They
are about *finding* a data directory, which nothing does any more — unlike
- nothing looks for a data directory any more, and nothing accepts a path to
one: `GlobalParams` and the libmagic and asset build options are gone with
v7. What decides where the compiled-in css and js *land* is live and stays —
`HtmlConfig::embed_shipped_resources`, `resource_path`,
`relative_resource_paths` and `HtmlResource::is_shipped`, which decide where
the compiled-in css and js land and are live again.
- drop the last inert traces of libmagic once consumers have moved off them:
`GlobalParams::libmagic_database_path` and its java, python and objc mirrors
still store and return a path nothing reads, and `ODR_WITH_LIBMAGIC` /
the conan `with_libmagic` option are still accepted so a build that sets one
keeps configuring. Removing them is the breaking change this deliberately
is not.
`relative_resource_paths`, `HtmlResource::is_shipped`.
- collect additional pdf files via the translate cli and capture the ones that break
- exercise editing across all formats (odp editing appears broken via an HTML issue)
1 change: 0 additions & 1 deletion jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ add_jar(odr_java
"java/app/opendocument/core/LoggerBridge.java"
"java/app/opendocument/core/SourceLocation.java"
"java/app/opendocument/core/Frame.java"
"java/app/opendocument/core/GlobalParams.java"
"java/app/opendocument/core/GraphicStyle.java"
"java/app/opendocument/core/GuardedNativeResource.java"
"java/app/opendocument/core/HorizontalAlign.java"
Expand Down
4 changes: 1 addition & 3 deletions jni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ configure step rather than producing a package without the jar in it.
## Runtime data

There is none. The renderer's CSS/JS are part of the library and detection needs
no database, so `GlobalParams.setOdrCoreDataPath(...)` and
`setLibmagicDatabasePath(...)` are deprecated leftovers that store a path
nothing reads.
no database, so there is nothing to point the library at.

## Notes

Expand Down
27 changes: 0 additions & 27 deletions jni/java/app/opendocument/core/GlobalParams.java

This file was deleted.

Loading
Loading