Browse Source

Added cocoapods and gradle docs

Björn Ritzl 9 tháng trước cách đây
mục cha
commit
23e8177fdd

+ 8 - 0
docs/en/en.json

@@ -1654,6 +1654,14 @@
                         "path": "/manuals/extensions-defold-sdk",
                         "name": "Defold SDK"
                     },
+                    {
+                        "path": "/manuals/extensions-gradle",
+                        "name": "Gradle dependencies"
+                    },
+                    {
+                        "path": "/manuals/extensions-cocoapods",
+                        "name": "Cocoapod dependencies"
+                    },
                     {
                         "path": "/manuals/extensions-script-api",
                         "name": "Adding auto-complete definition"

+ 27 - 0
docs/en/manuals/extensions-cocoapods.md

@@ -0,0 +1,27 @@
+---
+title: Using CocoaPods dependencies in iOS and macOS builds
+brief: This manual explains how to use CocoaPods to resolve dependencies in iOS and macOS builds.
+---
+
+# CocoaPods
+
+[CocoaPods](https://cocoapods.org/) is a dependency manager for Swift and Objective-C Cocoa projects. CocoaPods is typically used to manage and integrate dependencies in Xcode projects. Defold does not use Xcode when building for iOS and macOS, but it still uses Cocoapods to resolve dependencies on the build server.
+
+
+## Resolving dependencies
+
+Native extensions can include a `Podfile` file in the `manifests/ios` and `manifests/osx` folders to specify the extension dependencies. Example:
+
+```
+platform :ios '11.0'
+
+pod 'FirebaseCore', '10.22.0'
+pod 'FirebaseInstallations', '10.22.0'
+```
+
+The build server will collect the `Podfile` files from all the extensions and use these to resolve all dependencies and include them when building the native code.
+
+Examples:
+
+* https://github.com/defold/extension-firebase/blob/master/firebase/manifests/ios/Podfile
+* https://github.com/defold/extension-facebook/blob/master/facebook/manifests/ios/Podfile

+ 31 - 0
docs/en/manuals/extensions-gradle.md

@@ -0,0 +1,31 @@
+---
+title: Using Gradle dependencies in Android builds
+brief: This manual explains how to use Gradle to resolve dependencies in Android builds.
+---
+
+# Gradle for Android
+
+Contrary to how Android applications are typically built, Defold does not use [Gradle](https://gradle.org/) for the entire build process. Instead Defold uses Android command line tools such as `aapt2` and `bundletool` directly in the local build and only leverages Gradle while resolving dependencies on the build server.
+
+
+## Resolving dependencies
+
+Native extensions can include a `build.gradle` file in the `manifests/android` folder to specify the extension dependencies. Example:
+
+```
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    implementation 'com.google.firebase:firebase-installations:17.2.0'
+    implementation 'com.google.android.gms:play-services-base:18.2.0'
+}
+```
+
+The build server will collect the `build.gradle` files from all the extensions and use these to resolve all dependencies and include them when building the native code.
+
+Examples:
+
+* https://github.com/defold/extension-firebase/blob/master/firebase/manifests/android/build.gradle
+* https://github.com/defold/extension-facebook/blob/master/facebook/manifests/android/build.gradle

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

@@ -66,8 +66,11 @@ To create a new extension, create a folder in the project root. This folder will
 
 The optional *manifests* folder of an extension contains additional files used in the build and bundling process. Files should be placed in subfolders named by `platform`:
 
-* `android` - This folder accepts a manifest stub file to be merged into the main application ([as described here](/manuals/extensions-manifest-merge-tool)). The folder can also contain a `build.gradle` file with dependencies to be resolved by Gradle ([example](https://github.com/defold/extension-facebook/blob/master/facebook/manifests/android/build.gradle)). Finally the folder can also contain zero or more ProGuard files (experimental).
+* `android` - This folder accepts a manifest stub file to be merged into the main application ([as described here](/manuals/extensions-manifest-merge-tool)).
+  * The folder can also contain a `build.gradle` file with dependencies to be [resolved by Gradle](/manuals/extensions-gradle).
+  * Finally the folder can also contain zero or more ProGuard files (experimental).
 * `ios` - This folder accepts a manifest stub file to be merged into the main application ([as described here](/manuals/extensions-manifest-merge-tool)).
+  * The folder can also contain a `Podfile` file with dependencies to be [resolved by Cocoapods](/manuals/extensions-cocoapods).
 * `osx` - This folder accepts a manifest stub file to be merged into the main application ([as described here](/manuals/extensions-manifest-merge-tool)).
 * `web` - This folder accepts a manifest stub file to be merged into the main application ([as described here](/manuals/extensions-manifest-merge-tool)).