Skip to content

Commit

Permalink
Reorganising external dependency manager
Browse files Browse the repository at this point in the history
Summary:
Reorganising  external dependency manager to make easy to NOT import to a current project with and existing plugin.

NOTE: the motivation of this fix came from the task T143437219. Was too difficult to remove our current version of External Dependency Manager when a dev has a conflict with other SDK like FIrebase.

Reviewed By: SergioGuerreroFB

Differential Revision: D43453556

fbshipit-source-id: b0e66cefdd7db6859ff1b9cc9eb4e322aefd0749
  • Loading branch information
JordiFB authored and facebook-github-bot committed Feb 27, 2023
1 parent d7ecfc3 commit 51c8226
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -61,7 +61,7 @@ TestResult.xml
/UnitySDK/Assets/PlayServicesResolver.meta
/UnitySDK/Assets/PlayServicesResolver/
/UnitySDK/Assets/ExternalDependencyManager.meta
/UnitySDK/Assets/ExternalDependencyManager/
/UnitySDK/Assets/ExternalDependencyManager/Editor.meta

# Ignore Current Facebook Settings
FacebookSettings.asset*
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Payments price convertion to double
- Improved mobile orientation enum for Unity example
- Improved mobile Tournaments example
- Changed folder structure for External Dependecy Manager dlls

### Changed
- Bumped SDK to 16.0.0
Expand Down
2 changes: 1 addition & 1 deletion Facebook.Unity.Editor/Facebook.Unity.Editor.csproj
Expand Up @@ -40,7 +40,7 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Google.VersionHandler">
<HintPath>..\UnitySDK\Assets\PlayServicesResolver\Editor\Google.VersionHandler.dll</HintPath>
<HintPath>..\UnitySDK\Assets\ExternalDependencyManager\Editor\Google.VersionHandler.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
11 changes: 4 additions & 7 deletions Facebook.Unity.Editor/FacebookBuild.cs
Expand Up @@ -31,7 +31,6 @@ internal class FacebookBuild
private const string SDKPath = "Assets/FacebookSDK/SDK/";
private const string ExamplesPath = "Assets/FacebookSDK/Examples/";
private const string PluginsPath = "Assets/FacebookSDK/Plugins/";
private const string PlayServicesResolverPath = "Assets/PlayServicesResolver/";
private const string StreamingAssetsPath = "Assets/StreamingAssets/";
private const string ExternalDependencyManagerPath = "Assets/ExternalDependencyManager/";
private const string EditorPath = "Assets/Editor/";
Expand Down Expand Up @@ -86,21 +85,19 @@ public static string ExportPackage()
string[] sdkFiles = (string[])Directory.GetFiles(SDKPath, "*.*", SearchOption.AllDirectories);
string[] exampleFiles = (string[])Directory.GetFiles(ExamplesPath, "*.*", SearchOption.AllDirectories);
string[] pluginsFiles = (string[])Directory.GetFiles(PluginsPath, "*.*", SearchOption.AllDirectories);
string[] playServicesResolverFiles = (string[])Directory.GetFiles(PlayServicesResolverPath, "*.*", SearchOption.AllDirectories);
string[] streamingAssetsFiles = (string[])Directory.GetFiles(StreamingAssetsPath, "*.*", SearchOption.AllDirectories);
string[] externalDependencyManagerFiles = (string[])Directory.GetFiles(ExternalDependencyManagerPath, "*.*", SearchOption.AllDirectories);
string[] editorFiles = (string[])Directory.GetFiles(EditorPath, "*.*", SearchOption.AllDirectories);

string[] files = new string[facebookFiles.Length + sdkFiles.Length + exampleFiles.Length + pluginsFiles.Length + playServicesResolverFiles.Length + streamingAssetsFiles.Length + externalDependencyManagerFiles.Length + editorFiles.Length];
string[] files = new string[facebookFiles.Length + sdkFiles.Length + exampleFiles.Length + pluginsFiles.Length + streamingAssetsFiles.Length + externalDependencyManagerFiles.Length + editorFiles.Length];

facebookFiles.CopyTo(files, 0);
sdkFiles.CopyTo(files, facebookFiles.Length);
exampleFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length);
pluginsFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length);
playServicesResolverFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length);
streamingAssetsFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length + playServicesResolverFiles.Length);
externalDependencyManagerFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length + playServicesResolverFiles.Length+ streamingAssetsFiles.Length);
editorFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length + playServicesResolverFiles.Length+ streamingAssetsFiles.Length + externalDependencyManagerFiles.Length);
streamingAssetsFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length);
externalDependencyManagerFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length + streamingAssetsFiles.Length);
editorFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length + streamingAssetsFiles.Length + externalDependencyManagerFiles.Length);

AssetDatabase.ExportPackage(
files,
Expand Down

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions scripts/fixdependecies.sh
Expand Up @@ -56,3 +56,13 @@ cp "$UNITY_CSPROJ/external-dependency-manager_version-1.2.166_manifest.txt" $UNI
## TO DO: obtain the dependency version dinamically
sed s/_v1.2.166././g "$UNITY_CSPROJ/tmp.txt" > "$UNITY_CSPROJ/external-dependency-manager_version-1.2.166_manifest.txt"
rm "$UNITY_CSPROJ/tmp.txt"

mkdir -p "$UNITY_CSPROJ/1.2.166/"
mv "$UNITY_CSPROJ/Google.IOSResolver.dll" "$UNITY_CSPROJ/1.2.166/Google.IOSResolver.dll"
mv "$UNITY_CSPROJ/Google.IOSResolver.dll.mdb" "$UNITY_CSPROJ/1.2.166/Google.IOSResolver.dll.mdb"
mv "$UNITY_CSPROJ/Google.JarResolver.dll" "$UNITY_CSPROJ/1.2.166/Google.JarResolver.dll"
mv "$UNITY_CSPROJ/Google.JarResolver.dll.mdb" "$UNITY_CSPROJ/1.2.166/Google.JarResolver.dll.mdb"
mv "$UNITY_CSPROJ/Google.PackageManagerResolver.dll" "$UNITY_CSPROJ/1.2.166/Google.PackageManagerResolver.dll"
mv "$UNITY_CSPROJ/Google.PackageManagerResolver.dll.mdb" "$UNITY_CSPROJ/1.2.166/Google.PackageManagerResolver.dll.mdb"
mv "$UNITY_CSPROJ/Google.VersionHandlerImpl.dll" "$UNITY_CSPROJ/1.2.166/Google.VersionHandlerImpl.dll"
mv "$UNITY_CSPROJ/Google.VersionHandlerImpl.dll.mdb" "$UNITY_CSPROJ/1.2.166/Google.VersionHandlerImpl.dll.mdb"

0 comments on commit 51c8226

Please sign in to comment.