diff options
author | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-10-08 14:34:02 -0700 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-10-08 14:34:02 -0700 |
commit | d9fff97ae273807c8eab768847753f17b9ecda46 (patch) | |
tree | 03e6369f10286d0e5142c687913cf6bffa3ca582 | |
parent | 8bd8bca5986794ce1d8edbd6bbd170ad86881659 (diff) | |
download | godot-android-samples-d9fff97ae273807c8eab768847753f17b9ecda46.tar.gz godot-android-samples-d9fff97ae273807c8eab768847753f17b9ecda46.tar.bz2 godot-android-samples-d9fff97ae273807c8eab768847753f17b9ecda46.zip |
Update the 'HelloSignals' plugin sample's directory structure
12 files changed, 45 insertions, 48 deletions
diff --git a/plugins/hello_signals/README.md b/plugins/hello_signals/README.md index a6c39e8..2c01e95 100644 --- a/plugins/hello_signals/README.md +++ b/plugins/hello_signals/README.md @@ -12,7 +12,7 @@ cd Godot-Android-Samples ./gradlew :plugins:hello_signals:assemble ``` -The generated artifact can be found under [`demo/addons`](src/main/assets/addons). +The generated artifact can be found under [`demo/addons`](demo/addons). ### Usage diff --git a/plugins/hello_signals/build.gradle b/plugins/hello_signals/build.gradle index d639858..b3a6f76 100644 --- a/plugins/hello_signals/build.gradle +++ b/plugins/hello_signals/build.gradle @@ -29,21 +29,21 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion" } -tasks.register('copyDebugAARToAddons', Copy) { +tasks.register('copyDebugAARToDemoAddons', Copy) { from 'build/outputs/aar' include 'HelloSignals.debug.aar' - into 'src/main/assets/addons/hello_signals_plugin/.bin/debug' + into 'demo/addons/hello_signals_plugin/bin/debug' } -tasks.register('copyReleaseAARToAddons', Copy) { +tasks.register('copyReleaseAARToDemoAddons', Copy) { from 'build/outputs/aar' include 'HelloSignals.release.aar' - into 'src/main/assets/addons/hello_signals_plugin/.bin/release' + into 'demo/addons/hello_signals_plugin/bin/release' } tasks.register('copyAddonsToDemo', Copy) { - dependsOn(copyDebugAARToAddons) - dependsOn(copyReleaseAARToAddons) + finalizedBy(copyDebugAARToDemoAddons) + finalizedBy(copyReleaseAARToDemoAddons) doFirst { delete('demo/addons/hello_signals_plugin') @@ -52,6 +52,6 @@ tasks.register('copyAddonsToDemo', Copy) { into 'demo/addons/hello_signals_plugin' } -assemble.finalizedBy(copyDebugAARToAddons) -assemble.finalizedBy(copyReleaseAARToAddons) assemble.finalizedBy(copyAddonsToDemo) +assemble.finalizedBy(copyDebugAARToDemoAddons) +assemble.finalizedBy(copyReleaseAARToDemoAddons) diff --git a/plugins/hello_signals/demo/Main.gd b/plugins/hello_signals/demo/Main.gd index 2dca0db..db9499b 100644 --- a/plugins/hello_signals/demo/Main.gd +++ b/plugins/hello_signals/demo/Main.gd @@ -5,7 +5,7 @@ var timerRunning = false var helloSignalsPlugin : HelloSignalsPlugin func _ready(): - helloSignalsPlugin = preload("res://addons/hello_signals_plugin/interface/hello_signals_plugin.gd").new() + helloSignalsPlugin = preload("res://addons/hello_signals_plugin/hello_signals_plugin_interface.gd").new() helloSignalsPlugin.registerForTikTok(Callable(self, "_on_tiktok")) $Button.connect("pressed", Callable(self, "_on_Button_pressed")) diff --git a/plugins/hello_signals/demo/export_presets.cfg b/plugins/hello_signals/demo/export_presets.cfg index 44a32e5..33e36e8 100644 --- a/plugins/hello_signals/demo/export_presets.cfg +++ b/plugins/hello_signals/demo/export_presets.cfg @@ -35,6 +35,7 @@ package/app_category=2 package/retain_data_on_uninstall=false package/exclude_from_recents=false package/show_in_android_tv=false +package/show_in_app_library=true package/show_as_launcher_app=false launcher_icons/main_192x192="" launcher_icons/adaptive_foreground_432x432="" diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.bin/.gdignore b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.bin/.gdignore deleted file mode 100644 index 8b13789..0000000 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.bin/.gdignore +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.bin/.gitignore b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.bin/.gitignore deleted file mode 100644 index 375ed0d..0000000 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.bin/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!.gdignore diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/.gdignore b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/.gdignore deleted file mode 100644 index 8b13789..0000000 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/.gdignore +++ /dev/null @@ -1 +0,0 @@ - diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/hello_signals_editor_export_plugin.gd b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/hello_signals_editor_export_plugin.gd deleted file mode 100644 index ca0bcf4..0000000 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/hello_signals_editor_export_plugin.gd +++ /dev/null @@ -1,16 +0,0 @@ -@tool -extends EditorExportPlugin - -func _supports_platform(platform): - if platform is EditorExportPlatformAndroid: - return true - return false - -func _get_android_libraries(platform, debug): - if debug: - return PackedStringArray(["hello_signals_plugin/.bin/debug/HelloSignals.debug.aar"]) - else: - return PackedStringArray(["hello_signals_plugin/.bin/release/HelloSignals.release.aar"]) - -func _get_name(): - return "Hello Signals plugin" diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/hello_signals_editor_plugin.gd b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/hello_signals_editor_plugin.gd deleted file mode 100644 index 5df34a9..0000000 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/.export/hello_signals_editor_plugin.gd +++ /dev/null @@ -1,16 +0,0 @@ -@tool -extends EditorPlugin - -# A class member to hold the export plugin during its lifecycle -var export_plugin : EditorExportPlugin - -func _enter_tree(): - # Initialization of the plugin goes here. - export_plugin = preload("hello_signals_editor_export_plugin.gd").new() - add_export_plugin(export_plugin) - - -func _exit_tree(): - # Clean-up of the plugin goes here. - remove_export_plugin(export_plugin) - export_plugin = null diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/hello_signals_export_plugin.gd b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/hello_signals_export_plugin.gd new file mode 100644 index 0000000..6145d44 --- /dev/null +++ b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/hello_signals_export_plugin.gd @@ -0,0 +1,33 @@ +@tool +extends EditorPlugin + +# A class member to hold the 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: + + func _supports_platform(platform): + if platform is EditorExportPlatformAndroid: + return true + return false + + func _get_android_libraries(platform, debug): + if debug: + return PackedStringArray(["hello_signals_plugin/bin/debug/HelloSignals.debug.aar"]) + else: + return PackedStringArray(["hello_signals_plugin/bin/release/HelloSignals.release.aar"]) + + func _get_name(): + return "Hello Signals plugin" diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/interface/hello_signals_plugin.gd b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/hello_signals_plugin_interface.gd index 0cc9c1d..0cc9c1d 100644 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/interface/hello_signals_plugin.gd +++ b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/hello_signals_plugin_interface.gd diff --git a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/plugin.cfg b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/plugin.cfg index ca4a695..4ffab22 100644 --- a/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/plugin.cfg +++ b/plugins/hello_signals/src/main/assets/addons/hello_signals_plugin/plugin.cfg @@ -4,4 +4,4 @@ name="Hello Signals plugin" description="Showcases how to package a sample Android plugin" author="Fredia Huya-Kouadio" version="" -script=".export/hello_signals_editor_plugin.gd" +script="hello_signals_export_plugin.gd" |