C# 클래스 Google.JarResolver.PlayServicesSupport

Play services support is a helper class for managing the Google play services and Android support libraries in a Unity project. This is done by using the Maven repositories that are part of the Android SDK. This class implements the logic of version checking, transitive dependencies, and updating a a directory to make sure that there is only one version of a dependency present.
파일 보기 프로젝트 열기: googlesamples/unity-jar-resolver 1 사용 예제들

Private Properties

프로퍼티 타입 설명
CreateInstance PlayServicesSupport
FindCandidate Dependency
FindCandidate Dependency
GetDependencies IEnumerable
Log void
PersistDependencies void
ProcessMetadata void
ResetDependencies void

공개 메소드들

메소드 설명
ClearDependencies ( ) : void

Clears the dependencies for this client.

CopyDependencies ( Dependency>.Dictionary dependencies, string destDirectory, OverwriteConfirmation confirmer ) : void

Copies the dependencies from the repository to the specified directory. The destination directory is checked for an existing version of the dependency before copying. The OverwriteConfirmation delegate is called for the first existing file or directory. If the delegate returns true, the old dependency is deleted and the new one copied.

CreateInstance ( string clientName, string sdkPath, string settingsDirectory, LogMessage logger = null ) : PlayServicesSupport

Creates an instance of PlayServicesSupport. This instance is used to add dependencies for the calling client and invoke the resolution.

DeleteExistingFileOrDirectory ( string path ) : void

Delete a file or directory if it exists.

DependOn ( string group, string artifact, string version, string packageIds = null, string repositories = null ) : void

Adds a dependency to the project.

This method should be called for each library that is required. Transitive dependencies are processed so only directly referenced libraries need to be added.

The version string can be contain a trailing + to indicate " or greater". Trailing 0s are implied. For example:

1.0 means only version 1.0, but also matches 1.0.0.

1.2.3+ means version 1.2.3 or 1.2.4, etc. but not 1.3.

0+ means any version.

LATEST means the only the latest version.

LoadDependencies ( bool allClients, bool keepMissing = false ) : Dependency>.Dictionary

Loads the dependencies from the settings files.

ResolveDependencies ( bool useLatest ) : Dependency>.Dictionary

Performs the resolution process. This determines the versions of the dependencies that should be used. Transitive dependencies are also processed.

비공개 메소드들

메소드 설명
CreateInstance ( string clientName, string sdkPath, string additionalRepositories, string settingsDirectory, LogMessage logger = null ) : PlayServicesSupport

Creates an instance of PlayServicesSupport. This instance is used to add dependencies for the calling client and invoke the resolution.

FindCandidate ( Dependency dep ) : Dependency
FindCandidate ( string repoPath, Dependency dep ) : Dependency

Finds an acceptable candidate for the given dependency.

GetDependencies ( Dependency dep ) : IEnumerable

Gets the dependencies of the given dependency. This is done by reading the .pom file for the BestVersion of the dependency.

Log ( string message, bool verbose = false ) : void

Log a message to the currently set logger.

message is a string to write to the log.

PersistDependencies ( ) : void

Persists the dependencies to the settings file.

ProcessMetadata ( Dependency dep, string fname ) : void

Reads the maven metadata for an artifact. This reads the list of available versions.

ResetDependencies ( ) : void

Resets the dependencies. FOR TESTING ONLY!!!

메소드 상세

ClearDependencies() 공개 메소드

Clears the dependencies for this client.
public ClearDependencies ( ) : void
리턴 void

CopyDependencies() 공개 메소드

Copies the dependencies from the repository to the specified directory. The destination directory is checked for an existing version of the dependency before copying. The OverwriteConfirmation delegate is called for the first existing file or directory. If the delegate returns true, the old dependency is deleted and the new one copied.
public CopyDependencies ( Dependency>.Dictionary dependencies, string destDirectory, OverwriteConfirmation confirmer ) : void
dependencies Dependency>.Dictionary The dependencies to copy.
destDirectory string Destination directory.
confirmer OverwriteConfirmation Confirmer - the delegate for confirming overwriting.
리턴 void

CreateInstance() 공개 정적인 메소드

Creates an instance of PlayServicesSupport. This instance is used to add dependencies for the calling client and invoke the resolution.
public static CreateInstance ( string clientName, string sdkPath, string settingsDirectory, LogMessage logger = null ) : PlayServicesSupport
clientName string Client name. Must be a valid filename. /// This is used to uniquely identify /// the calling client so that dependencies can be associated with a specific /// client to help in resetting dependencies.
sdkPath string Sdk path for Android SDK.
settingsDirectory string The relative path to the directory /// to save the settings. For Unity projects this is "ProjectSettings"
logger LogMessage Delegate used to write messages to the log.
리턴 PlayServicesSupport

DeleteExistingFileOrDirectory() 정적인 공개 메소드

Delete a file or directory if it exists.
static public DeleteExistingFileOrDirectory ( string path ) : void
path string Path to the file or directory to delete if it exists.
리턴 void

DependOn() 공개 메소드

Adds a dependency to the project.
This method should be called for each library that is required. Transitive dependencies are processed so only directly referenced libraries need to be added.

The version string can be contain a trailing + to indicate " or greater". Trailing 0s are implied. For example:

1.0 means only version 1.0, but also matches 1.0.0.

1.2.3+ means version 1.2.3 or 1.2.4, etc. but not 1.3.

0+ means any version.

LATEST means the only the latest version.

public DependOn ( string group, string artifact, string version, string packageIds = null, string repositories = null ) : void
group string Group - the Group Id of the artiface
artifact string Artifact - Artifact Id
version string Version - the version constraint
packageIds string Optional list of Android SDK package identifiers.
repositories string List of additional repository directories to search for /// this artifact.
리턴 void

LoadDependencies() 공개 메소드

Loads the dependencies from the settings files.
public LoadDependencies ( bool allClients, bool keepMissing = false ) : Dependency>.Dictionary
allClients bool If true, all client dependencies are loaded and returned ///
keepMissing bool If false, missing dependencies result in a /// ResolutionException being thrown. If true, each missing dependency is included in /// the returned set with RepoPath set to an empty string.
리턴 Dependency>.Dictionary

ResolveDependencies() 공개 메소드

Performs the resolution process. This determines the versions of the dependencies that should be used. Transitive dependencies are also processed.
public ResolveDependencies ( bool useLatest ) : Dependency>.Dictionary
useLatest bool If set to true use latest version of a conflicting dependency. /// if false a ResolutionException is thrown in the case of a conflict.
리턴 Dependency>.Dictionary