generated from m4gr3d/Godot-Android-Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexport_plugin.gd
48 lines (34 loc) · 1.25 KB
/
export_plugin.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@tool
extends EditorPlugin
# A class member to hold the editor export plugin during its lifecycle.
var export_plugin: AndroidExportPlugin
func _enter_tree():
# Initialization of the plugin goes here.
export_plugin = AndroidExportPlugin.new()
add_export_plugin(export_plugin)
func _exit_tree():
# Clean-up of the plugin goes here.
remove_export_plugin(export_plugin)
export_plugin = null
class AndroidExportPlugin extends EditorExportPlugin:
var _plugin_name = "GeolocationPlugin"
func _supports_platform(platform):
if platform is EditorExportPlatformAndroid:
return true
return false
func _get_android_libraries(platform, debug):
if debug:
return PackedStringArray([_plugin_name + "/bin/debug/" + _plugin_name + "-debug.aar"])
else:
return PackedStringArray([_plugin_name + "/bin/release/" + _plugin_name + "-release.aar"])
func _get_android_dependencies(platform, debug):
if debug:
return PackedStringArray([
"androidx.core:core-ktx:1.13.1",
])
else:
return PackedStringArray([
"androidx.core:core-ktx:1.13.1",
])
func _get_name():
return _plugin_name