diff --git a/Editor/BuildResources/ARCoreiOSCloudAnchorDependencies.template b/Editor/BuildResources/ARCoreiOSCloudAnchorDependencies.template index b39e4c1..f85f957 100644 --- a/Editor/BuildResources/ARCoreiOSCloudAnchorDependencies.template +++ b/Editor/BuildResources/ARCoreiOSCloudAnchorDependencies.template @@ -1,6 +1,6 @@ - + diff --git a/Editor/BuildResources/ARCoreiOSDependencies.template b/Editor/BuildResources/ARCoreiOSDependencies.template index aee61b0..587a608 100644 --- a/Editor/BuildResources/ARCoreiOSDependencies.template +++ b/Editor/BuildResources/ARCoreiOSDependencies.template @@ -1,6 +1,6 @@ - + diff --git a/Editor/BuildResources/ARCoreiOSGeospatialDependencies.template b/Editor/BuildResources/ARCoreiOSGeospatialDependencies.template index ba408e7..24e3543 100644 --- a/Editor/BuildResources/ARCoreiOSGeospatialDependencies.template +++ b/Editor/BuildResources/ARCoreiOSGeospatialDependencies.template @@ -1,6 +1,6 @@ - + diff --git a/Editor/BuildResources/ARCoreiOSSemanticsDependencies.template b/Editor/BuildResources/ARCoreiOSSemanticsDependencies.template index 4c223b3..0fd5606 100644 --- a/Editor/BuildResources/ARCoreiOSSemanticsDependencies.template +++ b/Editor/BuildResources/ARCoreiOSSemanticsDependencies.template @@ -1,6 +1,6 @@ - + diff --git a/Editor/ExternalDependencyManager/Editor/CHANGELOG.md b/Editor/ExternalDependencyManager/Editor/CHANGELOG.md index 31c8088..923ed3c 100644 --- a/Editor/ExternalDependencyManager/Editor/CHANGELOG.md +++ b/Editor/ExternalDependencyManager/Editor/CHANGELOG.md @@ -1,3 +1,29 @@ +# Version 1.2.183 - Sep 18, 2024 +* Android Resolver - Handle package paths that don't include a version hash, + which is no longer present with Unity 6. Fixes #697 +* Android Resolver - Handle packages referenced using local file paths. + Fixes #701 + +# Version 1.2.182 - Aug 2, 2024 +* General - Check for gradle version instead of Unity version when determining + the template files to modify. + +# Version 1.2.181 - Jun 26, 2024 +* General - Disable `EditorMeasurement` reporting that relied on the + Measurement Protocol for Universal Analytics. + +# Version 1.2.180 - Jun 4, 2024 +* General - Fix project settings resetting on domain reload. + Fixes #524 + +# Version 1.2.179 - Feb 12, 2024 +* Android Resolver - Added logic to automatically turn on `mainTemplate.gradle` + for new projects, and prompt users to enable it on projects that have previously + had the resolver run. + +# Version 1.2.178 - Dec 20, 2023 +* Added [OpenUPM support](https://openupm.com/packages/com.google.external-dependency-manager/). + # Version 1.2.177 - Aug 14, 2023 * iOS Resolver - Added `/opt/homebrew/bin` to Cocoapod executable search path. Fixes #627 diff --git a/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta b/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta index f9a84fb..2909df3 100644 --- a/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta +++ b/Editor/ExternalDependencyManager/Editor/CHANGELOG.md.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 6cdb6572965940cb9bcd8ce572951c7d +guid: 2b4957d4e158489ca7b410312d84e001 labels: -- gvh -- gvh_version-1.2.177 +- gvh_version-1.2.183 - gvhp_exportpath-ExternalDependencyManager/Editor/CHANGELOG.md +- gvh TextScriptImporter: externalObjects: {} userData: diff --git a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll index f28b310..e756847 100644 Binary files a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll and b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.mdb b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.mdb deleted file mode 100644 index 930076c..0000000 Binary files a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.mdb and /dev/null differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.mdb.meta b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.mdb.meta deleted file mode 100644 index 44d697a..0000000 --- a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.mdb.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: adacdf2f31cf474c99788c9454063fed -labels: -- gvh -- gvh_rename_to_disable -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.IOSResolver.dll.mdb -- gvhp_targets-editor -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta index 99ec594..baf1980 100644 --- a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta +++ b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta @@ -30,9 +30,9 @@ PluginImporter: userData: validateReferences: 1 fileFormatVersion: 2 -guid: 5552c54c11d94016bcfe740f27df44a6 +guid: a366c71c93ae411ea1ece423e8b1538f labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll - gvh -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.IOSResolver.dll - gvhp_targets-editor diff --git a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.pdb b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.pdb new file mode 100644 index 0000000..d410ff5 Binary files /dev/null and b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.pdb differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.pdb.meta b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.pdb.meta new file mode 100644 index 0000000..61b14fd --- /dev/null +++ b/Editor/ExternalDependencyManager/Editor/Google.IOSResolver.pdb.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 586d58d05379419a8006364797db5fc8 +labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.pdb +- gvh +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll index 28462c5..736956c 100644 Binary files a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll and b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.mdb b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.mdb deleted file mode 100644 index 28fc0b6..0000000 Binary files a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.mdb and /dev/null differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.mdb.meta b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.mdb.meta deleted file mode 100644 index 02c72b3..0000000 --- a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.mdb.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: c613343662334614b65918fa6cf9c17e -labels: -- gvh -- gvh_rename_to_disable -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.JarResolver.dll.mdb -- gvhp_targets-editor -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.meta b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.meta index eefc7cc..bc666ff 100644 --- a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.meta +++ b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.dll.meta @@ -30,9 +30,9 @@ PluginImporter: userData: validateReferences: 1 fileFormatVersion: 2 -guid: 1f4f113972f04c3695341dfb3ba48d3b +guid: 9cab53159f0a43b68c16552c892bd579 labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll - gvh -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.JarResolver.dll - gvhp_targets-editor diff --git a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.pdb b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.pdb new file mode 100644 index 0000000..281accf Binary files /dev/null and b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.pdb differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.JarResolver.pdb.meta b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.pdb.meta new file mode 100644 index 0000000..c96b585 --- /dev/null +++ b/Editor/ExternalDependencyManager/Editor/Google.JarResolver.pdb.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e0353d541d44c98a54fc99fd1f63d18 +labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.pdb +- gvh +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll index 0064fe6..7aec9fc 100644 Binary files a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll and b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.mdb b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.mdb deleted file mode 100644 index fb0bba3..0000000 Binary files a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.mdb and /dev/null differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.mdb.meta b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.mdb.meta deleted file mode 100644 index d8b705b..0000000 --- a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.mdb.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: b60e304f823d423da748809d088d67b1 -labels: -- gvh -- gvh_rename_to_disable -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.PackageManagerResolver.dll.mdb -- gvhp_targets-editor -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.meta b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.meta index 0f38bfb..0f8ee49 100644 --- a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.meta +++ b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.dll.meta @@ -30,9 +30,9 @@ PluginImporter: userData: validateReferences: 1 fileFormatVersion: 2 -guid: 413ed4abd14645c38ebbd8c5ff26e9de +guid: 06f4aa8c065049e5970eedec5f52600f labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll - gvh -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.PackageManagerResolver.dll - gvhp_targets-editor diff --git a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.pdb b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.pdb new file mode 100644 index 0000000..cb06c26 Binary files /dev/null and b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.pdb differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.pdb.meta b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.pdb.meta new file mode 100644 index 0000000..c389e6e --- /dev/null +++ b/Editor/ExternalDependencyManager/Editor/Google.PackageManagerResolver.pdb.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 057fc189f58c4beea22228ccf76de84a +labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.pdb +- gvh +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll index 03ad637..d313c62 100644 Binary files a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll and b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb deleted file mode 100644 index caa8dbb..0000000 Binary files a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb and /dev/null differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta index b53a476..ea57ac5 100644 --- a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta +++ b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 86460262ea60447dbb6a62d21167790f +guid: 164f2f671ce9410dadebde5826bc0b51 labels: -- gvh -- gvh_version-1.2.177 +- gvh_version-1.2.183 - gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll +- gvh - gvhp_targets-editor PluginImporter: externalObjects: {} diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.pdb b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.pdb new file mode 100644 index 0000000..217ac51 Binary files /dev/null and b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.pdb differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb.meta b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.pdb.meta similarity index 71% rename from Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb.meta rename to Editor/ExternalDependencyManager/Editor/Google.VersionHandler.pdb.meta index fba0379..ec0c186 100644 --- a/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb.meta +++ b/Editor/ExternalDependencyManager/Editor/Google.VersionHandler.pdb.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 5855ffeab65945dc8f9cb3dc063f9eba +guid: d288fc5d6f024b9981c15982d8fd85ab labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.pdb - gvh -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll.mdb DefaultImporter: externalObjects: {} userData: diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll index 789a9f2..ec5f011 100644 Binary files a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll and b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.mdb b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.mdb deleted file mode 100644 index 72bfce3..0000000 Binary files a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.mdb and /dev/null differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.mdb.meta b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.mdb.meta deleted file mode 100644 index 3be8c8e..0000000 --- a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.mdb.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: bd203ff120ed4c69bfdeffa466beec72 -labels: -- gvh -- gvh_rename_to_disable -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.VersionHandlerImpl.dll.mdb -- gvhp_targets-editor -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.meta b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.meta index 62e5054..e21eb21 100644 --- a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.meta +++ b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.dll.meta @@ -30,9 +30,9 @@ PluginImporter: userData: validateReferences: 1 fileFormatVersion: 2 -guid: 38d0b40a7b2d44c6a6a2362599bfc41e +guid: ad4fd0d2f20345839aa31291c8c0c285 labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll - gvh -- gvh_version-1.2.177 -- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.VersionHandlerImpl.dll - gvhp_targets-editor diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.pdb b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.pdb new file mode 100644 index 0000000..1c7f97c Binary files /dev/null and b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.pdb differ diff --git a/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.pdb.meta b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.pdb.meta new file mode 100644 index 0000000..c70c0ee --- /dev/null +++ b/Editor/ExternalDependencyManager/Editor/Google.VersionHandlerImpl.pdb.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb5385e23ba94b15bd4c185022985fc5 +labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.pdb +- gvh +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/ExternalDependencyManager/Editor/LICENSE.md b/Editor/ExternalDependencyManager/Editor/LICENSE similarity index 99% rename from Editor/ExternalDependencyManager/Editor/LICENSE.md rename to Editor/ExternalDependencyManager/Editor/LICENSE index 6e4cd74..6258cc4 100644 --- a/Editor/ExternalDependencyManager/Editor/LICENSE.md +++ b/Editor/ExternalDependencyManager/Editor/LICENSE @@ -1,4 +1,4 @@ -Copyright 2014 Google LLC +Copyright (C) 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Editor/ExternalDependencyManager/Editor/LICENSE.md.meta b/Editor/ExternalDependencyManager/Editor/LICENSE.meta similarity index 67% rename from Editor/ExternalDependencyManager/Editor/LICENSE.md.meta rename to Editor/ExternalDependencyManager/Editor/LICENSE.meta index dbbe271..8cdb0f9 100644 --- a/Editor/ExternalDependencyManager/Editor/LICENSE.md.meta +++ b/Editor/ExternalDependencyManager/Editor/LICENSE.meta @@ -1,10 +1,10 @@ fileFormatVersion: 2 -guid: 61e923e8fff245a9bf5cfcf0774e75df +guid: 805e2c2846dd44248246ef896b03c176 labels: -- gvh_version-1.2.169 +- gvh_version-1.2.183 - gvhp_exportpath-ExternalDependencyManager/Editor/LICENSE - gvh -TextScriptImporter: +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/Editor/ExternalDependencyManager/Editor/README.md b/Editor/ExternalDependencyManager/Editor/README.md index c0ee576..3a7a5a2 100644 --- a/Editor/ExternalDependencyManager/Editor/README.md +++ b/Editor/ExternalDependencyManager/Editor/README.md @@ -1,239 +1,124 @@ -External Dependency Manager for Unity -======== +# External Dependency Manager for Unity -# Overview +[![openupm](https://img.shields.io/npm/v/com.google.external-dependency-manager?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.google.external-dependency-manager/) +[![openupm](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=downloads&query=%24.downloads&suffix=%2Fmonth&url=https%3A%2F%2Fpackage.openupm.com%2Fdownloads%2Fpoint%2Flast-month%2Fcom.google.external-dependency-manager)](https://openupm.com/packages/com.google.external-dependency-manager/) -The External Dependency Manager for Unity (EDM4U) -(formerly Play Services Resolver / Jar Resolver) is intended to be used by any -Unity plugin that requires: +## Overview - * Android specific libraries (e.g - [AARs](https://developer.android.com/studio/projects/android-library.html)). - * iOS [CocoaPods](https://cocoapods.org/). - * Version management of transitive dependencies. - * Management of Package Manager (PM) Registries. +The External Dependency Manager for Unity (EDM4U) (formerly Play Services +Resolver/Jar Resolver) is intended to be used by any Unity package or user that +requires: -Updated releases are available on -[GitHub](https://github.com/googlesamples/unity-jar-resolver) - -# Background - -Many Unity plugins have dependencies upon Android specific libraries, iOS -CocoaPods, and sometimes have transitive dependencies upon other Unity plugins. -This causes the following problems: - - * Integrating platform specific (e.g Android and iOS) libraries within a - Unity project can be complex and a burden on a Unity plugin maintainer. - * The process of resolving conflicting dependencies on platform specific - libraries is pushed to the developer attempting to use a Unity plugin. - The developer trying to use your plugin is very likely to give up when - faced with Android or iOS specific build errors. - * The process of resolving conflicting Unity plugins (due to shared Unity - plugin components) is pushed to the developer attempting to use your Unity - plugin. In an effort to resolve conflicts, the developer will very likely - attempt to resolve problems by deleting random files in your plugin, - report bugs when that doesn't work and finally give up. - -EDM provides solutions for each of these problems. - -If, after reading this, you need to debug usage of EDM in a Unity project, -consult the debugging [step-by-step guide](troubleshooting-faq.md). - -## Android Dependency Management - -The *Android Resolver* component of this plugin will download and integrate -Android library dependencies and handle any conflicts between plugins that share -the same dependencies. - -Without the Android Resolver, typically Unity plugins bundle their AAR and -JAR dependencies, e.g. a Unity plugin `SomePlugin` that requires the Google -Play Games Android library would redistribute the library and its transitive -dependencies in the folder `SomePlugin/Android/`. When a user imports -`SomeOtherPlugin` that includes the same libraries (potentially at different -versions) in `SomeOtherPlugin/Android/`, the developer using `SomePlugin` and -`SomeOtherPlugin` will see an error when building for Android that can be hard -to interpret. +* Android specific libraries (e.g + [AARs](https://developer.android.com/studio/projects/android-library.html)) -Using the Android Resolver to manage Android library dependencies: - - * Solves Android library conflicts between plugins. - * Handles all of the various processing steps required to use Android - libraries (AARs, JARs) in Unity 4.x and above projects. Almost all - versions of Unity have - at best - partial support for AARs. - * (Experimental) Supports minification of included Java components without - exporting a project. +* iOS [CocoaPods](https://cocoapods.org/) -## iOS Dependency Management +* Version management of transitive dependencies -The *iOS Resolver* component of this plugin integrates with -[CocoaPods](https://cocoapods.org/) to download and integrate iOS libraries -and frameworks into the Xcode project Unity generates when building for iOS. -Using CocoaPods allows multiple plugins to utilize shared components without -forcing developers to fix either duplicate or incompatible versions of -libraries included through multiple Unity plugins in their project. +* Management of Package Manager (PM) Registries -## Package Manager Registry Setup +If you want to add and use iOS/Android dependencies directly in your project, +then you should to install EDM4U in your project. -The [Package Manager](https://docs.unity3d.com/Manual/Packages.html) -(PM) makes use of [NPM](https://www.npmjs.com/) registry servers for package -hosting and provides ways to discover, install, upgrade and uninstall packages. -This makes it easier for developers to manage plugins within their projects. +If you are a package user and the plugin you are using depends on EDM4U, *and* +the package does not include EDM4U as a package dependency already, then you +should to install EDM4U in your project. -However, installing additional package registries requires a few manual steps -that can potentially be error prone. The *Package Manager Resolver* -component of this plugin integrates with -[PM](https://docs.unity3d.com/Manual/Packages.html) to provide a way to -auto-install PM package registries when a `.unitypackage` is installed which -allows plugin maintainers to ship a `.unitypackage` that can provide access -to their own PM registry server to make it easier for developers to -manage their plugins. +If you are a UPM package maintainer and your package requires EDM4U, then you +should add EDM4U as a +[package dependency](https://docs.unity3d.com/2019.3/Documentation/Manual/upm-dependencies.html) +in your package manifest (`package.json`): -## Unity Plugin Version Management +```json +{ + "dependencies": { + "com.google.external-dependency-manager": "1.2.178" + } +} +``` -Finally, the *Version Handler* component of this plugin simplifies the process -of managing transitive dependencies of Unity plugins and each plugin's upgrade -process. +You should still install EDM4U to test out the package during development. -For example, without the Version Handler plugin, if: +If you are a legacy `.unitypackage` package maintainer and your package requires +EDM4U, please ask the user to install EDM4U separately. You should install EDM4U +to test out the package during development. - * Unity plugin `SomePlugin` includes `EDM4U` plugin at - version 1.1. - * Unity plugin `SomeOtherPlugin` includes `EDM4U` - plugin at version 1.2. +Updated releases are available on +[GitHub](https://github.com/googlesamples/unity-jar-resolver) -The version of `EDM4U` included in the developer's project depends upon the -order the developer imports `SomePlugin` or `SomeOtherPlugin`. +## Requirements -This results in: +The *Android Resolver* and *iOS Resolver* components of the plugin only work +with Unity version 4.6.8 or higher. - * `EDM4U` at version 1.2, if `SomePlugin` is imported then `SomeOtherPlugin` - is imported. - * `EDM4U` at version 1.1, if `SomeOtherPlugin` is imported then - `SomePlugin` is imported. +The *Version Handler* component only works with Unity 5.x or higher as it +depends upon the `PluginImporter` UnityEditor API. -The Version Handler solves the problem of managing transitive dependencies by: +The *Package Manager Resolver* component only works with Unity 2018.4 or above, +when [scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html) support +was added to the Package Manager. - * Specifying a set of packaging requirements that enable a plugin at - different versions to be imported into a Unity project. - * Providing activation logic that selects the latest version of a plugin - within a project. +## Getting Started -When using the Version Handler to manage `EDM4U` included in `SomePlugin` and -`SomeOtherPlugin`, from the prior example, version 1.2 will always be the -version activated in a developer's Unity project. +Check out [troubleshooting](troubleshooting-faq.md) if you need help. -Plugin creators are encouraged to adopt this library to ease integration for -their customers. For more information about integrating EDM4U -into your own plugin, see the [Plugin Redistribution](#plugin-redistribution) -section of this document. +### Install via OpenUPM -# Analytics +EDM4U is available on +[OpenUPM](https://openupm.com/packages/com.google.external-dependency-manager/): -The External Dependency Manager for Unity plugin by default logs usage to Google -Analytics. The purpose of the logging is to quantitatively measure the usage of -functionality, to gather reports on integration failures and to inform future -improvements to the developer experience of the External Dependency Manager -plugin. Note that the analytics collected are limited to the scope of the EDM4U -plugin’s usage. +```shell +openupm add com.google.external-dependency-manager +``` -For details of what is logged, please refer to the usage of -`EditorMeasurement.Report()` in the source code. +### Install via Google APIs for Unity -# Requirements +EDM4U is available both in UPM and legacy `.unitypackage` formats on +[Google APIs for Unity](https://developers.google.com/unity/archive#external_dependency_manager_for_unity). -The *Android Resolver* and *iOS Resolver* components of the plugin only work -with Unity version 4.6.8 or higher. +You may install the UPM version (.tgz) as a +[local UPM package](https://docs.unity3d.com/Manual/upm-ui-local.html). -The *Version Handler* component only works with Unity 5.x or higher as it -depends upon the `PluginImporter` UnityEditor API. +You can also install EDM4U in your project as a `.unitypackage`. This is not +recommended due to potential conflicts. -The *Package Manager Resolver* component only works with -Unity 2018.4 or above, when -[scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html) -support was added to the Package Manager. +### Conflict Resolution -# Getting Started +For historical reasons, a package maintainer may choose to embed EDM4U in their +package for ease of installation. This will create a conflict when you try to +install EDM4U with the steps above, or with another package with embedded EDM4U. +If your project imported a `.unitypackage` that has a copy of EDM4U embedded in +it, you may safely delete it from your Assets folder. If your project depends on +another UPM package with EDM4U, please reach out to the package maintainer and +ask them to replace it with a dependency to this package. In the meantime, you +can workaround the issue by copying the package to your Packages folder (to +create an +[embedded package](https://docs.unity3d.com/Manual/upm-concepts.html#Embedded)) +and perform the steps yourself to avoid a dependency conflict. -Before you import EDM4U into your plugin project, you first -need to consider whether you intend to *redistribute* `EDM4U` -along with your own plugin. +### Config file -## Plugin Redistribution +To start adding dependencies to your project, copy and rename the +[SampleDependencies.xml](https://github.com/googlesamples/unity-jar-resolver/blob/master/sample/Assets/ExternalDependencyManager/Editor/SampleDependencies.xml) +file into your plugin and add the dependencies your project requires. -If you're a plugin maintainer, redistributing `EDM4U` inside your own plugin -will ease the integration process for your users, by resolving dependency -conflicts between your plugin and other plugins in a user's project. - -If you wish to redistribute `EDM4U` inside your plugin, -you **must** follow these steps when importing the -`external-dependency-manager-*.unitypackage`, and when exporting your own plugin -package: - - 1. Import the `external-dependency-manager-*.unitypackage` into your plugin - project by - [running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html), ensuring that - you add the `-gvh_disable` option. - 1. Export your plugin by [running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html), ensuring that - you: - - Include the contents of the `Assets/PlayServicesResolver` and - `Assets/ExternalDependencyManager` directory. - - Add the `-gvh_disable` option. +The XML file needs to be under an `Editor` directory and match the name +`*Dependencies.xml`. For example, `MyPlugin/Editor/MyPluginDependencies.xml`. -You **must** specify the `-gvh_disable` option in order for the Version -Handler to work correctly! +## Usages -For example, the following command will import the -`external-dependency-manager-1.2.46.0.unitypackage` into the project -`MyPluginProject` and export the entire Assets folder to -`MyPlugin.unitypackage`: - -``` -Unity -gvh_disable \ - -batchmode \ - -importPackage external-dependency-manager-1.2.46.0.unitypackage \ - -projectPath MyPluginProject \ - -exportPackage Assets MyPlugin.unitypackage \ - -quit -``` - -### Background - -The *Version Handler* component relies upon deferring the load of editor DLLs -so that it can run first and determine the latest version of a plugin component -to activate. The build of `EDM4U` plugin has Unity asset metadata that is -configured so that the editor components are not initially enabled when it's -imported into a Unity project. To maintain this configuration when importing -the `external-dependency-manager.unitypackage` into a Unity plugin project, you -*must* specify the command line option `-gvh_disable` which will prevent the -Version Handler component from running and changing the Unity asset metadata. - -# Android Resolver Usage +### Android Resolver The Android Resolver copies specified dependencies from local or remote Maven repositories into the Unity project when a user selects Android as the build target in the Unity editor. - 1. Add the `external-dependency-manager-*.unitypackage` to your plugin - project (assuming you are developing a plugin). If you are redistributing - EDM4U with your plugin, you **must** follow the - import steps in the [Getting Started](#getting-started) section! - - 2. Copy and rename the - [SampleDependencies.xml](https://github.com/googlesamples/unity-jar-resolver/blob/master/sample/Assets/ExternalDependencyManager/Editor/SampleDependencies.xml) - file into your plugin and add the dependencies your plugin requires. - - The XML file just needs to be under an `Editor` directory and match the - name `*Dependencies.xml`. For example, - `MyPlugin/Editor/MyPluginDependencies.xml`. - - 3. Follow the steps in the [Getting Started](#getting-started) - section when you are exporting your plugin package. - For example, to add the Google Play Games library -(`com.google.android.gms:play-services-games` package) at version `9.8.0` to -the set of a plugin's Android dependencies: +(`com.google.android.gms:play-services-games` package) at version `9.8.0` to the +set of a plugin's Android dependencies: -``` +```xml @@ -247,20 +132,22 @@ the set of a plugin's Android dependencies: The version specification (last component) supports: - * Specific versions e.g `9.8.0` - * Partial matches e.g `9.8.+` would match 9.8.0, 9.8.1 etc. choosing the most - recent version. - * Latest version using `LATEST` or `+`. We do *not* recommend using this - unless you're 100% sure the library you depend upon will not break your - Unity plugin in future. +* Specific versions e.g `9.8.0` + +* Partial matches e.g `9.8.+` would match 9.8.0, 9.8.1 etc. choosing the most + recent version + +* Latest version using `LATEST` or `+`. We do *not* recommend using this + unless you're 100% sure the library you depend upon will not break your + Unity plugin in future The above example specifies the dependency as a component of the Android SDK manager such that the Android SDK manager will be executed to install the -package if it's not found. If your Android dependency is located on Maven +package if it's not found. If your Android dependency is located on Maven central it's possible to specify the package simply using the `androidPackage` element: -``` +```xml @@ -268,170 +155,157 @@ element: ``` -## Auto-resolution +#### Auto-resolution By default the Android Resolver automatically monitors the dependencies you have -specified and the `Plugins/Android` folder of your Unity project. The -resolution process runs when the specified dependencies are not present in your -project. +specified and the `Plugins/Android` folder of your Unity project. The resolution +process runs when the specified dependencies are not present in your project. -The *auto-resolution* process can be disabled via the -`Assets > External Dependency Manager > Android Resolver > Settings` menu. +The *auto-resolution* process can be disabled via the `Assets > External +Dependency Manager > Android Resolver > Settings` menu. Manual resolution can be performed using the following menu options: - * `Assets > External Dependency Manager > Android Resolver > Resolve` - * `Assets > External Dependency Manager > Android Resolver > Force Resolve` +* `Assets > External Dependency Manager > Android Resolver > Resolve` -## Deleting libraries +* `Assets > External Dependency Manager > Android Resolver > Force Resolve` -Resolved packages are tracked via asset labels by the Android Resolver. -They can easily be deleted using the -`Assets > External Dependency Manager > Android Resolver > Delete Resolved Libraries` -menu item. +#### Deleting libraries -## Android Manifest Variable Processing +Resolved packages are tracked via asset labels by the Android Resolver. They can +easily be deleted using the `Assets > External Dependency Manager > Android +Resolver > Delete Resolved Libraries` menu item. + +#### Android Manifest Variable Processing Some AAR files (for example play-services-measurement) contain variables that -are processed by the Android Gradle plugin. Unfortunately, Unity does not +are processed by the Android Gradle plugin. Unfortunately, Unity does not perform the same processing when using Unity's Internal Build System, so the -Android Resolver plugin handles known cases of this variable substitution -by exploding the AAR into a folder and replacing `${applicationId}` with the +Android Resolver plugin handles known cases of this variable substitution by +exploding the AAR into a folder and replacing `${applicationId}` with the `bundleID`. Disabling AAR explosion and therefore Android manifest processing can be done via the `Assets > External Dependency Manager > Android Resolver > Settings` -menu. You may want to disable explosion of AARs if you're exporting a project -to be built with Gradle / Android Studio. +menu. You may want to disable explosion of AARs if you're exporting a project to +be built with Gradle/Android Studio. -## ABI Stripping +#### ABI Stripping -Some AAR files contain native libraries (.so files) for each ABI supported -by Android. Unfortunately, when targeting a single ABI (e.g x86), Unity does -not strip native libraries for unused ABIs. To strip unused ABIs, the Android -Resolver plugin explodes an AAR into a folder and removes unused ABIs to -reduce the built APK size. Furthermore, if native libraries are not stripped -from an APK (e.g you have a mix of Unity's x86 library and some armeabi-v7a -libraries) Android may attempt to load the wrong library for the current -runtime ABI completely breaking your plugin when targeting some architectures. +Some AAR files contain native libraries (.so files) for each ABI supported by +Android. Unfortunately, when targeting a single ABI (e.g x86), Unity does not +strip native libraries for unused ABIs. To strip unused ABIs, the Android +Resolver plugin explodes an AAR into a folder and removes unused ABIs to reduce +the built APK size. Furthermore, if native libraries are not stripped from an +APK (e.g you have a mix of Unity's x86 library and some armeabi-v7a libraries) +Android may attempt to load the wrong library for the current runtime ABI +completely breaking your plugin when targeting some architectures. -AAR explosion and therefore ABI stripping can be disabled via the -`Assets > External Dependency Manager > Android Resolver > Settings` menu. -You may want to disable explosion of AARs if you're exporting a project to be -built with Gradle / Android Studio. +AAR explosion and therefore ABI stripping can be disabled via the `Assets > +External Dependency Manager > Android Resolver > Settings` menu. You may want to +disable explosion of AARs if you're exporting a project to be built with +Gradle/Android Studio. -## Resolution Strategies +#### Resolution Strategies By default the Android Resolver will use Gradle to download dependencies prior -to integrating them into a Unity project. This works with Unity's internal -build system and Gradle / Android Studio project export. +to integrating them into a Unity project. This works with Unity's internal build +system and Gradle/Android Studio project export. -It's possible to change the resolution strategy via the -`Assets > External Dependency Manager > Android Resolver > Settings` menu. +It's possible to change the resolution strategy via the `Assets > External +Dependency Manager > Android Resolver > Settings` menu. -### Download Artifacts with Gradle +##### Download Artifacts with Gradle Using the default resolution strategy, the Android resolver executes the following operations: - - Remove the result of previous Android resolutions. - e.g Delete all files and directories labeled with "gpsr" under - `Plugins/Android` from the project. - - Collect the set of Android dependencies (libraries) specified by a - project's `*Dependencies.xml` files. - - Run `download_artifacts.gradle` with Gradle to resolve conflicts and, - if successful, download the set of resolved Android libraries (AARs, JARs). - - Process each AAR / JAR so that it can be used with the currently selected - Unity build system (e.g Internal vs. Gradle, Export vs. No Export). - This involves patching each reference to `applicationId` in the - AndroidManifest.xml with the project's bundle ID. This means resolution - must be run if the bundle ID is changed again. - - Move the processed AARs to `Plugins/Android` so they will be included when - Unity invokes the Android build. - -### Integrate into mainTemplate.gradle +- Remove the result of previous Android resolutions. E.g Delete all files and + directories labeled with "gpsr" under `Plugins/Android` from the project. + +- Collect the set of Android dependencies (libraries) specified by a project's + `*Dependencies.xml` files. + +- Run `download_artifacts.gradle` with Gradle to resolve conflicts and, if + successful, download the set of resolved Android libraries (AARs, JARs). + +- Process each AAR/JAR so that it can be used with the currently selected + Unity build system (e.g Internal vs. Gradle, Export vs. No Export). This + involves patching each reference to `applicationId` in the + `AndroidManifest.xml` with the project's bundle ID. This means resolution + must be run again if the bundle ID has changed. + +- Move the processed AARs to `Plugins/Android` so they will be included when + Unity invokes the Android build. + +##### Integrate into mainTemplate.gradle Unity 5.6 introduced support for customizing the `build.gradle` used to build Unity projects with Gradle. When the *Patch mainTemplate.gradle* setting is enabled, rather than downloading artifacts before the build, Android resolution results in the execution of the following operations: - - Remove the result of previous Android resolutions. - e.g Delete all files and directories labeled with "gpsr" under - `Plugins/Android` from the project and remove sections delimited with - `// Android Resolver * Start` and `// Android Resolver * End` lines. - - Collect the set of Android dependencies (libraries) specified by a - project's `*Dependencies.xml` files. - - Rename any `.srcaar` files in the build to `.aar` and exclude them from - being included directly by Unity in the Android build as - `mainTemplate.gradle` will be patched to include them instead from their - local maven repositories. - - Inject the required Gradle repositories into `mainTemplate.gradle` at the - line matching the pattern - `.*apply plugin: 'com\.android\.(application|library)'.*` or the section - starting at the line `// Android Resolver Repos Start`. - If you want to control the injection point in the file, the section - delimited by the lines `// Android Resolver Repos Start` and - `// Android Resolver Repos End` should be placed in the global scope - before the `dependencies` section. - - Inject the required Android dependencies (libraries) into - `mainTemplate.gradle` at the line matching the pattern `***DEPS***` or - the section starting at the line `// Android Resolver Dependencies Start`. - If you want to control the injection point in the file, the section - delimited by the lines `// Android Resolver Dependencies Start` and - `// Android Resolver Dependencies End` should be placed in the - `dependencies` section. - - Inject the packaging options logic, which excludes architecture specific - libraries based upon the selected build target, into `mainTemplate.gradle` - at the line matching the pattern `android +{` or the section starting at - the line `// Android Resolver Exclusions Start`. - If you want to control the injection point in the file, the section - delimited by the lines `// Android Resolver Exclusions Start` and - `// Android Resolver Exclusions End` should be placed in the global - scope before the `android` section. - -## Dependency Tracking +- Remove the result of previous Android resolutions. E.g Delete all files and + directories labeled with "gpsr" under `Plugins/Android` from the project and + remove sections delimited with `// Android Resolver * Start` and `// Android + Resolver * End` lines. + +- Collect the set of Android dependencies (libraries) specified by a project's + `*Dependencies.xml` files. + +- Rename any `.srcaar` files in the build to `.aar` and exclude them from + being included directly by Unity in the Android build as + `mainTemplate.gradle` will be patched to include them instead from their + local maven repositories. + +- Inject the required Gradle repositories into `mainTemplate.gradle` at the + line matching the pattern `.*apply plugin: + 'com\.android\.(application|library)'.*` or the section starting at the line + `// Android Resolver Repos Start`. If you want to control the injection + point in the file, the section delimited by the lines `// Android Resolver + Repos Start` and `// Android Resolver Repos End` should be placed in the + global scope before the `dependencies` section. + +- Inject the required Android dependencies (libraries) into + `mainTemplate.gradle` at the line matching the pattern `***DEPS***` or the + section starting at the line `// Android Resolver Dependencies Start`. If + you want to control the injection point in the file, the section delimited + by the lines `// Android Resolver Dependencies Start` and `// Android + Resolver Dependencies End` should be placed in the `dependencies` section. + +- Inject the packaging options logic, which excludes architecture specific + libraries based upon the selected build target, into `mainTemplate.gradle` + at the line matching the pattern `android +{` or the section starting at the + line `// Android Resolver Exclusions Start`. If you want to control the + injection point in the file, the section delimited by the lines `// Android + Resolver Exclusions Start` and `// Android Resolver Exclusions End` should + be placed in the global scope before the `android` section. + +#### Dependency Tracking The Android Resolver creates the `ProjectSettings/AndroidResolverDependencies.xml` to quickly determine the set -of resolved dependencies in a project. This is used by the auto-resolution +of resolved dependencies in a project. This is used by the auto-resolution process to only run the expensive resolution process when necessary. -## Displaying Dependencies +#### Displaying Dependencies -It's possible to display the set of dependencies the Android Resolver -would download and process in your project via the -`Assets > External Dependency Manager > Android Resolver > Display Libraries` -menu item. +It's possible to display the set of dependencies the Android Resolver would +download and process in your project via the `Assets > External Dependency +Manager > Android Resolver > Display Libraries` menu item. -# iOS Resolver Usage +### iOS Resolver The iOS resolver component of this plugin manages -[CocoaPods](https://cocoapods.org/). A CocoaPods `Podfile` is generated and -the `pod` tool is executed as a post build process step to add dependencies -to the Xcode project exported by Unity. +[CocoaPods](https://cocoapods.org/). A CocoaPods `Podfile` is generated and the +`pod` tool is executed as a post build process step to add dependencies to the +Xcode project exported by Unity. Dependencies for iOS are added by referring to CocoaPods. - 1. Add the `external-dependency-manager-*.unitypackage` to your plugin - project (assuming you are developing a plugin). If you are redistributing - EDM4U with your plugin, you **must** follow the - import steps in the [Getting Started](#getting-started) section! - - 2. Copy and rename the - [SampleDependencies.xml](https://github.com/googlesamples/unity-jar-resolver/blob/master/sample/Assets/ExternalDependencyManager/Editor/SampleDependencies.xml) - file into your plugin and add the dependencies your plugin requires. - - The XML file just needs to be under an `Editor` directory and match the - name `*Dependencies.xml`. For example, - `MyPlugin/Editor/MyPluginDependencies.xml`. - - 3. Follow the steps in the [Getting Started](#getting-started) - section when you are exporting your plugin package. - For example, to add the AdMob pod, version 7.0 or greater with bitcode enabled: -``` +```xml ``` -## Integration Strategies +#### Integration Strategies The `CocoaPods` are either: - * Downloaded and injected into the Xcode project file directly, rather than - creating a separate xcworkspace. We call this `Xcode project` integration. - * If the Unity version supports opening a xcworkspace file, the `pod` tool - is used as intended to generate a xcworkspace which references the - CocoaPods. We call this `Xcode workspace` integration. -The resolution strategy can be changed via the -`Assets > External Dependency Manager > iOS Resolver > Settings` menu. +* Downloaded and injected into the Xcode project file directly, rather than + creating a separate xcworkspace. We call this `Xcode project` integration. + +* If the Unity version supports opening a xcworkspace file, the `pod` tool is + used as intended to generate a xcworkspace which references the CocoaPods. + We call this `Xcode workspace` integration. + +The resolution strategy can be changed via the `Assets > External Dependency +Manager > iOS Resolver > Settings` menu. + +##### Appending text to generated Podfile -### Appending text to generated Podfile In order to modify the generated Podfile you can create a script like this: -``` + +```csharp using System.IO; -public class PostProcessIOS : MonoBehaviour { -[PostProcessBuildAttribute(45)]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50) -private static void PostProcessBuild_iOS(BuildTarget target, string buildPath) + +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEngine; + +public class PostProcessIOS : MonoBehaviour { - if (target == BuildTarget.iOS) + // Must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and + // that it's added before "pod install" (50). + [PostProcessBuildAttribute(45)] + private static void PostProcessBuild_iOS(BuildTarget target, string buildPath) { - - using (StreamWriter sw = File.AppendText(buildPath + "/Podfile")) + if (target == BuildTarget.iOS) { - //in this example I'm adding an app extension - sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend"); + using (StreamWriter sw = File.AppendText(buildPath + "/Podfile")) + { + // E.g. add an app extension + sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend"); + } } } } ``` -# Package Manager Resolver Usage +### Package Manager Resolver Adding registries to the -[Package Manager](https://docs.unity3d.com/Manual/Packages.html) -(PM) is a manual process. The Package Manager Resolver (PMR) component -of this plugin makes it easy for plugin maintainers to distribute new PM -registry servers and easy for plugin users to manage PM registry servers. - -## Adding Registries +[Package Manager](https://docs.unity3d.com/Manual/Packages.html) (PM) is a +manual process. The Package Manager Resolver (PMR) component of this plugin +makes it easy for plugin maintainers to distribute new PM registry servers and +easy for plugin users to manage PM registry servers. - 1. Add the `external-dependency-manager-*.unitypackage` to your plugin - project (assuming you are developing a plugin). If you are redistributing - EDM4U with your plugin, you **must** follow the - import steps in the [Getting Started](#getting-started) section! - - 2. Copy and rename the - [SampleRegistries.xml](https://github.com/googlesamples/unity-jar-resolver/blob/master/sample/Assets/ExternalDependencyManager/Editor/sample/Assets/ExternalDependencyManager/Editor/SampleRegistries.xml) - file into your plugin and add the registries your plugin requires. - - The XML file just needs to be under an `Editor` directory and match the - name `*Registries.xml` or labeled with `gumpr_registries`. For example, - `MyPlugin/Editor/MyPluginRegistries.xml`. - - 3. Follow the steps in the [Getting Started](#getting-started) - section when you are exporting your plugin package. +#### Adding Registries For example, to add a registry for plugins in the scope `com.coolstuff`: -``` +```xml External Dependency Manager > Package Manager Resolver > - Add Registries` will prompt the user with a window which allows them to - add registries discovered in the project to the Package Manager. -* `Assets > External Dependency Manager > Package Manager Resolver > - Remove Registries` will prompt the user with a window which allows them to - remove registries discovered in the project from the Package Manager. -* `Assets > External Dependency Manager > Package Manager Resolver > - Modify Registries` will prompt the user with a window which allows them to - add or remove registries discovered in the project. - -## Migration - -PMR can migrate Version Handler packages installed in the `Assets` folder -to PM packages. This requires the plugins to implement the following: - -* `.unitypackage` must include a Version Handler manifests that describes - the components of the plugin. If the plugin has no dependencies - the manifest would just include the files in the plugin. -* The PM package JSON provided by the registry must include a keyword - (in the `versions.VERSION.keyword` list) that maps the PM package - to a Version Handler package using the format - `vh-name:VERSION_HANDLER_MANIFEST_NAME` where `VERSION_HANDLER_MANIFEST_NAME` - is the name of the manifest defined in the `.unitypackage`. For - more information see the description of the `gvhp_manifestname` asset label - in the *Version Handler Usage* section. - -When using the `Assets > External Dependency Manager > -Package Manager Resolver > Migrate Packages` menu option, PMR then -will: - -* List all Version Handler manager packages in the project. -* Search all available packages in the PM registries and fetch keywords - associated with each package parsing the Version Handler manifest names - for each package. -* Map each installed Version Handler package to a PM package. -* Prompt the user to migrate the discovered packages. -* Perform package migration for all selected packages if the user clicks - the `Apply` button. - -## Configuration - -PMR can be configured via the `Assets > External Dependency Manager > -Package Manager Resolver > Settings` menu option: - -* `Add package registries` when enabled, when the plugin loads or registry - configuration files change, this will prompt the user to add registries - that are not present in the Package Manager. -* `Prompt to add package registries` will cause a developer to be prompted - with a window that will ask for confirmation before adding registries. - When this is disabled registries are added silently to the project. -* `Prompt to migrate packages` will cause a developer to be prompted - with a window that will ask for confirmation before migrating packages - installed in the `Assets` directory to PM packages. -* `Enable Analytics Reporting` when enabled, reports the use of the plugin - to the developers so they can make imrpovements. -* `Verbose logging` when enabled prints debug information to the console - which can be useful when filing bug reports. - -# Version Handler Usage +#### Managing Registries + +It's possible to add and remove registries that are specified via PMR XML +configuration files via the following menu options: + +* `Assets > External Dependency Manager > Package Manager Resolver > Add + Registries` will prompt the user with a window which allows them to add + registries discovered in the project to the Package Manager. + +* `Assets > External Dependency Manager > Package Manager Resolver > Remove + Registries` will prompt the user with a window which allows them to remove + registries discovered in the project from the Package Manager. + +* `Assets > External Dependency Manager > Package Manager Resolver > Modify + Registries` will prompt the user with a window which allows them to add or + remove registries discovered in the project. + +#### Migration + +PMR can migrate Version Handler packages installed in the `Assets` folder to PM +packages. This requires the plugins to implement the following: + +* `.unitypackage` must include a Version Handler manifests that describes the + components of the plugin. If the plugin has no dependencies the manifest + would just include the files in the plugin. + +* The PM package JSON provided by the registry must include a keyword (in the + `versions.VERSION.keyword` list) that maps the PM package to a Version + Handler package using the format `vh-name:VERSION_HANDLER_MANIFEST_NAME` + where `VERSION_HANDLER_MANIFEST_NAME` is the name of the manifest defined in + the `.unitypackage`. For more information see the description of the + `gvhp_manifestname` asset label in the [Version Handler](#version-handler) + section. + +When using the `Assets > External Dependency Manager > Package Manager +Resolver > Migrate Packages` menu option, PMR then will: + +* List all Version Handler manager packages in the project. + +* Search all available packages in the PM registries and fetch keywords + associated with each package parsing the Version Handler manifest names for + each package. + +* Map each installed Version Handler package to a PM package. + +* Prompt the user to migrate the discovered packages. + +* Perform package migration for all selected packages if the user clicks the + `Apply` button. + +#### Configuration + +PMR can be configured via the `Assets > External Dependency Manager > Package +Manager Resolver > Settings` menu option: + +* `Add package registries` when enabled, when the plugin loads or registry + configuration files change, this will prompt the user to add registries that + are not present in the Package Manager. + +* `Prompt to add package registries` will cause a developer to be prompted + with a window that will ask for confirmation before adding registries. When + this is disabled registries are added silently to the project. + +* `Prompt to migrate packages` will cause a developer to be prompted with a + window that will ask for confirmation before migrating packages installed in + the `Assets` directory to PM packages. + +* `Enable Analytics Reporting` when enabled, reports the use of the plugin to + the developers so they can make imrpovements. + +* `Verbose logging` when enabled prints debug information to the console which + can be useful when filing bug reports. + +### Version Handler The Version Handler component of this plugin manages: -* Shared Unity plugin dependencies. -* Upgrading Unity plugins by cleaning up old files from previous versions. -* Uninstallation of plugins that are distributed with manifest files. -* Restoration of plugin assets to their original install locations if assets - are tagged with the `exportpath` label. +* Shared Unity plugin dependencies. + +* Upgrading Unity plugins by cleaning up old files from previous versions. + +* Uninstallation of plugins that are distributed with manifest files. + +* Restoration of plugin assets to their original install locations if assets + are tagged with the `exportpath` label. Since the Version Handler needs to modify Unity asset metadata (`.meta` files), -to enable / disable components, rename and delete asset files it does not -work with Package Manager installed packages. It's still possible to -include EDM4U in Package Manager packages, the Version Handler component -simply won't do anything to PM plugins in this case. +to enable/disable components, rename and delete asset files it does not work +with Package Manager installed packages. It's still possible to include EDM4U in +Package Manager packages, the Version Handler component simply won't do anything +to PM plugins in this case. -## Using Version Handler Managed Plugins +#### Using Version Handler Managed Plugins -If a plugin is imported at multiple different versions into a project, if -the Version Handler is enabled, it will automatically check all managed -assets to determine the set of assets that are out of date and assets that -should be removed. To disable automatic checking managed assets disable -the `Enable version management` option in the -`Assets > External Dependency Manager > Version Handler > Settings` menu. +If a plugin is imported at multiple different versions into a project, if the +Version Handler is enabled, it will automatically check all managed assets to +determine the set of assets that are out of date and assets that should be +removed. To disable automatic checking managed assets disable the `Enable +version management` option in the `Assets > External Dependency Manager > +Version Handler > Settings` menu. If version management is disabled, it's possible to check managed assets -manually using the -`Assets > External Dependency Manager > Version Handler > Update` menu option. +manually using the `Assets > External Dependency Manager > Version Handler > +Update` menu option. -### Listing Managed Plugins +##### Listing Managed Plugins -Plugins managed by the Version Handler, those that ship with manifest files, -can displayed using the `Assets > External Dependency Manager > -Version Handler > Display Managed Packages` menu option. The list of plugins -are written to the console window along with the set of files used by each -plugin. +Plugins managed by the Version Handler, those that ship with manifest files, can +displayed using the `Assets > External Dependency Manager > Version Handler > +Display Managed Packages` menu option. The list of plugins are written to the +console window along with the set of files used by each plugin. -### Uninstalling Managed Plugins +##### Uninstalling Managed Plugins -Plugins managed by the Version Handler, those that ship with manifest files, -can be removed using the `Assets > External Dependency Manager > -Version Handler > Uninstall Managed Packages` menu option. This operation -will display a window that allows a developer to select a set of plugins to -remove which will remove all files owned by each plugin excluding those that -are in use by other installed plugins. +Plugins managed by the Version Handler, those that ship with manifest files, can +be removed using the `Assets > External Dependency Manager > Version Handler > +Uninstall Managed Packages` menu option. This operation will display a window +that allows a developer to select a set of plugins to remove which will remove +all files owned by each plugin excluding those that are in use by other +installed plugins. Files managed by the Version Handler, those labeled with the `gvh` asset label, -can be checked to see whether anything needs to be upgraded, disabled or -removed using the `Assets > External Dependency Manager > -Version Handler > Update` menu option. +can be checked to see whether anything needs to be upgraded, disabled or removed +using the `Assets > External Dependency Manager > Version Handler > Update` menu +option. -### Restore Install Paths +##### Restore Install Paths -Some developers move assets around in their project which can make it -harder for plugin maintainers to debug issues if this breaks Unity's -[special folders](https://docs.unity3d.com/Manual/SpecialFolders.html) rules. -If assets are labeled with their original install / export path -(see `gvhp_exportpath` below), Version Handler can restore assets to their -original locations when using the `Assets > External Dependency Manager > -Version Handler > Move Files To Install Locations` menu option. +Some developers move assets around in their project which can make it harder for +plugin maintainers to debug issues if this breaks Unity's +[special folders](https://docs.unity3d.com/Manual/SpecialFolders.html) rules. If +assets are labeled with their original install/export path (see +`gvhp_exportpath` below), Version Handler can restore assets to their original +locations when using the `Assets > External Dependency Manager > Version +Handler > Move Files To Install Locations` menu option. -### Settings +##### Settings -Some behavior of the Version Handler can be configured via the -`Assets > External Dependency Manager > Version Handler > Settings` menu -option. +Some behavior of the Version Handler can be configured via the `Assets > +External Dependency Manager > Version Handler > Settings` menu option. + +* `Enable version management` controls whether the plugin should automatically + check asset versions and apply changes. If this is disabled the process + should be run manually when installing or upgrading managed plugins using + `Assets > External Dependency Manager > Version Handler > Update`. + +* `Rename to canonical filenames` is a legacy option that will rename files to + remove version numbers and other labels from filenames. + +* `Prompt for obsolete file deletion` enables the display of a window when + obsolete files are deleted allowing the developer to select which files to + delete and those to keep. + +* `Allow disabling files via renaming` controls whether obsolete or disabled + files should be disabled by renaming them to `myfilename_DISABLED`. Renaming + to disable files is required in some scenarios where Unity doesn't support + removing files from the build via the PluginImporter. -* `Enable version management` controls whether the plugin should automatically - check asset versions and apply changes. If this is disabled the process - should be run manually when installing or upgrading managed plugins using - `Assets > External Dependency Manager > Version Handler > Update`. -* `Rename to canonical filenames` is a legacy option that will rename files to - remove version numbers and other labels from filenames. -* `Prompt for obsolete file deletion` enables the display of a window when - obsolete files are deleted allowing the developer to select which files to - delete and those to keep. -* `Allow disabling files via renaming` controls whether obsolete or disabled - files should be disabled by renaming them to `myfilename_DISABLED`. - Renaming to disable files is required in some scenarios where Unity doesn't - support removing files from the build via the PluginImporter. -* `Enable Analytics Reporting` enables / disables usage reporting to plugin - developers to improve the product. -* `Verbose logging` enables _very_ noisy log output that is useful for - debugging while filing a bug report or building a new managed plugin. -* `Use project settings` saves settings for the plugin in the project rather - than system-wide. - -## Redistributing a Managed Plugin - -The Version Handler employs a couple of methods for managing version -selection, upgrade and removal of plugins. - -* Each plugin can ship with a manifest file that lists the files it includes. - This makes it possible for Version Handler to calculate the difference - in assets between the most recent release of a plugin and the previous - release installed in a project. If a files are removed the Version Handler - will prompt the user to clean up obsolete files. -* Plugins can ship using assets with unique names, unique GUIDs and version - number labels. Version numbers can be attached to assets using labels or - added to the filename (e.g `myfile.txt` would be `myfile_version-x.y.z.txt). - This allows the Version Handler to determine which set of files are the - same file at different versions, select the most recent version and prompt - the developer to clean up old versions. +* `Enable Analytics Reporting` enables/disables usage reporting to plugin + developers to improve the product. + +* `Verbose logging` enables *very* noisy log output that is useful for + debugging while filing a bug report or building a new managed plugin. + +* `Use project settings` saves settings for the plugin in the project rather + than system-wide. + +#### Redistributing a Managed Plugin + +The Version Handler employs a couple of methods for managing version selection, +upgrade and removal of plugins. + +* Each plugin can ship with a manifest file that lists the files it includes. + This makes it possible for Version Handler to calculate the difference in + assets between the most recent release of a plugin and the previous release + installed in a project. If a files are removed the Version Handler will + prompt the user to clean up obsolete files. + +* Plugins can ship using assets with unique names, unique GUIDs and version + number labels. Version numbers can be attached to assets using labels or + added to the filename (e.g `myfile.txt` would be `myfile_version-x.y.z.txt). + This allows the Version Handler to determine which set of files are the same + file at different versions, select the most recent version and prompt the + developer to clean up old versions. Unity plugins can be managed by the Version Handler using the following steps: - 1. Add the `gvh` asset label to each asset (file) you want Version Handler - to manage. - 1. Add the `gvh_version-VERSION` label to each asset where `VERSION` is the - version of the plugin you're releasing (e.g 1.2.3). - 1. Add the `gvhp_exportpath-PATH` label to each asset where `PATH` is the - export path of the file when the `.unitypackage` is created. This is - used to track files if they're moved around in a project by developers. - 1. Optional: Add `gvh_targets-editor` label to each editor DLL in your - plugin and disable `editor` as a target platform for the DLL. - The Version Handler will enable the most recent version of this DLL when - the plugin is imported. - 1. Optional: If your plugin is included in other Unity plugins, you should - add the version number to each filename and change the GUID of each asset. - This allows multiple versions of your plugin to be imported into a Unity - project, with the Version Handler component activating only the most - recent version. - 1. Create a manifest text file named `MY_UNIQUE_PLUGIN_NAME_VERSION.txt` - that lists all the files in your plugin relative to the project root. - Then add the `gvh_manifest` label to the asset to indicate this file is - a plugin manifest. - 1. Optional: Add a `gvhp_manifestname-NAME` label to your manifest file - to provide a human readable name for your package. If this isn't provided - the name of the manifest file will be used as the package name. - NAME can match the pattern `[0-9]+[a-zA-Z -]' where a leading integer - will set the priority of the name where `0` is the highest priority - and preferably used as the display name. The lowest value (i.e highest - priority name) will be used as the display name and all other specified - names will be aliases of the display name. Aliases can refer to previous - names of the package allowing renaming across published versions. - 1. Redistribute EDM4U Unity plugin with your plugin. - See the [Plugin Redistribution](#plugin-redistribution) for the details. +1. Add the `gvh` asset label to each asset (file) you want Version Handler to + manage. + +1. Add the `gvh_version-VERSION` label to each asset where `VERSION` is the + version of the plugin you're releasing (e.g 1.2.3). + +1. Add the `gvhp_exportpath-PATH` label to each asset where `PATH` is the + export path of the file when the `.unitypackage` is created. This is used to + track files if they're moved around in a project by developers. + +1. Optional: Add `gvh_targets-editor` label to each editor DLL in your plugin + and disable `editor` as a target platform for the DLL. The Version Handler + will enable the most recent version of this DLL when the plugin is imported. + +1. Optional: If your plugin is included in other Unity plugins, you should add + the version number to each filename and change the GUID of each asset. This + allows multiple versions of your plugin to be imported into a Unity project, + with the Version Handler component activating only the most recent version. + +1. Create a manifest text file named `MY_UNIQUE_PLUGIN_NAME_VERSION.txt` that + lists all the files in your plugin relative to the project root. Then add + the `gvh_manifest` label to the asset to indicate this file is a plugin + manifest. + +1. Optional: Add a `gvhp_manifestname-NAME` label to your manifest file to + provide a human readable name for your package. If this isn't provided the + name of the manifest file will be used as the package name. NAME can match + the pattern `[0-9]+[a-zA-Z -]` where a leading integer will set the priority + of the name where `0` is the highest priority and preferably used as the + display name. The lowest value (i.e highest priority name) will be used as + the display name and all other specified names will be aliases of the + display name. Aliases can refer to previous names of the package allowing + renaming across published versions. + +1. Redistribute EDM4U Unity plugin with your plugin. See the + [Plugin Redistribution](#plugin-redistribution) section for details. If you follow these steps: - * When users import a newer version of your plugin, files referenced by the - older version's manifest are cleaned up. - * The latest version of the plugin will be selected when users import - multiple packages that include your plugin, assuming the steps in - [Plugin Redistribution](#plugin-redistribution) are followed. +* When users import a newer version of your plugin, files referenced by the + older version's manifest are cleaned up. + +* The latest version of the plugin will be selected when users import multiple + packages that include your plugin, assuming the steps in + [Plugin Redistribution](#plugin-redistribution) are followed. + +## Background + +Many Unity plugins have dependencies upon Android specific libraries, iOS +CocoaPods, and sometimes have transitive dependencies upon other Unity plugins. +This causes the following problems: + +* Integrating platform specific (e.g Android and iOS) libraries within a Unity + project can be complex and a burden on a Unity plugin maintainer. +* The process of resolving conflicting dependencies on platform specific + libraries is pushed to the developer attempting to use a Unity plugin. The + developer trying to use your plugin is very likely to give up when faced + with Android or iOS specific build errors. +* The process of resolving conflicting Unity plugins (due to shared Unity + plugin components) is pushed to the developer attempting to use your Unity + plugin. In an effort to resolve conflicts, the developer will very likely + attempt to resolve problems by deleting random files in your plugin, report + bugs when that doesn't work and finally give up. + +EDM4U provides solutions for each of these problems. + +### Android Dependency Management + +The *Android Resolver* component of this plugin will download and integrate +Android library dependencies and handle any conflicts between plugins that share +the same dependencies. + +Without the Android Resolver, typically Unity plugins bundle their AAR and JAR +dependencies, e.g. a Unity plugin `SomePlugin` that requires the Google Play +Games Android library would redistribute the library and its transitive +dependencies in the folder `SomePlugin/Android/`. When a user imports +`SomeOtherPlugin` that includes the same libraries (potentially at different +versions) in `SomeOtherPlugin/Android/`, the developer using `SomePlugin` and +`SomeOtherPlugin` will see an error when building for Android that can be hard +to interpret. + +Using the Android Resolver to manage Android library dependencies: + +* Solves Android library conflicts between plugins. +* Handles all of the various processing steps required to use Android + libraries (AARs, JARs) in Unity 4.x and above projects. Almost all versions + of Unity have - at best - partial support for AARs. +* (Experimental) Supports minification of included Java components without + exporting a project. + +### iOS Dependency Management + +The *iOS Resolver* component of this plugin integrates with +[CocoaPods](https://cocoapods.org/) to download and integrate iOS libraries and +frameworks into the Xcode project Unity generates when building for iOS. Using +CocoaPods allows multiple plugins to utilize shared components without forcing +developers to fix either duplicate or incompatible versions of libraries +included through multiple Unity plugins in their project. + +### Package Manager Registry Setup + +The [Package Manager](https://docs.unity3d.com/Manual/Packages.html) (PM) makes +use of [NPM](https://www.npmjs.com/) registry servers for package hosting and +provides ways to discover, install, upgrade and uninstall packages. This makes +it easier for developers to manage plugins within their projects. + +However, installing additional package registries requires a few manual steps +that can potentially be error prone. The *Package Manager Resolver* component of +this plugin integrates with [PM](https://docs.unity3d.com/Manual/Packages.html) +to provide a way to auto-install PM package registries when a `.unitypackage` is +installed which allows plugin maintainers to ship a `.unitypackage` that can +provide access to their own PM registry server to make it easier for developers +to manage their plugins. + +### Unity Plugin Version Management -# Building from Source +Finally, the *Version Handler* component of this plugin simplifies the process +of managing transitive dependencies of Unity plugins and each plugin's upgrade +process. -To build this plugin from source you need the following tools installed: - * Unity (with iOS and Android modules installed) +For example, without the Version Handler plugin, if: -You can build the plugin by running the following from your shell -(Linux / OSX): +* Unity plugin `SomePlugin` includes `EDM4U` plugin at version 1.1. +* Unity plugin `SomeOtherPlugin` includes `EDM4U` plugin at version 1.2. +The version of `EDM4U` included in the developer's project depends upon the +order the developer imports `SomePlugin` or `SomeOtherPlugin`. + +This results in: + +* `EDM4U` at version 1.2, if `SomePlugin` is imported then `SomeOtherPlugin` + is imported. +* `EDM4U` at version 1.1, if `SomeOtherPlugin` is imported then `SomePlugin` + is imported. + +The Version Handler solves the problem of managing transitive dependencies by: + +* Specifying a set of packaging requirements that enable a plugin at different + versions to be imported into a Unity project. +* Providing activation logic that selects the latest version of a plugin + within a project. + +When using the Version Handler to manage `EDM4U` included in `SomePlugin` and +`SomeOtherPlugin`, from the prior example, version 1.2 will always be the +version activated in a developer's Unity project. + +Plugin creators are encouraged to adopt this library to ease integration for +their customers. For more information about integrating EDM4U into your own +plugin, see the [Plugin Redistribution](#plugin-redistribution) section of this +document. + +## Analytics + +The External Dependency Manager for Unity plugin by default logs usage to Google +Analytics. The purpose of the logging is to quantitatively measure the usage of +functionality, to gather reports on integration failures and to inform future +improvements to the developer experience of the External Dependency Manager +plugin. Note that the analytics collected are limited to the scope of the EDM4U +plugin’s usage. + +For details of what is logged, please refer to the usage of +`EditorMeasurement.Report()` in the source code. + +## Plugin Redistribution + +If you are a package maintainer and your package depends on EDM4U, it is highly +recommended to use the UPM format and add EDM4U as a dependency. If you must +include it in your `.unitypackage`, redistributing `EDM4U` inside your own +plugin might ease the integration process for your users. + +If you wish to redistribute `EDM4U` inside your plugin, you **must** follow +these steps when importing the `external-dependency-manager-*.unitypackage`, and +when exporting your own plugin package: + +1. Import the `external-dependency-manager-*.unitypackage` into your plugin + project by + [running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html), + ensuring that you add the `-gvh_disable` option. +1. Export your plugin by + [running Unity from the command line](https://docs.unity3d.com/Manual/CommandLineArguments.html), + ensuring that you: + - Include the contents of the `Assets/PlayServicesResolver` and + `Assets/ExternalDependencyManager` directory. + - Add the `-gvh_disable` option. + +You **must** specify the `-gvh_disable` option in order for the Version Handler +to work correctly! + +For example, the following command will import the +`external-dependency-manager-1.2.46.0.unitypackage` into the project +`MyPluginProject` and export the entire Assets folder to +`MyPlugin.unitypackage`: + +```shell +Unity -gvh_disable \ + -batchmode \ + -importPackage external-dependency-manager-1.2.46.0.unitypackage \ + -projectPath MyPluginProject \ + -exportPackage Assets MyPlugin.unitypackage \ + -quit ``` + +### Background + +The *Version Handler* component relies upon deferring the load of editor DLLs so +that it can run first and determine the latest version of a plugin component to +activate. The build of `EDM4U` plugin has Unity asset metadata that is +configured so that the editor components are not initially enabled when it's +imported into a Unity project. To maintain this configuration when importing the +`external-dependency-manager.unitypackage` into a Unity plugin project, you +*must* specify the command line option `-gvh_disable` which will prevent the +Version Handler component from running and changing the Unity asset metadata. + +## Building from Source + +To build this plugin from source you need the following tools installed: * Unity +2021 and below (with iOS and Android modules installed) * Java 11 + +You can build the plugin by running the following from your shell (Linux / OSX): + +```shell ./gradlew build + ``` or Windows: -``` +```shell ./gradlew.bat build ``` -# Releasing - -Each time a new build of this plugin is checked into the source tree you -need to do the following: - - * Bump the plugin version variable `pluginVersion` in `build.gradle` - * Update `CHANGELOG.md` with the new version number and changes included in - the release. - * Build the release using `./gradlew release` which performs the following: - * Updates `external-dependency-manager-*.unitypackage` - * Copies the unpacked plugin to the `exploded` directory. - * Updates template metadata files in the `plugin` directory. - The GUIDs of all asset metadata is modified due to the version number - change. Each file within the plugin is versioned to allow multiple - versions of the plugin to be imported into a Unity project which allows - the most recent version to be activated by the Version Handler - component. - * Create release commit using `./gradlew gitCreateReleaseCommit` which - performs `git commit -a -m "description from CHANGELOG.md"` - * Once the release commit is merge, tag the release using - `./gradlew gitTagRelease` which performs the following: - * `git tag -a pluginVersion -m "version RELEASE"` to tag the release. - * Update tags on remote branch using `git push --tag REMOTE HEAD:master` +If Java 11 is not your default Java command, add +`-Dorg.gradle.java.home=` to the command above. + +## Testing + +You can run the tests by running the following from your shell (Linux / OSX): + +```shell +./gradlew test +``` + +or Windows: + +```shell +./gradlew.bat test +``` + +The following properties can be set to narrow down the tests to run or change +the test run behavior. + +* `INTERACTIVE_MODE_TESTS_ENABLED` - Default to `1`. Set to `1` to enable + interactive mode tests, which requires GPU on the machine. Otherwise, only + run tests in the batch mode. +* `INCLUDE_TEST_TYPES` - Default to empty string, which means to include every + type of the test. To narrow down the types of test to run, set this + properties with a list of case-insensitive type strings separated by comma. + For instance, `-PINCLUDE_TEST_TYPES="Python,NUnit"` means to include only + Python tests and NUnit tests. See `TestTypeEnum` in `build.gradle` for + available options. +* `EXCLUDE_TEST_TYPES` - Default to empty string, which means to exclude none. + To add types of tests to exclude, set this properties with a list of + case-insensitive type strings separated by comma. For instance, + `-PEXCLUDE_TEST_TYPES="Python,NUnit"` means to exclude Python tests and + NUnit tests. See `TestTypeEnum` in `build.gradle` for available options. +* `INCLUDE_TEST_MODULES` - Default to empty string, which means to include the + tests for every modules. To narrow down modules to test, set this properties + with a list of case-insensitive module strings separated by comma. For + instance, `-PINCLUDE_TEST_MODULES="Tool,AndroidResolver"` means to run tests + for tools and Android Resolver only. See `TestModuleEnum` in `build.gradle` + for available options. +* `EXCLUDE_TEST_MODULES` - Default to empty string, which means to exclude + none. To add modules to exclude, set this properties with a list of + case-insensitive module strings separated by comma. For instance, + `-PEXCLUDE_TEST_MODULES="Tool,AndroidResolver"` means to run tests for any + modules other than tools and Android Resolver. See `TestModuleEnum` in + `build.gradle` for available options. +* `EXCLUDE_TESTS` - Default to empty string, which means to exclude none. To + add tests to exclude, set this properties with a list of case-insensitive + test names separated by comma. For instance, + `-PEXCLUDE_TESTS="testGenGuids,testDownloadArtifacts"` means to run tests + except the tests with name of `testGenGuids` and `testDownloadArtifacts`. +* `CONTINUE_ON_FAIL_FOR_TESTS_ENABLED` - Default to `1`. Set to `1` to + continue running the next test when the current one fails. Otherwise, the + build script stops whenever any test fails. + +For instance, by running the following command, it only runs the Unity +integration tests that does not requires GPU, but exclude tests for Android +Resolver module and iOS Resolver module. + +```shell +./gradlew test \ + -PINTERACTIVE_MODE_TESTS_ENABLED=0 \ + -PINCLUDE_TEST_TYPES="Integration" \ + -PEXCLUDE_TEST_MODULES="AndroidResolver,iOSResolver" +``` + +## Releasing + +Each time a new build of this plugin is checked into the source tree you need to +do the following: + +* Bump the plugin version variable `pluginVersion` in `build.gradle` +* Update `CHANGELOG.md` with the new version number and changes included in + the release. +* Build the release using `./gradlew release` which performs the following: + * Updates `external-dependency-manager-*.unitypackage` + * Copies the unpacked plugin to the `exploded` directory. + * Updates template metadata files in the `plugin` directory. The GUIDs of + all asset metadata is modified due to the version number change. Each + file within the plugin is versioned to allow multiple versions of the + plugin to be imported into a Unity project which allows the most recent + version to be activated by the Version Handler component. +* Create release commit using `./gradlew gitCreateReleaseCommit` which + performs `git commit -a -m "description from CHANGELOG.md"` +* Once the release commit is merge, tag the release using `./gradlew + gitTagRelease` which performs the following: + * `git tag -a pluginVersion -m "version RELEASE"` to tag the release. +* Update tags on remote branch using `git push --tag REMOTE HEAD:master` diff --git a/Editor/ExternalDependencyManager/Editor/README.md.meta b/Editor/ExternalDependencyManager/Editor/README.md.meta index 78048f4..82425db 100644 --- a/Editor/ExternalDependencyManager/Editor/README.md.meta +++ b/Editor/ExternalDependencyManager/Editor/README.md.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 6fd4c95e7f9941198f1bac5f0fff74c8 +guid: 48c105d983344236ba7fd1e7d7208fca labels: -- gvh -- gvh_version-1.2.177 +- gvh_version-1.2.183 - gvhp_exportpath-ExternalDependencyManager/Editor/README.md +- gvh TextScriptImporter: externalObjects: {} userData: diff --git a/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt b/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt new file mode 100644 index 0000000..d2b057e --- /dev/null +++ b/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt @@ -0,0 +1,13 @@ +Assets/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.pdb +Assets/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.pdb +Assets/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.pdb +Assets/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll +Assets/ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.pdb +Assets/ExternalDependencyManager/Editor/CHANGELOG.md +Assets/ExternalDependencyManager/Editor/Google.VersionHandler.dll +Assets/ExternalDependencyManager/Editor/Google.VersionHandler.pdb +Assets/ExternalDependencyManager/Editor/LICENSE +Assets/ExternalDependencyManager/Editor/README.md diff --git a/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt.meta b/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt.meta new file mode 100644 index 0000000..3482555 --- /dev/null +++ b/Editor/ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 98518d47e8b1473f8055106d5eb931c7 +labels: +- gvh_version-1.2.183 +- gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt +- gvh +- gvh_manifest +- gvhp_manifestname-0External Dependency Manager +- gvhp_manifestname-play-services-resolver +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Plugins/ARPresto.aar b/Runtime/Plugins/ARPresto.aar index 1b248c2..d8a7e33 100644 Binary files a/Runtime/Plugins/ARPresto.aar and b/Runtime/Plugins/ARPresto.aar differ diff --git a/Runtime/Plugins/arcore_client.aar b/Runtime/Plugins/arcore_client.aar index fcf06fa..0beecdb 100644 Binary files a/Runtime/Plugins/arcore_client.aar and b/Runtime/Plugins/arcore_client.aar differ diff --git a/Runtime/Scripts/ARCoreExtensions.cs b/Runtime/Scripts/ARCoreExtensions.cs index 26999c2..24abfe9 100644 --- a/Runtime/Scripts/ARCoreExtensions.cs +++ b/Runtime/Scripts/ARCoreExtensions.cs @@ -19,6 +19,7 @@ //----------------------------------------------------------------------- + // InternalsVisibleTo is required because Geospatial Creator needs to access the internal // _instance field, but we don't want it to be part of the public API. diff --git a/Runtime/Scripts/VersionInfo.cs b/Runtime/Scripts/VersionInfo.cs index c4b28d0..f990e91 100644 --- a/Runtime/Scripts/VersionInfo.cs +++ b/Runtime/Scripts/VersionInfo.cs @@ -28,6 +28,6 @@ public class VersionInfo /// /// The current ARCore Extensions package version. /// - public static readonly string Version = "1.46.0"; + public static readonly string Version = "1.47.0"; } } diff --git a/Samples~/PersistentCloudAnchors/Materials/ARCoreDebugPlane.mat b/Samples~/PersistentCloudAnchors/Materials/ARCoreDebugPlane.mat new file mode 100644 index 0000000..34a81b1 --- /dev/null +++ b/Samples~/PersistentCloudAnchors/Materials/ARCoreDebugPlane.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ARCoreDebugPlane + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.99215686, g: 0.72156864, b: 0.07450981, a: 0.2509804} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Samples~/PersistentCloudAnchors/Materials/ARCoreDebugPlane.mat.meta b/Samples~/PersistentCloudAnchors/Materials/ARCoreDebugPlane.mat.meta new file mode 100644 index 0000000..c47abc9 --- /dev/null +++ b/Samples~/PersistentCloudAnchors/Materials/ARCoreDebugPlane.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81342cbacf8d04a2db8425f9388591eb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Samples~/PersistentCloudAnchors/Prefabs/AR Default Plane.prefab b/Samples~/PersistentCloudAnchors/Prefabs/AR Default Plane.prefab index d8ff96c..95c912f 100644 --- a/Samples~/PersistentCloudAnchors/Prefabs/AR Default Plane.prefab +++ b/Samples~/PersistentCloudAnchors/Prefabs/AR Default Plane.prefab @@ -102,7 +102,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: f1a110d32af21aa4d872c707dfcc6043, type: 2} + - {fileID: 2100000, guid: 81342cbacf8d04a2db8425f9388591eb, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/package.json b/package.json index a0502b2..7e7ba26 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.google.ar.core.arfoundation.extensions", "displayName": "ARCore Extensions", - "version": "1.46.0", + "version": "1.47.0", "unity": "2019.4", "description": "Google ARCore Extensions for AR Foundation. This package provides access to ARCore features not covered by AR Foundation's cross platform API.", "author":