Преглед изворни кода

Updated various extension docs

Björn Ritzl пре 11 месеци
родитељ
комит
e710aed8d1

+ 3 - 3
docs/en/en.json

@@ -1552,8 +1552,8 @@
                         "name": "Debugging"
                     },
                     {
-                        "path": "/manuals/extensions-build-variants",
-                        "name": "Build Variants"
+                        "path": "/manuals/extensions-ext-manifest",
+                        "name": "Extension Manifests"
                     },
                     {
                         "path": "/manuals/app-manifest",
@@ -1564,7 +1564,7 @@
                         "name": "Manifest Merging"
                     },
                     {
-                        "path": "https://lua.msys.ch/lua-integration-guide.html#_the_lua_c_api",
+                        "path": "https://www.lua.org/pil/contents.html#P4",
                         "name": "The Lua C API (external)"
                     },
                     {

+ 0 - 125
docs/en/manuals/extensions-build-variants.md

@@ -1,125 +0,0 @@
----
-title: Native extensions - Build variants
-brief: This manual describes the different builds variants that Defold can create and how they interact with native extensions and the engine.
----
-
-:[Build Variants](../shared/build-variants.md)
-
-## App Manifest
-
-Not only can you add native code to the engine with the Native Extensions feature, you can also remove standard parts of the engine. E.g. if you don't need a physics engine, you can remove that from the executable. Learn how to exclude unused feature [in the application manifest manual](/manuals/app-manifest).
-
-### Combined context
-
-The app manifest actually has the same structure and syntax as the extension manifest. This allows us to merge the contexts for one platform together when finally building.
-
-And, Defold itself, has its own build manifest as the foundation (`build.yml`). For each extension that is built, the manifests are combined as follows:
-
-	manifest = merge(game.appmanifest, ext.manifest, build.yml)
-
-This is so the user can override the default behaviour of the engine and also each extension. And, for the final link stage, we merge the app manifest with the defold manifest:
-
-	manifest = merge(game.appmanifest, build.yml)
-
-
-### Syntax
-
-Here is an example for reference:
-
-```yml
-platforms:
-    x86_64-osx:
-        context:
-            excludeLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    x86_64-linux:
-        context:
-            excludeLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    js-web:
-        context:
-            excludeLibs: []
-            excludeJsLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    wasm-web:
-        context:
-            excludeLibs: []
-            excludeJsLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    x86-win32:
-        context:
-            excludeLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    x86_64-win32:
-        context:
-            excludeLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    armv7-android:
-        context:
-            excludeLibs: []
-            excludeJars: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    armv7-ios:
-        context:
-            excludeLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-    arm64-ios:
-        context:
-            excludeLibs: []
-            excludeSymbols: []
-            libs: []
-            linkFlags: []
-```
-
-#### White listing
-
-For all the keywords, we apply white listing filter. This is to avoid illegal path handling and accessing files outside of the build upload folder.
-
-#### linkFlags
-
-Here you can add flags to the specific platform compiler.
-
-#### libs
-
-This flag is only used if you wish to add a library that is part of the platform or Defold SDK. All libraries in your app's extensions are added automatically, and you shouldn't add those to this flag. Here's an example where the 3D physics is removed from the engine:
-
-    x86_64-linux:
-        context:
-            excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision"]
-            excludeSymbols: []
-            libs: ["physics_2d"]
-            linkFlags: []
-
-#### Exclude flags
-
-These flags are used to remove things previously defined in the platform context. Here's an example of how to remove the Facebook extension from the engine (Note the `(.*)` which is a regexp to help remove the correct items).
-
-    armv7-android:
-        context:
-            excludeLibs: ["facebookext"]
-            excludeJars: ["(.*)/facebooksdk.jar","(.*)/facebook_android.jar"]
-            excludeSymbols: ["FacebookExt"]
-            libs: []
-            linkFlags: []
-
-#### Where's the list of all flags, libraries, symbols???
-
-We might put some of them here, but we also think our time is better spent completing the feature of moving the manifest configuration into the Editor, making it a seamless step for the user.
-
-In the meantime, we'll keep the [Manifestation](https://britzl.github.io/manifestation/) tool updated.

+ 1 - 1
docs/en/manuals/extensions-defold-sdk.md

@@ -45,4 +45,4 @@ The available SDK functions are documented in our [API reference](/ref/dmExtensi
 * [Shared Library](/ref/sharedlibrary/) - Utility functions for shared library export/import.
 * [Sony vector Math Library](../assets/Vector_Math_Library-Overview.pdf) - The Sony Vector Math library mainly provides functions used in 3-D graphics for 3-D and 4-D vector operations, matrix operations, and quaternion operations.
 
-If you need the `dmsdk/sdk.h` header file for code completion in your editor of choice it can be found [here in the main GitHub repository for Defold](https://github.com/defold/defold/blob/dev/engine/sdk/src/dmsdk/sdk.h) with [header files for the individual namespaces here](https://github.com/defold/defold/tree/dev/engine/dlib/src/dmsdk/dlib).
+The Defold SDK headers are included as a separate `defoldsdk_headers.zip` archive for each Defold [release on GitHub](https://github.com/defold/defold/releases). You can use these headers for code completion in your editor of choice.

+ 74 - 0
docs/en/manuals/extensions-ext-manifests.md

@@ -0,0 +1,74 @@
+---
+title: Native extensions - extension manifest
+brief: This manual describes the extension manifest and how it correlates to the application manifest.
+---
+
+# Extension manifest
+
+The extension manifest is a configuration file with flags and defines used when building a single extension. This configuration is combined with an application level configuration and a base level configuration for the Defold engine itself.
+
+## App Manifest
+
+The application manifest (file extension `.appmanifest`) is an application level configuration of how to build your game on the build servers. The application manifest lets you remove parts of the engine that you don't use. If you don't need a physics engine, you can remove that from the executable to reduce it's size. Learn how to exclude unused feature [in the application manifest manual](/manuals/app-manifest).
+
+## Engine manifest
+
+The Defold engine has a build manifest (`build.yml`) which is included with each release of the engine and the Defold SDK. The manifest controls which SDK versions to use, which compilers, linkers and other tools to run and which default build and link flags to pass to these tools. The manifest can be found in share/extender/build_input.yml [on GitHub](https://github.com/defold/defold/blob/dev/share/extender/build_input.yml).
+
+## Extension Manifest
+
+The extension manifest (`ext.manifest`) on the other hand is a configuration file specifically for an extension. The extension manifest controls how the source code of the extension is compiled and linked and which additional libraries to include. 
+
+The three different manifest files all share the same syntax so that they can be merged and fully control how the extensions and the game is built.
+
+For each extension that is built, the manifests are combined as follows:
+
+	manifest = merge(game.appmanifest, ext.manifest, build.yml)
+
+This allows the user to override the default behaviour of the engine and also each extension. And, for the final link stage, we merge the app manifest with the defold manifest:
+
+	manifest = merge(game.appmanifest, build.yml)
+
+
+### The ext.manifest file
+
+Apart from the name of the extension, the manifest file can contain platform specific compile flags, link flags, libs and frameworks. If the *ext.manifest* file does not contain a "platforms" segment, or a platform is missing from the list, the platform you bundle for will still build, but without any extra flags set.
+
+Here is an example:
+
+```yaml
+name: "AdExtension"
+
+platforms:
+    arm64-ios:
+        context:
+            frameworks: ["CoreGraphics", "CFNetwork", "GLKit", "CoreMotion", "MessageUI", "MediaPlayer", "StoreKit", "MobileCoreServices", "AdSupport", "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreMotion", "CoreTelephony", "CoreVideo", "Foundation", "GLKit", "JavaScriptCore", "MediaPlayer", "MessageUI", "MobileCoreServices", "OpenGLES", "SafariServices", "StoreKit", "SystemConfiguration", "UIKit", "WebKit"]
+            flags:      ["-stdlib=libc++"]
+            linkFlags:  ["-ObjC"]
+            libs:       ["z", "c++", "sqlite3"]
+            defines:    ["MY_DEFINE"]
+
+    armv7-ios:
+        context:
+            frameworks: ["CoreGraphics", "CFNetwork", "GLKit", "CoreMotion", "MessageUI", "MediaPlayer", "StoreKit", "MobileCoreServices", "AdSupport", "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreMotion", "CoreTelephony", "CoreVideo", "Foundation", "GLKit", "JavaScriptCore", "MediaPlayer", "MessageUI", "MobileCoreServices", "OpenGLES", "SafariServices", "StoreKit", "SystemConfiguration", "UIKit", "WebKit"]
+            flags:      ["-stdlib=libc++"]
+            linkFlags:  ["-ObjC"]
+            libs:       ["z", "c++", "sqlite3"]
+            defines:    ["MY_DEFINE"]
+```
+
+#### Allowed keys
+
+Allowed keys are for platform specific compile flags are:
+
+* `frameworks` - Apple frameworks to include when building (iOS and OSX)
+* `flags` - Flags that should be passed to the compiler
+* `linkFlags` - Flags that should be passed to the linker
+* `libs` - Additional libraries to include when linking
+* `defines` - Defines to set when building
+* `aaptExtraPackages` - Extra package name that should be generated (Android)
+* `aaptExcludePackages` - Regexp (or exact names) of packages to exclude (Android)
+* `aaptExcludeResourceDirs` - Regexp (or exact names) of resource dirs to exclude (Android)
+* `excludeLibs`, `excludeJars`, `excludeSymbols` - These flags are used to remove things previously defined in the platform context.
+
+For all the keywords, we apply white listing filter. This is to avoid illegal path handling and accessing files outside of the build upload folder.

+ 1 - 42
docs/en/manuals/extensions.md

@@ -17,7 +17,7 @@ Defold provides a zero setup entry point to native extensions with a cloud based
 
 ![Cloud build](images/extensions/cloud_build.png)
 
-Defold provides the cloud build server free of charge, without any usage restrictions. The server is hosted in Europe, and the URL to which native code is sent is configured in the [Editor Preferences window](/manuals/editor-preferences/#extensions) or through the `--build-server` command line option to [bob](/manuals/bob/#usage). If you wish to learn more about the cloud build server or how to set up your own server please refer to the [instructions on GitHub](https://github.com/defold/extender).
+Defold provides the cloud build server free of charge, without any usage restrictions. The server is hosted in Europe, and the URL to which native code is sent is configured in the [Editor Preferences window](/manuals/editor-preferences/#extensions) or through the `--build-server` command line option to [bob](/manuals/bob/#usage). If you wish to set up your own server please [follow these instructions](/manuals/extender-local-setup).
 
 ## Project layout
 
@@ -233,47 +233,6 @@ The following identifiers are defined by the builder on each respective platform
 
 Build server logs are available when the project is using native extensions. The build server log (`log.txt`) is downloaded together with the custom engine when the project is built and stored inside the file `.internal/%platform%/build.zip` and also unpacked to the build folder of your project.
 
-
-## The ext.manifest file
-
-Apart from the name of the extension, the manifest file can contain platform specific compile flags, link flags, libs and frameworks. If the *ext.manifest* file does not contain a "platforms" segment, or a platform is missing from the list, the platform you bundle for will still build, but without any extra flags set.
-
-Here is an example:
-
-```yaml
-name: "AdExtension"
-
-platforms:
-    arm64-ios:
-        context:
-            frameworks: ["CoreGraphics", "CFNetwork", "GLKit", "CoreMotion", "MessageUI", "MediaPlayer", "StoreKit", "MobileCoreServices", "AdSupport", "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreMotion", "CoreTelephony", "CoreVideo", "Foundation", "GLKit", "JavaScriptCore", "MediaPlayer", "MessageUI", "MobileCoreServices", "OpenGLES", "SafariServices", "StoreKit", "SystemConfiguration", "UIKit", "WebKit"]
-            flags:      ["-stdlib=libc++"]
-            linkFlags:  ["-ObjC"]
-            libs:       ["z", "c++", "sqlite3"]
-            defines:    ["MY_DEFINE"]
-
-    armv7-ios:
-        context:
-            frameworks: ["CoreGraphics", "CFNetwork", "GLKit", "CoreMotion", "MessageUI", "MediaPlayer", "StoreKit", "MobileCoreServices", "AdSupport", "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreMotion", "CoreTelephony", "CoreVideo", "Foundation", "GLKit", "JavaScriptCore", "MediaPlayer", "MessageUI", "MobileCoreServices", "OpenGLES", "SafariServices", "StoreKit", "SystemConfiguration", "UIKit", "WebKit"]
-            flags:      ["-stdlib=libc++"]
-            linkFlags:  ["-ObjC"]
-            libs:       ["z", "c++", "sqlite3"]
-            defines:    ["MY_DEFINE"]
-```
-
-### Allowed keys
-
-Allowed keys are for platform specific compile flags are:
-
-* `frameworks` - Apple frameworks to include when building (iOS and OSX)
-* `flags` - Flags that should be passed to the compiler
-* `linkFlags` - Flags that should be passed to the linker
-* `libs` - Libraries to include when linking
-* `defines` - Defines to set when building
-* `aaptExtraPackages` - Extra package name that should be generated (Android)
-* `aaptExcludePackages` - Regexp (or exact names) of packages to exclude (Android)
-* `aaptExcludeResourceDirs` - Regexp (or exact names) of resource dirs to exclude (Android)
-
 ## Example extensions
 
 * [Basic extension example](https://github.com/defold/template-native-extension) (the extension from this manual)

+ 1 - 1
docs/en/shared/platforms.md

@@ -1,3 +1,3 @@
 Supported platforms are `ios`, `android`, `osx`, `win32`, `linux`, `web`.
 
-Supported `arc-platform` pairs are `armv7-ios`, `arm64-ios`, `x86_64-ios`, `armv7-android`, `arm64-android`, `x86-osx`, `x86_64-osx`, `x86-win32`, `x86_64-win32`, `x86_64-linux`, `js-web` and `wasm-web`.
+Supported `arc-platform` pairs are `arm64-ios`, `x86_64-ios`, `armv7-android`, `arm64-android`, `arm64-osx`, `x86_64-osx`, `x86-win32`, `x86_64-win32`, `x86_64-linux`, `js-web` and `wasm-web`.