@@ -130,8 +130,6 @@ void KotlinEditorExportPlugin::_export_begin(const HashSet<String>& p_features,
130130 _generate_export_configuration_file (jni::JvmType::GRAAL_NATIVE_IMAGE);
131131 }
132132 } else if (is_android_export) {
133- files_to_add.push_back (String (RES_DIRECTORY).path_join (ANDROID_BOOTSTRAP_FILE));
134- files_to_add.push_back (String (RES_DIRECTORY).path_join (ANDROID_USER_CODE_FILE));
135133 _generate_export_configuration_file (jni::JvmType::ART);
136134 } else if (is_ios_export) {
137135 String base_ios_build_dir {String (RES_DIRECTORY).path_join (JVM_DIRECTORY).path_join (" ios" )};
@@ -158,19 +156,25 @@ void KotlinEditorExportPlugin::_export_begin(const HashSet<String>& p_features,
158156 JVM_LOG_INFO (" Exporting %s" , file_to_add);
159157 }
160158
159+ _add_exclude_filter_preset ();
160+
161161 JVM_LOG_INFO (" Finished Godot-Jvm specific exports." );
162162}
163163
164164void KotlinEditorExportPlugin::_generate_export_configuration_file (jni::JvmType vm_type) {
165- JvmUserConfiguration configuration = GDKotlin::get_instance ().get_configuration ();// Copy
166- configuration.vm_type = vm_type;// We only need to change the vm type
165+ JvmUserConfiguration configuration = GDKotlin::get_instance ().get_configuration (); // Copy
166+ configuration.vm_type = vm_type; // We only need to change the vm type
167167
168168 const char32_t * json_string {JvmUserConfiguration::export_configuration_to_json (configuration).get_data ()};
169169 Vector<uint8_t > json_bytes;
170170 for (int i = 0 ; json_string[i] != ' \0 ' ; ++i) {
171171 json_bytes.push_back (json_string[i]);
172172 }
173173
174+ add_file (JVM_CONFIGURATION_PATH, json_bytes, false );
175+ }
176+
177+ void KotlinEditorExportPlugin::_add_exclude_filter_preset () {
174178 // only add our configuration file to the exclude filter if it is not already present
175179 if (!get_export_preset ()->get_exclude_filter ().contains (JVM_CONFIGURATION_PATH)) {
176180 // we manually add the configuration file to the exclude filter to prevent it from being added multiple times
@@ -179,7 +183,15 @@ void KotlinEditorExportPlugin::_generate_export_configuration_file(jni::JvmType
179183 get_export_preset ()->set_exclude_filter (get_export_preset ()->get_exclude_filter () + " ," + JVM_CONFIGURATION_PATH);
180184 }
181185
182- add_file (JVM_CONFIGURATION_PATH, json_bytes, false );
186+ if (const String build_dir = String {BUILD_DIRECTORY}.path_join (" *" ); !get_export_preset ()->get_exclude_filter ().contains (build_dir)) {
187+ // exclude build folder
188+ get_export_preset ()->set_exclude_filter (get_export_preset ()->get_exclude_filter () + " ," + build_dir);
189+ }
190+
191+ if (const String jre_jars = String {" res://" } + JVM_DIRECTORY + " jre-*/**/*.jar" ; !get_export_preset ()->get_exclude_filter ().contains (jre_jars)) {
192+ // exclude any jars in the embedded jre
193+ get_export_preset ()->set_exclude_filter (get_export_preset ()->get_exclude_filter () + " ," + jre_jars);
194+ }
183195}
184196
185197String KotlinEditorExportPlugin::get_name () const {
0 commit comments