├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── bug_report.yaml
│ ├── config.yml
│ └── feature_request.yaml
├── .gitignore
├── .gitmodules
├── LICENSE
├── Podfile
├── README.md
├── config
└── InappReviewPlugin.gdip
├── demo
├── Main.gd
├── Main.gd.uid
├── Main.tscn
├── assets
│ ├── 1024.png
│ ├── 167.png
│ ├── 180.png
│ ├── 60.png
│ ├── 80.png
│ └── 87.png
├── export_presets.cfg
├── inappreview.png
└── project.godot
├── inapp_review
├── SwiftClass.swift
├── godot_plugin-Bridging-Header.h
├── godot_plugin.h
├── godot_plugin.mm
├── inapp_review_plugin.h
└── inapp_review_plugin.mm
├── inapp_review_plugin.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ └── IDEWorkspaceChecks.plist
└── script
├── build.sh
├── echocolor.sh
├── install.sh
└── run_with_timeout.sh
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: cengiz-pz
2 | buy_me_a_coffee: cengizpz
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yaml:
--------------------------------------------------------------------------------
1 | name: 🐞 Bug
2 | description: File a bug/issue
3 | title: "[BUG]
"
4 | labels: ["Bug", "Needs Triage"]
5 | body:
6 | - type: checkboxes
7 | attributes:
8 | label: Is there an existing issue for this?
9 | description: Please search to see if an issue already exists for the bug you encountered.
10 | options:
11 | - label: I have searched the existing issues
12 | required: true
13 | - type: textarea
14 | attributes:
15 | label: Current Behavior
16 | description: A clear and concise description of what the bug is.
17 | validations:
18 | required: true
19 | - type: textarea
20 | attributes:
21 | label: Expected Behavior
22 | description: A concise description of what you expected to happen.
23 | validations:
24 | required: true
25 | - type: textarea
26 | attributes:
27 | label: Steps To Reproduce
28 | description: Steps to reproduce the behavior.
29 | placeholder: |
30 | 1. Installed manually | Installed via AssetLib
31 | 2. Called method '....'
32 | 3. Received signal '....'
33 | 4. Noticed ADB Logcat error '...'
34 | validations:
35 | required: false
36 | - type: dropdown
37 | id: godot_version
38 | attributes:
39 | label: Godot Version
40 | description: What version of Godot are you running?
41 | options:
42 | - 4.3.stable
43 | - 4.4.1.stable
44 | - 4.5.dev
45 | - 4.x
46 | - Other
47 | default: 1
48 | validations:
49 | required: true
50 | - type: dropdown
51 | id: godot_os
52 | attributes:
53 | label: OS Godot Is Running On
54 | description: What operating system is Godot running on?
55 | options:
56 | - Windows 11
57 | - Windows (other)
58 | - macOS 15
59 | - macOS (other)
60 | - Other OS
61 | default: 0
62 | validations:
63 | required: true
64 | - type: dropdown
65 | id: plugin_version
66 | attributes:
67 | label: Plugin Version
68 | description: What version of the plugin are you running?
69 | options:
70 | - "3.0"
71 | - "3.1"
72 | - "3.2"
73 | - "3.3"
74 | - "4.0"
75 | - Other
76 | default: 4
77 | validations:
78 | required: true
79 | - type: dropdown
80 | id: plugin_os
81 | attributes:
82 | label: OS Plugin Is Running On
83 | description: What operating system the plugin (and your app) is running on?
84 | options:
85 | - iOS 18.1
86 | - iOS 18.2
87 | - iOS 18.3
88 | - iOS 18.4
89 | - iOS (other)
90 | default: 2
91 | validations:
92 | required: true
93 | - type: textarea
94 | attributes:
95 | label: Anything else?
96 | description: |
97 | Links? References? Anything that will give more context about the issue you are encountering!
98 |
99 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
100 | validations:
101 | required: false
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | # disable blank issue creation
2 | blank_issues_enabled: false
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yaml:
--------------------------------------------------------------------------------
1 | name: 🐠 Feature Request
2 | description: Suggest an idea for this project
3 | title: "[FEATURE REQUEST] "
4 | labels: ["Enhancement", "Question"]
5 | body:
6 | - type: checkboxes
7 | attributes:
8 | label: Is there an existing issue for this?
9 | description: Please search to see if an issue already exists for the bug you encountered.
10 | options:
11 | - label: I have searched the existing issues
12 | required: true
13 | - type: textarea
14 | attributes:
15 | label: Current Behavior
16 | description: Is your feature request related to a problem? Please describe.
17 | validations:
18 | required: false
19 | - type: textarea
20 | attributes:
21 | label: Proposed Behavior
22 | description: A clear and concise description of what you want to happen.
23 | validations:
24 | required: false
25 | - type: textarea
26 | attributes:
27 | label: Alternative Solutions
28 | description: Describe alternatives you've considered.
29 | placeholder: |
30 | A clear and concise description of any alternative solutions or features you've considered.
31 | validations:
32 | required: false
33 | - type: dropdown
34 | id: godot_version
35 | attributes:
36 | label: Godot Version
37 | description: What version of Godot are you running?
38 | options:
39 | - 4.3.stable
40 | - 4.4.1.stable
41 | - 4.5.dev
42 | - 4.x
43 | - Other
44 | default: 1
45 | validations:
46 | required: true
47 | - type: dropdown
48 | id: godot_os
49 | attributes:
50 | label: OS Godot Is Running On
51 | description: What operating system is Godot running on?
52 | options:
53 | - Windows 11
54 | - Windows (other)
55 | - macOS 15
56 | - macOS (other)
57 | - Other OS
58 | default: 0
59 | validations:
60 | required: true
61 | - type: dropdown
62 | id: plugin_version
63 | attributes:
64 | label: Plugin Version
65 | description: What version of the plugin are you running?
66 | options:
67 | - "3.0"
68 | - "3.1"
69 | - "3.2"
70 | - "3.3"
71 | - "4.0"
72 | - Other
73 | default: 4
74 | validations:
75 | required: true
76 | - type: dropdown
77 | id: plugin_os
78 | attributes:
79 | label: OS Plugin Is Running On
80 | description: What operating system the plugin (and your app) is running on?
81 | options:
82 | - iOS 18.1
83 | - iOS 18.2
84 | - iOS 18.3
85 | - iOS 18.4
86 | - iOS (other)
87 | default: 2
88 | validations:
89 | required: true
90 | - type: textarea
91 | attributes:
92 | label: Anything else?
93 | description: |
94 | Links? References? Anything that will give more context about the issue you are encountering!
95 |
96 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
97 | validations:
98 | required: false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | .DS_Store
6 |
7 | ## User settings
8 | xcuserdata/
9 |
10 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
11 | *.xcscmblueprint
12 | *.xccheckout
13 |
14 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
15 | build/
16 | DerivedData/
17 | *.moved-aside
18 | *.pbxuser
19 | !default.pbxuser
20 | *.mode1v3
21 | !default.mode1v3
22 | *.mode2v3
23 | !default.mode2v3
24 | *.perspectivev3
25 | !default.perspectivev3
26 |
27 | ## Gcc Patch
28 | /*.gcno
29 |
30 | *.d
31 | *.o
32 | *.dblite
33 |
34 | # Godot
35 | .godot/
36 | *.png.import
37 | *.svg.import
38 |
39 | # project specific
40 | bin/*
41 | godot/
42 | Pods/
43 | Podfile.lock
44 |
45 | # Plugin-specific
46 | demo/addons/
47 | demo/ios/
48 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "godot"]
2 | path = godot
3 | url = https://github.com/godotengine/godot.git
4 | [submodule "addon"]
5 | path = addon
6 | url = https://github.com/cengiz-pz/godot-inapp-review-addon.git
7 | branch = main
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 Cengiz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | #
2 | # © 2024-present https://github.com/cengiz-pz
3 | #
4 | source 'https://github.com/CocoaPods/Specs.git'
5 | use_frameworks!
6 |
7 | plugin_name = 'inapp_review_plugin'
8 |
9 | project "#{plugin_name}.xcodeproj"
10 | workspace "./#{plugin_name}.xcodeproj/project.xcworkspace"
11 |
12 | target "#{plugin_name}" do
13 | platform :ios, '13.0'
14 | # pod 'add-dependency-here', '1.0.0'
15 | end
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ---
6 | #  In-app Review Plugin
7 | Godot In-app Review Plugin enables access to Apple App Store's in-app review functionality.
8 |
9 | ##  Installation
10 | There are 2 ways to install the `In-app Review Plugin` into your project:
11 | - Through the Godot Editor's AssetLib
12 | - Manually by downloading archives from Github
13 |
14 | ###  Steps to install via AssetLib
15 | - search for and select the `In-app Review Plugin` in Godot Editor's AssetLib tab
16 | - click `Download` button
17 | - on the installation dialog...
18 | - leave your project's root directory selected as the target directory
19 | - leave `Ignore asset root` checkbox checked
20 | - click `Install` button
21 | - enable the plugin via the `Plugins` tab of `Project->Project Settings...` menu, in the Godot Editor
22 |
23 | ###  Manual installation steps
24 | - download release archive from Github
25 | - unzip the release archive
26 | - copy contents of the unzipped directory into your project's root directory
27 | - enable the plugin via the `Plugins` tab of `Project->Project Settings...` menu, in the Godot Editor
28 |
29 |
30 |
31 | ##  Usage
32 | Add an `InappReview` node to your scene and follow the following steps:
33 | - register listeners for the following signals emitted from the `InappReview` node
34 | - `review_flow_launched`
35 | - call the `launch_review_flow()` of the `InappReview` node
36 | - Apple's StoreKit API will display a review dialog
37 | - Dialog may not be displayed if the review flow was launched recently
38 | - normal app functionality can resume when `review_flow_launched` signal is received
39 |
40 |
41 |
42 | ##  Export to iOS
43 | Follow instructions on the following page to export your project and run on an iOS device:
44 | - [Exporting for iOS](https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_ios.html)
45 |
46 |
47 |
48 | ---
49 | #  Credits
50 | Developed by [Cengiz](https://github.com/cengiz-pz)
51 |
52 | Based on [DrMoriarty](https://github.com/DrMoriarty)'s [Godot iOS Plugin Template](https://github.com/DrMoriarty/godot_ios_plugin_template)
53 |
54 | Original repository: [Godot iOS In-app Review Plugin](https://github.com/cengiz-pz/godot-ios-inapp-review-plugin)
55 |
56 |
57 |
58 |
59 | ___
60 |
61 | #  Contribution
62 |
63 | This section provides information on how to build the plugin for contributors.
64 |
65 |
66 |
67 | ___
68 |
69 | ##  Prerequisites
70 |
71 | - [Install SCons](https://scons.org/doc/production/HTML/scons-user/ch01s02.html)
72 | - [Install CocoaPods](https://guides.cocoapods.org/using/getting-started.html)
73 |
74 |
75 |
76 | ___
77 |
78 | ##  Build
79 |
80 | - Run `./script/build.sh -A ` initially to run a full build
81 | - Run `./script/build.sh -cgA ` to clean, redownload Godot, and rebuild
82 | - Run `./script/build.sh -ca` to clean and build without redownloading Godot
83 | - Run `./script/build.sh -h` for more information on the build script
84 |
85 |
86 |
87 | ___
88 |
89 | ##  Git addon submodule
90 |
91 |
92 | ###  Creating
93 |
94 | - `git submodule add -b main --force --name addon https://github.com/cengiz-pz/godot-inapp-review-addon.git addon`
95 |
96 |
97 | ###  Updating
98 |
99 | - Remove `addon` directory
100 | - Run `git submodule update --remote --merge`
101 |
102 |
103 |
104 | ___
105 |
106 | ##  Libraries
107 |
108 | Library archives will be created in the `bin/release` directory.
109 |
110 |
111 |
112 | ---
113 | #  All Plugins
114 |
115 | | Plugin | Android | iOS |
116 | | :---: | :--- | :--- |
117 | | Notification Scheduler | https://github.com/cengiz-pz/godot-android-notification-scheduler-plugin | https://github.com/cengiz-pz/godot-ios-notification-scheduler-plugin |
118 | | Admob | https://github.com/cengiz-pz/godot-android-admob-plugin | https://github.com/cengiz-pz/godot-ios-admob-plugin |
119 | | Deeplink | https://github.com/cengiz-pz/godot-android-deeplink-plugin | https://github.com/cengiz-pz/godot-ios-deeplink-plugin |
120 | | Share | https://github.com/cengiz-pz/godot-android-share-plugin | https://github.com/cengiz-pz/godot-ios-share-plugin |
121 | | In-App Review | https://github.com/cengiz-pz/godot-android-inapp-review-plugin | https://github.com/cengiz-pz/godot-ios-inapp-review-plugin |
122 |
--------------------------------------------------------------------------------
/config/InappReviewPlugin.gdip:
--------------------------------------------------------------------------------
1 | ;
2 | ; © 2024-present https://github.com/cengiz-pz
3 | ;
4 |
5 | [config]
6 |
7 | name="InappReviewPlugin"
8 | binary="InappReviewPlugin.xcframework"
9 | initialization="InappReviewPlugin_init"
10 | deinitialization="InappReviewPlugin_deinit"
11 | use_swift_runtime=true
12 |
13 |
14 | [dependencies]
15 |
16 | linked=[]
17 | embedded=[]
18 | system=["Foundation.framework","StoreKit.framework"]
19 | capabilities=[]
20 | files=[]
21 | linker_flags=["-ObjC","-Wl,-weak-lswiftCore,-weak-lswiftObjectiveC,-weak-lswift_Concurrency"]
22 |
23 |
24 | [plist]
25 |
--------------------------------------------------------------------------------
/demo/Main.gd:
--------------------------------------------------------------------------------
1 | #
2 | # © 2024-present https://github.com/cengiz-pz
3 | #
4 |
5 | extends Node
6 |
7 | @onready var inapp_review: InappReview = $InappReview as InappReview
8 | @onready var _label: RichTextLabel = $CanvasLayer/CenterContainer/VBoxContainer/RichTextLabel as RichTextLabel
9 |
10 |
11 | func _on_button_pressed() -> void:
12 | inapp_review.generate_review_info()
13 |
14 |
15 | func _on_inapp_review_review_info_generated() -> void:
16 | _print_to_screen("In-app review info generation success!")
17 | _print_to_screen("Launching review flow...")
18 | inapp_review.launch_review_flow()
19 |
20 |
21 | func _on_inapp_review_review_info_generation_failed() -> void:
22 | _print_to_screen("In-app review info generation failed!", true)
23 |
24 |
25 | func _on_inapp_review_review_flow_launched() -> void:
26 | _print_to_screen("In-app review flow launched!")
27 |
28 |
29 | func _on_inapp_review_review_flow_launch_failed() -> void:
30 | _print_to_screen("In-app review flow launch failed!", true)
31 |
32 |
33 | func _print_to_screen(a_message: String, a_is_error: bool = false) -> void:
34 | _label.add_text("%s\n\n" % a_message)
35 | if a_is_error:
36 | printerr(a_message)
37 | else:
38 | print(a_message)
39 |
--------------------------------------------------------------------------------
/demo/Main.gd.uid:
--------------------------------------------------------------------------------
1 | uid://fkta25bsptq7
2 |
--------------------------------------------------------------------------------
/demo/Main.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://bvb3ltmpkaso3"]
2 |
3 | [ext_resource type="Script" uid="uid://fkta25bsptq7" path="res://Main.gd" id="1_ut41m"]
4 | [ext_resource type="Texture2D" uid="uid://dr1ksqyo7r2xn" path="res://inappreview.png" id="2_cgov0"]
5 | [ext_resource type="Script" uid="uid://dn8mp6rsb5k66" path="res://addons/InappReviewPlugin/InappReview.gd" id="3_m6sqx"]
6 |
7 | [node name="Main" type="Node"]
8 | script = ExtResource("1_ut41m")
9 |
10 | [node name="CanvasLayer" type="CanvasLayer" parent="."]
11 |
12 | [node name="CenterContainer" type="CenterContainer" parent="CanvasLayer"]
13 | anchors_preset = 15
14 | anchor_right = 1.0
15 | anchor_bottom = 1.0
16 | grow_horizontal = 2
17 | grow_vertical = 2
18 |
19 | [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/CenterContainer"]
20 | layout_mode = 2
21 | theme_override_constants/separation = 20
22 |
23 | [node name="TextureRect" type="TextureRect" parent="CanvasLayer/CenterContainer/VBoxContainer"]
24 | layout_mode = 2
25 | texture = ExtResource("2_cgov0")
26 | stretch_mode = 3
27 |
28 | [node name="Label" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer"]
29 | layout_mode = 2
30 | theme_override_font_sizes/font_size = 24
31 | text = "In-app Review Demo"
32 | horizontal_alignment = 1
33 |
34 | [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer"]
35 | layout_mode = 2
36 | theme_override_constants/separation = 10
37 |
38 | [node name="Button" type="Button" parent="CanvasLayer/CenterContainer/VBoxContainer/VBoxContainer"]
39 | custom_minimum_size = Vector2(375, 0)
40 | layout_mode = 2
41 | text = "Launch Review"
42 |
43 | [node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/CenterContainer/VBoxContainer"]
44 | custom_minimum_size = Vector2(250, 300)
45 | layout_mode = 2
46 |
47 | [node name="InappReview" type="Node" parent="."]
48 | script = ExtResource("3_m6sqx")
49 |
50 | [connection signal="pressed" from="CanvasLayer/CenterContainer/VBoxContainer/VBoxContainer/Button" to="." method="_on_button_pressed"]
51 | [connection signal="review_flow_launch_failed" from="InappReview" to="." method="_on_inapp_review_review_flow_launch_failed"]
52 | [connection signal="review_flow_launched" from="InappReview" to="." method="_on_inapp_review_review_flow_launched"]
53 | [connection signal="review_info_generated" from="InappReview" to="." method="_on_inapp_review_review_info_generated"]
54 | [connection signal="review_info_generation_failed" from="InappReview" to="." method="_on_inapp_review_review_info_generation_failed"]
55 |
--------------------------------------------------------------------------------
/demo/assets/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/assets/1024.png
--------------------------------------------------------------------------------
/demo/assets/167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/assets/167.png
--------------------------------------------------------------------------------
/demo/assets/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/assets/180.png
--------------------------------------------------------------------------------
/demo/assets/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/assets/60.png
--------------------------------------------------------------------------------
/demo/assets/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/assets/80.png
--------------------------------------------------------------------------------
/demo/assets/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/assets/87.png
--------------------------------------------------------------------------------
/demo/export_presets.cfg:
--------------------------------------------------------------------------------
1 | [preset.0]
2 |
3 | name="iOS"
4 | platform="iOS"
5 | runnable=true
6 | advanced_options=false
7 | dedicated_server=false
8 | custom_features=""
9 | export_filter="all_resources"
10 | include_filter=""
11 | exclude_filter=""
12 | export_path="../../../../Xcode/inapp_review_demo/Inappreview Demo.ipa"
13 | patches=PackedStringArray()
14 | encryption_include_filters=""
15 | encryption_exclude_filters=""
16 | seed=0
17 | encrypt_pck=false
18 | encrypt_directory=false
19 | script_export_mode=2
20 |
21 | [preset.0.options]
22 |
23 | custom_template/debug=""
24 | custom_template/release=""
25 | architectures/arm64=true
26 | application/app_store_team_id="GODOTTEAM1"
27 | application/export_method_debug=1
28 | application/code_sign_identity_debug=""
29 | application/code_sign_identity_release=""
30 | application/provisioning_profile_specifier_debug=""
31 | application/provisioning_profile_specifier_release=""
32 | application/export_method_release=0
33 | application/targeted_device_family=2
34 | application/bundle_identifier="org.godotengine.inappreview.demo"
35 | application/signature=""
36 | application/short_version=""
37 | application/version=""
38 | application/min_ios_version="13.0"
39 | application/additional_plist_content=""
40 | application/icon_interpolation=4
41 | application/export_project_only=false
42 | application/delete_old_export_files_unconditionally=false
43 | plugins/InappReviewPlugin=true
44 | entitlements/increased_memory_limit=false
45 | entitlements/game_center=false
46 | entitlements/push_notifications="Disabled"
47 | entitlements/additional=""
48 | capabilities/access_wifi=false
49 | capabilities/performance_gaming_tier=false
50 | capabilities/performance_a12=false
51 | capabilities/additional=PackedStringArray()
52 | user_data/accessible_from_files_app=false
53 | user_data/accessible_from_itunes_sharing=false
54 | privacy/camera_usage_description=""
55 | privacy/camera_usage_description_localized={}
56 | privacy/microphone_usage_description=""
57 | privacy/microphone_usage_description_localized={}
58 | privacy/photolibrary_usage_description=""
59 | privacy/photolibrary_usage_description_localized={}
60 | privacy/file_timestamp_access_reasons=3
61 | privacy/system_boot_time_access_reasons=1
62 | privacy/disk_space_access_reasons=3
63 | privacy/active_keyboard_access_reasons=0
64 | privacy/user_defaults_access_reasons=0
65 | privacy/tracking_enabled=false
66 | privacy/tracking_domains=PackedStringArray()
67 | privacy/collected_data/name/collected=false
68 | privacy/collected_data/name/linked_to_user=false
69 | privacy/collected_data/name/used_for_tracking=false
70 | privacy/collected_data/name/collection_purposes=0
71 | privacy/collected_data/email_address/collected=false
72 | privacy/collected_data/email_address/linked_to_user=false
73 | privacy/collected_data/email_address/used_for_tracking=false
74 | privacy/collected_data/email_address/collection_purposes=0
75 | privacy/collected_data/phone_number/collected=false
76 | privacy/collected_data/phone_number/linked_to_user=false
77 | privacy/collected_data/phone_number/used_for_tracking=false
78 | privacy/collected_data/phone_number/collection_purposes=0
79 | privacy/collected_data/physical_address/collected=false
80 | privacy/collected_data/physical_address/linked_to_user=false
81 | privacy/collected_data/physical_address/used_for_tracking=false
82 | privacy/collected_data/physical_address/collection_purposes=0
83 | privacy/collected_data/other_contact_info/collected=false
84 | privacy/collected_data/other_contact_info/linked_to_user=false
85 | privacy/collected_data/other_contact_info/used_for_tracking=false
86 | privacy/collected_data/other_contact_info/collection_purposes=0
87 | privacy/collected_data/health/collected=false
88 | privacy/collected_data/health/linked_to_user=false
89 | privacy/collected_data/health/used_for_tracking=false
90 | privacy/collected_data/health/collection_purposes=0
91 | privacy/collected_data/fitness/collected=false
92 | privacy/collected_data/fitness/linked_to_user=false
93 | privacy/collected_data/fitness/used_for_tracking=false
94 | privacy/collected_data/fitness/collection_purposes=0
95 | privacy/collected_data/payment_info/collected=false
96 | privacy/collected_data/payment_info/linked_to_user=false
97 | privacy/collected_data/payment_info/used_for_tracking=false
98 | privacy/collected_data/payment_info/collection_purposes=0
99 | privacy/collected_data/credit_info/collected=false
100 | privacy/collected_data/credit_info/linked_to_user=false
101 | privacy/collected_data/credit_info/used_for_tracking=false
102 | privacy/collected_data/credit_info/collection_purposes=0
103 | privacy/collected_data/other_financial_info/collected=false
104 | privacy/collected_data/other_financial_info/linked_to_user=false
105 | privacy/collected_data/other_financial_info/used_for_tracking=false
106 | privacy/collected_data/other_financial_info/collection_purposes=0
107 | privacy/collected_data/precise_location/collected=false
108 | privacy/collected_data/precise_location/linked_to_user=false
109 | privacy/collected_data/precise_location/used_for_tracking=false
110 | privacy/collected_data/precise_location/collection_purposes=0
111 | privacy/collected_data/coarse_location/collected=false
112 | privacy/collected_data/coarse_location/linked_to_user=false
113 | privacy/collected_data/coarse_location/used_for_tracking=false
114 | privacy/collected_data/coarse_location/collection_purposes=0
115 | privacy/collected_data/sensitive_info/collected=false
116 | privacy/collected_data/sensitive_info/linked_to_user=false
117 | privacy/collected_data/sensitive_info/used_for_tracking=false
118 | privacy/collected_data/sensitive_info/collection_purposes=0
119 | privacy/collected_data/contacts/collected=false
120 | privacy/collected_data/contacts/linked_to_user=false
121 | privacy/collected_data/contacts/used_for_tracking=false
122 | privacy/collected_data/contacts/collection_purposes=0
123 | privacy/collected_data/emails_or_text_messages/collected=false
124 | privacy/collected_data/emails_or_text_messages/linked_to_user=false
125 | privacy/collected_data/emails_or_text_messages/used_for_tracking=false
126 | privacy/collected_data/emails_or_text_messages/collection_purposes=0
127 | privacy/collected_data/photos_or_videos/collected=false
128 | privacy/collected_data/photos_or_videos/linked_to_user=false
129 | privacy/collected_data/photos_or_videos/used_for_tracking=false
130 | privacy/collected_data/photos_or_videos/collection_purposes=0
131 | privacy/collected_data/audio_data/collected=false
132 | privacy/collected_data/audio_data/linked_to_user=false
133 | privacy/collected_data/audio_data/used_for_tracking=false
134 | privacy/collected_data/audio_data/collection_purposes=0
135 | privacy/collected_data/gameplay_content/collected=false
136 | privacy/collected_data/gameplay_content/linked_to_user=false
137 | privacy/collected_data/gameplay_content/used_for_tracking=false
138 | privacy/collected_data/gameplay_content/collection_purposes=0
139 | privacy/collected_data/customer_support/collected=false
140 | privacy/collected_data/customer_support/linked_to_user=false
141 | privacy/collected_data/customer_support/used_for_tracking=false
142 | privacy/collected_data/customer_support/collection_purposes=0
143 | privacy/collected_data/other_user_content/collected=false
144 | privacy/collected_data/other_user_content/linked_to_user=false
145 | privacy/collected_data/other_user_content/used_for_tracking=false
146 | privacy/collected_data/other_user_content/collection_purposes=0
147 | privacy/collected_data/browsing_history/collected=false
148 | privacy/collected_data/browsing_history/linked_to_user=false
149 | privacy/collected_data/browsing_history/used_for_tracking=false
150 | privacy/collected_data/browsing_history/collection_purposes=0
151 | privacy/collected_data/search_hhistory/collected=false
152 | privacy/collected_data/search_hhistory/linked_to_user=false
153 | privacy/collected_data/search_hhistory/used_for_tracking=false
154 | privacy/collected_data/search_hhistory/collection_purposes=0
155 | privacy/collected_data/user_id/collected=false
156 | privacy/collected_data/user_id/linked_to_user=false
157 | privacy/collected_data/user_id/used_for_tracking=false
158 | privacy/collected_data/user_id/collection_purposes=0
159 | privacy/collected_data/device_id/collected=false
160 | privacy/collected_data/device_id/linked_to_user=false
161 | privacy/collected_data/device_id/used_for_tracking=false
162 | privacy/collected_data/device_id/collection_purposes=0
163 | privacy/collected_data/purchase_history/collected=false
164 | privacy/collected_data/purchase_history/linked_to_user=false
165 | privacy/collected_data/purchase_history/used_for_tracking=false
166 | privacy/collected_data/purchase_history/collection_purposes=0
167 | privacy/collected_data/product_interaction/collected=false
168 | privacy/collected_data/product_interaction/linked_to_user=false
169 | privacy/collected_data/product_interaction/used_for_tracking=false
170 | privacy/collected_data/product_interaction/collection_purposes=0
171 | privacy/collected_data/advertising_data/collected=false
172 | privacy/collected_data/advertising_data/linked_to_user=false
173 | privacy/collected_data/advertising_data/used_for_tracking=false
174 | privacy/collected_data/advertising_data/collection_purposes=0
175 | privacy/collected_data/other_usage_data/collected=false
176 | privacy/collected_data/other_usage_data/linked_to_user=false
177 | privacy/collected_data/other_usage_data/used_for_tracking=false
178 | privacy/collected_data/other_usage_data/collection_purposes=0
179 | privacy/collected_data/crash_data/collected=false
180 | privacy/collected_data/crash_data/linked_to_user=false
181 | privacy/collected_data/crash_data/used_for_tracking=false
182 | privacy/collected_data/crash_data/collection_purposes=0
183 | privacy/collected_data/performance_data/collected=false
184 | privacy/collected_data/performance_data/linked_to_user=false
185 | privacy/collected_data/performance_data/used_for_tracking=false
186 | privacy/collected_data/performance_data/collection_purposes=0
187 | privacy/collected_data/other_diagnostic_data/collected=false
188 | privacy/collected_data/other_diagnostic_data/linked_to_user=false
189 | privacy/collected_data/other_diagnostic_data/used_for_tracking=false
190 | privacy/collected_data/other_diagnostic_data/collection_purposes=0
191 | privacy/collected_data/environment_scanning/collected=false
192 | privacy/collected_data/environment_scanning/linked_to_user=false
193 | privacy/collected_data/environment_scanning/used_for_tracking=false
194 | privacy/collected_data/environment_scanning/collection_purposes=0
195 | privacy/collected_data/hands/collected=false
196 | privacy/collected_data/hands/linked_to_user=false
197 | privacy/collected_data/hands/used_for_tracking=false
198 | privacy/collected_data/hands/collection_purposes=0
199 | privacy/collected_data/head/collected=false
200 | privacy/collected_data/head/linked_to_user=false
201 | privacy/collected_data/head/used_for_tracking=false
202 | privacy/collected_data/head/collection_purposes=0
203 | privacy/collected_data/other_data_types/collected=false
204 | privacy/collected_data/other_data_types/linked_to_user=false
205 | privacy/collected_data/other_data_types/used_for_tracking=false
206 | privacy/collected_data/other_data_types/collection_purposes=0
207 | icons/icon_1024x1024=""
208 | icons/icon_1024x1024_dark=""
209 | icons/icon_1024x1024_tinted=""
210 | icons/settings_58x58=""
211 | icons/settings_58x58_dark=""
212 | icons/settings_58x58_tinted=""
213 | icons/settings_87x87="res://assets/87.png"
214 | icons/settings_87x87_dark=""
215 | icons/settings_87x87_tinted=""
216 | icons/notification_40x40=""
217 | icons/notification_40x40_dark=""
218 | icons/notification_40x40_tinted=""
219 | icons/notification_60x60="res://assets/60.png"
220 | icons/notification_60x60_dark=""
221 | icons/notification_60x60_tinted=""
222 | icons/notification_76x76=""
223 | icons/notification_76x76_dark=""
224 | icons/notification_76x76_tinted=""
225 | icons/notification_114x114=""
226 | icons/notification_114x114_dark=""
227 | icons/notification_114x114_tinted=""
228 | icons/spotlight_80x80="res://assets/80.png"
229 | icons/spotlight_80x80_dark=""
230 | icons/spotlight_80x80_tinted=""
231 | icons/spotlight_120x120=""
232 | icons/spotlight_120x120_dark=""
233 | icons/spotlight_120x120_tinted=""
234 | icons/iphone_120x120=""
235 | icons/iphone_120x120_dark=""
236 | icons/iphone_120x120_tinted=""
237 | icons/iphone_180x180="res://assets/180.png"
238 | icons/iphone_180x180_dark=""
239 | icons/iphone_180x180_tinted=""
240 | icons/ipad_167x167="res://assets/167.png"
241 | icons/ipad_167x167_dark=""
242 | icons/ipad_167x167_tinted=""
243 | icons/ipad_152x152=""
244 | icons/ipad_152x152_dark=""
245 | icons/ipad_152x152_tinted=""
246 | icons/ios_128x128=""
247 | icons/ios_128x128_dark=""
248 | icons/ios_128x128_tinted=""
249 | icons/ios_192x192=""
250 | icons/ios_192x192_dark=""
251 | icons/ios_192x192_tinted=""
252 | icons/ios_136x136=""
253 | icons/ios_136x136_dark=""
254 | icons/ios_136x136_tinted=""
255 | icons/app_store_1024x1024="res://assets/1024.png"
256 | icons/app_store_1024x1024_dark=""
257 | icons/app_store_1024x1024_tinted=""
258 | storyboard/image_scale_mode=0
259 | storyboard/custom_image@2x=""
260 | storyboard/custom_image@3x=""
261 | storyboard/use_custom_bg_color=false
262 | storyboard/custom_bg_color=Color(0, 0, 0, 1)
263 | application/generate_simulator_library_if_missing=true
264 | capabilities/push_notifications=false
265 | icons/ipad_76x76=""
266 | icons/spotlight_40x40=""
267 | application/launch_screens_interpolation=4
268 | storyboard/use_launch_screen_storyboard=true
269 | landscape_launch_screens/iphone_2436x1125=""
270 | landscape_launch_screens/iphone_2208x1242=""
271 | landscape_launch_screens/ipad_1024x768=""
272 | landscape_launch_screens/ipad_2048x1536=""
273 | portrait_launch_screens/iphone_640x960=""
274 | portrait_launch_screens/iphone_640x1136=""
275 | portrait_launch_screens/iphone_750x1334=""
276 | portrait_launch_screens/iphone_1125x2436=""
277 | portrait_launch_screens/ipad_768x1024=""
278 | portrait_launch_screens/ipad_1536x2048=""
279 | portrait_launch_screens/iphone_1242x2208=""
280 |
--------------------------------------------------------------------------------
/demo/inappreview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cengiz-pz/godot-ios-inapp-review-plugin/017f15e87187481ae0d28591bf380c1750a24271/demo/inappreview.png
--------------------------------------------------------------------------------
/demo/project.godot:
--------------------------------------------------------------------------------
1 | ; Engine configuration file.
2 | ; It's best edited using the editor UI and not directly,
3 | ; since the parameters that go here are not all obvious.
4 | ;
5 | ; Format:
6 | ; [section] ; section goes between []
7 | ; param=value ; assign values to parameters
8 |
9 | config_version=5
10 |
11 | [application]
12 |
13 | config/name="In-app Review Demo"
14 | run/main_scene="res://Main.tscn"
15 | config/features=PackedStringArray("4.4", "GL Compatibility")
16 | config/icon="res://inappreview.png"
17 |
18 | [display]
19 |
20 | window/size/viewport_width=450
21 | window/size/viewport_height=700
22 | window/stretch/mode="canvas_items"
23 | window/stretch/aspect="ignore"
24 | window/handheld/orientation=1
25 |
26 | [editor_plugins]
27 |
28 | enabled=PackedStringArray("res://addons/InappReviewPlugin/plugin.cfg")
29 |
30 | [rendering]
31 |
32 | renderer/rendering_method="gl_compatibility"
33 | renderer/rendering_method.mobile="gl_compatibility"
34 | textures/vram_compression/import_etc2_astc=true
35 |
--------------------------------------------------------------------------------
/inapp_review/SwiftClass.swift:
--------------------------------------------------------------------------------
1 | //
2 | // © 2024-present https://github.com/cengiz-pz
3 | //
4 | import Foundation
5 | import StoreKit
6 |
7 | @available(iOS 16.0, *)
8 | @objcMembers public class SwiftClass : NSObject
9 | {
10 | static func launch_review_flow() {
11 | SKStoreReviewController.requestReview()
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/inapp_review/godot_plugin-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // © 2024-present https://github.com/cengiz-pz
3 | //
4 | // Use this file to import your target's public headers that you would like to expose to Swift.
5 | //
6 |
7 |
--------------------------------------------------------------------------------
/inapp_review/godot_plugin.h:
--------------------------------------------------------------------------------
1 | //
2 | // © 2024-present https://github.com/cengiz-pz
3 | //
4 | void InappReviewPlugin_init();
5 | void InappReviewPlugin_deinit();
6 |
--------------------------------------------------------------------------------
/inapp_review/godot_plugin.mm:
--------------------------------------------------------------------------------
1 | //
2 | // © 2024-present https://github.com/cengiz-pz
3 | //
4 | #import
5 |
6 | #import "godot_plugin.h"
7 | #import "inapp_review_plugin.h"
8 | #import "core/config/engine.h"
9 |
10 | InappReviewPlugin *plugin;
11 |
12 | void InappReviewPlugin_init() {
13 | plugin = memnew(InappReviewPlugin);
14 | Engine::get_singleton()->add_singleton(Engine::Singleton("InappReviewPlugin", plugin));
15 | }
16 |
17 | void InappReviewPlugin_deinit() {
18 | if (plugin) {
19 | memdelete(plugin);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/inapp_review/inapp_review_plugin.h:
--------------------------------------------------------------------------------
1 | //
2 | // © 2024-present https://github.com/cengiz-pz
3 | //
4 | #pragma once
5 |
6 | #include "core/object/object.h"
7 | #include "core/object/class_db.h"
8 |
9 | extern String const REVIEW_INFO_GENERATED_SIGNAL;
10 | extern String const REVIEW_INFO_GENERATION_FAILED_SIGNAL;
11 | extern String const REVIEW_FLOW_LAUNCHED_SIGNAL;
12 | extern String const REVIEW_FLOW_LAUNCH_FAILED_SIGNAL;
13 |
14 |
15 | class InappReviewPlugin : public Object {
16 | GDCLASS(InappReviewPlugin, Object);
17 |
18 | static void _bind_methods();
19 |
20 | public:
21 | void generate_review_info();
22 | void launch_review_flow();
23 |
24 | InappReviewPlugin();
25 | ~InappReviewPlugin();
26 | };
27 |
--------------------------------------------------------------------------------
/inapp_review/inapp_review_plugin.mm:
--------------------------------------------------------------------------------
1 | //
2 | // © 2024-present https://github.com/cengiz-pz
3 | //
4 | #import
5 |
6 | #include "core/config/project_settings.h"
7 |
8 | #import "inapp_review_plugin.h"
9 | #import "inapp_review_plugin-Swift.h"
10 |
11 |
12 | String const REVIEW_INFO_GENERATED_SIGNAL = "review_info_generated";
13 | String const REVIEW_INFO_GENERATION_FAILED_SIGNAL = "review_info_generation_failed";
14 | String const REVIEW_FLOW_LAUNCHED_SIGNAL = "review_flow_launched";
15 | String const REVIEW_FLOW_LAUNCH_FAILED_SIGNAL = "review_flow_launch_failed";
16 |
17 |
18 | /*
19 | * Bind plugin's public interface
20 | */
21 | void InappReviewPlugin::_bind_methods() {
22 | ClassDB::bind_method(D_METHOD("generate_review_info"), &InappReviewPlugin::generate_review_info);
23 | ClassDB::bind_method(D_METHOD("launch_review_flow"), &InappReviewPlugin::launch_review_flow);
24 |
25 | ADD_SIGNAL(MethodInfo(REVIEW_INFO_GENERATED_SIGNAL));
26 | ADD_SIGNAL(MethodInfo(REVIEW_INFO_GENERATION_FAILED_SIGNAL));
27 | ADD_SIGNAL(MethodInfo(REVIEW_FLOW_LAUNCHED_SIGNAL));
28 | ADD_SIGNAL(MethodInfo(REVIEW_FLOW_LAUNCH_FAILED_SIGNAL));
29 | }
30 |
31 | // Only for platform parity.
32 | void InappReviewPlugin::generate_review_info() {
33 | NSLog(@"InappReviewPlugin generate_review_info");
34 |
35 | emit_signal(REVIEW_INFO_GENERATED_SIGNAL);
36 | }
37 |
38 | void InappReviewPlugin::launch_review_flow() {
39 | NSLog(@"InappReviewPlugin launch_review_flow");
40 | [SwiftClass launch_review_flow];
41 |
42 | emit_signal(REVIEW_FLOW_LAUNCHED_SIGNAL);
43 | }
44 |
45 | InappReviewPlugin::InappReviewPlugin() {
46 | NSLog(@"InappReviewPlugin constructor");
47 | }
48 |
49 | InappReviewPlugin::~InappReviewPlugin() {
50 | NSLog(@"InappReviewPlugin destructor");
51 | }
52 |
--------------------------------------------------------------------------------
/inapp_review_plugin.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 515DBA0925EE9E1E00187A4B /* SwiftClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515DBA0825EE9E1E00187A4B /* SwiftClass.swift */; };
11 | 90CAAA9924E71FF10013969F /* godot_plugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 90CAAA9824E71FF10013969F /* godot_plugin.mm */; };
12 | 90CAAAA424E724C50013969F /* inapp_review_plugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 90CAAAA324E724C50013969F /* inapp_review_plugin.mm */; };
13 | 94A1B0B2910D06DA0F4D3D3C /* Pods_inapp_review_plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 380C444E6383B0C8ACA7CA7D /* Pods_inapp_review_plugin.framework */; };
14 | /* End PBXBuildFile section */
15 |
16 | /* Begin PBXCopyFilesBuildPhase section */
17 | 90CAAA9224E71FF10013969F /* CopyFiles */ = {
18 | isa = PBXCopyFilesBuildPhase;
19 | buildActionMask = 2147483647;
20 | dstPath = "include/$(PRODUCT_NAME)";
21 | dstSubfolderSpec = 16;
22 | files = (
23 | );
24 | runOnlyForDeploymentPostprocessing = 0;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | 1A3D1E30D9DC57319C20B62B /* Pods-godot_plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-godot_plugin.release.xcconfig"; path = "Target Support Files/Pods-godot_plugin/Pods-godot_plugin.release.xcconfig"; sourceTree = ""; };
30 | 380C444E6383B0C8ACA7CA7D /* Pods_inapp_review_plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_inapp_review_plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; };
31 | 403D7C7BCFBA671DEF15AE95 /* Pods-godot_plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-godot_plugin.debug.xcconfig"; path = "Target Support Files/Pods-godot_plugin/Pods-godot_plugin.debug.xcconfig"; sourceTree = ""; };
32 | 515DBA0825EE9E1E00187A4B /* SwiftClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftClass.swift; sourceTree = ""; };
33 | 90CAAA9424E71FF10013969F /* libinapp_review_plugin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libinapp_review_plugin.a; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 90CAAA9724E71FF10013969F /* godot_plugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = godot_plugin.h; sourceTree = ""; };
35 | 90CAAA9824E71FF10013969F /* godot_plugin.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = godot_plugin.mm; sourceTree = ""; };
36 | 90CAAAA324E724C50013969F /* inapp_review_plugin.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = inapp_review_plugin.mm; sourceTree = ""; };
37 | 90CAAAA524E724D00013969F /* inapp_review_plugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = inapp_review_plugin.h; sourceTree = ""; };
38 | AAE936A0178A8EA9BB753CEA /* Pods-inapp_review_plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-inapp_review_plugin.debug.xcconfig"; path = "Target Support Files/Pods-inapp_review_plugin/Pods-inapp_review_plugin.debug.xcconfig"; sourceTree = ""; };
39 | D5F7A9D28867FD798F31BF3B /* Pods-inapp_review_plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-inapp_review_plugin.release.xcconfig"; path = "Target Support Files/Pods-inapp_review_plugin/Pods-inapp_review_plugin.release.xcconfig"; sourceTree = ""; };
40 | /* End PBXFileReference section */
41 |
42 | /* Begin PBXFrameworksBuildPhase section */
43 | 90CAAA9124E71FF10013969F /* Frameworks */ = {
44 | isa = PBXFrameworksBuildPhase;
45 | buildActionMask = 2147483647;
46 | files = (
47 | 94A1B0B2910D06DA0F4D3D3C /* Pods_inapp_review_plugin.framework in Frameworks */,
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | /* End PBXFrameworksBuildPhase section */
52 |
53 | /* Begin PBXGroup section */
54 | 66EA7AD27171A8F93A267403 /* Pods */ = {
55 | isa = PBXGroup;
56 | children = (
57 | 403D7C7BCFBA671DEF15AE95 /* Pods-godot_plugin.debug.xcconfig */,
58 | 1A3D1E30D9DC57319C20B62B /* Pods-godot_plugin.release.xcconfig */,
59 | AAE936A0178A8EA9BB753CEA /* Pods-inapp_review_plugin.debug.xcconfig */,
60 | D5F7A9D28867FD798F31BF3B /* Pods-inapp_review_plugin.release.xcconfig */,
61 | );
62 | path = Pods;
63 | sourceTree = "";
64 | };
65 | 90CAAA8B24E71FF10013969F = {
66 | isa = PBXGroup;
67 | children = (
68 | 90CAAA9624E71FF10013969F /* inapp_review */,
69 | 90CAAA9524E71FF10013969F /* Products */,
70 | 90CAAAA824E72A8A0013969F /* Frameworks */,
71 | 66EA7AD27171A8F93A267403 /* Pods */,
72 | );
73 | sourceTree = "";
74 | };
75 | 90CAAA9524E71FF10013969F /* Products */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 90CAAA9424E71FF10013969F /* libinapp_review_plugin.a */,
79 | );
80 | name = Products;
81 | sourceTree = "";
82 | };
83 | 90CAAA9624E71FF10013969F /* inapp_review */ = {
84 | isa = PBXGroup;
85 | children = (
86 | 90CAAA9724E71FF10013969F /* godot_plugin.h */,
87 | 90CAAA9824E71FF10013969F /* godot_plugin.mm */,
88 | 90CAAAA524E724D00013969F /* inapp_review_plugin.h */,
89 | 90CAAAA324E724C50013969F /* inapp_review_plugin.mm */,
90 | 515DBA0825EE9E1E00187A4B /* SwiftClass.swift */,
91 | );
92 | path = inapp_review;
93 | sourceTree = "";
94 | };
95 | 90CAAAA824E72A8A0013969F /* Frameworks */ = {
96 | isa = PBXGroup;
97 | children = (
98 | 380C444E6383B0C8ACA7CA7D /* Pods_inapp_review_plugin.framework */,
99 | );
100 | name = Frameworks;
101 | sourceTree = "";
102 | };
103 | /* End PBXGroup section */
104 |
105 | /* Begin PBXNativeTarget section */
106 | 90CAAA9324E71FF10013969F /* inapp_review_plugin */ = {
107 | isa = PBXNativeTarget;
108 | buildConfigurationList = 90CAAA9D24E71FF10013969F /* Build configuration list for PBXNativeTarget "inapp_review_plugin" */;
109 | buildPhases = (
110 | DD9BF3CC2255FDE9321FE7D1 /* [CP] Check Pods Manifest.lock */,
111 | 90CAAA9024E71FF10013969F /* Sources */,
112 | 90CAAA9124E71FF10013969F /* Frameworks */,
113 | 90CAAA9224E71FF10013969F /* CopyFiles */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = inapp_review_plugin;
120 | productName = godot_plugin;
121 | productReference = 90CAAA9424E71FF10013969F /* libinapp_review_plugin.a */;
122 | productType = "com.apple.product-type.library.static";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | 90CAAA8C24E71FF10013969F /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 1160;
131 | ORGANIZATIONNAME = Godot;
132 | TargetAttributes = {
133 | 90CAAA9324E71FF10013969F = {
134 | CreatedOnToolsVersion = 11.6;
135 | LastSwiftMigration = 1230;
136 | };
137 | };
138 | };
139 | buildConfigurationList = 90CAAA8F24E71FF10013969F /* Build configuration list for PBXProject "inapp_review_plugin" */;
140 | compatibilityVersion = "Xcode 9.3";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = 90CAAA8B24E71FF10013969F;
148 | productRefGroup = 90CAAA9524E71FF10013969F /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | 90CAAA9324E71FF10013969F /* inapp_review_plugin */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXShellScriptBuildPhase section */
158 | DD9BF3CC2255FDE9321FE7D1 /* [CP] Check Pods Manifest.lock */ = {
159 | isa = PBXShellScriptBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | );
163 | inputFileListPaths = (
164 | );
165 | inputPaths = (
166 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
167 | "${PODS_ROOT}/Manifest.lock",
168 | );
169 | name = "[CP] Check Pods Manifest.lock";
170 | outputFileListPaths = (
171 | );
172 | outputPaths = (
173 | "$(DERIVED_FILE_DIR)/Pods-inapp_review_plugin-checkManifestLockResult.txt",
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | shellPath = /bin/sh;
177 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
178 | showEnvVarsInLog = 0;
179 | };
180 | /* End PBXShellScriptBuildPhase section */
181 |
182 | /* Begin PBXSourcesBuildPhase section */
183 | 90CAAA9024E71FF10013969F /* Sources */ = {
184 | isa = PBXSourcesBuildPhase;
185 | buildActionMask = 2147483647;
186 | files = (
187 | 90CAAAA424E724C50013969F /* inapp_review_plugin.mm in Sources */,
188 | 515DBA0925EE9E1E00187A4B /* SwiftClass.swift in Sources */,
189 | 90CAAA9924E71FF10013969F /* godot_plugin.mm in Sources */,
190 | );
191 | runOnlyForDeploymentPostprocessing = 0;
192 | };
193 | /* End PBXSourcesBuildPhase section */
194 |
195 | /* Begin XCBuildConfiguration section */
196 | 90CAAA9B24E71FF10013969F /* Debug */ = {
197 | isa = XCBuildConfiguration;
198 | buildSettings = {
199 | ALWAYS_SEARCH_USER_PATHS = NO;
200 | CLANG_ANALYZER_NONNULL = YES;
201 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
202 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
203 | CLANG_CXX_LIBRARY = "libc++";
204 | CLANG_ENABLE_MODULES = YES;
205 | CLANG_ENABLE_OBJC_ARC = YES;
206 | CLANG_ENABLE_OBJC_WEAK = YES;
207 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
208 | CLANG_WARN_BOOL_CONVERSION = YES;
209 | CLANG_WARN_COMMA = YES;
210 | CLANG_WARN_CONSTANT_CONVERSION = YES;
211 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
212 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
213 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
214 | CLANG_WARN_EMPTY_BODY = YES;
215 | CLANG_WARN_ENUM_CONVERSION = YES;
216 | CLANG_WARN_INFINITE_RECURSION = YES;
217 | CLANG_WARN_INT_CONVERSION = YES;
218 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
219 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
220 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
221 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
222 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
223 | CLANG_WARN_STRICT_PROTOTYPES = YES;
224 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
225 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
226 | CLANG_WARN_UNREACHABLE_CODE = YES;
227 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
228 | COPY_PHASE_STRIP = NO;
229 | DEBUG_INFORMATION_FORMAT = dwarf;
230 | ENABLE_STRICT_OBJC_MSGSEND = YES;
231 | ENABLE_TESTABILITY = YES;
232 | GCC_C_LANGUAGE_STANDARD = gnu11;
233 | GCC_DYNAMIC_NO_PIC = NO;
234 | GCC_NO_COMMON_BLOCKS = YES;
235 | GCC_OPTIMIZATION_LEVEL = 0;
236 | GCC_PREPROCESSOR_DEFINITIONS = (
237 | "DEBUG=1",
238 | "$(inherited)",
239 | );
240 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
241 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
242 | GCC_WARN_UNDECLARED_SELECTOR = YES;
243 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
244 | GCC_WARN_UNUSED_FUNCTION = YES;
245 | GCC_WARN_UNUSED_VARIABLE = YES;
246 | IPHONEOS_DEPLOYMENT_TARGET = 14.3;
247 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
248 | MTL_FAST_MATH = YES;
249 | ONLY_ACTIVE_ARCH = YES;
250 | SDKROOT = iphoneos;
251 | };
252 | name = Debug;
253 | };
254 | 90CAAA9C24E71FF10013969F /* Release */ = {
255 | isa = XCBuildConfiguration;
256 | buildSettings = {
257 | ALWAYS_SEARCH_USER_PATHS = NO;
258 | CLANG_ANALYZER_NONNULL = YES;
259 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
261 | CLANG_CXX_LIBRARY = "libc++";
262 | CLANG_ENABLE_MODULES = YES;
263 | CLANG_ENABLE_OBJC_ARC = YES;
264 | CLANG_ENABLE_OBJC_WEAK = YES;
265 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
266 | CLANG_WARN_BOOL_CONVERSION = YES;
267 | CLANG_WARN_COMMA = YES;
268 | CLANG_WARN_CONSTANT_CONVERSION = YES;
269 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
271 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
272 | CLANG_WARN_EMPTY_BODY = YES;
273 | CLANG_WARN_ENUM_CONVERSION = YES;
274 | CLANG_WARN_INFINITE_RECURSION = YES;
275 | CLANG_WARN_INT_CONVERSION = YES;
276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
281 | CLANG_WARN_STRICT_PROTOTYPES = YES;
282 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
283 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
284 | CLANG_WARN_UNREACHABLE_CODE = YES;
285 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
286 | COPY_PHASE_STRIP = NO;
287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
288 | ENABLE_NS_ASSERTIONS = NO;
289 | ENABLE_STRICT_OBJC_MSGSEND = YES;
290 | GCC_C_LANGUAGE_STANDARD = gnu11;
291 | GCC_NO_COMMON_BLOCKS = YES;
292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
294 | GCC_WARN_UNDECLARED_SELECTOR = YES;
295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
296 | GCC_WARN_UNUSED_FUNCTION = YES;
297 | GCC_WARN_UNUSED_VARIABLE = YES;
298 | IPHONEOS_DEPLOYMENT_TARGET = 16.0;
299 | MTL_ENABLE_DEBUG_INFO = NO;
300 | MTL_FAST_MATH = YES;
301 | SDKROOT = iphoneos;
302 | VALIDATE_PRODUCT = YES;
303 | };
304 | name = Release;
305 | };
306 | 90CAAA9E24E71FF10013969F /* Debug */ = {
307 | isa = XCBuildConfiguration;
308 | baseConfigurationReference = AAE936A0178A8EA9BB753CEA /* Pods-inapp_review_plugin.debug.xcconfig */;
309 | buildSettings = {
310 | CODE_SIGN_STYLE = Automatic;
311 | HEADER_SEARCH_PATHS = (
312 | "$(SRCROOT)/godot",
313 | "$(SRCROOT)/godot/platform/ios",
314 | );
315 | LD_RUNPATH_SEARCH_PATHS = (
316 | "$(inherited)",
317 | "@executable_path/Frameworks",
318 | "@loader_path/Frameworks",
319 | );
320 | LIBRARY_SEARCH_PATHS = (
321 | "$(inherited)",
322 | "$(PROJECT_DIR)/godot/bin",
323 | );
324 | ONLY_ACTIVE_ARCH = YES;
325 | OTHER_CFLAGS = (
326 | "-g",
327 | "-DDEBUG",
328 | "-DDEBUG_ENABLED",
329 | "-DDEBUG_MEMORY_ALLOC",
330 | "-DDISABLE_FORCED_INLINE",
331 | "-DTYPED_METHOD_BIND",
332 | "-fmodules",
333 | "-fobjc-arc",
334 | "-fmessage-length=0",
335 | "-fno-strict-aliasing",
336 | "-fdiagnostics-print-source-range-info",
337 | "-fdiagnostics-show-category=id",
338 | "-fdiagnostics-parseable-fixits",
339 | "-fpascal-strings",
340 | "-fblocks",
341 | "-fvisibility=hidden",
342 | "-MMD",
343 | "-MT",
344 | "-fno-exceptions",
345 | "-Wno-ambiguous-macro",
346 | "-Wall",
347 | "-Werror=return-type",
348 | "-DPTRCALL_ENABLED",
349 | );
350 | OTHER_CPLUSPLUSFLAGS = (
351 | "-fcxx-modules",
352 | "-gdwarf-2",
353 | "-O0",
354 | "-DDEBUG_MEMORY_ALLOC",
355 | "-DDISABLE_FORCED_INLINE",
356 | "-D_DEBUG",
357 | "-DDEBUG=1",
358 | "-DDEBUG_ENABLED",
359 | "-DVERSION_4_0",
360 | "-DIOS_ENABLED",
361 | "-DNEED_LONG_INT",
362 | "-DLIBYUV_DISABLE_NEON",
363 | "-DIPHONE_ENABLED",
364 | "-DUNIX_ENABLED",
365 | "-DCOREAUDIO_ENABLED",
366 | );
367 | OTHER_LDFLAGS = "-ObjC";
368 | PRODUCT_NAME = "$(TARGET_NAME)";
369 | SKIP_INSTALL = YES;
370 | SWIFT_OBJC_BRIDGING_HEADER = "inapp_review/godot_plugin-Bridging-Header.h";
371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
372 | SWIFT_VERSION = 5.0;
373 | TARGETED_DEVICE_FAMILY = "1,2";
374 | };
375 | name = Debug;
376 | };
377 | 90CAAA9F24E71FF10013969F /* Release */ = {
378 | isa = XCBuildConfiguration;
379 | baseConfigurationReference = D5F7A9D28867FD798F31BF3B /* Pods-inapp_review_plugin.release.xcconfig */;
380 | buildSettings = {
381 | CODE_SIGN_STYLE = Automatic;
382 | HEADER_SEARCH_PATHS = (
383 | "$(SRCROOT)/godot",
384 | "$(SRCROOT)/godot/platform/ios",
385 | );
386 | LD_RUNPATH_SEARCH_PATHS = (
387 | "$(inherited)",
388 | "@executable_path/Frameworks",
389 | "@loader_path/Frameworks",
390 | );
391 | LIBRARY_SEARCH_PATHS = (
392 | "$(inherited)",
393 | "$(PROJECT_DIR)/godot/bin",
394 | );
395 | ONLY_ACTIVE_ARCH = YES;
396 | OTHER_CFLAGS = (
397 | "-fmodules",
398 | "-fobjc-arc",
399 | "-fmessage-length=0",
400 | "-fno-strict-aliasing",
401 | "-fdiagnostics-print-source-range-info",
402 | "-fdiagnostics-show-category=id",
403 | "-fdiagnostics-parseable-fixits",
404 | "-fpascal-strings",
405 | "-fblocks",
406 | "-fvisibility=hidden",
407 | "-MMD",
408 | "-MT",
409 | "-fno-exceptions",
410 | "-Wno-ambiguous-macro",
411 | "-Wall",
412 | "-Werror=return-type",
413 | "-DPTRCALL_ENABLED",
414 | );
415 | OTHER_CPLUSPLUSFLAGS = (
416 | "-fcxx-modules",
417 | "-O2",
418 | "-ftree-vectorize",
419 | "-DNDEBUG",
420 | "-DNS_BLOCK_ASSERTIONS=1",
421 | "-DVERSION_4_0",
422 | "-DIOS_ENABLED",
423 | "-DNEED_LONG_INT",
424 | "-DLIBYUV_DISABLE_NEON",
425 | "-DIPHONE_ENABLED",
426 | "-DUNIX_ENABLED",
427 | "-DCOREAUDIO_ENABLED",
428 | );
429 | OTHER_LDFLAGS = "-ObjC";
430 | PRODUCT_NAME = "$(TARGET_NAME)";
431 | SKIP_INSTALL = YES;
432 | SWIFT_OBJC_BRIDGING_HEADER = "inapp_review/godot_plugin-Bridging-Header.h";
433 | SWIFT_VERSION = 5.0;
434 | TARGETED_DEVICE_FAMILY = "1,2";
435 | };
436 | name = Release;
437 | };
438 | /* End XCBuildConfiguration section */
439 |
440 | /* Begin XCConfigurationList section */
441 | 90CAAA8F24E71FF10013969F /* Build configuration list for PBXProject "inapp_review_plugin" */ = {
442 | isa = XCConfigurationList;
443 | buildConfigurations = (
444 | 90CAAA9B24E71FF10013969F /* Debug */,
445 | 90CAAA9C24E71FF10013969F /* Release */,
446 | );
447 | defaultConfigurationIsVisible = 0;
448 | defaultConfigurationName = Release;
449 | };
450 | 90CAAA9D24E71FF10013969F /* Build configuration list for PBXNativeTarget "inapp_review_plugin" */ = {
451 | isa = XCConfigurationList;
452 | buildConfigurations = (
453 | 90CAAA9E24E71FF10013969F /* Debug */,
454 | 90CAAA9F24E71FF10013969F /* Release */,
455 | );
456 | defaultConfigurationIsVisible = 0;
457 | defaultConfigurationName = Release;
458 | };
459 | /* End XCConfigurationList section */
460 | };
461 | rootObject = 90CAAA8C24E71FF10013969F /* Project object */;
462 | }
463 |
--------------------------------------------------------------------------------
/inapp_review_plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/inapp_review_plugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/script/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # © 2024-present https://github.com/cengiz-pz
4 | #
5 | set -e
6 | trap "sleep 1; echo" EXIT
7 |
8 | PLUGIN_NODE_TYPE="InappReview"
9 | PLUGIN_NAME="${PLUGIN_NODE_TYPE}Plugin"
10 | PLUGIN_VERSION=''
11 | SUPPORTED_GODOT_VERSIONS=("4.2" "4.3" "4.4.1" "4.5")
12 | BUILD_TIMEOUT=40 # increase this value using -t option if device is not able to generate all headers before godot build is killed
13 |
14 | DESTDIR="./bin/release"
15 | FRAMEWORKDIR="./bin/framework"
16 | LIBDIR="./bin/lib"
17 | CONFIGDIR="./config"
18 |
19 | do_clean=false
20 | do_remove_pod_trunk=false
21 | do_remove_godot=false
22 | do_download_godot=false
23 | do_generate_headers=false
24 | do_install_pods=false
25 | do_build=false
26 | do_create_zip=false
27 | ignore_unsupported_godot_version=false
28 |
29 |
30 | function display_help()
31 | {
32 | echo
33 | ./script/echocolor.sh -y "The " -Y "$0 script" -y " builds the plugin, generates library archives, and"
34 | ./script/echocolor.sh -y "creates a zip file containing all libraries and configuration."
35 | echo
36 | ./script/echocolor.sh -y "If plugin version is not set with the -z option, then Godot version will be used."
37 | echo
38 | ./script/echocolor.sh -Y "Syntax:"
39 | ./script/echocolor.sh -y " $0 [-a|A |c|g|G |h|H|i|p|P|t |z ]"
40 | echo
41 | ./script/echocolor.sh -Y "Options:"
42 | ./script/echocolor.sh -y " a generate godot headers and build plugin"
43 | ./script/echocolor.sh -y " A download specified godot version, generate godot headers, and"
44 | ./script/echocolor.sh -y " build plugin"
45 | ./script/echocolor.sh -y " b build plugin"
46 | ./script/echocolor.sh -y " c remove any existing plugin build"
47 | ./script/echocolor.sh -y " g remove godot directory"
48 | ./script/echocolor.sh -y " G download the godot version specified in the option argument"
49 | ./script/echocolor.sh -y " into godot directory"
50 | ./script/echocolor.sh -y " h display usage information"
51 | ./script/echocolor.sh -y " H generate godot headers"
52 | ./script/echocolor.sh -y " i ignore if an unsupported godot version selected and continue"
53 | ./script/echocolor.sh -y " p remove pods and pod repo trunk"
54 | ./script/echocolor.sh -y " P install pods"
55 | ./script/echocolor.sh -y " t change timeout value for godot build"
56 | ./script/echocolor.sh -y " z create zip archive with given version added to the file name"
57 | echo
58 | ./script/echocolor.sh -Y "Examples:"
59 | ./script/echocolor.sh -y " * clean existing build, remove godot, and rebuild all"
60 | ./script/echocolor.sh -y " $> $0 -cgA 4.2"
61 | ./script/echocolor.sh -y " $> $0 -cgpG 4.2 -HPbz 1.0"
62 | echo
63 | ./script/echocolor.sh -y " * clean existing build, remove pods and pod repo trunk, and rebuild plugin"
64 | ./script/echocolor.sh -y " $> $0 -cpPb"
65 | echo
66 | ./script/echocolor.sh -y " * clean existing build and rebuild plugin"
67 | ./script/echocolor.sh -y " $> $0 -ca"
68 | ./script/echocolor.sh -y " $> $0 -cHbz 1.0"
69 | echo
70 | ./script/echocolor.sh -y " * clean existing build and rebuild plugin with custom plugin version"
71 | ./script/echocolor.sh -y " $> $0 -cHbz 1.0"
72 | echo
73 | ./script/echocolor.sh -y " * clean existing build and rebuild plugin with custom build timeout"
74 | ./script/echocolor.sh -y " $> $0 -cHbt 15"
75 | echo
76 | }
77 |
78 |
79 | function display_status()
80 | {
81 | echo
82 | ./script/echocolor.sh -c "********************************************************************************"
83 | ./script/echocolor.sh -c "* $1"
84 | ./script/echocolor.sh -c "********************************************************************************"
85 | echo
86 | }
87 |
88 |
89 | function display_warning()
90 | {
91 | ./script/echocolor.sh -y "$1"
92 | }
93 |
94 |
95 | function display_error()
96 | {
97 | ./script/echocolor.sh -r "$1"
98 | }
99 |
100 |
101 | function remove_godot_directory()
102 | {
103 | if [[ -d "godot" ]]
104 | then
105 | display_status "removing 'godot' directory..."
106 | rm -rf "godot"
107 | else
108 | display_warning "'godot' directory not found..."
109 | fi
110 | }
111 |
112 |
113 | function clean_plugin_build()
114 | {
115 | display_status "cleaning existing build directories and generated files..."
116 | rm -rf ./bin/*
117 | find . -name "*.d" -type f -delete
118 | find . -name "*.o" -type f -delete
119 | }
120 |
121 |
122 | function remove_pods()
123 | {
124 | if [[ -d ./Pods ]]
125 | then
126 | rm -rf ./Pods/
127 | else
128 | display_warning "Warning: './Pods' directory does not exist"
129 | fi
130 | }
131 |
132 |
133 | function download_godot()
134 | {
135 | if [[ $# -eq 0 ]]
136 | then
137 | display_error "Error: Please provide the Godot version as an option argument for -G option."
138 | exit 1
139 | fi
140 |
141 | if [[ -d "godot" ]]
142 | then
143 | display_error "Error: godot directory already exists. Won't download."
144 | exit 1
145 | fi
146 |
147 | SELECTED_GODOT_VERSION=$1
148 | display_status "downloading godot version $SELECTED_GODOT_VERSION..."
149 |
150 | godot_directory="godot-${SELECTED_GODOT_VERSION}-stable"
151 | godot_archive_file_name="${godot_directory}.tar.xz"
152 |
153 | curl -LO "https://github.com/godotengine/godot/releases/download/${SELECTED_GODOT_VERSION}-stable/${godot_archive_file_name}"
154 | tar -xf "$godot_archive_file_name"
155 |
156 | mv "$godot_directory" godot
157 | rm $godot_archive_file_name
158 |
159 | echo "$SELECTED_GODOT_VERSION" > godot/GODOT_VERSION
160 | }
161 |
162 |
163 | function generate_godot_headers()
164 | {
165 | if [[ ! -d "godot" ]]
166 | then
167 | display_error "Error: godot directory does not exist. Can't generate headers."
168 | exit 1
169 | fi
170 |
171 | display_status "starting godot build to generate godot headers..."
172 |
173 | ./script/run_with_timeout.sh -t $BUILD_TIMEOUT -c "scons platform=ios target=template_release" -d ./godot || true
174 |
175 | display_status "terminated godot build after $BUILD_TIMEOUT seconds..."
176 | }
177 |
178 |
179 | function install_pods()
180 | {
181 | display_status "installing pods..."
182 | pod install --repo-update || true
183 | }
184 |
185 |
186 | function build_plugin()
187 | {
188 | if [[ ! -f "./godot/GODOT_VERSION" ]]
189 | then
190 | display_error "Error: godot wasn't downloaded properly. Can't build plugin."
191 | exit 1
192 | fi
193 |
194 | GODOT_VERSION=$(cat ./godot/GODOT_VERSION)
195 |
196 | SCHEME=${1:-inapp_review_plugin}
197 | PROJECT=${2:-inapp_review_plugin.xcodeproj}
198 | OUT=InappReviewPlugin
199 | CLASS=InappReviewPlugin
200 |
201 | mkdir -p $FRAMEWORKDIR
202 | mkdir -p $LIBDIR
203 |
204 | xcodebuild archive \
205 | -project "./$PROJECT" \
206 | -scheme $SCHEME \
207 | -archivePath "$LIBDIR/ios_release.xcarchive" \
208 | -sdk iphoneos \
209 | SKIP_INSTALL=NO
210 |
211 | xcodebuild archive \
212 | -project "./$PROJECT" \
213 | -scheme $SCHEME \
214 | -archivePath "$LIBDIR/sim_release.xcarchive" \
215 | -sdk iphonesimulator \
216 | SKIP_INSTALL=NO
217 |
218 | xcodebuild archive \
219 | -project "./$PROJECT" \
220 | -scheme $SCHEME \
221 | -archivePath "$LIBDIR/ios_debug.xcarchive" \
222 | -sdk iphoneos \
223 | SKIP_INSTALL=NO \
224 | GCC_PREPROCESSOR_DEFINITIONS="DEBUG_ENABLED=1"
225 |
226 | xcodebuild archive \
227 | -project "./$PROJECT" \
228 | -scheme $SCHEME \
229 | -archivePath "$LIBDIR/sim_debug.xcarchive" \
230 | -sdk iphonesimulator \
231 | SKIP_INSTALL=NO \
232 | GCC_PREPROCESSOR_DEFINITIONS="DEBUG_ENABLED=1"
233 |
234 | mv $LIBDIR/ios_release.xcarchive/Products/usr/local/lib/lib${SCHEME}.a $LIBDIR/ios_release.xcarchive/Products/usr/local/lib/${OUT}.a
235 | mv $LIBDIR/sim_release.xcarchive/Products/usr/local/lib/lib${SCHEME}.a $LIBDIR/sim_release.xcarchive/Products/usr/local/lib/${OUT}.a
236 | mv $LIBDIR/ios_debug.xcarchive/Products/usr/local/lib/lib${SCHEME}.a $LIBDIR/ios_debug.xcarchive/Products/usr/local/lib/${OUT}.a
237 | mv $LIBDIR/sim_debug.xcarchive/Products/usr/local/lib/lib${SCHEME}.a $LIBDIR/sim_debug.xcarchive/Products/usr/local/lib/${OUT}.a
238 |
239 | if [[ -d "$FRAMEWORKDIR/${OUT}.release.xcframework" ]]
240 | then
241 | rm -rf $FRAMEWORKDIR/${OUT}.release.xcframework
242 | fi
243 |
244 | if [[ -d "$FRAMEWORKDIR/${OUT}.debug.xcframework" ]]
245 | then
246 | rm -rf $FRAMEWORKDIR/${OUT}.debug.xcframework
247 | fi
248 |
249 | xcodebuild -create-xcframework \
250 | -library "$LIBDIR/ios_release.xcarchive/Products/usr/local/lib/${OUT}.a" \
251 | -library "$LIBDIR/sim_release.xcarchive/Products/usr/local/lib/${OUT}.a" \
252 | -output "$FRAMEWORKDIR/${OUT}.release.xcframework"
253 |
254 | xcodebuild -create-xcframework \
255 | -library "$LIBDIR/ios_debug.xcarchive/Products/usr/local/lib/${OUT}.a" \
256 | -library "$LIBDIR/sim_debug.xcarchive/Products/usr/local/lib/${OUT}.a" \
257 | -output "$FRAMEWORKDIR/${OUT}.debug.xcframework"
258 | }
259 |
260 |
261 | function create_zip_archive()
262 | {
263 | if [[ ! -f "./godot/GODOT_VERSION" ]]
264 | then
265 | display_error "Error: godot wasn't downloaded properly. Can't create zip archive."
266 | exit 1
267 | fi
268 |
269 | GODOT_VERSION=$(cat ./godot/GODOT_VERSION)
270 |
271 | if [[ -z $PLUGIN_VERSION ]]
272 | then
273 | godot_version_suffix="v$GODOT_VERSION"
274 | else
275 | godot_version_suffix="v$PLUGIN_VERSION"
276 | fi
277 |
278 | file_name="$PLUGIN_NAME-$godot_version_suffix.zip"
279 |
280 | if [[ -e "./bin/release/$file_name" ]]
281 | then
282 | display_warning "deleting existing $file_name file..."
283 | rm ./bin/release/$file_name
284 | fi
285 |
286 | tmp_directory="./bin/.tmp_zip_"
287 | addon_directory="./addon"
288 |
289 | if [[ -d "$tmp_directory" ]]
290 | then
291 | display_status "removing existing staging directory $tmp_directory"
292 | rm -r $tmp_directory
293 | fi
294 |
295 | if [[ -d "$addon_directory" ]]
296 | then
297 | mkdir -p $tmp_directory/addons/$PLUGIN_NAME
298 | cp -r $addon_directory/* $tmp_directory/addons/$PLUGIN_NAME
299 | sed -i '' -e "s/@pluginName@/$PLUGIN_NAME/g" $tmp_directory/addons/$PLUGIN_NAME/*.{gd,cfg}
300 | sed -i '' -e "s/@pluginVersion@/$PLUGIN_VERSION/g" $tmp_directory/addons/$PLUGIN_NAME/*.{gd,cfg}
301 | sed -i '' -e "s/@pluginNodeName@/$PLUGIN_NODE_TYPE/g" $tmp_directory/addons/$PLUGIN_NAME/*.{gd,cfg}
302 | sed -i '' -e "s/@pluginDependencies@/$PLUGIN_DEPENDENCIES/g" $tmp_directory/addons/$PLUGIN_NAME/*.{gd,cfg}
303 | fi
304 |
305 | mkdir -p $tmp_directory/ios/framework
306 | find ./Pods -iname '*.xcframework' -type d -exec cp -r {} $tmp_directory/ios/framework \;
307 |
308 | mkdir -p $tmp_directory/ios/plugins
309 | cp $CONFIGDIR/*.gdip $tmp_directory/ios/plugins
310 | cp -r $FRAMEWORKDIR/$PLUGIN_NAME.{release,debug}.xcframework $tmp_directory/ios/plugins
311 |
312 | mkdir -p $DESTDIR
313 |
314 | display_status "creating $file_name file..."
315 | cd $tmp_directory; zip -yr ../release/$file_name ./*; cd -
316 |
317 | rm -rf $tmp_directory
318 | }
319 |
320 |
321 | while getopts "aA:bcgG:hHipPt:z:" option; do
322 | case $option in
323 | h)
324 | display_help
325 | exit;;
326 | a)
327 | do_generate_headers=true
328 | do_install_pods=true
329 | do_build=true
330 | ;;
331 | A)
332 | GODOT_VERSION=$OPTARG
333 | do_download_godot=true
334 | do_generate_headers=true
335 | do_install_pods=true
336 | do_build=true
337 | ;;
338 | b)
339 | do_build=true
340 | ;;
341 | c)
342 | do_clean=true
343 | ;;
344 | g)
345 | do_remove_godot=true
346 | ;;
347 | G)
348 | GODOT_VERSION=$OPTARG
349 | do_download_godot=true
350 | ;;
351 | H)
352 | do_generate_headers=true
353 | ;;
354 | i)
355 | ignore_unsupported_godot_version=true
356 | ;;
357 | p)
358 | do_remove_pod_trunk=true
359 | ;;
360 | P)
361 | do_install_pods=true
362 | ;;
363 | t)
364 | regex='^[0-9]+$'
365 | if ! [[ $OPTARG =~ $regex ]]
366 | then
367 | display_error "Error: The argument for the -t option should be an integer. Found $OPTARG."
368 | echo
369 | display_help
370 | exit 1
371 | else
372 | BUILD_TIMEOUT=$OPTARG
373 | fi
374 | ;;
375 | z)
376 | if ! [[ -z $OPTARG ]]
377 | then
378 | PLUGIN_VERSION=$OPTARG
379 | fi
380 | do_create_zip=true
381 | ;;
382 | \?)
383 | display_error "Error: invalid option"
384 | echo
385 | display_help
386 | exit;;
387 | esac
388 | done
389 |
390 | if ! [[ " ${SUPPORTED_GODOT_VERSIONS[*]} " =~ [[:space:]]${GODOT_VERSION}[[:space:]] ]]
391 | then
392 | if [[ "$do_download_godot" == false ]]
393 | then
394 | display_warning "Warning: Godot version not specified. Will look for existing download."
395 | elif [[ "$ignore_unsupported_godot_version" == true ]]
396 | then
397 | display_warning "Warning: Godot version '$GODOT_VERSION' is not supported. Supported versions are [${SUPPORTED_GODOT_VERSIONS[*]}]."
398 | else
399 | display_error "Error: Godot version '$GODOT_VERSION' is not supported. Supported versions are [${SUPPORTED_GODOT_VERSIONS[*]}]."
400 | exit 1
401 | fi
402 | fi
403 |
404 | if [[ "$do_clean" == true ]]
405 | then
406 | clean_plugin_build
407 | fi
408 |
409 | if [[ "$do_remove_pod_trunk" == true ]]
410 | then
411 | remove_pods
412 | fi
413 |
414 | if [[ "$do_remove_godot" == true ]]
415 | then
416 | remove_godot_directory
417 | fi
418 |
419 | if [[ "$do_download_godot" == true ]]
420 | then
421 | download_godot $GODOT_VERSION
422 | fi
423 |
424 | if [[ "$do_generate_headers" == true ]]
425 | then
426 | generate_godot_headers
427 | fi
428 |
429 | if [[ "$do_install_pods" == true ]]
430 | then
431 | install_pods
432 | fi
433 |
434 | if [[ "$do_build" == true ]]
435 | then
436 | build_plugin
437 | fi
438 |
439 | if [[ "$do_create_zip" == true ]]
440 | then
441 | create_zip_archive
442 | fi
443 |
--------------------------------------------------------------------------------
/script/echocolor.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Original Source:
4 | # https://github.com/Gruppio/Echolor.git
5 |
6 | # Michele Gruppioni 2015
7 | # http://www.michelegruppioni.com
8 |
9 | # For more info
10 | # http://misc.flogisoft.com/bash/tip_colors_and_formatting
11 |
12 |
13 | rainbowColor=-2
14 | rainbowColorIndex=0
15 | rainbowColors=( 196 208 226 118 46 48 51 33 21 93 201 198 )
16 | numRainbowColors=${#rainbowColors[@]}
17 |
18 | foreground=38
19 | background=48
20 |
21 |
22 |
23 |
24 |
25 | # $3 The text
26 | # $2 Color Code [0 - 255]
27 | # $1 Foreground 0 / Background 1
28 | function printColoredText {
29 |
30 | text=$1
31 | colorCode=$2
32 |
33 | if [[ $3 == 1 ]]
34 | then
35 | foregroundCode=$background
36 | else
37 | foregroundCode=$foreground
38 | fi
39 |
40 | if [[ $colorCode == -1 ]]
41 | then
42 | printf "\033[0 m$text"
43 | return
44 | fi
45 |
46 | if [[ $colorCode == $rainbowColor ]]
47 | then
48 | for (( i=0 ; i < ${#text} ; i++ ))
49 | do
50 | colorCode=${rainbowColors[$rainbowColorIndex]}
51 | rainbowColorIndex=$(($rainbowColorIndex +1))
52 | rainbowColorIndex=$(($rainbowColorIndex %$numRainbowColors))
53 | character=${text:i:1}
54 | printf "\033[${foregroundCode};5;${colorCode}m${character}\033[0m"
55 | done
56 | return
57 | fi
58 |
59 | printf "\033[${foregroundCode};5;${colorCode}m${text}\033[0m"
60 | }
61 |
62 | # Check if the $1 parameter is a number > 0 and <= $2
63 | function isInRange {
64 | if [[ "$1" =~ ^[0-9]+$ ]] && [ "$1" -ge 0 -a "$1" -le $2 ] && [ $# == 2 ]
65 | then
66 | echo $((1))
67 | else
68 | echo $((0))
69 | fi
70 | }
71 |
72 | # $1 = Red Component [0 - 5]
73 | # $2 = Green Component [0 - 5]
74 | # $3 = Blue Component [0 - 5]
75 | function getColorCode {
76 | if [[ $(isInRange $1 5) == 1 && $(isInRange $2 5) == 1 && $(isInRange $3 5) == 1 && $# == 3 ]]
77 | then
78 | echo $((16 + (36 * $1) + (6 * $2) + $3))
79 | else
80 | echo $((-1))
81 | fi
82 | }
83 |
84 | function printUsage {
85 | $0 "\n"
86 | $0 --rainbow "===================================="
87 | $0 -W " $0 "
88 | $0 --rainbow " The most colorful echo command "
89 | $0 --rainbow "===================================="
90 |
91 | $0 -Y "\n\nUsage:"
92 | $0 -W "$0 [[options] text]"
93 | $0 -W "Typical usage: " -G "$0 color1 text1 color2 text2 ..."
94 |
95 | $0 -Y "\n\nOptions:"
96 | $0 -C " -h|--help" -W " Print the correct usage"
97 | $0 -C " -bk|--black" -W " Print the following parameters with a black color" -bk " example"
98 | $0 -C " -r|--red" -W " Print the following parameters with a red color" -r " example"
99 | $0 -C " -g|--green" -W " Print the following parameters with a green color" -g " example"
100 | $0 -C " -y|--yellow" -W " Print the following parameters with a yellow color" -y " example"
101 | $0 -C " -b|--blue" -W " Print the following parameters with a blue color" -b " example"
102 | $0 -C " -m|--magenta" -W " Print the following parameters with a magenta color" -m " example"
103 | $0 -C " -c|--cyan" -W " Print the following parameters with a cyan color" -c " example"
104 | $0 -C " -w|--white" -W " Print the following parameters with a white color" -w " example"
105 | $0 -C " -gy|--grey" -W " Print the following parameters with a grey color" -gy " example"
106 | $0 -C " -R|--Red" -W " Print the following parameters with a bright red color" -R " example"
107 | $0 -C " -G|--Green" -W " Print the following parameters with a bright green color" -G " example"
108 | $0 -C " -Y|--Yellow" -W " Print the following parameters with a bright yellow color" -Y " example"
109 | $0 -C " -B|--Blue" -W " Print the following parameters with a bright blue color" -B " example"
110 | $0 -C " -M|--Magenta" -W " Print the following parameters with a bright magenta color" -M " example"
111 | $0 -C " -C|--Cyan" -W " Print the following parameters with a bright cyan color" -C " example"
112 | $0 -C " -W|--White" -W " Print the following parameters with a bright white color" -W " example"
113 | $0 -C " -Gy|--Gray" -W " Print the following parameters with a bright grey color" -Gy " example"
114 | $0 -C " -h|--hex" -W " Print the following parameters with a color from in a hex format.\n The hex color shall not start with the # but just 6 hex digits.\n example: " -G "$0 --hex F8E4B0 text \n"
115 | $0 -C " -rgb5" -W " Print the following parameters with the specified R G B components.\n The R G B components must have a range between 0-5 and must be divided by a comma without spaces.\n example: " -G "$0 -rgb5 1,2,3 text \n"
116 | $0 -C " -rgb100" -W " Print the following parameters with the specified R G B components.\n The R G B components must have a range between 0-100 and must be divided by a comma without spaces.\n example: " -G "$0 -rgb5 10,20,30 text \n"
117 | $0 -C " -rgb|-rgb255" -W " Print the following parameters with the specified R G B components.\n The R G B components must have a range between 0-255 and must be divided by a comma without spaces.\n example: " -G "$0 -rgb5 100,200,255 text \n"
118 | $0 -C " -fg|--foreground" -W " Color the foreground ( default )"
119 | $0 -C " -bg|--background" -W " Color the background " -bg -R " example " -fg ""
120 | $0 -C " -n|-il|--in-line" -W " With this option the command will not print the new line character after the execution\n"
121 | $0 -C " -ran|--random" -W " Print the following parameters with a random color"
122 | $0 -C " -rb|--rainbow" -W " Print the following parameters with a different color for each character following the classical Rainbow schema " -rb "example"
123 | $0 -C " -code|--color-code " -W " Print the following parameters with the specified color code, the code must be a number between 0-255.\n"
124 | $0 -C " --get-color-code " -W " Print the color code from the R G B components. The R G B components must have a range between 0-255 and must be divided by a comma without spaces.\n"
125 |
126 |
127 |
128 | $0 -Y "\n\nExamples:"
129 | $0 -il -G "$0 text" -W " will print: "
130 | $0 text
131 |
132 | $0 -il -G "$0 --Red RedText" -W " will print: "
133 | $0 --Red RedText
134 |
135 | $0 -il -G "$0 --Green GreenText" -W " will print: "
136 | $0 --Green GreenText
137 |
138 | $0 -il -G "$0 --Blue BlueText" -W " will print: "
139 | $0 --Blue BlueText
140 |
141 | $0 -il -G "$0 --Red \"RedText\" --Green \" GreenText\" --Blue \" BlueText\"" -W " will print: "
142 | $0 --Red RedText --Green " GreenText" --Blue " BlueText"
143 |
144 | $0 -il -G "$0 --rainbow \"Rainbow Colored Text\"" -W " will print: "
145 | $0 --rainbow "Rainbow Colored Text"
146 |
147 | $0 -il -G "$0 -rgb 100,200,30 \"Custom Color Text\"" -W " will print: "
148 | $0 -rgb 200,100,30 "Custom Color Text"
149 |
150 | $0 -il -G "$0 --hex FF88ee \"Color From Hex\"" -W " will print: "
151 | $0 --hex FF88ee "Color From Hex"
152 |
153 | $0 -il -G "$0 -B G -R o -Y o -B g -G l -R e" -W " will print: "
154 | $0 -B G -R o -Y o -B g -G l -R e
155 |
156 | $0 -Y "\n\nInfo:"
157 | $0 -Gy "Original Sources at: https://github.com/Gruppio/Echolor.git"
158 | $0 -Gy "Created by Gruppio 2015"
159 |
160 | $0 "\n"
161 | exit -1
162 | }
163 |
164 | # Main
165 | color=-1
166 | colorBackground=0
167 | inline=0
168 |
169 | while (( "$#" ))
170 | do
171 | case $1 in
172 | -h|--help) printUsage ;;
173 | -bk|--black) color=0 ;;
174 | -r|--red) color=1 ;;
175 | -g|--green) color=2 ;;
176 | -y|--yellow) color=3 ;;
177 | -b|--blue) color=4 ;;
178 | -m|--magenta) color=5 ;;
179 | -c|--cyan) color=6 ;;
180 | -w|--white) color=7 ;;
181 | -Gy|--Grey) color=8 ;;
182 | -R|--Red) color=9 ;;
183 | -G|--Green) color=10 ;;
184 | -Y|--Yellow) color=11 ;;
185 | -B|--Blue) color=12 ;;
186 | -M|--Magenta) color=13 ;;
187 | -C|--Cyan) color=14 ;;
188 | -W|--White) color=15 ;;
189 | -gy|--gray) color=16 ;;
190 | -fg|--foreground) colorBackground=0 ;;
191 | -bg|--background) colorBackground=1 ;;
192 | -il|--in-line) inline=1 ;;
193 | -ran|--random) color=$(($RANDOM %255)) ;;
194 | -rb|--rainbow)
195 | color=$rainbowColor
196 | rainbowColorIndex=0
197 | ;;
198 | -code|--color-code)
199 | color=$2
200 | shift
201 | ;;
202 | --get-color-code)
203 | IFS=, read r g b <<< "$2"
204 | if [[ $r && $g && $b ]]
205 | then
206 | r=$(($r/51))
207 | g=$(($g/51))
208 | b=$(($b/51))
209 | getColorCode $r $g $b
210 | exit 0
211 | else
212 | printUsage
213 | fi
214 | ;;
215 | -rgb5)
216 | IFS=, read r g b <<< "$2"
217 | if [[ $r && $g && $b ]]
218 | then
219 | color=$(getColorCode $r $g $b)
220 | shift
221 | else
222 | printUsage
223 | fi
224 | ;;
225 | -rgb100)
226 | IFS=, read r g b <<< "$2"
227 | if [[ $r && $g && $b ]]
228 | then
229 | r=$(($r/20))
230 | g=$(($g/20))
231 | b=$(($b/20))
232 | color=$(getColorCode $r $g $b)
233 | shift
234 | else
235 | printUsage
236 | fi
237 | ;;
238 | -rgb|-rgb255)
239 | IFS=, read r g b <<< "$2"
240 | if [[ $r && $g && $b ]]
241 | then
242 | r=$(($r/51))
243 | g=$(($g/51))
244 | b=$(($b/51))
245 | color=$(getColorCode $r $g $b)
246 | shift
247 | else
248 | printUsage
249 | fi
250 | ;;
251 | -h|--hex)
252 | if [[ $# > 1 && $2 =~ ^[0-9A-Fa-f]{6}$ ]]
253 | then
254 | hex=$2
255 | r=$(printf "%d\n" 0x${hex:0:2})
256 | g=$(printf "%d\n" 0x${hex:2:2})
257 | b=$(printf "%d\n" 0x${hex:4:2})
258 | r=$(($r/51))
259 | g=$(($g/51))
260 | b=$(($b/51))
261 | color=$(getColorCode $r $g $b)
262 | shift
263 | else
264 | printUsage
265 | fi
266 | ;;
267 | # print the text
268 | *)
269 | text=$1
270 | printColoredText "$text" $color $colorBackground
271 | ;;
272 | esac
273 | shift
274 | done
275 |
276 | if [[ $inline == 0 ]]
277 | then
278 | printf "\n"
279 | fi
280 |
281 | exit 0
282 |
--------------------------------------------------------------------------------
/script/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # © 2024-present https://github.com/cengiz-pz
4 | #
5 | set -e
6 | trap "sleep 1; echo" EXIT
7 |
8 | plugin_name="InappReviewPlugin"
9 | target_directory=""
10 | zip_file_path=""
11 |
12 |
13 | function display_help()
14 | {
15 | echo
16 | ./script/echocolor.sh -y "The " -Y "$0 script" -y " installs plugin in the specified directory"
17 | echo
18 | ./script/echocolor.sh -Y "Syntax:"
19 | ./script/echocolor.sh -y " $0 [-h|t |z ]"
20 | echo
21 | ./script/echocolor.sh -Y "Options:"
22 | ./script/echocolor.sh -y " h display usage information"
23 | ./script/echocolor.sh -y " t specify the path for target directory"
24 | ./script/echocolor.sh -y " z specify the path for zip file"
25 | echo
26 | ./script/echocolor.sh -Y "Examples:"
27 | ./script/echocolor.sh -y " * install plugin in project"
28 | ./script/echocolor.sh -y " $> $0 -t /mypath/myproject -z ../myzipfile.zip"
29 | echo
30 | }
31 |
32 |
33 | function display_status()
34 | {
35 | echo
36 | ./script/echocolor.sh -c "********************************************************************************"
37 | ./script/echocolor.sh -c "* $1"
38 | ./script/echocolor.sh -c "********************************************************************************"
39 | echo
40 | }
41 |
42 |
43 | function display_warning()
44 | {
45 | ./script/echocolor.sh -y "$1"
46 | }
47 |
48 |
49 | function display_error()
50 | {
51 | ./script/echocolor.sh -r "$1"
52 | }
53 |
54 |
55 | while getopts "hdt:z:" option; do
56 | case $option in
57 | h)
58 | display_help
59 | exit;;
60 | t)
61 | if ! [[ -z $OPTARG ]]
62 | then
63 | target_directory=$OPTARG
64 | fi
65 | ;;
66 | z)
67 | if ! [[ -z $OPTARG ]]
68 | then
69 | zip_file_path=$OPTARG
70 | fi
71 | ;;
72 | \?)
73 | display_error "Error: invalid option"
74 | echo
75 | display_help
76 | exit;;
77 | esac
78 | done
79 |
80 | if [[ ! -f "$zip_file_path" ]]
81 | then
82 | display_error "Error: zip file '$zip_file_path' not found"
83 | exit 1
84 | fi
85 |
86 | if [[ ! -d "$target_directory" ]]
87 | then
88 | display_status "creating target directory $target_directory"
89 | mkdir -p $target_directory
90 | fi
91 |
92 | display_status "installing $zip_file_path in $target_directory"
93 |
94 | unzip -o $zip_file_path -d $target_directory
95 |
--------------------------------------------------------------------------------
/script/run_with_timeout.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # © 2024-present https://github.com/cengiz-pz
4 | #
5 |
6 | function display_help()
7 | {
8 | echo
9 | ./script/echocolor.sh -y "The " -Y "$0 script" -y " runs specified command for specified number of seconds,"
10 | ./script/echocolor.sh -y "then stops the command and exits."
11 | echo
12 | ./script/echocolor.sh -Y "Syntax:"
13 | ./script/echocolor.sh -y " $0 [-h] [-d ] -t -c "
14 | echo
15 | ./script/echocolor.sh -Y "Options:"
16 | ./script/echocolor.sh -y " h display usage information"
17 | ./script/echocolor.sh -y " t timeout value in seconds"
18 | ./script/echocolor.sh -y " c command to run"
19 | ./script/echocolor.sh -y " d run command in specified directory"
20 | echo
21 | ./script/echocolor.sh -Y "Examples:"
22 | ./script/echocolor.sh -y " $> $0 -t 10 -c 'my_command'"
23 | echo
24 | }
25 |
26 |
27 | function display_error()
28 | {
29 | ./script/echocolor.sh -r "$1"
30 | }
31 |
32 |
33 | min_expected_arguments=1
34 |
35 | if [[ $# -lt $min_expected_arguments ]]
36 | then
37 | display_error "Error: Expected at least $min_expected_arguments arguments, found $#."
38 | echo
39 | display_help
40 | exit 1
41 | fi
42 |
43 | RUN_TIMEOUT=''
44 | RUN_COMMAND=''
45 | RUN_DIRECTORY=''
46 |
47 | while getopts "hd:t:c:" option
48 | do
49 | case $option in
50 | c)
51 | RUN_COMMAND=$OPTARG
52 | ;;
53 | d)
54 | RUN_DIRECTORY=$OPTARG
55 | ;;
56 | h)
57 | display_help
58 | exit;;
59 | t)
60 | RUN_TIMEOUT=$OPTARG
61 | ;;
62 | \?)
63 | display_error "Error: invalid option"
64 | echo
65 | display_help
66 | exit;;
67 | esac
68 | done
69 |
70 | regex='^[0-9]+$'
71 | if ! [[ $RUN_TIMEOUT =~ $regex ]]
72 | then
73 | display_error "Error: The value for timeout option should be an integer. Found $RUN_TIMEOUT."
74 | echo
75 | display_help
76 | exit 1
77 | fi
78 |
79 | (
80 | if ! [[ -z $RUN_DIRECTORY ]]
81 | then
82 | cd $RUN_DIRECTORY
83 | echo "current directory is $(pwd)"
84 | fi
85 |
86 | eval $RUN_COMMAND
87 | ) 2> /dev/null &
88 |
89 | sleep $RUN_TIMEOUT
90 |
91 | pkill -P $! || true
92 |
93 | sleep 1
94 |
--------------------------------------------------------------------------------