C# Class GooglePlayServices.DefaultResolver

Default resolver base class.
This class contains the default implementation of the standard methods used to resolve the play-services dependencies. The intention is that common, stable methods are implemented here, and subsequent versions of the resolver would extend this class to modify the behavior.
Inheritance: IResolver
显示文件 Open project: googlesamples/unity-jar-resolver Class Usage Examples

Private Properties

Property Type Description
ExtractAar bool
FindJavaTool string
MakeVersionNumber int
ProcessAar string

Public Methods

Method Description
AndroidPackageInstallationEnabled ( ) : bool

Returns true if Android package installation is enabled.

AutomaticResolutionEnabled ( ) : bool

Returns true if automatic resolution is enabled.

CreateTemporaryDirectory ( ) : string

Create a temporary directory.

DoResolution ( PlayServicesSupport svcSupport, string destinationDirectory, PlayServicesSupport handleOverwriteConfirmation ) : void

Compatibility method for synchronous implementations of DoResolution().

DoResolution ( PlayServicesSupport svcSupport, string destinationDirectory, PlayServicesSupport handleOverwriteConfirmation, System resolutionComplete ) : void

Does the resolution of the play-services aars.

OnBundleId ( string bundleId ) : string[]

Called during Update to allow the resolver to check the bundle ID of the application to see whether resolution should be triggered again.

SetAutomaticResolutionEnabled ( bool flag ) : void

Enables automatic resolution.

ShouldAutoResolve ( string importedAssets, string deletedAssets, string movedAssets, string movedFromAssetPaths ) : bool

Checks based on the asset changes, if resolution should occur.

The resolution only happens if a script file (.cs, or .js) was imported or if an Android plugin was deleted. This allows for changes to assets that do not affect the dependencies to happen without processing. This also avoids an infinite loop when a version of a dependency is deleted during resolution.

ShowSettingsDialog ( ) : void

Shows the settings dialog.

Version ( ) : int

Version of the resolver - 1.0.0

Private Methods

Method Description
ExtractAar ( string aarFile, string extractFilenames, string outputDirectory ) : bool

Extract an AAR to the specified directory.

FindJavaTool ( string javaTool ) : string

Find a Java tool.

MakeVersionNumber ( int maj, int min, int pt ) : int

Makes the version number.

This combines the major/minor/point version components into an integer. If multiple resolvers are registered, then the greatest version is used.

ProcessAar ( string dir, string aarFile ) : string

Explodes a single aar file. This is done by calling the JDK "jar" command, then moving the classes.jar file.

Method Details

AndroidPackageInstallationEnabled() public method

Returns true if Android package installation is enabled.
public AndroidPackageInstallationEnabled ( ) : bool
return bool

AutomaticResolutionEnabled() public method

Returns true if automatic resolution is enabled.
public AutomaticResolutionEnabled ( ) : bool
return bool

CreateTemporaryDirectory() public static method

Create a temporary directory.
public static CreateTemporaryDirectory ( ) : string
return string

DoResolution() public abstract method

Compatibility method for synchronous implementations of DoResolution().
public abstract DoResolution ( PlayServicesSupport svcSupport, string destinationDirectory, PlayServicesSupport handleOverwriteConfirmation ) : void
svcSupport Google.JarResolver.PlayServicesSupport Svc support.
destinationDirectory string Destination directory.
handleOverwriteConfirmation Google.JarResolver.PlayServicesSupport Handle overwrite confirmation.
return void

DoResolution() public method

Does the resolution of the play-services aars.
public DoResolution ( PlayServicesSupport svcSupport, string destinationDirectory, PlayServicesSupport handleOverwriteConfirmation, System resolutionComplete ) : void
svcSupport Google.JarResolver.PlayServicesSupport Svc support.
destinationDirectory string Destination directory.
handleOverwriteConfirmation Google.JarResolver.PlayServicesSupport Handle overwrite confirmation.
resolutionComplete System Delegate called when resolution is complete.
return void

OnBundleId() public method

Called during Update to allow the resolver to check the bundle ID of the application to see whether resolution should be triggered again.
public OnBundleId ( string bundleId ) : string[]
bundleId string
return string[]

SetAutomaticResolutionEnabled() public method

Enables automatic resolution.
public SetAutomaticResolutionEnabled ( bool flag ) : void
flag bool If set to true flag.
return void

ShouldAutoResolve() public method

Checks based on the asset changes, if resolution should occur.
The resolution only happens if a script file (.cs, or .js) was imported or if an Android plugin was deleted. This allows for changes to assets that do not affect the dependencies to happen without processing. This also avoids an infinite loop when a version of a dependency is deleted during resolution.
public ShouldAutoResolve ( string importedAssets, string deletedAssets, string movedAssets, string movedFromAssetPaths ) : bool
importedAssets string Imported assets.
deletedAssets string Deleted assets.
movedAssets string Moved assets.
movedFromAssetPaths string Moved from asset paths.
return bool

ShowSettingsDialog() public method

Shows the settings dialog.
public ShowSettingsDialog ( ) : void
return void

Version() public method

Version of the resolver - 1.0.0
public Version ( ) : int
return int