Avoid using reflected types in the scripting API
since it causes numerous classloading issues. Using the wrapping types and reload them in the proper context when needed. Note: this version supports only classes, but the wrapping type could be extended to support other types in the future. + numerous fixes related to proper loading and handling of the templates.
This commit is contained in:
@@ -65,7 +65,6 @@ dependencies {
|
||||
runtime project(':kotlin-reflect')
|
||||
runtime project(':kotlin-scripting-common')
|
||||
runtime project(':kotlin-scripting-compiler')
|
||||
runtime project(':kotlin-scripting-jvm')
|
||||
runtime project(path: ':kotlin-scripting-gradle', configuration: 'runtimeJar')
|
||||
|
||||
// com.android.tools.build:gradle has ~50 unneeded transitive dependencies
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, JvmAbi.DEFAULT_MODULE_NAME);
|
||||
|
||||
ScriptingCompilerConfigurationExtensionKt.configureScriptDefinitions(
|
||||
scriptTemplates, configuration, messageCollector, new HashMap<>()
|
||||
scriptTemplates, configuration, this.getClass().getClassLoader(), messageCollector, new HashMap<>()
|
||||
);
|
||||
|
||||
KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForProduction(rootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
|
||||
|
||||
Reference in New Issue
Block a user